2013-02-13 22:04:35 +01:00
|
|
|
var tutorial = (function () {
|
|
|
|
|
|
|
|
var exports = {};
|
2013-07-02 19:58:44 +02:00
|
|
|
|
2013-04-12 21:33:00 +02:00
|
|
|
function set_tutorial_status(status, callback) {
|
2013-12-18 19:55:18 +01:00
|
|
|
return channel.post({
|
2017-10-09 22:55:38 +02:00
|
|
|
url: '/json/users/me/tutorial_status',
|
2015-11-25 07:39:30 +01:00
|
|
|
data: {status: JSON.stringify(status)},
|
2017-01-12 00:17:43 +01:00
|
|
|
success: callback,
|
2013-04-12 21:33:00 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2013-02-13 22:15:13 +01:00
|
|
|
exports.initialize = function () {
|
2013-03-25 23:26:14 +01:00
|
|
|
if (page_params.needs_tutorial) {
|
2017-08-31 18:20:03 +02:00
|
|
|
set_tutorial_status("started");
|
2018-04-23 06:02:11 +02:00
|
|
|
narrow.by('is', 'private', {trigger: 'sidebar'});
|
2013-02-13 22:15:13 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-02-13 22:04:35 +01:00
|
|
|
return exports;
|
|
|
|
}());
|
2014-01-31 06:24:15 +01:00
|
|
|
if (typeof module !== 'undefined') {
|
|
|
|
module.exports = tutorial;
|
|
|
|
}
|