js: Use inside variant of IIFE wrappers.

Prettier would do this anyway, but it’s separated out for a more
reviewable diff.  Generated by ESLint.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-07-16 13:35:58 -07:00
committed by Tim Abbott
parent 6924d501bc
commit a20c12366f
36 changed files with 118 additions and 118 deletions

View File

@@ -136,7 +136,7 @@
"strict": "off",
"template-curly-spacing": "error",
"valid-typeof": [ "error", { "requireStringLiterals": true } ],
"wrap-iife": "error",
"wrap-iife": ["error", "inside"],
"yoda": "error"
},
"overrides": [

View File

@@ -336,7 +336,7 @@ run_test("handlers", () => {
activity.user_cursor.go_to(alice.user_id);
filter_key_handlers.down_arrow();
filter_key_handlers.up_arrow();
}());
})();
(function test_click_filter() {
init();
@@ -346,7 +346,7 @@ run_test("handlers", () => {
const handler = $(".user-list-filter").get_on_handler("focus");
handler(e);
}());
})();
(function test_click_header_filter() {
init();
@@ -358,7 +358,7 @@ run_test("handlers", () => {
handler(e);
// and click again
handler(e);
}());
})();
(function test_enter_key() {
init();
@@ -378,7 +378,7 @@ run_test("handlers", () => {
// get line coverage for cleared case
activity.user_cursor.clear();
filter_key_handlers.enter_key();
}());
})();
(function test_click_handler() {
init();
@@ -393,14 +393,14 @@ run_test("handlers", () => {
activity.narrow_for_user({li: alice_li});
assert(narrowed);
}());
})();
(function test_blur_filter() {
init();
const e = {};
const handler = $(".user-list-filter").get_on_handler("blur");
handler(e);
}());
})();
});
presence.presence_info = new Map();

View File

@@ -65,7 +65,7 @@ run_test("test_basics", () => {
assert.equal("http://bar.com", services[0].base_url);
assert.equal(1, services[0].interface);
assert.equal(undefined, bot.extra);
}());
})();
(function test_update() {
bot_data.add(test_bot);
@@ -88,7 +88,7 @@ run_test("test_basics", () => {
bot = bot_data.get(43);
assert.equal(bot.owner_id, fred.user_id);
}());
})();
(function test_embedded_bot_update() {
bot_data.add(test_embedded_bot);
@@ -97,7 +97,7 @@ run_test("test_basics", () => {
assert.equal("12345678", services[0].config_data.key);
bot_data.update(bot_id, {services: [{config_data: {key: "87654321"}}]});
assert.equal("87654321", services[0].config_data.key);
}());
})();
(function test_remove() {
let bot;
@@ -110,13 +110,13 @@ run_test("test_basics", () => {
bot_data.deactivate(43);
bot = bot_data.get(43);
assert.equal(bot.is_active, false);
}());
})();
(function test_all_user_ids() {
const all_ids = bot_data.all_user_ids();
all_ids.sort();
assert.deepEqual(all_ids, [143, 314, 42, 43]);
}());
})();
(function test_delete() {
let bot;
@@ -129,7 +129,7 @@ run_test("test_basics", () => {
bot_data.del(43);
bot = bot_data.get(43);
assert.equal(bot, undefined);
}());
})();
(function test_get_editable() {
@@ -139,7 +139,7 @@ run_test("test_basics", () => {
const editable_bots = bot_data.get_editable().map((bot) => bot.email);
assert.deepEqual(["bot1@zulip.com", "bot2@zulip.com"], editable_bots);
}());
})();
(function test_get_all_bots_for_current_user() {
const bots = bot_data.get_all_bots_for_current_user();
@@ -147,5 +147,5 @@ run_test("test_basics", () => {
assert.equal(bots.length, 2);
assert.equal(bots[0].email, "bot1@zulip.com");
assert.equal(bots[1].email, "bot2@zulip.com");
}());
})();
});

View File

