mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 11:22:04 +00:00
js: Convert static/js/invite.js to ES6 module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
a935af9243
commit
f3af16db3f
@@ -179,7 +179,6 @@
|
|||||||
"i18n": false,
|
"i18n": false,
|
||||||
"info_overlay": false,
|
"info_overlay": false,
|
||||||
"input_pill": false,
|
"input_pill": false,
|
||||||
"invite": false,
|
|
||||||
"jQuery": false,
|
"jQuery": false,
|
||||||
"keydown_util": false,
|
"keydown_util": false,
|
||||||
"lightbox": false,
|
"lightbox": false,
|
||||||
|
|||||||
@@ -93,7 +93,6 @@ zrequire("condense");
|
|||||||
zrequire("spoilers");
|
zrequire("spoilers");
|
||||||
zrequire("lightbox");
|
zrequire("lightbox");
|
||||||
zrequire("overlays");
|
zrequire("overlays");
|
||||||
zrequire("invite");
|
|
||||||
zrequire("message_view_header");
|
zrequire("message_view_header");
|
||||||
zrequire("narrow_state");
|
zrequire("narrow_state");
|
||||||
zrequire("presence");
|
zrequire("presence");
|
||||||
|
|||||||
@@ -101,7 +101,6 @@ import "../hotkey";
|
|||||||
import "../notifications";
|
import "../notifications";
|
||||||
import "../hash_util";
|
import "../hash_util";
|
||||||
import "../hashchange";
|
import "../hashchange";
|
||||||
import "../invite";
|
|
||||||
import "../message_flags";
|
import "../message_flags";
|
||||||
import "../starred_messages";
|
import "../starred_messages";
|
||||||
import "../alert_words";
|
import "../alert_words";
|
||||||
|
|||||||
1
static/js/global.d.ts
vendored
1
static/js/global.d.ts
vendored
@@ -51,7 +51,6 @@ declare let hotspots: any;
|
|||||||
declare let i18n: any;
|
declare let i18n: any;
|
||||||
declare let info_overlay: any;
|
declare let info_overlay: any;
|
||||||
declare let input_pill: any;
|
declare let input_pill: any;
|
||||||
declare let invite: any;
|
|
||||||
declare let keydown_util: any;
|
declare let keydown_util: any;
|
||||||
declare let lightbox: any;
|
declare let lightbox: any;
|
||||||
declare let list_util: any;
|
declare let list_util: any;
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
const invite = require("./invite");
|
||||||
|
|
||||||
// Read https://zulip.readthedocs.io/en/latest/subsystems/hashchange-system.html
|
// Read https://zulip.readthedocs.io/en/latest/subsystems/hashchange-system.html
|
||||||
// or locally: docs/subsystems/hashchange-system.md
|
// or locally: docs/subsystems/hashchange-system.md
|
||||||
let changing_hash = false;
|
let changing_hash = false;
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
"use strict";
|
import autosize from "autosize";
|
||||||
|
import ClipboardJS from "clipboard";
|
||||||
|
|
||||||
const autosize = require("autosize");
|
import copy_invite_link from "../templates/copy_invite_link.hbs";
|
||||||
const ClipboardJS = require("clipboard");
|
import render_invitation_failed_error from "../templates/invitation_failed_error.hbs";
|
||||||
|
import render_invite_subscription from "../templates/invite_subscription.hbs";
|
||||||
const copy_invite_link = require("../templates/copy_invite_link.hbs");
|
import render_settings_dev_env_email_access from "../templates/settings/dev_env_email_access.hbs";
|
||||||
const render_invitation_failed_error = require("../templates/invitation_failed_error.hbs");
|
|
||||||
const render_invite_subscription = require("../templates/invite_subscription.hbs");
|
|
||||||
const render_settings_dev_env_email_access = require("../templates/settings/dev_env_email_access.hbs");
|
|
||||||
|
|
||||||
function reset_error_messages() {
|
function reset_error_messages() {
|
||||||
$("#invite_status").hide().text("").removeClass(common.status_classes);
|
$("#invite_status").hide().text("").removeClass(common.status_classes);
|
||||||
@@ -130,7 +128,7 @@ function generate_multiuse_invite() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.get_invite_streams = function () {
|
export function get_invite_streams() {
|
||||||
const streams = stream_data.get_invite_stream_data();
|
const streams = stream_data.get_invite_stream_data();
|
||||||
|
|
||||||
function compare_streams(a, b) {
|
function compare_streams(a, b) {
|
||||||
@@ -138,11 +136,11 @@ exports.get_invite_streams = function () {
|
|||||||
}
|
}
|
||||||
streams.sort(compare_streams);
|
streams.sort(compare_streams);
|
||||||
return streams;
|
return streams;
|
||||||
};
|
}
|
||||||
|
|
||||||
function update_subscription_checkboxes() {
|
function update_subscription_checkboxes() {
|
||||||
const data = {
|
const data = {
|
||||||
streams: exports.get_invite_streams(),
|
streams: get_invite_streams(),
|
||||||
notifications_stream: stream_data.get_notifications_stream(),
|
notifications_stream: stream_data.get_notifications_stream(),
|
||||||
};
|
};
|
||||||
const html = render_invite_subscription(data);
|
const html = render_invite_subscription(data);
|
||||||
@@ -154,7 +152,7 @@ function prepare_form_to_be_shown() {
|
|||||||
reset_error_messages();
|
reset_error_messages();
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.launch = function () {
|
export function launch() {
|
||||||
$("#submit-invitation").button();
|
$("#submit-invitation").button();
|
||||||
prepare_form_to_be_shown();
|
prepare_form_to_be_shown();
|
||||||
|
|
||||||
@@ -174,9 +172,9 @@ exports.launch = function () {
|
|||||||
submit_invitation_form();
|
submit_invitation_form();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
exports.initialize = function () {
|
export function initialize() {
|
||||||
$(document).on("click", "#invite_check_all_button", () => {
|
$(document).on("click", "#invite_check_all_button", () => {
|
||||||
$("#streams_to_add :checkbox").prop("checked", true);
|
$("#streams_to_add :checkbox").prop("checked", true);
|
||||||
});
|
});
|
||||||
@@ -212,6 +210,4 @@ exports.initialize = function () {
|
|||||||
$("#invite-method-choice").show();
|
$("#invite-method-choice").show();
|
||||||
reset_error_messages();
|
reset_error_messages();
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
window.invite = exports;
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ const render_edit_content_button = require("../templates/edit_content_button.hbs
|
|||||||
const copy_and_paste = require("./copy_and_paste");
|
const copy_and_paste = require("./copy_and_paste");
|
||||||
const echo = require("./echo");
|
const echo = require("./echo");
|
||||||
const emojisets = require("./emojisets");
|
const emojisets = require("./emojisets");
|
||||||
|
const invite = require("./invite");
|
||||||
const markdown_config = require("./markdown_config");
|
const markdown_config = require("./markdown_config");
|
||||||
const people = require("./people");
|
const people = require("./people");
|
||||||
const pm_conversations = require("./pm_conversations");
|
const pm_conversations = require("./pm_conversations");
|
||||||
|
|||||||
Reference in New Issue
Block a user