js: Convert static/js/tutorial.js to ES6 module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-02-10 08:04:41 -08:00 committed by Tim Abbott
parent f3fb01a430
commit 881d6c437b
6 changed files with 3 additions and 10 deletions

View File

@ -272,7 +272,6 @@
"top_left_corner": false,
"topic_list": false,
"transmit": false,
"tutorial": false,
"typeahead_helper": false,
"typing": false,
"typing_data": false,

View File

@ -105,7 +105,6 @@ zrequire("composebox_typeahead");
zrequire("narrow");
zrequire("search_suggestion");
zrequire("search");
zrequire("tutorial");
rewiremock.proxy(() => zrequire("notifications"), {
"../../static/js/favicon": {},
});

View File

@ -119,7 +119,6 @@ import "../list_cursor";
import "../activity";
import "../user_events";
import "../timerender";
import "../tutorial";
import "../hotspots";
import "../templates";
import "../upload_widget";

View File

@ -138,7 +138,6 @@ declare let stream_topic_history: any;
declare let topic_list: any;
declare let top_left_corner: any;
declare let transmit: any;
declare let tutorial: any;
declare let typeahead_helper: any;
declare let typing: any;
declare let typing_data: any;

View File

@ -1,5 +1,3 @@
"use strict";
function set_tutorial_status(status, callback) {
return channel.post({
url: "/json/users/me/tutorial_status",
@ -8,11 +6,9 @@ function set_tutorial_status(status, callback) {
});
}
exports.initialize = function () {
export function initialize() {
if (page_params.needs_tutorial) {
set_tutorial_status("started");
narrow.by("is", "private", {trigger: "sidebar"});
}
};
window.tutorial = exports;
}

View File

@ -17,6 +17,7 @@ const markdown_config = require("./markdown_config");
const people = require("./people");
const pm_conversations = require("./pm_conversations");
const topic_zoom = require("./topic_zoom");
const tutorial = require("./tutorial");
const user_status = require("./user_status");
const user_status_ui = require("./user_status_ui");