@@ -76,7 +76,7 @@ run_test("basics", () => {
};
return self;
}());
})();
const switcher = (function () {
const self = {};
@@ -106,7 +106,7 @@ run_test("basics", () => {
};
return self;
}());
})();
set_global("$", (sel) => {
if (sel.stub) {

View File

@@ -684,7 +684,7 @@ run_test("send_message", () => {
assert(!$("#compose-send-status").visible());
assert.equal($("#compose-send-button").prop("disabled"), false);
assert(!$("#sending-indicator").visible());
}());
})();
// This is the additional setup which is common to both the tests below.
transmit.send_message = function (payload, success, error) {
@@ -713,7 +713,7 @@ run_test("send_message", () => {
};
assert.deepEqual(stub_state, state);
assert(echo_error_msg_checked);
}());
})();
(function test_error_codepath_local_id_undefined() {
stub_state = initialize_state_stub_dict();
@@ -749,7 +749,7 @@ run_test("send_message", () => {
assert($("#compose-send-status").visible());
assert.equal($("#compose-send-button").prop("disabled"), false);
assert(!$("#sending-indicator").visible());
}());
})();
});
set_global("document", "document-stub");
@@ -806,7 +806,7 @@ run_test("finish", () => {
assert(!$("#compose-send-button").is_focused());
assert.equal($("#compose-send-button").prop("disabled"), false);
assert.equal($("#compose-error-msg").html(), i18n.t("You have nothing to send!"));
}());
})();
(function test_when_compose_validation_succeed() {
$("#compose-textarea").hide();
@@ -835,7 +835,7 @@ run_test("finish", () => {
assert($("#markdown_preview").visible());
assert(send_message_called);
assert(compose_finished_event_checked);
}());
})();
});
run_test("warn_if_private_stream_is_linked", () => {
@@ -875,7 +875,7 @@ run_test("warn_if_private_stream_is_linked", () => {
return "fake-compose_private_stream_alert-template";
});
return function () { assert(called); };
}()),
})(),
(function () {
let called;
@@ -884,7 +884,7 @@ run_test("warn_if_private_stream_is_linked", () => {
assert.equal(html, "fake-compose_private_stream_alert-template");
};
return function () { assert(called); };
}()),
})(),
];
denmark = {
@@ -988,7 +988,7 @@ run_test("initialize", () => {
compose.initialize();
assert(compose_actions_start_checked);
}());
})();
(function test_page_params_narrow_topic() {
page_params.narrow_topic = "testing";
@@ -1000,7 +1000,7 @@ run_test("initialize", () => {
compose.initialize();
assert(compose_actions_start_checked);
}());
})();
(function test_abort_xhr() {
$("#compose-send-button").attr("disabled", "disabled");
@@ -1013,7 +1013,7 @@ run_test("initialize", () => {
assert.equal($("#compose-send-button").attr(), undefined);
assert(uppy_cancel_all_called);
}());
})();
});
run_test("update_fade", () => {
@@ -1150,7 +1150,7 @@ run_test("warn_if_mentioning_unsubscribed_user", () => {
return true;
};
return function () { assert(called); };
}()),
})(),
(function () {
let called;
@@ -1163,7 +1163,7 @@ run_test("warn_if_mentioning_unsubscribed_user", () => {
return "fake-compose-invite-user-template";
});
return function () { assert(called); };
}()),
})(),
(function () {
let called;
@@ -1172,7 +1172,7 @@ run_test("warn_if_mentioning_unsubscribed_user", () => {
assert.equal(html, "fake-compose-invite-user-template");
};
return function () { assert(called); };
}()),
})(),
];
mentioned = {
@@ -1266,7 +1266,7 @@ run_test("on_events", () => {
assert(compose_finish_checked);
assert(!$("#compose-all-everyone").visible());
assert(!$("#compose-send-status").visible());
}());
})();
(function test_compose_invite_users_clicked() {
const handler = $("#compose_invite_users")
@@ -1323,7 +1323,7 @@ run_test("on_events", () => {
assert(!$("#compose_invite_users").visible());
assert(invite_user_to_stream_called);
assert(all_invite_children_called);
}());
})();
(function test_compose_invite_close_clicked() {
const handler = $("#compose_invite_users")
@@ -1347,7 +1347,7 @@ run_test("on_events", () => {
assert(helper.container_was_removed());
assert(all_invite_children_called);
assert(!$("#compose_invite_users").visible());
}());
})();
(function test_compose_not_subscribed_clicked() {
const handler = $("#compose-send-status")
@@ -1379,7 +1379,7 @@ run_test("on_events", () => {
handler(helper.event);
assert(!$("#compose-send-status").visible());
}());
})();
(function test_compose_not_subscribed_close_clicked() {
const handler = $("#compose-send-status")
@@ -1396,7 +1396,7 @@ run_test("on_events", () => {
handler(helper.event);
assert(!$("#compose-send-status").visible());
}());
})();
(function test_attach_files_compose_clicked() {
const handler = $("#compose")
@@ -1416,7 +1416,7 @@ run_test("on_events", () => {
handler(event);
assert(compose_file_input_clicked);
}());
})();
(function test_video_link_compose_clicked() {
page_params.jitsi_server_url = "https://meet.jit.si";
@@ -1489,7 +1489,7 @@ run_test("on_events", () => {
video_link_regex = /\[Click to join video call\]\(\/calls\/bigbluebutton\/join\?meeting_id=%22zulip-1%22&password=%22AAAAAAAAAA%22&checksum=%2232702220bff2a22a44aee72e96cfdb4c4091752e%22\)/;
assert(video_link_regex.test(syntax_to_insert));
}());
})();
(function test_markdown_preview_compose_clicked() {
// Tests setup
@@ -1612,7 +1612,7 @@ run_test("on_events", () => {
assert_visibilities();
assert.equal($("#preview_content").html(),
"Server: foobarfoobar");
}());
})();
(function test_undo_markdown_preview_clicked() {
const handler = $("#compose")
@@ -1633,7 +1633,7 @@ run_test("on_events", () => {
assert(!$("#undo_markdown_preview").visible());
assert(!$("#preview_message_area").visible());
assert($("#markdown_preview").visible());
}());
})();
});

View File

@@ -45,7 +45,7 @@ compose_state.private_message_recipient = (function () {
recipient = arg;
};
}());
})();
set_global("reload_state", {
is_in_progress: return_false,

View File

@@ -102,7 +102,7 @@ run_test("pills", () => {
const item = handler(othello.email, pills.items());
assert(get_by_email_called);
assert.equal(item, undefined);
}());
})();
(function test_success_path() {
get_by_email_called = false;
@@ -111,7 +111,7 @@ run_test("pills", () => {
assert.equal(typeof res, "object");
assert.equal(res.user_id, iago.user_id);
assert.equal(res.display_value, iago.full_name);
}());
})();
}
function input_pill_stub(opts) {

View File

@@ -107,7 +107,7 @@ run_test("draft_model", () => {
ls.set("drafts", expected);
assert.deepEqual(draft_model.get(), expected);
}());
})();
localStorage.clear();
(function test_get() {
@@ -115,7 +115,7 @@ run_test("draft_model", () => {
assert.deepEqual(draft_model.getDraft("id1"), draft_1);
assert.equal(draft_model.getDraft("id2"), false);
}());
})();
localStorage.clear();
(function test_addDraft() {
@@ -126,7 +126,7 @@ run_test("draft_model", () => {
assert.deepEqual(ls.get("drafts")[id], expected);
});
}());
})();
localStorage.clear();
(function test_editDraft() {
@@ -138,7 +138,7 @@ run_test("draft_model", () => {
assert.deepEqual(ls.get("drafts").id1, expected);
});
}());
})();
localStorage.clear();
(function test_deleteDraft() {
@@ -146,7 +146,7 @@ run_test("draft_model", () => {
draft_model.deleteDraft("id1");
assert.deepEqual(ls.get("drafts"), {});
}());
})();
});
run_test("snapshot_message", () => {

View File

@@ -531,7 +531,7 @@ run_test("unread_ops", () => {
message_list.all = {};
message_list.all.show_message_as_read = noop;
notifications.close_notification = noop;
}());
})();
// Set up a way to capture the options passed in to channel.post.
let channel_post_opts;

View File

