mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
* .screen is no longer being changed by other parts of the tutorial * first_run_message we don't need, since we're guaranteed to have a message. * Changing to #home and narrow.deactivate are not needed since we're immediately narrowing to PM with welcome-bot.
36 lines
731 B
JavaScript
36 lines
731 B
JavaScript
var tutorial = (function () {
|
|
|
|
var exports = {};
|
|
|
|
function set_tutorial_status(status, callback) {
|
|
return channel.post({
|
|
url: '/json/tutorial_status',
|
|
data: {status: JSON.stringify(status)},
|
|
success: callback,
|
|
});
|
|
}
|
|
|
|
function finale() {
|
|
set_tutorial_status("finished");
|
|
|
|
var sender_bot = "welcome-bot@zulip.com";
|
|
narrow.by('pm-with', sender_bot, {select_first_unread: true, trigger: 'sidebar'});
|
|
compose_actions.cancel();
|
|
}
|
|
|
|
exports.start = function () {
|
|
finale();
|
|
};
|
|
|
|
exports.initialize = function () {
|
|
if (page_params.needs_tutorial) {
|
|
exports.start();
|
|
}
|
|
};
|
|
|
|
return exports;
|
|
}());
|
|
if (typeof module !== 'undefined') {
|
|
module.exports = tutorial;
|
|
}
|