diff --git a/.eslintrc.json b/.eslintrc.json index 1c03103bbc..0e81209754 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -245,6 +245,12 @@ "FunctionExpression": {"parameters": "first"}, "FunctionDeclaration": {"parameters": "first"} }], + "key-spacing": [ "error", + { + "beforeColon": false, + "afterColon": true + } + ], "keyword-spacing": [ "error", { "before": true, diff --git a/frontend_tests/casper_lib/common.js b/frontend_tests/casper_lib/common.js index 57224ba680..db8f4e4416 100644 --- a/frontend_tests/casper_lib/common.js +++ b/frontend_tests/casper_lib/common.js @@ -169,7 +169,7 @@ exports.select_item_via_typeahead = function (field_selector, str, item) { currentTarget: $('.typeahead:visible li:contains("' + item + '")')[0], }); tah.select(); - }, {field_selector:field_selector, str: str, item: item}); + }, {field_selector: field_selector, str: str, item: item}); }); }; diff --git a/frontend_tests/casper_tests/02-site.js b/frontend_tests/casper_tests/02-site.js index 507b16641a..8cd498e8c6 100644 --- a/frontend_tests/casper_tests/02-site.js +++ b/frontend_tests/casper_tests/02-site.js @@ -29,23 +29,23 @@ casper.then(function () { // Send some messages. common.then_send_many([ - { stream: 'Verona', subject: 'frontend test', + { stream: 'Verona', subject: 'frontend test', content: 'test verona A' }, - { stream: 'Verona', subject: 'frontend test', + { stream: 'Verona', subject: 'frontend test', content: 'test verona B' }, - { stream: 'Verona', subject: 'other subject', + { stream: 'Verona', subject: 'other subject', content: 'test verona C' }, { recipient: 'cordelia@zulip.com, hamlet@zulip.com', - content: 'personal A' }, + content: 'personal A' }, { recipient: 'cordelia@zulip.com, hamlet@zulip.com', - content: 'personal B' }, + content: 'personal B' }, { recipient: 'cordelia@zulip.com', - content: 'personal C' }]); + content: 'personal C' }]); common.wait_for_receive(function () { common.expected_messages('zhome', [ @@ -66,11 +66,11 @@ common.wait_for_receive(function () { }); common.then_send_many([ - { stream: 'Verona', subject: 'frontend test', + { stream: 'Verona', subject: 'frontend test', content: 'test verona D' }, { recipient: 'cordelia@zulip.com, hamlet@zulip.com', - content: 'personal D' }, + content: 'personal D' }, ]); common.then_log_out(); diff --git a/frontend_tests/casper_tests/03-narrow.js b/frontend_tests/casper_tests/03-narrow.js index 147a5761b8..15e2f70df6 100644 --- a/frontend_tests/casper_tests/03-narrow.js +++ b/frontend_tests/casper_tests/03-narrow.js @@ -11,35 +11,35 @@ casper.then(function () { }); common.then_send_many([ - { stream: 'Verona', subject: 'frontend test', + { stream: 'Verona', subject: 'frontend test', content: 'test message A' }, - { stream: 'Verona', subject: 'frontend test', + { stream: 'Verona', subject: 'frontend test', content: 'test message B' }, - { stream: 'Verona', subject: 'other subject', + { stream: 'Verona', subject: 'other subject', content: 'test message C' }, - { stream: 'Denmark', subject: 'frontend test', + { stream: 'Denmark', subject: 'frontend test', content: 'other message' }, { recipient: 'cordelia@zulip.com, hamlet@zulip.com', - content: 'personal A' }, + content: 'personal A' }, { recipient: 'cordelia@zulip.com, hamlet@zulip.com', - content: 'personal B' }, + content: 'personal B' }, { recipient: 'cordelia@zulip.com', - content: 'personal C' }, + content: 'personal C' }, - { stream: 'Verona', subject: 'frontend test', + { stream: 'Verona', subject: 'frontend test', content: 'test message D' }, { recipient: 'cordelia@zulip.com, hamlet@zulip.com', - content: 'personal D' }, + content: 'personal D' }, { recipient: 'cordelia@zulip.com', - content: 'personal E' }, + content: 'personal E' }, ]); diff --git a/frontend_tests/casper_tests/04-compose.js b/frontend_tests/casper_tests/04-compose.js index 23b7caa872..f17a98e220 100644 --- a/frontend_tests/casper_tests/04-compose.js +++ b/frontend_tests/casper_tests/04-compose.js @@ -163,7 +163,7 @@ casper.then(function () { casper.waitWhileVisible('.message_comp'); common.then_send_many([ { recipient: recipients.join(','), - content: 'A huddle to check spaces' }]); + content: 'A huddle to check spaces' }]); casper.then(function () { common.keypress(27); // escape to dismiss compose box diff --git a/frontend_tests/casper_tests/06-settings.js b/frontend_tests/casper_tests/06-settings.js index 5e8a539bb7..e1c1286d89 100644 --- a/frontend_tests/casper_tests/06-settings.js +++ b/frontend_tests/casper_tests/06-settings.js @@ -68,7 +68,7 @@ casper.then(function () { casper.then(function () { casper.waitUntilVisible('#get_api_key_button', function () { - casper.fill('#get_api_key_form', {password:test_credentials.default_user.password}); + casper.fill('#get_api_key_form', {password: test_credentials.default_user.password}); casper.click('#get_api_key_button'); }); }); diff --git a/frontend_tests/casper_tests/07-stars.js b/frontend_tests/casper_tests/07-stars.js index e141d5b3e3..a2ed33f999 100644 --- a/frontend_tests/casper_tests/07-stars.js +++ b/frontend_tests/casper_tests/07-stars.js @@ -19,7 +19,7 @@ casper.then(function () { }); common.then_send_message('stream', { - stream: 'Verona', + stream: 'Verona', subject: 'stars', content: 'test star', }); diff --git a/frontend_tests/casper_tests/08-edit.js b/frontend_tests/casper_tests/08-edit.js index dcdc5ef016..71cb56cdef 100644 --- a/frontend_tests/casper_tests/08-edit.js +++ b/frontend_tests/casper_tests/08-edit.js @@ -18,7 +18,7 @@ function then_edit_last_message() { // Send and edit a stream message common.then_send_message('stream', { - stream: 'Verona', + stream: 'Verona', subject: 'edits', content: 'test editing', }); @@ -45,7 +45,7 @@ casper.waitWhileVisible("textarea.message_edit_content", function () { }); common.then_send_message('stream', { - stream: 'Verona', + stream: 'Verona', subject: 'edits', content: '/me test editing one line with me', }); diff --git a/frontend_tests/casper_tests/11-mention.js b/frontend_tests/casper_tests/11-mention.js index 162e6bc357..8c1734be62 100644 --- a/frontend_tests/casper_tests/11-mention.js +++ b/frontend_tests/casper_tests/11-mention.js @@ -9,7 +9,7 @@ casper.waitUntilVisible('#zhome', function () { casper.then(function () { casper.fill('form[action^="/json/messages"]', { - stream_message_recipient_stream: 'Verona', + stream_message_recipient_stream: 'Verona', stream_message_recipient_topic: 'Test mention all', }); }); diff --git a/frontend_tests/casper_tests/12-toggle-message-editing.js b/frontend_tests/casper_tests/12-toggle-message-editing.js index d92e423776..c0edaf3e25 100644 --- a/frontend_tests/casper_tests/12-toggle-message-editing.js +++ b/frontend_tests/casper_tests/12-toggle-message-editing.js @@ -15,12 +15,12 @@ var content2 = 'admin: edit test message 2'; // send two messages common.then_send_message('stream', { - stream: 'Verona', + stream: 'Verona', subject: 'edits', content: content1, }); common.then_send_message('stream', { - stream: 'Verona', + stream: 'Verona', subject: 'edits', content: content2, }); diff --git a/frontend_tests/casper_tests/16-copy-and-paste.js b/frontend_tests/casper_tests/16-copy-and-paste.js index 804111304a..6e21117993 100644 --- a/frontend_tests/casper_tests/16-copy-and-paste.js +++ b/frontend_tests/casper_tests/16-copy-and-paste.js @@ -8,25 +8,25 @@ casper.then(function () { // setup environment: several messages to different topics common.then_send_many([ - { stream: 'Verona', subject: 'copy-paste-subject #1', + { stream: 'Verona', subject: 'copy-paste-subject #1', content: 'copy paste test A' }, - { stream: 'Verona', subject: 'copy-paste-subject #1', + { stream: 'Verona', subject: 'copy-paste-subject #1', content: 'copy paste test B' }, - { stream: 'Verona', subject: 'copy-paste-subject #2', + { stream: 'Verona', subject: 'copy-paste-subject #2', content: 'copy paste test C' }, - { stream: 'Verona', subject: 'copy-paste-subject #2', + { stream: 'Verona', subject: 'copy-paste-subject #2', content: 'copy paste test D' }, - { stream: 'Verona', subject: 'copy-paste-subject #2', + { stream: 'Verona', subject: 'copy-paste-subject #2', content: 'copy paste test E' }, - { stream: 'Verona', subject: 'copy-paste-subject #3', + { stream: 'Verona', subject: 'copy-paste-subject #3', content: 'copy paste test F' }, - { stream: 'Verona', subject: 'copy-paste-subject #3', + { stream: 'Verona', subject: 'copy-paste-subject #3', content: 'copy paste test G' }, ]); diff --git a/frontend_tests/node_tests/components.js b/frontend_tests/node_tests/components.js index d5e82d88a7..76c7b32616 100644 --- a/frontend_tests/node_tests/components.js +++ b/frontend_tests/node_tests/components.js @@ -5,8 +5,8 @@ zrequire('components'); var noop = function () {}; -var LEFT_KEY = { which: 37, preventDefault: noop, stopPropagation:noop }; -var RIGHT_KEY = { which: 39, preventDefault: noop, stopPropagation:noop }; +var LEFT_KEY = { which: 37, preventDefault: noop, stopPropagation: noop }; +var RIGHT_KEY = { which: 39, preventDefault: noop, stopPropagation: noop }; run_test('basics', () => { var keydown_f; diff --git a/frontend_tests/node_tests/markdown.js b/frontend_tests/node_tests/markdown.js index 82d6cfd6cb..98412854eb 100644 --- a/frontend_tests/node_tests/markdown.js +++ b/frontend_tests/node_tests/markdown.js @@ -324,7 +324,7 @@ run_test('marked', () => { {input: 'T\n@**Cordelia Lear**', expected: '

T
\n@Cordelia Lear

'}, {input: '@**Mark Twin|104** and @**Mark Twin|105** are out to confuse you.', - expected:'

@Mark Twin and @Mark Twin are out to confuse you.

'}, + expected: '

@Mark Twin and @Mark Twin are out to confuse you.

'}, {input: '@**Invalid User|1234**', expected: '

@**Invalid User|1234**

'}, {input: '@**Cordelia Lear|103** has a wrong user_id.', diff --git a/frontend_tests/node_tests/message_list.js b/frontend_tests/node_tests/message_list.js index 8c1cc3816a..209c36813a 100644 --- a/frontend_tests/node_tests/message_list.js +++ b/frontend_tests/node_tests/message_list.js @@ -219,7 +219,7 @@ run_test('updates', () => { run_test('nth_most_recent_id', () => { var list = new MessageList({}); - list.append([{id:10}, {id:20}, {id:30}]); + list.append([{id: 10}, {id: 20}, {id: 30}]); assert.equal(list.nth_most_recent_id(1), 30); assert.equal(list.nth_most_recent_id(2), 20); assert.equal(list.nth_most_recent_id(3), 10); @@ -269,8 +269,9 @@ run_test('last_sent_by_me', () => { run_test('local_echo', () => { var list = new MessageList({}); - list.append([{id:10}, {id:20}, {id:30}, {id:20.02}, {id:20.03}, {id:40}, {id:50}, {id:60}]); - list._local_only = {20.02: {id:20.02}, 20.03: {id:20.03}}; + list.append([{id: 10}, {id: 20}, {id: 30}, {id: 20.02}, + {id: 20.03}, {id: 40}, {id: 50}, {id: 60}]); + list._local_only = {20.02: {id: 20.02}, 20.03: {id: 20.03}}; assert.equal(list.closest_id(10), 10); assert.equal(list.closest_id(20), 20); @@ -292,9 +293,9 @@ run_test('local_echo', () => { list = new MessageList({}); list.append([ - {id:10}, {id:20}, {id:30}, {id:20.02}, {id:20.03}, {id:40}, - {id:50}, {id: 50.01}, {id: 50.02}, {id:60}]); - list._local_only = {20.02: {id:20.02}, 20.03: {id:20.03}, + {id: 10}, {id: 20}, {id: 30}, {id: 20.02}, {id: 20.03}, {id: 40}, + {id: 50}, {id: 50.01}, {id: 50.02}, {id: 60}]); + list._local_only = {20.02: {id: 20.02}, 20.03: {id: 20.03}, 50.01: {id: 50.01}, 50.02: {id: 50.02}}; assert.equal(list.closest_id(10), 10); diff --git a/frontend_tests/node_tests/message_list_view.js b/frontend_tests/node_tests/message_list_view.js index 566d11c3cd..064475bad9 100644 --- a/frontend_tests/node_tests/message_list_view.js +++ b/frontend_tests/node_tests/message_list_view.js @@ -26,7 +26,7 @@ set_global('timerender', { } return [{outerHTML: String(time1.getTime()) + ' - ' + String(time2.getTime())}]; }, - stringify_time : function (time) { + stringify_time: function (time) { if (page_params.twenty_four_hour_time) { return time.toString('HH:mm'); } diff --git a/frontend_tests/node_tests/settings_bots.js b/frontend_tests/node_tests/settings_bots.js index bfee6079ab..26d1c9d002 100644 --- a/frontend_tests/node_tests/settings_bots.js +++ b/frontend_tests/node_tests/settings_bots.js @@ -2,8 +2,8 @@ set_global("page_params", { realm_uri: "https://chat.example.com", realm_embedded_bots: [ {name: "converter", config: {}}, - {name:"giphy", config: {key: "12345678"}}, - {name:"foobot", config: {bar: "baz", qux: "quux"}}, + {name: "giphy", config: {key: "12345678"}}, + {name: "foobot", config: {bar: "baz", qux: "quux"}}, ], realm_bots: [{api_key: 'QadL788EkiottHmukyhHgePUFHREiu8b', email: 'error-bot@zulip.org', diff --git a/frontend_tests/node_tests/typeahead_helper.js b/frontend_tests/node_tests/typeahead_helper.js index 99ed190f91..7cbb830c58 100644 --- a/frontend_tests/node_tests/typeahead_helper.js +++ b/frontend_tests/node_tests/typeahead_helper.js @@ -210,22 +210,22 @@ run_test('sort_recipients', () => { // For splitting based on recency global.recent_senders.process_message_for_senders({ - sender_id : 7, - stream_id : 1, - subject : "Dev Topic", - id : _.uniqueId(), + sender_id: 7, + stream_id: 1, + subject: "Dev Topic", + id: _.uniqueId(), }); global.recent_senders.process_message_for_senders({ - sender_id : 5, - stream_id : 1, - subject : "Dev Topic", - id : _.uniqueId(), + sender_id: 5, + stream_id: 1, + subject: "Dev Topic", + id: _.uniqueId(), }); global.recent_senders.process_message_for_senders({ - sender_id : 6, - stream_id : 1, - subject : "Dev Topic", - id : _.uniqueId(), + sender_id: 6, + stream_id: 1, + subject: "Dev Topic", + id: _.uniqueId(), }); // Typeahead for stream message [query, stream-name, topic-name] @@ -240,16 +240,16 @@ run_test('sort_recipients', () => { ]); global.recent_senders.process_message_for_senders({ - sender_id : 5, - stream_id : 2, - subject : "Linux Topic", - id : _.uniqueId(), + sender_id: 5, + stream_id: 2, + subject: "Linux Topic", + id: _.uniqueId(), }); global.recent_senders.process_message_for_senders({ - sender_id : 7, - stream_id : 2, - subject : "Linux Topic", - id : _.uniqueId(), + sender_id: 7, + stream_id: 2, + subject: "Linux Topic", + id: _.uniqueId(), }); // No match diff --git a/frontend_tests/node_tests/unread.js b/frontend_tests/node_tests/unread.js index aa2e9fc6ed..ce0c386a79 100644 --- a/frontend_tests/node_tests/unread.js +++ b/frontend_tests/node_tests/unread.js @@ -446,7 +446,7 @@ run_test('mentions', () => { stream_id: 999, subject: 'lunch', mentioned: true, - unread:true, + unread: true, }; unread.process_loaded_messages([message]); diff --git a/frontend_tests/node_tests/util.js b/frontend_tests/node_tests/util.js index cb9df55989..d3de22b69b 100644 --- a/frontend_tests/node_tests/util.js +++ b/frontend_tests/node_tests/util.js @@ -53,7 +53,7 @@ run_test('lower_bound', () => { assert.equal(util.lower_bound(arr, 55), 5); assert.equal(util.lower_bound(arr, 2, 4, 31), 3); - arr = [{x: 10}, {x: 20}, {x:30}]; + arr = [{x: 10}, {x: 20}, {x: 30}]; function compare(a, b) { return a.x < b; diff --git a/frontend_tests/zjsunit/bugdown_assert.js b/frontend_tests/zjsunit/bugdown_assert.js index f4d7b7ba20..f9342f1a51 100644 --- a/frontend_tests/zjsunit/bugdown_assert.js +++ b/frontend_tests/zjsunit/bugdown_assert.js @@ -118,8 +118,8 @@ class MarkdownComparer { are_equivalent = this._haveEqualContents(element_actual, element_expected); if (!are_equivalent) { html = { - actual : this._reorderAttributes(element_actual).innerHTML, - expected : this._reorderAttributes(element_expected).innerHTML, + actual: this._reorderAttributes(element_actual).innerHTML, + expected: this._reorderAttributes(element_expected).innerHTML, }; } @@ -137,7 +137,7 @@ class MarkdownComparer { if (comparison_results.are_equivalent === false) { throw new assert.AssertionError({ - message : message + this._output_formatter( + message: message + this._output_formatter( comparison_results.html.actual, comparison_results.html.expected ), @@ -153,7 +153,7 @@ class MarkdownComparer { if (comparison_results.are_equivalent) { throw new assert.AssertionError({ - message : message + [ + message: message + [ "actual and expected output produce semantially identical HTML", actual, "==", diff --git a/frontend_tests/zjsunit/mdiff.js b/frontend_tests/zjsunit/mdiff.js index e392620d2b..60f9b63094 100644 --- a/frontend_tests/zjsunit/mdiff.js +++ b/frontend_tests/zjsunit/mdiff.js @@ -20,9 +20,9 @@ function apply_color(input_string, changes) { input_string = input_string.slice(2); const formatter = { - delete : (string) => { return "\u001b[31m" + string + "\u001b[0m"; }, - insert : (string) => { return "\u001b[32m" + string + "\u001b[0m"; }, - replace : (string) => { return "\u001b[33m" + string + "\u001b[0m"; }, + delete: (string) => { return "\u001b[31m" + string + "\u001b[0m"; }, + insert: (string) => { return "\u001b[32m" + string + "\u001b[0m"; }, + replace: (string) => { return "\u001b[33m" + string + "\u001b[0m"; }, }; changes.forEach((change) => { if (formatter.hasOwnProperty(change.tag)) { @@ -57,16 +57,16 @@ function parse_questionmark_line(questionmark_line) { const changes_list = []; const aliases = { - "^" : "replace", - "+" : "insert", - "-" : "delete", + "^": "replace", + "+": "insert", + "-": "delete", }; const add_change = () => { if (current_sequence) { changes_list.push({ - tag : aliases[current_sequence], + tag: aliases[current_sequence], beginning_index, - ending_index : index, + ending_index: index, }); current_sequence = ""; } diff --git a/static/js/admin.js b/static/js/admin.js index f0bfc0a96d..0804e2a081 100644 --- a/static/js/admin.js +++ b/static/js/admin.js @@ -14,7 +14,7 @@ var admin_settings_label = { // Organization permissions realm_name_changes_disabled: i18n.t("Prevent users from changing their name"), - realm_email_changes_disabled : i18n.t("Prevent users from changing their email address"), + realm_email_changes_disabled: i18n.t("Prevent users from changing their email address"), }; exports.build_page = function () { diff --git a/static/js/billing/billing.js b/static/js/billing/billing.js index 595e12cb59..97f6cc8720 100644 --- a/static/js/billing/billing.js +++ b/static/js/billing/billing.js @@ -98,9 +98,9 @@ $(function () { stripe_token: JSON.stringify(stripe_token.id), csrfmiddlewaretoken: $("#autopay-form input[name='csrf']").val(), signed_seat_count: get_form_input("signed_seat_count"), - salt: get_form_input("salt"), - plan: get_form_input("plan"), - billing_modality: get_form_input("billing_modality"), + salt: get_form_input("salt"), + plan: get_form_input("plan"), + billing_modality: get_form_input("billing_modality"), }, success: function () { $("#autopay-loading").hide(); @@ -156,8 +156,8 @@ $(function () { signed_seat_count: get_form_input("signed_seat_count"), salt: get_form_input("salt"), plan: get_form_input("plan"), - billing_modality: get_form_input("billing_modality"), - invoiced_seat_count: get_form_input("invoiced_seat_count", false), + billing_modality: get_form_input("billing_modality"), + invoiced_seat_count: get_form_input("invoiced_seat_count", false), }, success: function () { $("#invoice-loading").hide(); diff --git a/static/js/buddy_data.js b/static/js/buddy_data.js index 100ab8df3c..8e0e1e75b4 100644 --- a/static/js/buddy_data.js +++ b/static/js/buddy_data.js @@ -15,7 +15,7 @@ exports.max_size_before_shrinking = 600; var presence_descriptions = { active: 'is active', - idle: 'is not active', + idle: 'is not active', }; var fade_config = { diff --git a/static/js/click_handlers.js b/static/js/click_handlers.js index b01ffe7a43..6262e19ba4 100644 --- a/static/js/click_handlers.js +++ b/static/js/click_handlers.js @@ -562,8 +562,8 @@ exports.initialize = function () { } channel.post({ - url: "/accounts/webathena_kerberos_login/", - data: {cred: JSON.stringify(r.session)}, + url: "/accounts/webathena_kerberos_login/", + data: {cred: JSON.stringify(r.session)}, success: function () { $("#zephyr-mirror-error").removeClass("show"); }, diff --git a/static/js/compose_actions.js b/static/js/compose_actions.js index e76e3f70bd..0cec1dbc55 100644 --- a/static/js/compose_actions.js +++ b/static/js/compose_actions.js @@ -170,11 +170,11 @@ exports.maybe_scroll_up_selected_message = function () { function fill_in_opts_from_current_narrowed_view(msg_type, opts) { var default_opts = { - message_type: msg_type, - stream: '', - topic: '', + message_type: msg_type, + stream: '', + topic: '', private_message_recipient: '', - trigger: 'unknown', + trigger: 'unknown', }; // Set default parameters based on the current narrowed view. diff --git a/static/js/emoji_picker.js b/static/js/emoji_picker.js index 5d913ec119..9178a42a54 100644 --- a/static/js/emoji_picker.js +++ b/static/js/emoji_picker.js @@ -583,10 +583,10 @@ exports.render_emoji_popover = function (elt, id) { elt.popover({ // temporary patch for handling popover placement of `viewport_center` placement: placement === 'viewport_center' ? 'left' : placement, - template: template, - title: "", - content: generate_emoji_picker_content(id), - trigger: "manual", + template: template, + title: "", + content: generate_emoji_picker_content(id), + trigger: "manual", }); elt.popover("show"); elt.prop("title", i18n.t("Add emoji reaction (:)")); diff --git a/static/js/hashchange.js b/static/js/hashchange.js index 03c9485786..8bfa5a965a 100644 --- a/static/js/hashchange.js +++ b/static/js/hashchange.js @@ -93,7 +93,7 @@ function do_hashchange_normal(from_reload) { return false; } var narrow_opts = { - change_hash: false, // already set + change_hash: false, // already set trigger: 'hash change', }; if (from_reload) { diff --git a/static/js/info_overlay.js b/static/js/info_overlay.js index 0e5a35dfbb..e3876e76d1 100644 --- a/static/js/info_overlay.js +++ b/static/js/info_overlay.js @@ -79,7 +79,7 @@ exports.show = function (target) { if (!overlay.hasClass("show")) { overlays.open_overlay({ - name: 'informationalOverlays', + name: 'informationalOverlays', overlay: overlay, on_close: function () { hashchange.changehash(""); diff --git a/static/js/message_events.js b/static/js/message_events.js index c6332554b8..94b9f64bfc 100644 --- a/static/js/message_events.js +++ b/static/js/message_events.js @@ -9,10 +9,10 @@ function maybe_add_narrowed_messages(messages, msg_list, messages_are_new) { }); channel.get({ - url: '/json/messages/matches_narrow', - data: {msg_ids: JSON.stringify(ids), - narrow: JSON.stringify(narrow_state.public_operators())}, - timeout: 5000, + url: '/json/messages/matches_narrow', + data: {msg_ids: JSON.stringify(ids), + narrow: JSON.stringify(narrow_state.public_operators())}, + timeout: 5000, success: function (data) { if (msg_list !== current_msg_list) { // We unnarrowed in the mean time diff --git a/static/js/message_fetch.js b/static/js/message_fetch.js index 7240992d3d..2df8a5be2a 100644 --- a/static/js/message_fetch.js +++ b/static/js/message_fetch.js @@ -141,8 +141,8 @@ exports.load_messages = function (opts) { data.client_gravatar = true; channel.get({ - url: '/json/messages', - data: data, + url: '/json/messages', + data: data, idempotent: true, success: function (data) { get_messages_success(data, opts); diff --git a/static/js/message_flags.js b/static/js/message_flags.js index 81d5e71f1a..6810e4edce 100644 --- a/static/js/message_flags.js +++ b/static/js/message_flags.js @@ -36,12 +36,12 @@ exports.send_read = (function () { // call finishes, they will be handled in the success callback. channel.post({ - url: '/json/messages/flags', + url: '/json/messages/flags', idempotent: true, - data: {messages: JSON.stringify(real_msg_ids), - op: 'add', - flag: 'read'}, - success: on_success, + data: {messages: JSON.stringify(real_msg_ids), + op: 'add', + flag: 'read'}, + success: on_success, }); } diff --git a/static/js/pointer.js b/static/js/pointer.js index f57e022ef4..050a281172 100644 --- a/static/js/pointer.js +++ b/static/js/pointer.js @@ -19,9 +19,9 @@ function update_pointer() { if (!pointer_update_in_flight) { pointer_update_in_flight = true; return channel.post({ - url: '/json/users/me/pointer', + url: '/json/users/me/pointer', idempotent: true, - data: {pointer: pointer.furthest_read}, + data: {pointer: pointer.furthest_read}, success: function () { pointer.server_furthest_read = pointer.furthest_read; pointer_update_in_flight = false; diff --git a/static/js/popovers.js b/static/js/popovers.js index f1327262ef..df9e649515 100644 --- a/static/js/popovers.js +++ b/static/js/popovers.js @@ -422,9 +422,9 @@ exports.toggle_actions_popover = function (element, id) { elt.popover({ // Popover height with 7 items in it is ~190 px placement: message_viewport.height() - ypos < 220 ? 'top' : 'bottom', - title: "", - content: templates.render('actions_popover_content', args), - trigger: "manual", + title: "", + content: templates.render('actions_popover_content', args), + trigger: "manual", }); elt.popover("show"); current_actions_popover_elem = elt; @@ -445,9 +445,9 @@ exports.render_actions_remind_popover = function (element, id) { elt.popover({ // Popover height with 7 items in it is ~190 px placement: message_viewport.height() - ypos < 220 ? 'top' : 'bottom', - title: "", - content: templates.render('remind_me_popover_content', args), - trigger: "manual", + title: "", + content: templates.render('remind_me_popover_content', args), + trigger: "manual", }); elt.popover("show"); current_flatpickr_instance = $('.remind.custom[data-message-id="' + message.id + '"]').flatpickr({ diff --git a/static/js/portico/integrations.js b/static/js/portico/integrations.js index 3a2b604354..de01676c5f 100644 --- a/static/js/portico/integrations.js +++ b/static/js/portico/integrations.js @@ -370,7 +370,7 @@ function integration_events() { $(".integrations .searchbar input[type='text']") .focus() .on('input', function (e) { - dispatch('UPDATE_QUERY', { query : e.target.value.toLowerCase() }); + dispatch('UPDATE_QUERY', { query: e.target.value.toLowerCase() }); }); $(window).scroll(function () { diff --git a/static/js/portico/signup.js b/static/js/portico/signup.js index 46cae6c403..12a5486e0a 100644 --- a/static/js/portico/signup.js +++ b/static/js/portico/signup.js @@ -31,7 +31,7 @@ $(function () { $('#registration, #password_reset').validate({ rules: { - password: 'password_strength', + password: 'password_strength', new_password1: 'password_strength', }, errorElement: "p", @@ -45,7 +45,7 @@ $(function () { error.insertAfter(element).addClass('help-inline alert alert-error'); } }, - highlight: highlight('error'), + highlight: highlight('error'), unhighlight: highlight('success'), }); diff --git a/static/js/server_events.js b/static/js/server_events.js index 13d7905740..d8ade3d8c4 100644 --- a/static/js/server_events.js +++ b/static/js/server_events.js @@ -185,10 +185,10 @@ function get_events(options) { get_events_timeout = undefined; get_events_xhr = channel.get({ - url: '/json/events', - data: get_events_params, + url: '/json/events', + data: get_events_params, idempotent: true, - timeout: page_params.poll_timeout, + timeout: page_params.poll_timeout, success: function (data) { exports.suspect_offline = false; try { @@ -303,8 +303,8 @@ exports.cleanup_event_queue = function cleanup_event_queue() { // Set expired because in a reload we may be called twice. page_params.event_queue_expired = true; channel.del({ - url: '/json/events', - data: {queue_id: page_params.queue_id}, + url: '/json/events', + data: {queue_id: page_params.queue_id}, }); }; diff --git a/static/js/settings_invites.js b/static/js/settings_invites.js index fba0b150e7..f54fb8a025 100644 --- a/static/js/settings_invites.js +++ b/static/js/settings_invites.js @@ -57,7 +57,7 @@ exports.set_up = function () { channel.get({ url: '/json/invites', idempotent: true, - timeout: 10 * 1000, + timeout: 10 * 1000, success: exports.on_load_success, error: failed_listing_invites, }); diff --git a/static/js/settings_notifications.js b/static/js/settings_notifications.js index a5a6b43e64..18e74833bb 100644 --- a/static/js/settings_notifications.js +++ b/static/js/settings_notifications.js @@ -3,10 +3,10 @@ var settings_notifications = (function () { var exports = {}; var stream_notification_settings = [ - {setting: "enable_stream_desktop_notifications", notifications:"desktop_notifications"}, - {setting: "enable_stream_push_notifications", notifications:"push_notifications"}, - {setting: "enable_stream_sounds", notifications:"audible_notifications"}, - {setting: "enable_stream_email_notifications", notifications:"email_notifications"}, + {setting: "enable_stream_desktop_notifications", notifications: "desktop_notifications"}, + {setting: "enable_stream_push_notifications", notifications: "push_notifications"}, + {setting: "enable_stream_sounds", notifications: "audible_notifications"}, + {setting: "enable_stream_email_notifications", notifications: "email_notifications"}, ]; var pm_mention_notification_settings = [ diff --git a/static/js/settings_org.js b/static/js/settings_org.js index 62dc689a02..af3b439108 100644 --- a/static/js/settings_org.js +++ b/static/js/settings_org.js @@ -1084,7 +1084,7 @@ exports.build_page = function () { overlays.close_modal('deactivate-realm-modal'); } channel.post({ - url:'/json/realm/deactivate', + url: '/json/realm/deactivate', error: function (xhr) { ui_report.error( i18n.t("Failed"), xhr, $('#admin-realm-deactivation-status').expectOne() diff --git a/static/js/settings_users.js b/static/js/settings_users.js index 411853a4f3..3954691ed2 100644 --- a/static/js/settings_users.js +++ b/static/js/settings_users.js @@ -206,9 +206,9 @@ exports.set_up = function () { // Populate users and bots tables channel.get({ - url: '/json/users', + url: '/json/users', idempotent: true, - timeout: 10 * 1000, + timeout: 10 * 1000, success: exports.on_load_success, error: failed_listing_users, }); diff --git a/static/js/socket.js b/static/js/socket.js index f504b7fc1b..24819b66b9 100644 --- a/static/js/socket.js +++ b/static/js/socket.js @@ -1,12 +1,12 @@ var Socket = (function () { var CLOSE_REASONS = { - none_given: {code: 4000, msg: "No reason provided"}, + none_given: {code: 4000, msg: "No reason provided"}, no_heartbeat: {code: 4001, msg: "Missed too many heartbeats"}, - auth_fail: {code: 4002, msg: "Authentication failed"}, - ack_timeout: {code: 4003, msg: "ACK timeout"}, - cant_send: {code: 4004, msg: "User attempted to send while Socket was not ready"}, - unsuspend: {code: 4005, msg: "Got unsuspend event"}, + auth_fail: {code: 4002, msg: "Authentication failed"}, + ack_timeout: {code: 4003, msg: "ACK timeout"}, + cant_send: {code: 4004, msg: "User attempted to send while Socket was not ready"}, + unsuspend: {code: 4005, msg: "Got unsuspend event"}, }; function Socket(url) { diff --git a/static/js/topic_data.js b/static/js/topic_data.js index d9e726f683..39984786c9 100644 --- a/static/js/topic_data.js +++ b/static/js/topic_data.js @@ -179,7 +179,7 @@ exports.get_server_history = function (stream_id, on_success) { channel.get({ url: url, data: {}, - success: function (data) { + success: function (data) { var server_history = data.topics; exports.add_history(stream_id, server_history); on_success(); diff --git a/static/js/tutorial.js b/static/js/tutorial.js index 3e1ae083ea..714c748d21 100644 --- a/static/js/tutorial.js +++ b/static/js/tutorial.js @@ -4,9 +4,9 @@ var exports = {}; function set_tutorial_status(status, callback) { return channel.post({ - url: '/json/users/me/tutorial_status', - data: {status: JSON.stringify(status)}, - success: callback, + url: '/json/users/me/tutorial_status', + data: {status: JSON.stringify(status)}, + success: callback, }); } diff --git a/static/js/unread_ops.js b/static/js/unread_ops.js index 2a4ef159b6..18f56ab755 100644 --- a/static/js/unread_ops.js +++ b/static/js/unread_ops.js @@ -7,9 +7,9 @@ exports.mark_all_as_read = function (cont) { unread_ui.update_unread_counts(); channel.post({ - url: '/json/mark_all_as_read', + url: '/json/mark_all_as_read', idempotent: true, - success: cont}); + success: cont}); }; function process_newly_read_message(message, options) {