@@ -398,7 +398,7 @@ run_test("loading_newer", () => {
// since the last message event's data had been discarded.
// This fetch goes on until the newest message has been found.
assert.equal(msg_list.data.fetch_status.can_load_newer_messages(), false);
}());
})();
(function test_home() {
reset_lists();
@@ -455,6 +455,6 @@ run_test("loading_newer", () => {
assert.equal(msg_list.data.fetch_status.can_load_newer_messages(), false);
}());
})();
});

View File

@@ -120,7 +120,7 @@ run_test("msg_edited_vars", () => {
assert_alongside_sender(result[0]);
assert_left_col(result[1]);
assert_status_msg(result[2]);
}());
})();
});
run_test("merge_message_groups", () => {
@@ -204,7 +204,7 @@ run_test("merge_message_groups", () => {
assert.deepEqual(result.rerender_groups, []);
assert.deepEqual(result.append_messages, []);
assert.deepEqual(result.rerender_messages_next_same_sender, []);
}());
})();
(function test_append_message_same_subject() {
@@ -229,7 +229,7 @@ run_test("merge_message_groups", () => {
assert.deepEqual(result.rerender_groups, []);
assert_message_list_equal(result.append_messages, [message2]);
assert_message_list_equal(result.rerender_messages_next_same_sender, [message1]);
}());
})();
(function test_append_message_different_subject() {
@@ -255,7 +255,7 @@ run_test("merge_message_groups", () => {
assert.deepEqual(result.rerender_groups, []);
assert.deepEqual(result.append_messages, []);
assert.deepEqual(result.rerender_messages_next_same_sender, []);
}());
})();
(function test_append_message_different_subject_and_days() {
@@ -284,7 +284,7 @@ run_test("merge_message_groups", () => {
assert.equal(
message_group2.group_date_divider_html,
"900000000 - 1000000");
}());
})();
(function test_append_message_different_day() {
@@ -308,7 +308,7 @@ run_test("merge_message_groups", () => {
assert.deepEqual(result.append_messages, [message2]);
assert.deepEqual(result.rerender_messages_next_same_sender, [message1]);
assert(list._message_groups[0].message_containers[1].want_date_divider);
}());
})();
(function test_append_message_historical() {
@@ -334,7 +334,7 @@ run_test("merge_message_groups", () => {
assert.deepEqual(result.rerender_groups, []);
assert.deepEqual(result.append_messages, []);
assert.deepEqual(result.rerender_messages_next_same_sender, []);
}());
})();
(function test_append_message_same_subject_me_message() {
@@ -360,7 +360,7 @@ run_test("merge_message_groups", () => {
assert.deepEqual(result.rerender_groups, []);
assert_message_list_equal(result.append_messages, [message2]);
assert_message_list_equal(result.rerender_messages_next_same_sender, [message1]);
}());
})();
(function test_prepend_message_same_subject() {
@@ -386,7 +386,7 @@ run_test("merge_message_groups", () => {
[build_message_group([message2, message1])]);
assert.deepEqual(result.append_messages, []);
assert.deepEqual(result.rerender_messages_next_same_sender, []);
}());
})();
(function test_prepend_message_different_subject() {
@@ -411,7 +411,7 @@ run_test("merge_message_groups", () => {
assert.deepEqual(result.rerender_groups, []);
assert.deepEqual(result.append_messages, []);
assert.deepEqual(result.rerender_messages_next_same_sender, []);
}());
})();
(function test_prepend_message_different_subject_and_day() {
@@ -441,7 +441,7 @@ run_test("merge_message_groups", () => {
assert.deepEqual(result.rerender_groups, [message_group1]);
assert.deepEqual(result.append_messages, []);
assert.deepEqual(result.rerender_messages_next_same_sender, []);
}());
})();
(function test_prepend_message_different_day() {
@@ -470,7 +470,7 @@ run_test("merge_message_groups", () => {
assert_message_groups_list_equal(result.rerender_groups, [message_group2]);
assert.deepEqual(result.append_messages, []);
assert.deepEqual(result.rerender_messages_next_same_sender, []);
}());
})();
(function test_prepend_message_historical() {
@@ -496,7 +496,7 @@ run_test("merge_message_groups", () => {
assert.deepEqual(result.rerender_groups, []);
assert.deepEqual(result.append_messages, []);
assert.deepEqual(result.rerender_messages_next_same_sender, []);
}());
})();
});
@@ -533,7 +533,7 @@ run_test("render_windows", () => {
view.rerender_preserving_scrolltop = noop;
return view;
}());
})();
const list = view.list;
@@ -541,7 +541,7 @@ run_test("render_windows", () => {
// The function should early exit here.
const rendered = view.maybe_rerender();
assert.equal(rendered, false);
}());
})();
let messages;

View File

@@ -25,7 +25,7 @@ run_test("basics", () => {
};
return self;
}());
})();
function password_field(min_length, min_guesses) {
const self = {};

View File

@@ -69,7 +69,7 @@ run_test("scroll_element_into_container", () => {
top = arg;
},
};
}());
})();
const elem1 = {
innerHeight: () => 25,

View File

@@ -170,7 +170,7 @@ run_test("test tab clicks", () => {
assert(forms.add.visible());
assert(!forms.active.visible());
assert(!forms.inactive.visible());
}());
})();
(function () {
click_on_tab(tabs.active);
@@ -181,7 +181,7 @@ run_test("test tab clicks", () => {
assert(!forms.add.visible());
assert(forms.active.visible());
assert(!forms.inactive.visible());
}());
})();
(function () {
click_on_tab(tabs.inactive);
@@ -192,7 +192,7 @@ run_test("test tab clicks", () => {
assert(!forms.add.visible());
assert(!forms.active.visible());
assert(forms.inactive.visible());
}());
})();
});
run_test("can_create_new_bots", () => {

View File

@@ -198,7 +198,7 @@ run_test("populate_user_groups", () => {
return fake_person;
};
assert.equal(config.highlighter(), fake_person);
}());
})();
const fake_context = {
query: "ali",
@@ -212,7 +212,7 @@ run_test("populate_user_groups", () => {
const result = config.source.call(fake_context, iago);
const emails = result.map((user) => user.email).sort();
assert.deepEqual(emails, [alice.email, bob.email]);
}());
})();
(function test_matcher() {
/* Here the query doesn't begin with an '@' because typeahead is triggered
@@ -232,7 +232,7 @@ run_test("populate_user_groups", () => {
page_params.is_admin = true;
result = config.matcher.call(fake_context_for_email, bob);
assert(result);
}());
})();
(function test_sorter() {
let sort_recipientbox_typeahead_called = false;
@@ -241,7 +241,7 @@ run_test("populate_user_groups", () => {
};
config.sorter.call(fake_context);
assert(sort_recipientbox_typeahead_called);
}());
})();
(function test_updater() {
input_field_stub.text("@ali");
@@ -287,7 +287,7 @@ run_test("populate_user_groups", () => {
assert(cancel_fade_to_called);
assert(instructions_fade_to_called);
assert.equal(text_cleared, true);
}());
})();
input_typeahead_called = true;
};
@@ -313,7 +313,7 @@ run_test("populate_user_groups", () => {
const item = handler(iago.email, pills.items());
assert(get_by_email_called);
assert.equal(item, undefined);
}());
})();
(function test_success_path() {
get_by_email_called = false;
@@ -322,7 +322,7 @@ run_test("populate_user_groups", () => {
assert.equal(typeof res, "object");
assert.equal(res.user_id, bob.user_id);
assert.equal(res.display_value, bob.full_name);
}());
})();
}
pills.onPillRemove = function (handler) {
@@ -572,7 +572,7 @@ run_test("on_events", () => {
assert(!$("#admin-user-group-status").visible());
assert.equal($("form.admin-user-group-form input[type='text']").val(), "");
}());
})();
(function test_post_error() {
$("#admin-user-group-status").show();
@@ -590,11 +590,11 @@ run_test("on_events", () => {
opts.error(xhr);
assert(!$("#admin-user-group-status").visible());
}());
})();
};
handler.call(fake_this, event);
}());
})();
(function test_user_groups_delete_click_triggered() {
const handler = $("#user-groups").get_on_handler("click", ".delete");
@@ -626,7 +626,7 @@ run_test("on_events", () => {
};
handler.call(fake_this);
}());
})();
(function test_user_groups_keypress_enter_triggered() {
const handler = $("#user-groups").get_on_handler("keypress", ".user-group h4 > span");
@@ -639,7 +639,7 @@ run_test("on_events", () => {
};
handler(event);
assert(default_action_for_enter_stopped);
}());
})();
(function test_do_not_blur() {
const blur_event_classes = [".name", ".description", ".input"];
@@ -697,7 +697,7 @@ run_test("on_events", () => {
assert(!api_endpoint_called);
assert(settings_user_groups_reload_called);
}
}());
})();
(function test_update_cancel_button() {
const handler_name = $(user_group_selector).get_on_handler("input", ".name");
@@ -745,7 +745,7 @@ run_test("on_events", () => {
handler_desc.call(fake_this);
assert(cancel_fade_out_called);
assert(instructions_fade_out_called);
}());
})();
(function test_user_groups_save_group_changes_triggered() {
const handler_name = $(user_group_selector).get_on_handler("blur", ".name");
@@ -796,7 +796,7 @@ run_test("on_events", () => {
assert(cancel_fade_out_called);
assert(instructions_fade_out_called);
assert(saved_fade_to_called);
}());
})();
(function test_post_error() {
const user_group_error = $(user_group_selector + " .user-group-status");
user_group_error.show();
@@ -814,7 +814,7 @@ run_test("on_events", () => {
opts.error(xhr);
assert(user_group_error.visible());
}());
})();
};
const fake_this = $.create("fake-#user-groups_blur_name");
@@ -841,7 +841,7 @@ run_test("on_events", () => {
api_endpoint_called = false;
handler_desc.call(fake_this, event);
assert(!api_endpoint_called);
}());
})();
(function test_user_groups_save_member_changes_triggered() {
const handler = $(user_group_selector).get_on_handler("blur", ".input");
@@ -886,7 +886,7 @@ run_test("on_events", () => {
assert(cancel_fade_out_called);
assert(instructions_fade_out_called);
assert(saved_fade_to_called);
}());
})();
};
const fake_this = $.create("fake-#user-groups_blur_input");
@@ -901,5 +901,5 @@ run_test("on_events", () => {
api_endpoint_called = false;
handler.call(fake_this, event);
assert(api_endpoint_called);
}());
})();
});

View File

@@ -76,7 +76,7 @@ run_test("create_sidebar_row", () => {
stream_list.create_sidebar_row(devel);
assert.equal(devel_value.text(), "42");
}());
})();
(function create_social_sidebar_row() {
const social_value = $.create("social-value");
@@ -95,7 +95,7 @@ run_test("create_sidebar_row", () => {
stream_list.create_sidebar_row(social);
assert.equal(social_value.text(), "42");
}());
})();
const split = '<hr class="stream-split">';
const devel_sidebar = $("<devel sidebar row>");

View File

@@ -125,7 +125,7 @@ run_test("basics", () => {
verify_collapsed();
assert.deepEqual(cursor_helper.events, ["reset", "clear"]);
}());
})();
// Expand the widget.
toggle_filter();

View File

@@ -39,4 +39,4 @@ exports.with_stub = function (f) {
assert.equal(args.color, "blue");
assert.equal(args.n, 42);
});
}());
})();

View File

@@ -68,7 +68,7 @@ Logger.prototype = (function () {
}
return proto;
}());
})();
const logger = new Logger();

View File

@@ -571,7 +571,7 @@ exports.initialize = function () {
$(sel).on("click", "a", function () {
this.blur();
});
}());
})();
popovers.register_click_handlers();
emoji_picker.register_click_handlers();
@@ -826,7 +826,7 @@ exports.initialize = function () {
$("[data-make-editable='" + selector + "']").html("");
}
});
}());
})();
// HOTSPOTS

View File

@@ -35,7 +35,7 @@ exports.toggle = function (opts) {
_component.append(tab);
});
return _component;
}(opts));
})(opts);
const meta = {
$ind_tab: component.find(".ind-tab"),
@@ -96,7 +96,7 @@ exports.toggle = function (opts) {
if (typeof opts.selected === "number") {
select_tab(opts.selected);
}
}());
})();
const prototype = {
maybe_go_left: maybe_go_left,

View File

@@ -65,7 +65,7 @@ const draft_model = (function () {
};
return exports;
}());
})();
exports.draft_model = draft_model;

View File

@@ -167,7 +167,7 @@ exports.process_fenced_code = function (content) {
handler_stack.pop();
},
};
}());
})();
}
function default_hander() {

View File

@@ -364,7 +364,7 @@ exports.create = function (opts) {
e.originalEvent.clipboardData.setData("text/plain", store.get_text_from_item(data.item));
e.preventDefault();
});
}());
})();
// the external, user-accessible prototype.
const prototype = {

View File

@@ -51,6 +51,6 @@ exports.get_next_id_float = (function () {
return local_id_float;
};
}());
})();
window.local_message = exports;

View File

@@ -59,7 +59,7 @@ exports.send_read = (function () {
}
return add;
}());
})();
exports.save_collapsed = function (message) {
send_flag_update(message, "collapsed", "add");

View File

@@ -291,7 +291,7 @@ exports.activate = function (raw_operators, opts) {
maybe_report_narrow_time(msg_list);
},
});
}());
})();
if (select_immediately) {
exports.update_selection({

View File

@@ -75,6 +75,6 @@ exports.recent = (function () {
};
return self;
}());
})();
window.pm_conversations = exports;

View File

@@ -43,7 +43,7 @@ function elem_to_user_id(elem) {
// add back all shallow properties of $.fn.popover to the new proxied version.
Object.assign($.fn.popover, popover);
}($.fn.popover));
})($.fn.popover);
function copy_email_handler(e) {
const email_el = $(e.trigger.parentElement);
@@ -1088,7 +1088,7 @@ exports.register_click_handlers = function () {
// retrigger `hide_all` while still scrolling.
last_scroll = date;
});
}());
})();
};
exports.any_active = function () {

View File

@@ -144,12 +144,12 @@ exports.watch_manual_resize = function (element) {
document.body.addEventListener("mouseup", body_handler);
return [box_handler, body_handler];
}((height) => {
})((height) => {
// This callback disables autosize on the textarea. It
// will be re-enabled when this component is next opened.
autosize.destroy($(element))
.height(height + "px");
}));
});
};
exports.resize_bottom_whitespace = function (h) {

View File

@@ -256,7 +256,7 @@ exports.populate_user_groups = function () {
input.focus();
}, 100);
});
}());
})();
}
};

View File

@@ -35,7 +35,7 @@ const stream_subscription_error = (function () {
return self;
}());
})();
const stream_name_error = (function () {
const self = {};
@@ -95,7 +95,7 @@ const stream_name_error = (function () {
};
return self;
}());
})();
// Within the new stream modal...
function update_announce_stream_state() {
@@ -374,7 +374,7 @@ exports.create_handlers_for_users = function (container) {
const display = user_checked ? "block" : "none";
elem.css({display: display});
});
}());
})();
e.preventDefault();
});

View File

@@ -53,7 +53,7 @@ exports.stream_sidebar = (function () {
};
return self;
}());
})();
function get_search_term() {
const search_box = $(".stream-list-filter");

View File

@@ -925,7 +925,7 @@ exports.initialize = function () {
stream_edit.open_edit_panel_empty();
}
});
}());
})();
};

View File

@@ -289,7 +289,7 @@ exports.absolute_time = (function () {
str += " " + fmt_time(date, H_24);
return str;
};
}());
})();
exports.get_full_datetime = function (time) {
// Convert to number of hours ahead/behind UTC.

View File

@@ -179,7 +179,7 @@ exports.unread_pm_counter = (function () {
};
return self;
}());
})();
function make_per_stream_bucketer() {
return make_bucketer({
@@ -372,7 +372,7 @@ exports.unread_topic_counter = (function () {
};
return self;
}());
})();
exports.unread_mentions_counter = new Set();