Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
js: Remove extra consecutive spaces.
Anders Kaseorg8046b6477a1a
diff --git a/.eslintrc.json b/.eslintrc.jsonindex 5a92c9374ea..f62167d2283 100644--- a/.eslintrc.json+++ b/.eslintrc.json@@ -78,6 +78,7 @@"no-label-var": "error","no-labels": "error","no-loop-func": "error",+ "no-multi-spaces": "error","no-multi-str": "error","no-native-reassign": "error","no-new-func": "error",diff --git a/babel.config.js b/babel.config.jsindex 034f73ad1c8..889341cc916 100644--- a/babel.config.js+++ b/babel.config.js@@ -4,7 +4,7 @@ module.exports = {"@babel/preset-env",{corejs: 3,- loose: true, // Loose mode for…of loops are 5× faster in Firefox+ loose: true, // Loose mode for…of loops are 5× faster in FirefoxuseBuiltIns: "usage",},],diff --git a/frontend_tests/casper_tests/04-compose.js b/frontend_tests/casper_tests/04-compose.jsindex 6569808b8da..c2b649e1876 100644--- a/frontend_tests/casper_tests/04-compose.js+++ b/frontend_tests/casper_tests/04-compose.js@@ -164,7 +164,7 @@ casper.then(function () {// Make sure multiple PM recipients display properly.var recipients = ["[email protected]", "[email protected]"];casper.then(function () {- common.keypress(27); // escape to dismiss compose box+ common.keypress(27); // escape to dismiss compose box});casper.waitWhileVisible(".message_comp");common.then_send_message("private", {@@ -175,7 +175,7 @@ common.then_send_message("private", {casper.then(function () {- common.keypress(27); // escape to dismiss compose box+ common.keypress(27); // escape to dismiss compose box});casper.then(function () {common.un_narrow();diff --git a/frontend_tests/node_tests/colorspace.js b/frontend_tests/node_tests/colorspace.jsindex 5bfcef963d1..ed1f0bc5635 100644--- a/frontend_tests/node_tests/colorspace.js+++ b/frontend_tests/node_tests/colorspace.js@@ -21,7 +21,7 @@ run_test("rgb_luminance", () => {run_test("luminance_to_lightness", () => {let luminance = 0;- let expected_value = 116 * 4 / 29 - 16;+ let expected_value = 116 * 4 / 29 - 16;let actual_value = colorspace.luminance_to_lightness(luminance);assert.equal(actual_value, expected_value);diff --git a/frontend_tests/node_tests/compose.js b/frontend_tests/node_tests/compose.jsindex 5a45f5f4658..b1b798e1908 100644--- a/frontend_tests/node_tests/compose.js+++ b/frontend_tests/node_tests/compose.js@@ -373,7 +373,7 @@ run_test("markdown_rtl", () => {const textarea = $("#compose-textarea");const event = {- keyCode: 65, // A+ keyCode: 65, // A};rtl.get_direction = (text) => {@@ -397,7 +397,7 @@ run_test("markdown_ltr", () => {const textarea = $("#compose-textarea");const event = {- keyCode: 65, // A+ keyCode: 65, // A};assert.equal(textarea.hasClass("rtl"), true);@@ -1100,7 +1100,7 @@ run_test("needs_subscribe_warning", () => {});run_test("warn_if_mentioning_unsubscribed_user", () => {- let mentioned = {+ let mentioned = {email: "[email protected]",};@@ -1287,7 +1287,7 @@ run_test("on_events", () => {invite_user_to_stream_called = true;assert.deepEqual(user_ids, [mentioned.user_id]);assert.equal(sub, subscription);- success(); // This will check success callback path.+ success(); // This will check success callback path.};const helper = setup_parents_and_mock_remove(diff --git a/frontend_tests/node_tests/composebox_typeahead.js b/frontend_tests/node_tests/composebox_typeahead.jsindex 5db0a923aa0..6ae2cfb50df 100644--- a/frontend_tests/node_tests/composebox_typeahead.js+++ b/frontend_tests/node_tests/composebox_typeahead.js@@ -302,7 +302,7 @@ run_test("content_typeahead_selected", () => {let caret_called1 = false;let caret_called2 = false;fake_this.$element.caret = function (...args) {- if (args.length === 0) { // .caret() used in split_at_cursor+ if (args.length === 0) { // .caret() used in split_at_cursorcaret_called1 = true;return fake_this.query.length;}@@ -415,7 +415,7 @@ run_test("content_typeahead_selected", () => {expected_value = "@_**King Hamlet** ";assert.equal(actual_value, expected_value);- fake_this.query = "@_**kin";+ fake_this.query = "@_**kin";fake_this.token = "kin";actual_value = ct.content_typeahead_selected.call(fake_this, hamlet);expected_value = "@_**King Hamlet** ";@@ -606,7 +606,7 @@ run_test("initialize", () => {// The sorter should return the query as the first element if there// isn't a topic with such name.// This only happens if typeahead is providing other suggestions.- options.query = "e"; // Letter present in "furniture" and "ice"+ options.query = "e"; // Letter present in "furniture" and "ice"actual_value = options.sorter(["furniture", "ice"]);expected_value = ["e", "furniture", "ice"];assert.deepEqual(actual_value, expected_value);@@ -663,11 +663,11 @@ run_test("initialize", () => {}let query;- query = "el"; // Matches both "othELlo" and "cordELia"+ query = "el"; // Matches both "othELlo" and "cordELia"assert.equal(matcher(query, othello), true);assert.equal(matcher(query, cordelia), true);- query = "bender"; // Doesn't exist+ query = "bender"; // Doesn't existassert.equal(matcher(query, othello), false);assert.equal(matcher(query, cordelia), false);@@ -724,7 +724,7 @@ run_test("initialize", () => {assert.deepEqual(actual_value, expected_value);// A literal match at the beginning of an element puts it at the top.- query = "co"; // Matches everything ("[email protected]")+ query = "co"; // Matches everything ("[email protected]")actual_value = sorter(query, [othello, deactivated_user, cordelia]);expected_value = [cordelia, deactivated_user, othello];assert.deepEqual(actual_value, expected_value);@@ -946,13 +946,13 @@ run_test("initialize", () => {let pm_recipient_blur_called = false;const old_pm_recipient_blur = $("#private_message_recipient").blur;$("#private_message_recipient").blur = function (handler) {- if (handler) { // The blur handler is being set.+ if (handler) { // The blur handler is being set.this.val("[email protected], ");handler.call(this);const actual_value = this.val();const expected_value = "[email protected]";assert.equal(actual_value, expected_value);- } else { // The element is simply losing the focus.+ } else { // The element is simply losing the focus.old_pm_recipient_blur();}pm_recipient_blur_called = true;@@ -1076,10 +1076,10 @@ run_test("initialize", () => {// in_handler tries to avoid.$("#stream_message_recipient_stream").one = function (event, handler) {handler({preventDefault: noop});- f(); // This time in_handler will already be true.+ f(); // This time in_handler will already be true.stream_one_called = true;};- f(); // Here in_handler is false.+ f(); // Here in_handler is false.focus_handler_called = true;};diff --git a/frontend_tests/node_tests/dispatch.js b/frontend_tests/node_tests/dispatch.jsindex 8912a31fff2..d2e2c82c284 100644--- a/frontend_tests/node_tests/dispatch.js+++ b/frontend_tests/node_tests/dispatch.js@@ -361,7 +361,7 @@ with_overrides((override) => {event = event_fixtures.realm__update_notifications_stream_id;dispatch(event);assert_same(page_params.realm_notifications_stream_id, 42);- page_params.realm_notifications_stream_id = -1; // make sure to reset for future tests+ page_params.realm_notifications_stream_id = -1; // make sure to reset for future testsevent = event_fixtures.realm__update_signup_notifications_stream_id;dispatch(event);@@ -687,7 +687,7 @@ with_overrides((override) => {assert_same(toggled, ["less_dense_mode", "more_dense_mode"]);$("body").fadeOut = (secs) => { assert_same(secs, 300); };- $("body").fadeIn = (secs) => { assert_same(secs, 300); };+ $("body").fadeIn = (secs) => { assert_same(secs, 300); };global.with_stub((stub) => {event = event_fixtures.update_display_settings__color_scheme_dark;diff --git a/frontend_tests/node_tests/drafts.js b/frontend_tests/node_tests/drafts.jsindex 267bc79ecd5..89f1263f14e 100644--- a/frontend_tests/node_tests/drafts.js+++ b/frontend_tests/node_tests/drafts.js@@ -231,7 +231,7 @@ run_test("remove_old_drafts", () => {run_test("format_drafts", () => {drafts.remove_old_drafts = noop;- draft_1.updatedAt = new Date(1549958107000).getTime(); // 2/12/2019 07:55:07 AM (UTC+0)+ draft_1.updatedAt = new Date(1549958107000).getTime(); // 2/12/2019 07:55:07 AM (UTC+0)draft_2.updatedAt = new Date(1549958107000).setDate(-1);const draft_3 = {stream: "stream 2",diff --git a/frontend_tests/node_tests/dropdown_list_widget.js b/frontend_tests/node_tests/dropdown_list_widget.jsindex ed65112c669..d988869e6c8 100644--- a/frontend_tests/node_tests/dropdown_list_widget.js+++ b/frontend_tests/node_tests/dropdown_list_widget.js@@ -34,7 +34,7 @@ run_test("basic_functions", () => {const widget = dropdown_list_widget(opts);assert.equal(widget.value(), "one");- assert.equal(updated_value, undefined); // We haven't 'updated' the widget yet.+ assert.equal(updated_value, undefined); // We haven't 'updated' the widget yet.assert(reset_button.visible());widget.update("two");diff --git a/frontend_tests/node_tests/list_render.js b/frontend_tests/node_tests/list_render.jsindex e53eced1e2d..8a91beef2a2 100644--- a/frontend_tests/node_tests/list_render.js+++ b/frontend_tests/node_tests/list_render.js@@ -499,7 +499,7 @@ run_test("custom sort", () => {list_render.create(container, list, {name: "custom-sort-list",- modifier: (n) => "(" + n.x + ", " + n.y + ")",+ modifier: (n) => "(" + n.x + ", " + n.y + ")",sort_fields: {product: sort_by_product,x_value: sort_by_x,@@ -740,7 +740,7 @@ run_test("opts.get_item", () => {run_test("render item", () => {const container = make_container();- const scroll_container = make_scroll_container();+ const scroll_container = make_scroll_container();const INITIAL_RENDER_COUNT = 80; // Keep this in sync with the actual code.container.html = () => {};let called = false;diff --git a/frontend_tests/node_tests/message_events.js b/frontend_tests/node_tests/message_events.jsindex 727e4a15f19..a3684da8f3d 100644--- a/frontend_tests/node_tests/message_events.js+++ b/frontend_tests/node_tests/message_events.js@@ -127,7 +127,7 @@ run_test("update_messages", () => {helper.verify();- assert.deepEqual(rendered_mgs, [+ assert.deepEqual(rendered_mgs, [{alerted: false,collapsed: false,diff --git a/frontend_tests/node_tests/message_store.js b/frontend_tests/node_tests/message_store.jsindex 586f5f3497c..97606d11835 100644--- a/frontend_tests/node_tests/message_store.js+++ b/frontend_tests/node_tests/message_store.js@@ -49,7 +49,7 @@ const cindy = {full_name: "Cindy",};-const denise = {+const denise = {email: "[email protected]",user_id: 105,full_name: "Denise ",diff --git a/frontend_tests/node_tests/poll_widget.js b/frontend_tests/node_tests/poll_widget.jsindex 8152c15c363..e564a37db52 100644--- a/frontend_tests/node_tests/poll_widget.js+++ b/frontend_tests/node_tests/poll_widget.js@@ -61,7 +61,7 @@ run_test("poll_data_holder my question", () => {question: "best plan?",});- let vote_event = {+ let vote_event = {type: "vote",key: "99,1",vote: 1,@@ -146,7 +146,7 @@ run_test("activate another person poll", () => {const widget_elem = $("<div>").addClass("widget-content");- let out_data; // Used to check the event data sent to the server+ let out_data; // Used to check the event data sent to the serverconst callback = (data) => {out_data = data;};@@ -242,7 +242,7 @@ run_test("activate another person poll", () => {poll_option_input.val("cool choice");out_data = undefined;option_button_callback(e);- assert.deepEqual(out_data, {type: "new_option", idx: 1, option: "cool choice"});+ assert.deepEqual(out_data, {type: "new_option", idx: 1, option: "cool choice"});poll_option_input.val("");out_data = undefined;@@ -405,7 +405,7 @@ run_test("activate own poll", () => {out_data = undefined;show_submit = true;question_button_callback(e);- assert.deepEqual(out_data, {type: "question", question: "Is it new?"});+ assert.deepEqual(out_data, {type: "question", question: "Is it new?"});poll_option_input.val("");out_data = undefined;diff --git a/frontend_tests/node_tests/popovers.js b/frontend_tests/node_tests/popovers.jsindex ccce5455b83..cefada4dd45 100644--- a/frontend_tests/node_tests/popovers.js+++ b/frontend_tests/node_tests/popovers.js@@ -10,7 +10,7 @@ zrequire("user_status");zrequire("feature_flags");zrequire("message_edit");-const noop = function () {};+const noop = function () {};$.fn.popover = noop; // this will get wrapped by our codezrequire("popovers");diff --git a/frontend_tests/node_tests/reactions.js b/frontend_tests/node_tests/reactions.jsindex e8bbc74f599..aceb8486973 100644--- a/frontend_tests/node_tests/reactions.js+++ b/frontend_tests/node_tests/reactions.js@@ -236,7 +236,7 @@ run_test("sending", () => {});});- emoji_name = "unknown-emoji"; // Test sending an emoji unknown to frontend.+ emoji_name = "unknown-emoji"; // Test sending an emoji unknown to frontend.blueslip.expect("warn", "Bad emoji name: " + emoji_name);reactions.toggle_emoji_reaction(message_id, emoji_name);reactions.add_reaction = orig_add_reaction;@@ -592,7 +592,7 @@ run_test("error_handling", () => {blueslip.expect("error", "reactions: Bad message id: 55");- const bogus_event = {+ const bogus_event = {message_id: 55,reaction_type: "realm_emoji",emoji_name: "realm_emoji",diff --git a/frontend_tests/node_tests/recent_topics.js b/frontend_tests/node_tests/recent_topics.jsindex 76f3cda99a7..650878f4aff 100644--- a/frontend_tests/node_tests/recent_topics.js+++ b/frontend_tests/node_tests/recent_topics.js@@ -80,13 +80,13 @@ const stream4 = 4;const stream5 = 5; // Deleted stream// Topics in the stream, all unread except topic1 & stream1.-const topic1 = "topic-1"; // No Other sender & read.-const topic2 = "topic-2"; // Other sender-const topic3 = "topic-3"; // User not present-const topic4 = "topic-4"; // User not present-const topic5 = "topic-5"; // other sender-const topic6 = "topic-6"; // other sender-const topic7 = "topic-7"; // muted topic+const topic1 = "topic-1"; // No Other sender & read.+const topic2 = "topic-2"; // Other sender+const topic3 = "topic-3"; // User not present+const topic4 = "topic-4"; // User not present+const topic5 = "topic-5"; // other sender+const topic6 = "topic-6"; // other sender+const topic7 = "topic-7"; // muted topicconst topic8 = "topic-8";const topic9 = "topic-9";const topic10 = "topic-10";diff --git a/frontend_tests/node_tests/search_suggestion.js b/frontend_tests/node_tests/search_suggestion.jsindex 61b4cc48694..b9aff116934 100644--- a/frontend_tests/node_tests/search_suggestion.js+++ b/frontend_tests/node_tests/search_suggestion.js@@ -876,7 +876,7 @@ run_test("topic_suggestions", () => {assert.equal(describe("te"), "Search for te");assert.equal(describe("stream:office topic:team"), "Stream office > team");- suggestions = get_suggestions("topic:staplers", "stream:office");+ suggestions = get_suggestions("topic:staplers", "stream:office");expected = ["stream:office",];diff --git a/frontend_tests/node_tests/settings_org.js b/frontend_tests/node_tests/settings_org.jsindex 64ffc63f0ad..30e44a9ebfe 100644--- a/frontend_tests/node_tests/settings_org.js+++ b/frontend_tests/node_tests/settings_org.js@@ -165,7 +165,7 @@ function createSaveButtons(subsection) {save_button_controls.set_find_results(".discard-button", stub_discard_button,);- const props = {};+ const props = {};props.hidden = false;save_button_controls.fadeIn = () => {props.hidden = false;diff --git a/frontend_tests/node_tests/stream_events.js b/frontend_tests/node_tests/stream_events.jsindex e2789ced4d2..8d019f0f843 100644--- a/frontend_tests/node_tests/stream_events.js+++ b/frontend_tests/node_tests/stream_events.js@@ -150,7 +150,7 @@ run_test("update_property", () => {});const args = stub.get_args("sub", "val");assert.equal(args.sub.stream_id, 1);- assert.deepEqual(args.val, {+ assert.deepEqual(args.val, {invite_only: true,history_public_to_subscribers: true,});diff --git a/frontend_tests/node_tests/stream_list.js b/frontend_tests/node_tests/stream_list.jsindex 7b4418e0df0..66861cfd0e2 100644--- a/frontend_tests/node_tests/stream_list.js+++ b/frontend_tests/node_tests/stream_list.js@@ -116,9 +116,9 @@ run_test("create_sidebar_row", () => {assert(topic_list_cleared);const expected_elems = [- devel_sidebar, //pinned- split, //separator- social_sidebar, //not pinned+ devel_sidebar, //pinned+ split, //separator+ social_sidebar, //not pinned];assert.deepEqual(appended_elems, expected_elems);@@ -229,7 +229,7 @@ function add_row(sub) {const html = "<" + sub.name + " sidebar row html>";const obj = $(html);- obj.length = 1; // bypass blueslip error+ obj.length = 1; // bypass blueslip errorreturn obj;},diff --git a/frontend_tests/node_tests/stream_search.js b/frontend_tests/node_tests/stream_search.jsindex 4f70fb806ce..e107abd47d3 100644--- a/frontend_tests/node_tests/stream_search.js+++ b/frontend_tests/node_tests/stream_search.js@@ -174,7 +174,7 @@ run_test("expanding_sidebar", () => {popovers.hide_all = () => {events.push("popovers.hide_all");};- stream_popover.show_streamlist_sidebar = () => {+ stream_popover.show_streamlist_sidebar = () => {events.push("stream_popover.show_streamlist_sidebar");};diff --git a/frontend_tests/node_tests/timerender.js b/frontend_tests/node_tests/timerender.jsindex b36af25f9a1..11ee2b38017 100644--- a/frontend_tests/node_tests/timerender.js+++ b/frontend_tests/node_tests/timerender.js@@ -77,7 +77,7 @@ run_test("render_now_returns_year_with_year_boundary", () => {run_test("render_date_renders_time_html", () => {const today = new XDate(1555091573000); // Friday 4/12/2019 5:52:53 PM (UTC+0)- const message_time = today.clone();+ const message_time = today.clone();const expected_html = i18n.t("Today");const attrs = {};diff --git a/frontend_tests/node_tests/upload.js b/frontend_tests/node_tests/upload.jsindex 226d39ba206..319a0eb0627 100644--- a/frontend_tests/node_tests/upload.js+++ b/frontend_tests/node_tests/upload.js@@ -171,7 +171,7 @@ run_test("upload_files", () => {hide_upload_status_called = true;assert(config.mode, "compose");};- const config = {mode: "compose"};+ const config = {mode: "compose"};$("#compose-send-button").attr("disabled", false);upload.upload_files(uppy, config, []);assert.equal($("#compose-send-button").attr("disabled"), false);diff --git a/frontend_tests/puppeteer_tests/00-realm-creation.js b/frontend_tests/puppeteer_tests/00-realm-creation.jsindex 45c3f106a5d..18f1a655757 100644--- a/frontend_tests/puppeteer_tests/00-realm-creation.js+++ b/frontend_tests/puppeteer_tests/00-realm-creation.js@@ -59,7 +59,7 @@ async function realm_creation_tests(page) {// Check if realm is created and user is logged in by checking if// element of id `lightbox_overlay` exists.- await page.waitForSelector("#lightbox_overlay"); // if element doesn't exist,timeout error raises+ await page.waitForSelector("#lightbox_overlay"); // if element doesn't exist,timeout error raises}common.run_test(realm_creation_tests);diff --git a/frontend_tests/zjsunit/mdiff.js b/frontend_tests/zjsunit/mdiff.jsindex 53f555b3095..29d8de18cca 100644--- a/frontend_tests/zjsunit/mdiff.js+++ b/frontend_tests/zjsunit/mdiff.js@@ -50,7 +50,7 @@ function apply_color(input_string, changes) {* directions to add appropriate color to the lines that they annotate.*/function parse_questionmark_line(questionmark_line) {- let current_sequence = ""; // Either "^", "-", "+", or ""+ let current_sequence = ""; // Either "^", "-", "+", or ""let beginning_index = 0;let index = 0;diff --git a/frontend_tests/zjsunit/zjquery.js b/frontend_tests/zjsunit/zjquery.jsindex b374ec03a93..7d3888887bb 100644--- a/frontend_tests/zjsunit/zjquery.js+++ b/frontend_tests/zjsunit/zjquery.js@@ -507,7 +507,7 @@ exports.make_zjquery = function (opts) {return elems.get(selector);};- zjquery.create = function (name) {+ zjquery.create = function (name) {assert(!elems.has(name),"You already created an object with this name!!");const elem = new_elem(name);diff --git a/static/js/billing/helpers.js b/static/js/billing/helpers.jsindex 1ab3a2fac58..33a1cb68d79 100644--- a/static/js/billing/helpers.js+++ b/static/js/billing/helpers.js@@ -6,8 +6,8 @@ exports.create_ajax_request = function (url, form_name, stripe_token = null, numconst form_error = "#" + form_name + "-error";const form_loading = "#" + form_name + "-loading";- const zulip_limited_section = "#zulip-limited-section";- const free_trial_alert_message = "#free-trial-alert-message";+ const zulip_limited_section = "#zulip-limited-section";+ const free_trial_alert_message = "#free-trial-alert-message";loading.make_indicator($(form_loading_indicator),{text: "Processing ...", abs_positioned: true});diff --git a/static/js/click_handlers.js b/static/js/click_handlers.jsindex f2beec00f06..a2d8a5f4546 100644--- a/static/js/click_handlers.js+++ b/static/js/click_handlers.js@@ -7,7 +7,7 @@ const render_buddy_list_tooltip_content = require("../templates/buddy_list_tooltfunction convert_enter_to_click(e) {const key = e.which;- if (key === 13) { // enter+ if (key === 13) { // enter$(e.currentTarget).click();}}diff --git a/static/js/compose.js b/static/js/compose.jsindex 620ebce9bc2..222ef924400 100644--- a/static/js/compose.js+++ b/static/js/compose.js@@ -806,7 +806,7 @@ exports.render_and_show_preview = function (preview_spinner, preview_content_boxif (content.length === 0) {show_preview(i18n.t("Nothing to preview"));} else {- if (markdown.contains_backend_only_syntax(content)) {+ if (markdown.contains_backend_only_syntax(content)) {const spinner = preview_spinner.expectOne();loading.make_indicator(spinner);} else {@@ -1131,7 +1131,7 @@ exports.initialize = function () {},});} else {- video_call_link = page_params.jitsi_server_url + "/" + video_call_id;+ video_call_link = page_params.jitsi_server_url + "/" + video_call_id;insert_video_call_url(video_call_link, target_textarea);}});diff --git a/static/js/compose_fade.js b/static/js/compose_fade.jsindex c85bea3214f..946a3ffe227 100644--- a/static/js/compose_fade.js+++ b/static/js/compose_fade.js@@ -2,7 +2,7 @@ const util = require("./util");let focused_recipient;let normal_display = false;-exports.should_fade_message = function (message) {+exports.should_fade_message = function (message) {return !util.same_recipient(focused_recipient, message);};diff --git a/static/js/compose_state.js b/static/js/compose_state.jsindex 639ef0e5cf0..66dd2b150bc 100644--- a/static/js/compose_state.js+++ b/static/js/compose_state.js@@ -36,8 +36,8 @@ function get_or_set(fieldname, keep_leading_whitespace) {}// TODO: Break out setters and getter into their own functions.-exports.stream_name = get_or_set("stream_message_recipient_stream");-exports.topic = get_or_set("stream_message_recipient_topic");+exports.stream_name = get_or_set("stream_message_recipient_stream");+exports.topic = get_or_set("stream_message_recipient_topic");// We can't trim leading whitespace in `compose_textarea` because// of the indented syntax for multi-line code blocks.exports.message_content = get_or_set("compose-textarea", true);diff --git a/static/js/composebox_typeahead.js b/static/js/composebox_typeahead.jsindex 4572464216b..e7be251ef31 100644--- a/static/js/composebox_typeahead.js+++ b/static/js/composebox_typeahead.js@@ -174,7 +174,7 @@ function handle_keydown(e) {}const on_stream = target_sel === "#stream_message_recipient_stream";- const on_topic = target_sel === "#stream_message_recipient_topic";+ const on_topic = target_sel === "#stream_message_recipient_topic";const on_pm = target_sel === "#private_message_recipient";const on_compose = target_sel === "#compose-textarea";@@ -709,7 +709,7 @@ exports.get_candidates = function (query) {if (this.options.completions.topic) {// Stream regex modified from marked.js// Matches '#**stream name** >' at the end of a split.- const stream_regex = /#\*\*([^*>]+)\*\*\s?>$/;+ const stream_regex = /#\*\*([^*>]+)\*\*\s?>$/;const should_jump_inside_typeahead = stream_regex.test(split[0]);if (should_jump_inside_typeahead) {this.completing = "topic_jump";@@ -892,7 +892,7 @@ exports.content_typeahead_selected = function (item, event) {const on_timestamp_selection = (val) => {const datestr = val;- beginning = beginning.substring(0, beginning.lastIndexOf("<time")) + `<time:${datestr}> `;+ beginning = beginning.substring(0, beginning.lastIndexOf("<time")) + `<time:${datestr}> `;if (rest.startsWith(">")) {rest = rest.slice(1);}diff --git a/static/js/drafts.js b/static/js/drafts.jsindex 69119f8be4d..c578f03d511 100644--- a/static/js/drafts.js+++ b/static/js/drafts.js@@ -204,7 +204,7 @@ exports.restore_draft = function (draft_id) {const DRAFT_LIFETIME = 30;exports.remove_old_drafts = function () {- const old_date = new Date().setDate(new Date().getDate() - DRAFT_LIFETIME);+ const old_date = new Date().setDate(new Date().getDate() - DRAFT_LIFETIME);const drafts = draft_model.get();for (const [id, draft] of Object.entries(drafts)) {if (draft.updatedAt < old_date) {diff --git a/static/js/emoji_picker.js b/static/js/emoji_picker.jsindex 75bb0ae92e2..2211878872a 100644--- a/static/js/emoji_picker.js+++ b/static/js/emoji_picker.js@@ -213,7 +213,7 @@ function filter_emojis() {const match = search_terms.every((search_term) => alias.includes(search_term));if (match) {search_results.push({...emoji_dict, emoji_name: alias});- break; // We only need the first matching alias per emoji.+ break; // We only need the first matching alias per emoji.}}}@@ -353,7 +353,7 @@ function get_next_emoji_coordinates(move_by) {if (move_by === -6) {max_len = get_max_index(next_section);const prev_multiple = round_off_to_previous_multiple(max_len, 6);- next_index = prev_multiple + current_index;+ next_index = prev_multiple + current_index;next_index = next_index >= max_len? prev_multiple + current_index - 6: next_index;@@ -505,9 +505,9 @@ function process_keypress(e) {const old_query = emoji_filter.val();let new_query = "";- if (pressed_key === 8) { // Handles backspace.+ if (pressed_key === 8) { // Handles backspace.new_query = old_query.slice(0, -1);- } else { // Handles any printable character.+ } else { // Handles any printable character.const key_str = String.fromCharCode(e.which);new_query = old_query + key_str;}diff --git a/static/js/fenced_code.js b/static/js/fenced_code.jsindex 401ec360c07..7fc978df93b 100644--- a/static/js/fenced_code.js+++ b/static/js/fenced_code.js@@ -5,19 +5,19 @@// auto-completing code blocks missing a trailing close.// See backend fenced_code.py:71 for associated regexp-const fencestr = "^(~{3,}|`{3,})" + // Opening Fence- "[ ]*" + // Spaces- "(" +- "\\{?\\.?" +- "([a-zA-Z0-9_+-./#]*)" + // Language- "\\}?" +- ")" +- "[ ]*" + // Spaces- "(" +- "\\{?\\.?" +- "([^~`]*)" + // Header (see fenced_code.py)- "\\}?" +- ")" ++const fencestr = "^(~{3,}|`{3,})" + // Opening Fence+ "[ ]*" + // Spaces+ "(" ++ "\\{?\\.?" ++ "([a-zA-Z0-9_+-./#]*)" + // Language+ "\\}?" ++ ")" ++ "[ ]*" + // Spaces+ "(" ++ "\\{?\\.?" ++ "([^~`]*)" + // Header (see fenced_code.py)+ "\\}?" ++ ")" +"$";const fence_re = new RegExp(fencestr);diff --git a/static/js/filter.js b/static/js/filter.jsindex 51bbeadbaa1..e5af1cbbd3a 100644--- a/static/js/filter.js+++ b/static/js/filter.js@@ -260,7 +260,7 @@ function decodeOperand(encoded, operator) {// Parse a string into a list of operators (see below).Filter.parse = function (str) {- const operators = [];+ const operators = [];const search_term = [];let negated;let operator;@@ -494,7 +494,7 @@ Filter.prototype = {if (!this._sub) {return "#";}- return "/#narrow/stream/" + stream_data.name_to_slug(this.operands("stream")[0]) + "/topic/" + this.operands("topic")[0];+ return "/#narrow/stream/" + stream_data.name_to_slug(this.operands("stream")[0]) + "/topic/" + this.operands("topic")[0];}// eliminate "complex filters"@@ -509,22 +509,22 @@ Filter.prototype = {if (!this._sub) {return "#";}- return "/#narrow/stream/" + stream_data.name_to_slug(this.operands("stream")[0]);+ return "/#narrow/stream/" + stream_data.name_to_slug(this.operands("stream")[0]);case "is-private":- return "/#narrow/is/private";+ return "/#narrow/is/private";case "is-starred":- return "/#narrow/is/starred";+ return "/#narrow/is/starred";case "is-mentioned":- return "/#narrow/is/mentioned";+ return "/#narrow/is/mentioned";case "streams-public":- return "/#narrow/streams/public";+ return "/#narrow/streams/public";case "pm-with":// join is used to transform the array to a comma separated string- return "/#narrow/pm-with/" + people.emails_to_slug(this.operands("pm-with").join());+ return "/#narrow/pm-with/" + people.emails_to_slug(this.operands("pm-with").join());// TODO: It is ambiguous how we want to handle the 'sender' case,// we may remove it in the future based on design decisionscase "sender":- return "/#narrow/sender/" + people.emails_to_slug(this.operands("sender")[0]);+ return "/#narrow/sender/" + people.emails_to_slug(this.operands("sender")[0]);}}diff --git a/static/js/hash_util.js b/static/js/hash_util.jsindex d67bde3dc48..80e8db961b5 100644--- a/static/js/hash_util.js+++ b/static/js/hash_util.js@@ -190,7 +190,7 @@ exports.parse_narrow = function (hash) {operator = operator.slice(1);}- const operand = exports.decode_operand(operator, raw_operand);+ const operand = exports.decode_operand(operator, raw_operand);operators.push({negated: negated, operator: operator, operand: operand});}return operators;diff --git a/static/js/hashchange.js b/static/js/hashchange.jsindex 0a5cc308873..60690e5f1c9 100644--- a/static/js/hashchange.js+++ b/static/js/hashchange.js@@ -18,7 +18,7 @@ function get_full_url(hash) {}// Build a full URL to not have same origin problems- const url = location.protocol + "//" + location.host + pathname + hash;+ const url = location.protocol + "//" + location.host + pathname + hash;return url;}@@ -88,7 +88,7 @@ function do_hashchange_normal(from_reload) {return false;}const narrow_opts = {- change_hash: false, // already set+ change_hash: false, // already settrigger: "hash change",};if (from_reload) {diff --git a/static/js/hotkey.js b/static/js/hotkey.jsindex 785118e586c..5d5743f6b6b 100644--- a/static/js/hotkey.js+++ b/static/js/hotkey.js@@ -26,7 +26,7 @@ const menu_dropdown_hotkeys = [const keydown_shift_mappings = {// these can be triggered by shift + key only9: {name: "shift_tab", message_view_only: false}, // tab- 32: {name: "shift_spacebar", message_view_only: true}, // space bar+ 32: {name: "shift_spacebar", message_view_only: true}, // space bar37: {name: "left_arrow", message_view_only: false}, // left arrow39: {name: "right_arrow", message_view_only: false}, // right arrow38: {name: "up_arrow", message_view_only: false}, // up arrowdiff --git a/static/js/i18n.js b/static/js/i18n.jsindex e4099a6bb07..5458fb8ccc0 100644--- a/static/js/i18n.js+++ b/static/js/i18n.js@@ -13,7 +13,7 @@ i18next.init({prefix: "__",suffix: "__",},- returnEmptyString: false, // Empty string is not a valid translation.+ returnEmptyString: false, // Empty string is not a valid translation.});window.i18n = i18next;diff --git a/static/js/message_flags.js b/static/js/message_flags.jsindex 7cef4fca8c4..70b4323f230 100644--- a/static/js/message_flags.js+++ b/static/js/message_flags.js@@ -42,7 +42,7 @@ exports.send_read = (function () {start = _.throttle(server_request, 1000);on_success = function on_success(data) {- if (data === undefined || data.messages === undefined) {+ if (data === undefined || data.messages === undefined) {return;}diff --git a/static/js/message_list.js b/static/js/message_list.jsindex e92446caa3e..8d284ce9f1b 100644--- a/static/js/message_list.js+++ b/static/js/message_list.js@@ -121,7 +121,7 @@ exports.MessageList.prototype = {return this.data.can_mark_messages_read();},- clear: function MessageList_clear(opts) {+ clear: function MessageList_clear(opts) {opts = {clear_selected_id: true, ...opts};this.data.clear();diff --git a/static/js/message_list_data.js b/static/js/message_list_data.jsindex 6a2cc51af86..1c657628c53 100644--- a/static/js/message_list_data.js+++ b/static/js/message_list_data.js@@ -357,7 +357,7 @@ MessageListData.prototype = {}const start_idx = this._lower_bound(start);- const end_idx = this._lower_bound(end);+ const end_idx = this._lower_bound(end);return this._items.slice(start_idx, end_idx + 1);},diff --git a/static/js/message_list_view.js b/static/js/message_list_view.jsindex 2451ce7320b..8470357f2ad 100644--- a/static/js/message_list_view.js+++ b/static/js/message_list_view.js@@ -259,7 +259,7 @@ MessageListView.prototype = {const message_reactions = reactions.get_message_reactions(message_container.msg);message_container.msg.message_reactions = message_reactions;message_container.include_recipient = false;- message_container.include_footer = false;+ message_container.include_footer = false;if (same_recipient(prev, message_container) && self.collapse_messages &&prev.msg.historical === message_container.msg.historical) {diff --git a/static/js/message_store.js b/static/js/message_store.jsindex 570b0ac8137..73db317dab0 100644--- a/static/js/message_store.js+++ b/static/js/message_store.js@@ -99,7 +99,7 @@ exports.set_message_booleans = function (message) {message.historical = convert_flag("historical");message.starred = convert_flag("starred");message.mentioned = convert_flag("mentioned") || convert_flag("wildcard_mentioned");- message.mentioned_me_directly = convert_flag("mentioned");+ message.mentioned_me_directly = convert_flag("mentioned");message.collapsed = convert_flag("collapsed");message.alerted = convert_flag("has_alert_word");@@ -133,7 +133,7 @@ exports.update_booleans = function (message, flags) {}message.mentioned = convert_flag("mentioned") || convert_flag("wildcard_mentioned");- message.mentioned_me_directly = convert_flag("mentioned");+ message.mentioned_me_directly = convert_flag("mentioned");message.alerted = convert_flag("has_alert_word");};diff --git a/static/js/message_viewport.js b/static/js/message_viewport.jsindex 74ec0a9c16e..380870ceb6c 100644--- a/static/js/message_viewport.js+++ b/static/js/message_viewport.js@@ -396,7 +396,7 @@ exports.keep_pointer_in_view = function () {// return true only if we make an actual adjustment, so// that we know to short circuit the other directionif (in_view(next_row)) {- return false; // try other side+ return false; // try other side}while (!in_view(next_row)) {candidate = get_next_row(next_row);diff --git a/static/js/narrow.js b/static/js/narrow.jsindex 06bd5e304f3..b543579288a 100644--- a/static/js/narrow.js+++ b/static/js/narrow.js@@ -205,7 +205,7 @@ exports.activate = function (raw_operators, opts) {// Save how far from the pointer the top of the message list was.exports.save_pre_narrow_offset_for_reload();- let msg_data = new MessageListData({+ let msg_data = new MessageListData({filter: narrow_state.filter(),muting_enabled: muting_enabled,});diff --git a/static/js/narrow_state.js b/static/js/narrow_state.jsindex 32831b591c3..68da784f210 100644--- a/static/js/narrow_state.js+++ b/static/js/narrow_state.js@@ -45,7 +45,7 @@ exports.search_string = function () {// Collect operators which appear only once into an object,// and discard those which appear more than once.function collect_single(operators) {- const seen = new Map();+ const seen = new Map();const result = new Map();for (const elem of operators) {diff --git a/static/js/people.js b/static/js/people.jsindex fa8d92462f1..00dde2b7151 100644--- a/static/js/people.js+++ b/static/js/people.js@@ -1,5 +1,5 @@const util = require("./util");-require("unorm"); // String.prototype.normalize polyfill for IE11+require("unorm"); // String.prototype.normalize polyfill for IE11const FoldDict = require("./fold_dict").FoldDict;const typeahead = require("../shared/js/typeahead");const settings_data = require("./settings_data");diff --git a/static/js/popovers.js b/static/js/popovers.jsindex 918759255f8..9302331701c 100644--- a/static/js/popovers.js+++ b/static/js/popovers.js@@ -256,7 +256,7 @@ function show_user_info_popover(element, user, message) {return;}- const is_sender_popover = message.sender_id === user.user_id;+ const is_sender_popover = message.sender_id === user.user_id;render_user_info_popover(user, elt, is_sender_popover, "respond_personal_button","message-info-popover", "right");diff --git a/static/js/portico/integrations_dev_panel.js b/static/js/portico/integrations_dev_panel.jsindex 591468d0f9d..1a836973010 100644--- a/static/js/portico/integrations_dev_panel.js+++ b/static/js/portico/integrations_dev_panel.js@@ -91,9 +91,9 @@ function set_results(response) {responses.forEach((response) => {if (response.fixture_name !== undefined) {data += "Fixture: " + response.fixture_name;- data += "\nStatus Code: " + response.status_code;+ data += "\nStatus Code: " + response.status_code;} else {- data += "Status Code: " + response.status_code;+ data += "Status Code: " + response.status_code;}data += "\nResponse: " + response.message + "\n\n";});diff --git a/static/js/reload.js b/static/js/reload.jsindex d44dc67ca25..7ddea92a40c 100644--- a/static/js/reload.js+++ b/static/js/reload.js@@ -271,8 +271,8 @@ exports.initiate = function (options) {let idle_control;const random_variance = util.random_int(0, 1000 * 60 * 5);const unconditional_timeout = 1000 * 60 * 30 + random_variance;- const composing_idle_timeout = 1000 * 60 * 7 + random_variance;- const basic_idle_timeout = 1000 * 60 * 1 + random_variance;+ const composing_idle_timeout = 1000 * 60 * 7 + random_variance;+ const basic_idle_timeout = 1000 * 60 * 1 + random_variance;let compose_started_handler;function reload_from_idle() {diff --git a/static/js/settings_org.js b/static/js/settings_org.jsindex a3137291611..313cef83105 100644--- a/static/js/settings_org.js+++ b/static/js/settings_org.js@@ -385,7 +385,7 @@ exports.sync_realm_settings = function (property) {} else if (property === "invite_required" || property === "invite_by_admins_only") {property = "user_invite_restriction";}- const element = $("#id_realm_" + property);+ const element = $("#id_realm_" + property);if (element.length) {discard_property_element_changes(element);}@@ -967,7 +967,7 @@ exports.build_page = function () {form_data.append("night", JSON.stringify(night));}const spinner = $(`${widget} .upload-spinner-background`).expectOne();- const upload_text = $(`${widget} .settings-page-upload-text`).expectOne();+ const upload_text = $(`${widget} .settings-page-upload-text`).expectOne();const delete_button = $(`${widget} .settings-page-delete-button`).expectOne();const error_field = $(`${widget} .image_file_input_error`).expectOne();realm_icon_logo_upload_start(spinner, upload_text, delete_button);diff --git a/static/js/settings_profile_fields.js b/static/js/settings_profile_fields.jsindex adb84950130..44d3e630279 100644--- a/static/js/settings_profile_fields.js+++ b/static/js/settings_profile_fields.js@@ -340,8 +340,8 @@ exports.do_populate_profile_fields = function (profile_fields_data) {// We should only call this internally or from tests.const profile_fields_table = $("#admin_profile_fields_table").expectOne();- profile_fields_table.find("tr.profile-field-row").remove(); // Clear all rows.- profile_fields_table.find("tr.profile-field-form").remove(); // Clear all rows.+ profile_fields_table.find("tr.profile-field-row").remove(); // Clear all rows.+ profile_fields_table.find("tr.profile-field-form").remove(); // Clear all rows.order = [];for (const profile_field of profile_fields_data) {diff --git a/static/js/settings_users.js b/static/js/settings_users.jsindex 4c99c7e6b75..32147f7472a 100644--- a/static/js/settings_users.js+++ b/static/js/settings_users.js@@ -433,7 +433,7 @@ function get_human_profile_data(fields_user_pills) {}});// Append user type field values also- for (const [field_id, field_pills] of fields_user_pills) {+ for (const [field_id, field_pills] of fields_user_pills) {if (field_pills) {const user_ids = user_pill.get_user_ids(field_pills);new_profile_data.push({diff --git a/static/js/stream_create.js b/static/js/stream_create.jsindex da68a355365..0c245cd4383 100644--- a/static/js/stream_create.js+++ b/static/js/stream_create.js@@ -311,7 +311,7 @@ exports.create_handlers_for_users = function (container) {// 'Check all' and 'Uncheck all' visible userscontainer.on("click", ".subs_set_all_users", (e) => {$("#user-checkboxes .checkbox").each((idx, li) => {- if (li.style.display !== "none") {+ if (li.style.display !== "none") {$(li.firstElementChild).prop("checked", true);}});diff --git a/static/js/stream_data.js b/static/js/stream_data.jsindex 66b5a0f2e86..144780c431a 100644--- a/static/js/stream_data.js+++ b/static/js/stream_data.js@@ -458,7 +458,7 @@ exports.update_stream_privacy = function (sub, values) {sub.history_public_to_subscribers = values.history_public_to_subscribers;};-exports.update_message_retention_setting = function (sub, message_retention_days) {+exports.update_message_retention_setting = function (sub, message_retention_days) {sub.message_retention_days = message_retention_days;};@@ -845,7 +845,7 @@ exports.sort_for_stream_settings = function (stream_ids, order) {return -1;}- function by_stream_name(id_a, id_b) {+ function by_stream_name(id_a, id_b) {const stream_a_name = name(id_a);const stream_b_name = name(id_b);return String.prototype.localeCompare.call(stream_a_name, stream_b_name);diff --git a/static/js/stream_edit.js b/static/js/stream_edit.jsindex 02e1869d797..cfae40c1f45 100644--- a/static/js/stream_edit.js+++ b/static/js/stream_edit.js@@ -69,7 +69,7 @@ exports.get_retention_policy_text_for_subscription_type = function (sub) {// If we are deleting messages, even if it's the organization// default, it's worth commenting on the policy.- if (message_retention_days === null) {+ if (message_retention_days === null) {message_retention_days = page_params.realm_message_retention_days;}diff --git a/static/js/stream_list.js b/static/js/stream_list.jsindex 43b5cf08220..97d81d4e4ab 100644--- a/static/js/stream_list.js+++ b/static/js/stream_list.js@@ -353,7 +353,7 @@ exports.refresh_pinned_or_unpinned_stream = function (sub) {}};-exports.get_sidebar_stream_topic_info = function (filter) {+exports.get_sidebar_stream_topic_info = function (filter) {const result = {stream_id: undefined,topic_selected: false,diff --git a/static/js/timerender.js b/static/js/timerender.jsindex 5c5701c2b29..75df5a57eb7 100644--- a/static/js/timerender.js+++ b/static/js/timerender.js@@ -60,7 +60,7 @@ exports.render_now = function (time, today) {// Current date is passed as an argument for unit testingexports.last_seen_status_from_date = function (last_active_date, current_date) {- if (typeof current_date === "undefined") {+ if (typeof current_date === "undefined") {current_date = new XDate();}diff --git a/static/js/topic_generator.js b/static/js/topic_generator.jsindex 5293ea12162..81a2b216854 100644--- a/static/js/topic_generator.js+++ b/static/js/topic_generator.js@@ -197,7 +197,7 @@ exports.get_next_topic = function (curr_stream, curr_topic) {if (!stream_data.is_stream_muted_by_name(stream_name)) {return true;}- if (stream_name === curr_stream) {+ if (stream_name === curr_stream) {// We can use n within a muted stream if we are// currently narrowed to it.return true;diff --git a/static/js/transmit.js b/static/js/transmit.jsindex 41764e68a97..99e62da6177 100644--- a/static/js/transmit.js+++ b/static/js/transmit.js@@ -74,7 +74,7 @@ exports.reply_message = function (opts) {content = mention + " " + content;reply.type = "stream";- reply.to = stream;+ reply.to = stream;reply.content = content;reply.topic = message.topic;diff --git a/static/js/unread.js b/static/js/unread.jsindex a86eba93e7b..eee89d66fcd 100644--- a/static/js/unread.js+++ b/static/js/unread.js@@ -233,7 +233,7 @@ exports.unread_topic_counter = (function () {self.get_counts = function () {const res = {};res.stream_unread_messages = 0;- res.stream_count = new Map(); // hash by stream_id -> count+ res.stream_count = new Map(); // hash by stream_id -> countfor (const [stream_id, per_stream_bucketer] of bucketer) {// We track unread counts for streams that may be currentlydiff --git a/tools/message-screenshot.js b/tools/message-screenshot.jsindex 5663b8b2476..24ab9d6fde7 100644--- a/tools/message-screenshot.js+++ b/tools/message-screenshot.js@@ -51,8 +51,8 @@ async function run() {await page.waitForSelector(messageSelector);// remove unread marker and don't select messageconst marker = `#zfilt${options.messageId} .unread_marker`;- await page.evaluate((sel) => $(sel).remove(), marker); // eslint-disable-line no-undef- await page.evaluate(() => navigate.up()); // eslint-disable-line no-undef+ await page.evaluate((sel) => $(sel).remove(), marker); // eslint-disable-line no-undef+ await page.evaluate(() => navigate.up()); // eslint-disable-line no-undefconst messageBox = await page.$(messageSelector);const messageGroup = (await messageBox.$x(".."))[0];// Compute screenshot area, with some padding around the message groupdiff --git a/tools/webpack.config.ts b/tools/webpack.config.tsindex 8d9f35a8c30..724dc6419b3 100644--- a/tools/webpack.config.ts+++ b/tools/webpack.config.ts@@ -30,7 +30,7 @@ export default (env?: string): webpack.Configuration[] => {{loader: "css-loader",options: {- url: false, // webfonts-loader generates public relative URLs+ url: false, // webfonts-loader generates public relative URLs},},{