mirror of https://github.com/zulip/zulip.git
eslint: Add key-spacing linter rule.
Apparently, we didn't have one of these, and thus had a moderate number of generally very old violations in the codebase. Fix this and clear the ones that exist..
This commit is contained in:
parent
392175d6e8
commit
bdb3da4504
|
@ -245,6 +245,12 @@
|
|||
"FunctionExpression": {"parameters": "first"},
|
||||
"FunctionDeclaration": {"parameters": "first"}
|
||||
}],
|
||||
"key-spacing": [ "error",
|
||||
{
|
||||
"beforeColon": false,
|
||||
"afterColon": true
|
||||
}
|
||||
],
|
||||
"keyword-spacing": [ "error",
|
||||
{
|
||||
"before": true,
|
||||
|
|
|
@ -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});
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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' },
|
||||
]);
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -19,7 +19,7 @@ casper.then(function () {
|
|||
});
|
||||
|
||||
common.then_send_message('stream', {
|
||||
stream: 'Verona',
|
||||
stream: 'Verona',
|
||||
subject: 'stars',
|
||||
content: 'test star',
|
||||
});
|
||||
|
|
|
@ -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',
|
||||
});
|
||||
|
|
|
@ -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',
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
|
|
|
@ -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' },
|
||||
]);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -324,7 +324,7 @@ run_test('marked', () => {
|
|||
{input: 'T\n@**Cordelia Lear**',
|
||||
expected: '<p>T<br>\n<span class="user-mention" data-user-id="101">@Cordelia Lear</span></p>'},
|
||||
{input: '@**Mark Twin|104** and @**Mark Twin|105** are out to confuse you.',
|
||||
expected:'<p><span class="user-mention" data-user-id="104">@Mark Twin</span> and <span class="user-mention" data-user-id="105">@Mark Twin</span> are out to confuse you.</p>'},
|
||||
expected: '<p><span class="user-mention" data-user-id="104">@Mark Twin</span> and <span class="user-mention" data-user-id="105">@Mark Twin</span> are out to confuse you.</p>'},
|
||||
{input: '@**Invalid User|1234**',
|
||||
expected: '<p>@**Invalid User|1234**</p>'},
|
||||
{input: '@**Cordelia Lear|103** has a wrong user_id.',
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -446,7 +446,7 @@ run_test('mentions', () => {
|
|||
stream_id: 999,
|
||||
subject: 'lunch',
|
||||
mentioned: true,
|
||||
unread:true,
|
||||
unread: true,
|
||||
};
|
||||
|
||||
unread.process_loaded_messages([message]);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
"==",
|
||||
|
|
|
@ -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 = "";
|
||||
}
|
||||
|
|
|
@ -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 () {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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");
|
||||
},
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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 (:)"));
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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("");
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -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 () {
|
||||
|
|
|
@ -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'),
|
||||
});
|
||||
|
||||
|
|
|
@ -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},
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue