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({
|
2013-06-20 18:06:31 +02:00
|
|
|
url: '/json/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-07-18 01:59:26 +02:00
|
|
|
set_tutorial_status("finished");
|
|
|
|
narrow.by('is', 'private', {select_first_unread: true, 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;
|
|
|
|
}
|