mirror of https://github.com/zulip/zulip.git
eslint: Enable comma-dangle for functions.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
a79322bc94
commit
e014ea966a
|
@ -22,15 +22,7 @@
|
|||
"arrow-spacing": [ "error", { "before": true, "after": true } ],
|
||||
"block-scoped-var": "error",
|
||||
"brace-style": [ "error", "1tbs", { "allowSingleLine": true } ],
|
||||
"comma-dangle": [ "error",
|
||||
{
|
||||
"arrays": "always-multiline",
|
||||
"objects": "always-multiline",
|
||||
"imports": "always-multiline",
|
||||
"exports": "always-multiline",
|
||||
"functions": "never"
|
||||
}
|
||||
],
|
||||
"comma-dangle": [ "error", "always-multiline" ],
|
||||
"comma-spacing": [ "error",
|
||||
{
|
||||
"before": false,
|
||||
|
@ -368,6 +360,16 @@
|
|||
],
|
||||
"rules": {
|
||||
// Don’t require ES features that PhantomJS doesn’t support
|
||||
"comma-dangle": [
|
||||
"error",
|
||||
{
|
||||
"arrays": "always-multiline",
|
||||
"objects": "always-multiline",
|
||||
"imports": "always-multiline",
|
||||
"exports": "always-multiline",
|
||||
"functions": "never"
|
||||
}
|
||||
],
|
||||
"no-var": "off",
|
||||
"prefer-arrow-callback": "off"
|
||||
}
|
||||
|
|
|
@ -4,23 +4,23 @@ run_test("clean_path", () => {
|
|||
// Local file
|
||||
assert.strictEqual(
|
||||
blueslip_stacktrace.clean_path("webpack:///static/js/upload.js"),
|
||||
"/static/js/upload.js"
|
||||
"/static/js/upload.js",
|
||||
);
|
||||
|
||||
// Third party library (jQuery)
|
||||
assert.strictEqual(
|
||||
blueslip_stacktrace.clean_path(
|
||||
"webpack:///.-npm-cache/de76fb6f582a29b053274f9048b6158091351048/node_modules/jquery/dist/jquery.js"
|
||||
"webpack:///.-npm-cache/de76fb6f582a29b053274f9048b6158091351048/node_modules/jquery/dist/jquery.js",
|
||||
),
|
||||
"jquery/dist/jquery.js"
|
||||
"jquery/dist/jquery.js",
|
||||
);
|
||||
|
||||
// Third party library (underscore)
|
||||
assert.strictEqual(
|
||||
blueslip_stacktrace.clean_path(
|
||||
"webpack:///.-npm-cache/de76fb6f582a29b053274f9048b…58091351048/node_modules/underscore/underscore.js"
|
||||
"webpack:///.-npm-cache/de76fb6f582a29b053274f9048b…58091351048/node_modules/underscore/underscore.js",
|
||||
),
|
||||
"underscore/underscore.js"
|
||||
"underscore/underscore.js",
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -33,7 +33,7 @@ run_test("clean_function_name", () => {
|
|||
{
|
||||
scope: "Object../static/js/upload.js.exports.",
|
||||
name: "options",
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// Third party library (jQuery)
|
||||
|
@ -45,12 +45,12 @@ run_test("clean_function_name", () => {
|
|||
// Third party library (underscore)
|
||||
assert.deepEqual(
|
||||
blueslip_stacktrace.clean_function_name(
|
||||
"Function.../zulip-npm-cache/de76fb6f582a29b053274f…es/underscore/underscore.js?3817._.each._.forEach"
|
||||
"Function.../zulip-npm-cache/de76fb6f582a29b053274f…es/underscore/underscore.js?3817._.each._.forEach",
|
||||
),
|
||||
{
|
||||
scope:
|
||||
"Function.../zulip-npm-cache/de76fb6f582a29b053274f…es/underscore/underscore.js?3817._.each._.",
|
||||
name: "forEach",
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
@ -1233,7 +1233,7 @@ run_test('on_events', () => {
|
|||
const helper = setup_parents_and_mock_remove(
|
||||
'compose-all-everyone',
|
||||
'compose-all-everyone',
|
||||
'.compose-all-everyone'
|
||||
'.compose-all-everyone',
|
||||
);
|
||||
|
||||
$("#compose-all-everyone").show();
|
||||
|
@ -1277,7 +1277,7 @@ run_test('on_events', () => {
|
|||
const helper = setup_parents_and_mock_remove(
|
||||
'compose_invite_users',
|
||||
'compose_invite_link',
|
||||
'.compose_invite_user'
|
||||
'.compose_invite_user',
|
||||
);
|
||||
|
||||
// !sub will result false here and we check the failure code path.
|
||||
|
@ -1322,7 +1322,7 @@ run_test('on_events', () => {
|
|||
const helper = setup_parents_and_mock_remove(
|
||||
'compose_invite_users_close',
|
||||
'compose_invite_close',
|
||||
'.compose_invite_user'
|
||||
'.compose_invite_user',
|
||||
);
|
||||
|
||||
let all_invite_children_called = false;
|
||||
|
@ -1355,7 +1355,7 @@ run_test('on_events', () => {
|
|||
const helper = setup_parents_and_mock_remove(
|
||||
'compose-send-status',
|
||||
'sub_unsub_button',
|
||||
'.compose_not_subscribed'
|
||||
'.compose_not_subscribed',
|
||||
);
|
||||
|
||||
handler(helper.event);
|
||||
|
@ -1378,7 +1378,7 @@ run_test('on_events', () => {
|
|||
const helper = setup_parents_and_mock_remove(
|
||||
'compose_user_not_subscribed_close',
|
||||
'compose_not_subscribed_close',
|
||||
'.compose_not_subscribed'
|
||||
'.compose_not_subscribed',
|
||||
);
|
||||
|
||||
$("#compose-send-status").show();
|
||||
|
|
|
@ -287,7 +287,7 @@ run_test('topics_seen_for', () => {
|
|||
|
||||
assert.deepEqual(
|
||||
ct.topics_seen_for('Denmark'),
|
||||
['With Twisted Metal', 'acceptance', 'civil fears']
|
||||
['With Twisted Metal', 'acceptance', 'civil fears'],
|
||||
);
|
||||
|
||||
// Test when the stream doesn't exist (there are no topics)
|
||||
|
@ -711,7 +711,7 @@ run_test('initialize', () => {
|
|||
people,
|
||||
query,
|
||||
compose_state.stream_name(),
|
||||
compose_state.topic()
|
||||
compose_state.topic(),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -819,7 +819,7 @@ run_test('initialize', () => {
|
|||
let actual_value = options.source.call(fake_this, 'test #s');
|
||||
assert.deepEqual(
|
||||
sorted_names_from(actual_value),
|
||||
['Denmark', 'Sweden', 'The Netherlands']
|
||||
['Denmark', 'Sweden', 'The Netherlands'],
|
||||
);
|
||||
assert(caret_called);
|
||||
|
||||
|
@ -1133,7 +1133,7 @@ run_test('begins_typeahead', () => {
|
|||
return [input, rest];
|
||||
};
|
||||
const values = ct.get_candidates.call(
|
||||
begin_typehead_this, input
|
||||
begin_typehead_this, input,
|
||||
);
|
||||
return values;
|
||||
}
|
||||
|
@ -1158,7 +1158,7 @@ run_test('begins_typeahead', () => {
|
|||
const values = get_values(input, rest);
|
||||
assert.deepEqual(
|
||||
sorted_names_from(values),
|
||||
['Denmark', 'Sweden', 'The Netherlands']
|
||||
['Denmark', 'Sweden', 'The Netherlands'],
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ with_overrides((override) => {
|
|||
|
||||
assert.deepEqual(
|
||||
alert_words.get_word_list(),
|
||||
['fire', 'lunch']
|
||||
['fire', 'lunch'],
|
||||
);
|
||||
assert(alert_words.has_alert_word('fire'));
|
||||
assert(alert_words.has_alert_word('lunch'));
|
||||
|
|
|
@ -93,7 +93,7 @@ const short_msg = {
|
|||
run_test('legacy', () => {
|
||||
assert.deepEqual(
|
||||
drafts.restore_message(legacy_draft),
|
||||
compose_args_for_legacy_draft
|
||||
compose_args_for_legacy_draft,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ run_test('build_emoji_upload_widget', () => {
|
|||
file_name_field,
|
||||
input_error,
|
||||
clear_button,
|
||||
upload_button
|
||||
upload_button,
|
||||
) {
|
||||
assert.deepEqual(get_file_input(), $('#emoji_file_input'));
|
||||
assert.deepEqual(file_name_field, $('#emoji-file-name'));
|
||||
|
|
|
@ -1276,26 +1276,26 @@ run_test('term_type', () => {
|
|||
|
||||
assert_term_sort(
|
||||
['topic', 'stream', 'sender'],
|
||||
['stream', 'topic', 'sender']
|
||||
['stream', 'topic', 'sender'],
|
||||
);
|
||||
|
||||
assert_term_sort(
|
||||
['has-link', 'near', 'is-unread', 'pm-with'],
|
||||
['pm-with', 'near', 'is-unread', 'has-link']
|
||||
['pm-with', 'near', 'is-unread', 'has-link'],
|
||||
);
|
||||
|
||||
assert_term_sort(
|
||||
['bogus', 'stream', 'topic'],
|
||||
['stream', 'topic', 'bogus']
|
||||
['stream', 'topic', 'bogus'],
|
||||
);
|
||||
assert_term_sort(
|
||||
['stream', 'topic', 'stream'],
|
||||
['stream', 'stream', 'topic']
|
||||
['stream', 'stream', 'topic'],
|
||||
);
|
||||
|
||||
assert_term_sort(
|
||||
['search', 'streams-public'],
|
||||
['streams-public', 'search']
|
||||
['streams-public', 'search'],
|
||||
);
|
||||
|
||||
const terms = [
|
||||
|
@ -1398,7 +1398,7 @@ run_test('navbar_helpers', () => {
|
|||
const filter = new Filter(test_case.operator);
|
||||
assert.equal(
|
||||
filter.generate_redirect_url(),
|
||||
test_case.redirect_url_with_search
|
||||
test_case.redirect_url_with_search,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1600,7 +1600,7 @@ run_test('navbar_helpers', () => {
|
|||
let filter = new Filter(complex_operators_test_case.operator);
|
||||
assert.equal(
|
||||
filter.generate_redirect_url(),
|
||||
complex_operators_test_case.redirect_url
|
||||
complex_operators_test_case.redirect_url,
|
||||
);
|
||||
assert.equal(filter.is_common_narrow(), false);
|
||||
|
||||
|
@ -1627,7 +1627,7 @@ run_test('navbar_helpers', () => {
|
|||
filter = new Filter(default_redirect.operator);
|
||||
assert.equal(
|
||||
filter.generate_redirect_url(),
|
||||
default_redirect.redirect_url
|
||||
default_redirect.redirect_url,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -65,68 +65,68 @@ run_test('hash_util', () => {
|
|||
run_test('test_get_hash_category', () => {
|
||||
assert.deepEqual(
|
||||
hash_util.get_hash_category('streams/subscribed'),
|
||||
'streams'
|
||||
'streams',
|
||||
);
|
||||
assert.deepEqual(
|
||||
hash_util.get_hash_category('#settings/display-settings'),
|
||||
'settings'
|
||||
'settings',
|
||||
);
|
||||
assert.deepEqual(
|
||||
hash_util.get_hash_category('#drafts'),
|
||||
'drafts'
|
||||
'drafts',
|
||||
);
|
||||
assert.deepEqual(
|
||||
hash_util.get_hash_category('invites'),
|
||||
'invites'
|
||||
'invites',
|
||||
);
|
||||
});
|
||||
|
||||
run_test('test_get_hash_section', () => {
|
||||
assert.equal(
|
||||
hash_util.get_hash_section('streams/subscribed'),
|
||||
'subscribed'
|
||||
'subscribed',
|
||||
);
|
||||
assert.equal(
|
||||
hash_util.get_hash_section('#settings/your-account'),
|
||||
'your-account'
|
||||
'your-account',
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
hash_util.get_hash_section('settings/10/general/'),
|
||||
'10'
|
||||
'10',
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
hash_util.get_hash_section('#drafts'),
|
||||
''
|
||||
'',
|
||||
);
|
||||
assert.equal(
|
||||
hash_util.get_hash_section(''),
|
||||
''
|
||||
'',
|
||||
);
|
||||
});
|
||||
|
||||
run_test('test_parse_narrow', () => {
|
||||
assert.deepEqual(
|
||||
hash_util.parse_narrow(['narrow', 'stream', '99-frontend']),
|
||||
[{negated: false, operator: 'stream', operand: 'frontend'}]
|
||||
[{negated: false, operator: 'stream', operand: 'frontend'}],
|
||||
);
|
||||
|
||||
assert.deepEqual(
|
||||
hash_util.parse_narrow(['narrow', '-stream', '99-frontend']),
|
||||
[{negated: true, operator: 'stream', operand: 'frontend'}]
|
||||
[{negated: true, operator: 'stream', operand: 'frontend'}],
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
hash_util.parse_narrow(['narrow', 'BOGUS']),
|
||||
undefined
|
||||
undefined,
|
||||
);
|
||||
|
||||
// For nonexistent streams, we get the full slug.
|
||||
// We possibly should remove the prefix and fix this test.
|
||||
assert.deepEqual(
|
||||
hash_util.parse_narrow(['narrow', 'stream', '42-bogus']),
|
||||
[{negated: false, operator: 'stream', operand: '42-bogus'}]
|
||||
[{negated: false, operator: 'stream', operand: '42-bogus'}],
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -164,7 +164,7 @@ run_test('scrolling', () => {
|
|||
|
||||
assert.deepEqual(
|
||||
container.appended_data.html(),
|
||||
items.slice(0, 80).join('')
|
||||
items.slice(0, 80).join(''),
|
||||
);
|
||||
|
||||
// Set up our fake geometry so it forces a scroll action.
|
||||
|
@ -177,7 +177,7 @@ run_test('scrolling', () => {
|
|||
scroll_container.call_scroll();
|
||||
assert.deepEqual(
|
||||
container.appended_data.html(),
|
||||
items.slice(80, 100).join('')
|
||||
items.slice(80, 100).join(''),
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -339,7 +339,7 @@ run_test('wire up filter element', () => {
|
|||
filter_element.f.apply({value: 'se'});
|
||||
assert.equal(
|
||||
container.appended_data.html(),
|
||||
'(JESSE)(moses)(Sean)'
|
||||
'(JESSE)(moses)(Sean)',
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -505,7 +505,7 @@ run_test('custom sort', () => {
|
|||
|
||||
assert.deepEqual(
|
||||
container.appended_data.html(),
|
||||
'(6, 7)(1, 43)(4, 11)'
|
||||
'(6, 7)(1, 43)(4, 11)',
|
||||
);
|
||||
|
||||
const widget = list_render.get('custom-sort-list');
|
||||
|
@ -513,7 +513,7 @@ run_test('custom sort', () => {
|
|||
widget.sort('x_value');
|
||||
assert.deepEqual(
|
||||
container.appended_data.html(),
|
||||
'(1, 43)(4, 11)(6, 7)'
|
||||
'(1, 43)(4, 11)(6, 7)',
|
||||
);
|
||||
|
||||
// We can sort without registering the function, too.
|
||||
|
@ -524,7 +524,7 @@ run_test('custom sort', () => {
|
|||
widget.sort(sort_by_y);
|
||||
assert.deepEqual(
|
||||
container.appended_data.html(),
|
||||
'(6, 7)(4, 11)(1, 43)'
|
||||
'(6, 7)(4, 11)(1, 43)',
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -654,7 +654,7 @@ run_test('replace_list_data w/filter update', () => {
|
|||
|
||||
assert.deepEqual(
|
||||
container.appended_data.html(),
|
||||
'(2)(4)'
|
||||
'(2)(4)',
|
||||
);
|
||||
|
||||
const widget = list_render.get('replace-list');
|
||||
|
@ -664,7 +664,7 @@ run_test('replace_list_data w/filter update', () => {
|
|||
|
||||
assert.deepEqual(
|
||||
container.appended_data.html(),
|
||||
'(6)(8)'
|
||||
'(6)(8)',
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -684,9 +684,9 @@ run_test('opts.get_item', () => {
|
|||
|
||||
assert.deepEqual(
|
||||
list_render.get_filtered_items(
|
||||
'whatever', list, boring_opts
|
||||
'whatever', list, boring_opts,
|
||||
),
|
||||
['one', 'two', 'three', 'four']
|
||||
['one', 'two', 'three', 'four'],
|
||||
);
|
||||
|
||||
const predicate = (item, value) => item.startsWith(value);
|
||||
|
@ -700,9 +700,9 @@ run_test('opts.get_item', () => {
|
|||
|
||||
assert.deepEqual(
|
||||
list_render.get_filtered_items(
|
||||
't', list, predicate_opts
|
||||
't', list, predicate_opts,
|
||||
),
|
||||
['two', 'three']
|
||||
['two', 'three'],
|
||||
);
|
||||
|
||||
const filterer_opts = {
|
||||
|
@ -714,9 +714,9 @@ run_test('opts.get_item', () => {
|
|||
|
||||
assert.deepEqual(
|
||||
list_render.get_filtered_items(
|
||||
't', list, filterer_opts
|
||||
't', list, filterer_opts,
|
||||
),
|
||||
['two', 'three']
|
||||
['two', 'three'],
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ run_test('fenced_block_defaults', () => {
|
|||
|
||||
markdown.initialize(
|
||||
page_params.realm_filters,
|
||||
markdown_config.get_helpers()
|
||||
markdown_config.get_helpers(),
|
||||
);
|
||||
|
||||
const markdown_data = global.read_fixture_data('markdown_test_cases.json');
|
||||
|
|
|
@ -77,7 +77,7 @@ run_test('update_messages', () => {
|
|||
|
||||
assert.deepEqual(
|
||||
stream_topic_history.get_recent_topic_names(denmark.stream_id),
|
||||
['lunch']
|
||||
['lunch'],
|
||||
);
|
||||
|
||||
unread.update_message_for_mention(original_message);
|
||||
|
|
|
@ -327,7 +327,7 @@ run_test('loading_newer', () => {
|
|||
{
|
||||
name: "Error",
|
||||
message: "There are no message available to frontfill.",
|
||||
}
|
||||
},
|
||||
);
|
||||
} else {
|
||||
message_fetch.maybe_load_newer_messages({
|
||||
|
|
|
@ -156,12 +156,12 @@ run_test('more muting', () => {
|
|||
|
||||
assert.deepEqual(
|
||||
mld._all_items.map((message) => message.id),
|
||||
[3, 4, 7, 8]
|
||||
[3, 4, 7, 8],
|
||||
);
|
||||
|
||||
assert.deepEqual(
|
||||
mld.all_messages().map((message) => message.id),
|
||||
[4, 8]
|
||||
[4, 8],
|
||||
);
|
||||
|
||||
const more_messages = [
|
||||
|
@ -178,12 +178,12 @@ run_test('more muting', () => {
|
|||
|
||||
assert.deepEqual(
|
||||
mld._all_items.map((message) => message.id),
|
||||
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
||||
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
|
||||
);
|
||||
|
||||
assert.deepEqual(
|
||||
mld.all_messages().map((message) => message.id),
|
||||
[2, 4, 6, 8, 10]
|
||||
[2, 4, 6, 8, 10],
|
||||
);
|
||||
|
||||
assert.deepEqual(more_info, {
|
||||
|
|
|
@ -74,7 +74,7 @@ run_test('show_empty_narrow_message', () => {
|
|||
assert($('#empty_narrow_message').visible());
|
||||
assert.equal(
|
||||
$('#left_bar_compose_reply_button_big').attr('title'),
|
||||
'translated: There are no messages to reply to.'
|
||||
'translated: There are no messages to reply to.',
|
||||
);
|
||||
|
||||
// for non-existent or private stream
|
||||
|
|
|
@ -234,7 +234,7 @@ run_test('basics', () => {
|
|||
|
||||
assert.equal(
|
||||
people.get_actual_name_from_user_id(32),
|
||||
full_name
|
||||
full_name,
|
||||
);
|
||||
|
||||
assert(people.is_valid_full_name_and_user_id(full_name, 32));
|
||||
|
@ -266,7 +266,7 @@ run_test('basics', () => {
|
|||
|
||||
assert.equal(
|
||||
people.get_bot_owner_user(bot_botson).full_name,
|
||||
'Isaac Newton'
|
||||
'Isaac Newton',
|
||||
);
|
||||
|
||||
// Add our cross-realm bot. It won't add to our human
|
||||
|
@ -276,7 +276,7 @@ run_test('basics', () => {
|
|||
assert.equal(people.get_active_human_count(), 1);
|
||||
assert.equal(
|
||||
people.get_by_email(welcome_bot.email).full_name,
|
||||
'Welcome Bot'
|
||||
'Welcome Bot',
|
||||
);
|
||||
|
||||
// get_realm_users() will include our active bot,
|
||||
|
@ -286,7 +286,7 @@ run_test('basics', () => {
|
|||
[
|
||||
me.user_id,
|
||||
bot_botson.user_id,
|
||||
]
|
||||
],
|
||||
);
|
||||
|
||||
// The bot doesn't add to our human count.
|
||||
|
@ -593,14 +593,14 @@ run_test('concat_huddle', () => {
|
|||
|
||||
assert.equal(
|
||||
people.concat_huddle(user_ids, 304),
|
||||
'301,302,303,304'
|
||||
'301,302,303,304',
|
||||
);
|
||||
|
||||
// IMPORTANT: we always want to sort
|
||||
// ids numerically to create huddle strings.
|
||||
assert.equal(
|
||||
people.concat_huddle(user_ids, 99),
|
||||
'99,301,302,303'
|
||||
'99,301,302,303',
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -673,7 +673,7 @@ run_test('message_methods', () => {
|
|||
sender_id: maria.user_id,
|
||||
};
|
||||
assert.equal(people.small_avatar_url(message),
|
||||
'https://secure.gravatar.com/avatar/md5-athens@example.com?d=identicon&s=50'
|
||||
'https://secure.gravatar.com/avatar/md5-athens@example.com?d=identicon&s=50',
|
||||
);
|
||||
|
||||
blueslip.expect('error', 'Unknown user_id in get_by_user_id: 9999999');
|
||||
|
@ -683,14 +683,14 @@ run_test('message_methods', () => {
|
|||
sender_id: 9999999,
|
||||
};
|
||||
assert.equal(people.small_avatar_url(message),
|
||||
'https://secure.gravatar.com/avatar/md5-foo@example.com?d=identicon&s=50'
|
||||
'https://secure.gravatar.com/avatar/md5-foo@example.com?d=identicon&s=50',
|
||||
);
|
||||
|
||||
message = {
|
||||
sender_id: ashton.user_id,
|
||||
};
|
||||
assert.equal(people.small_avatar_url(message),
|
||||
`/avatar/${ashton.user_id}&s=50`
|
||||
`/avatar/${ashton.user_id}&s=50`,
|
||||
);
|
||||
|
||||
message = {
|
||||
|
@ -914,17 +914,17 @@ run_test('update_email_in_reply_to', () => {
|
|||
let reply_to = ' charles@example.com, athens@example.com';
|
||||
assert.equal(
|
||||
people.update_email_in_reply_to(reply_to, 9999, 'whatever'),
|
||||
reply_to
|
||||
reply_to,
|
||||
);
|
||||
assert.equal(
|
||||
people.update_email_in_reply_to(reply_to, maria.user_id, 'maria@example.com'),
|
||||
'charles@example.com,maria@example.com'
|
||||
'charles@example.com,maria@example.com',
|
||||
);
|
||||
|
||||
reply_to = ' charles@example.com, athens@example.com, unknown@example.com';
|
||||
assert.equal(
|
||||
people.update_email_in_reply_to(reply_to, 9999, 'whatever'),
|
||||
reply_to
|
||||
reply_to,
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -937,7 +937,7 @@ run_test('track_duplicate_full_names', () => {
|
|||
assert(!people.is_duplicate_full_name('Stephen King'));
|
||||
assert.equal(
|
||||
people.get_user_id_from_name('Stephen King'),
|
||||
stephen1.user_id
|
||||
stephen1.user_id,
|
||||
);
|
||||
|
||||
// Now duplicate the Stephen King name.
|
||||
|
@ -948,7 +948,7 @@ run_test('track_duplicate_full_names', () => {
|
|||
// other codepaths for disambiguation.
|
||||
assert.equal(
|
||||
people.get_user_id_from_name('Stephen King'),
|
||||
undefined
|
||||
undefined,
|
||||
);
|
||||
|
||||
assert(people.is_duplicate_full_name('Stephen King'));
|
||||
|
|
|
@ -114,7 +114,7 @@ run_test('status_from_raw', () => {
|
|||
{
|
||||
status: 'active',
|
||||
last_active: raw.active_timestamp,
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
raw = {
|
||||
|
@ -127,7 +127,7 @@ run_test('status_from_raw', () => {
|
|||
{
|
||||
status: 'offline',
|
||||
last_active: raw.active_timestamp,
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
raw = {
|
||||
|
@ -140,7 +140,7 @@ run_test('status_from_raw', () => {
|
|||
{
|
||||
status: 'idle',
|
||||
last_active: raw.idle_timestamp,
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -181,31 +181,31 @@ run_test('set_presence_info', () => {
|
|||
presence.initialize(params);
|
||||
|
||||
assert.deepEqual(presence.presence_info.get(alice.user_id),
|
||||
{ status: 'active', last_active: recent}
|
||||
{ status: 'active', last_active: recent},
|
||||
);
|
||||
assert.equal(presence.get_status(alice.user_id), 'active');
|
||||
assert.deepEqual(
|
||||
presence.last_active_date(alice.user_id),
|
||||
{seconds: recent * 1000}
|
||||
{seconds: recent * 1000},
|
||||
);
|
||||
|
||||
assert.deepEqual(presence.presence_info.get(fred.user_id),
|
||||
{ status: 'idle', last_active: now}
|
||||
{ status: 'idle', last_active: now},
|
||||
);
|
||||
assert.equal(presence.get_status(fred.user_id), 'idle');
|
||||
|
||||
assert.deepEqual(presence.presence_info.get(me.user_id),
|
||||
{ status: 'active', last_active: now}
|
||||
{ status: 'active', last_active: now},
|
||||
);
|
||||
assert.equal(presence.get_status(me.user_id), 'active');
|
||||
|
||||
assert.deepEqual(presence.presence_info.get(sally.user_id),
|
||||
{ status: 'offline', last_active: a_while_ago}
|
||||
{ status: 'offline', last_active: a_while_ago},
|
||||
);
|
||||
assert.equal(presence.get_status(sally.user_id), 'offline');
|
||||
|
||||
assert.deepEqual(presence.presence_info.get(zoe.user_id),
|
||||
{ status: 'offline', last_active: undefined}
|
||||
{ status: 'offline', last_active: undefined},
|
||||
);
|
||||
assert.equal(presence.get_status(zoe.user_id), 'offline');
|
||||
assert.equal(presence.last_active_date(zoe.user_id), undefined);
|
||||
|
@ -214,12 +214,12 @@ run_test('set_presence_info', () => {
|
|||
assert.equal(presence.get_status(bot.user_id), 'offline');
|
||||
|
||||
assert.deepEqual(presence.presence_info.get(john.user_id),
|
||||
{ status: 'offline', last_active: a_while_ago}
|
||||
{ status: 'offline', last_active: a_while_ago},
|
||||
);
|
||||
assert.equal(presence.get_status(john.user_id), 'offline');
|
||||
|
||||
assert.deepEqual(presence.presence_info.get(jane.user_id),
|
||||
{ status: 'idle', last_active: now}
|
||||
{ status: 'idle', last_active: now},
|
||||
);
|
||||
assert.equal(presence.get_status(jane.user_id), 'idle');
|
||||
|
||||
|
@ -250,7 +250,7 @@ run_test('falsy values', () => {
|
|||
|
||||
assert.deepEqual(
|
||||
presence.presence_info.get(zoe.user_id),
|
||||
{ status: 'idle', last_active: a_bit_ago }
|
||||
{ status: 'idle', last_active: a_bit_ago },
|
||||
);
|
||||
|
||||
presences[zoe.user_id.toString()] = {
|
||||
|
@ -262,7 +262,7 @@ run_test('falsy values', () => {
|
|||
|
||||
assert.deepEqual(
|
||||
presence.presence_info.get(zoe.user_id),
|
||||
{ status: 'offline', last_active: undefined }
|
||||
{ status: 'offline', last_active: undefined },
|
||||
);
|
||||
}
|
||||
});
|
||||
|
@ -312,7 +312,7 @@ run_test('update_info_from_event', () => {
|
|||
|
||||
assert.deepEqual(
|
||||
presence.presence_info.get(alice.user_id),
|
||||
{ status: 'active', last_active: 500 }
|
||||
{ status: 'active', last_active: 500 },
|
||||
);
|
||||
|
||||
info = {
|
||||
|
@ -325,7 +325,7 @@ run_test('update_info_from_event', () => {
|
|||
|
||||
assert.deepEqual(
|
||||
presence.presence_info.get(alice.user_id),
|
||||
{ status: 'active', last_active: 510 }
|
||||
{ status: 'active', last_active: 510 },
|
||||
);
|
||||
|
||||
info = {
|
||||
|
@ -338,6 +338,6 @@ run_test('update_info_from_event', () => {
|
|||
|
||||
assert.deepEqual(
|
||||
presence.presence_info.get(alice.user_id),
|
||||
{ status: 'idle', last_active: 1000 }
|
||||
{ status: 'idle', last_active: 1000 },
|
||||
);
|
||||
});
|
||||
|
|
|
@ -631,7 +631,7 @@ run_test('remove last user', () => {
|
|||
function assert_names(names) {
|
||||
assert.deepEqual(
|
||||
reactions.get_message_reactions(message).map((r) => r.emoji_name),
|
||||
names
|
||||
names,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -145,10 +145,10 @@ run_test('process_message_for_senders', () => {
|
|||
|
||||
// Test topic change
|
||||
assert.equal(
|
||||
rs.get_topic_recent_senders(stream3, topic3).toString(), '3'
|
||||
rs.get_topic_recent_senders(stream3, topic3).toString(), '3',
|
||||
);
|
||||
assert.equal(
|
||||
rs.get_topic_recent_senders(stream3, topic2).toString(), '2,3'
|
||||
rs.get_topic_recent_senders(stream3, topic2).toString(), '2,3',
|
||||
);
|
||||
|
||||
// message7's topic was changed by user
|
||||
|
@ -156,36 +156,36 @@ run_test('process_message_for_senders', () => {
|
|||
|
||||
rs.process_topic_edit(stream3, topic2, topic3);
|
||||
assert.equal(
|
||||
rs.get_topic_recent_senders(stream3, topic3).toString(), '2,3'
|
||||
rs.get_topic_recent_senders(stream3, topic3).toString(), '2,3',
|
||||
);
|
||||
assert.equal(
|
||||
rs.get_topic_recent_senders(stream3, topic2).toString(), '3'
|
||||
rs.get_topic_recent_senders(stream3, topic2).toString(), '3',
|
||||
);
|
||||
|
||||
// Test stream change
|
||||
assert.equal(
|
||||
rs.get_topic_recent_senders(stream3, topic3).toString(), '2,3'
|
||||
rs.get_topic_recent_senders(stream3, topic3).toString(), '2,3',
|
||||
);
|
||||
assert.equal(
|
||||
rs.get_topic_recent_senders(stream4, topic3).toString(), ''
|
||||
rs.get_topic_recent_senders(stream4, topic3).toString(), '',
|
||||
);
|
||||
// stream of topic3 was changed to stream4.
|
||||
messages[6].stream_id = stream4; // message7's topic is topic3
|
||||
messages[7].stream_id = stream4;
|
||||
rs.process_topic_edit(stream3, topic3, topic3, stream4);
|
||||
assert.equal(
|
||||
rs.get_topic_recent_senders(stream3, topic3).toString(), ''
|
||||
rs.get_topic_recent_senders(stream3, topic3).toString(), '',
|
||||
);
|
||||
assert.equal(
|
||||
rs.get_topic_recent_senders(stream4, topic3).toString(), '2,3'
|
||||
rs.get_topic_recent_senders(stream4, topic3).toString(), '2,3',
|
||||
);
|
||||
|
||||
// Test stream & topic change
|
||||
assert.equal(
|
||||
rs.get_topic_recent_senders(stream4, topic3).toString(), '2,3'
|
||||
rs.get_topic_recent_senders(stream4, topic3).toString(), '2,3',
|
||||
);
|
||||
assert.equal(
|
||||
rs.get_topic_recent_senders(stream5, topic4).toString(), ''
|
||||
rs.get_topic_recent_senders(stream5, topic4).toString(), '',
|
||||
);
|
||||
// stream of topic3 was changed to stream5 and topic was changed to topic4.
|
||||
messages[6].stream_id = stream5;
|
||||
|
@ -194,9 +194,9 @@ run_test('process_message_for_senders', () => {
|
|||
messages[7].topic = topic4;
|
||||
rs.process_topic_edit(stream4, topic3, topic4, stream5);
|
||||
assert.equal(
|
||||
rs.get_topic_recent_senders(stream4, topic3).toString(), ''
|
||||
rs.get_topic_recent_senders(stream4, topic3).toString(), '',
|
||||
);
|
||||
assert.equal(
|
||||
rs.get_topic_recent_senders(stream5, topic4).toString(), '2,3'
|
||||
rs.get_topic_recent_senders(stream5, topic4).toString(), '2,3',
|
||||
);
|
||||
});
|
||||
|
|
|
@ -13,43 +13,43 @@ run_test('basics', () => {
|
|||
|
||||
assert.equal(
|
||||
check_rec({foo: 'apple', bar: 'banana'}),
|
||||
undefined
|
||||
undefined,
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
check_rec('bogus'),
|
||||
'my_rec is not a record'
|
||||
'my_rec is not a record',
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
check_rec({foo: 'apple'}),
|
||||
'in my_rec bar is missing'
|
||||
'in my_rec bar is missing',
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
check_rec({}),
|
||||
'in my_rec bar is missing, foo is missing'
|
||||
'in my_rec bar is missing, foo is missing',
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
check_rec({foo: 'apple', bar: 42}),
|
||||
'in my_rec bar is not a string'
|
||||
'in my_rec bar is not a string',
|
||||
);
|
||||
|
||||
const check_array = (val) => schema.check_array('lst', val, schema.check_string);
|
||||
|
||||
assert.equal(
|
||||
check_array(['foo', 'bar']),
|
||||
undefined
|
||||
undefined,
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
check_array('foo'),
|
||||
'lst is not an array'
|
||||
'lst is not an array',
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
check_array(['foo', 3]),
|
||||
'in lst we found an item where item is not a string'
|
||||
'in lst we found an item where item is not a string',
|
||||
);
|
||||
});
|
||||
|
|
|
@ -102,7 +102,7 @@ run_test('get_list_scrolling_container error', () => {
|
|||
blueslip.expect(
|
||||
'error',
|
||||
"Please wrap lists in an element with " +
|
||||
"'max-height' attribute."
|
||||
"'max-height' attribute.",
|
||||
);
|
||||
|
||||
scroll_util.get_list_scrolling_container(body);
|
||||
|
|
|
@ -36,7 +36,7 @@ run_test('generate_zuliprc_uri', () => {
|
|||
const expected = "data:application/octet-stream;charset=utf-8," + encodeURIComponent(
|
||||
"[api]\nemail=error-bot@zulip.org\n" +
|
||||
"key=QadL788EkiottHmukyhHgePUFHREiu8b\n" +
|
||||
"site=https://chat.example.com\n"
|
||||
"site=https://chat.example.com\n",
|
||||
);
|
||||
|
||||
assert.equal(uri, expected);
|
||||
|
|
|
@ -92,7 +92,7 @@ run_test('unloaded', () => {
|
|||
function simulate_realm_domains_table() {
|
||||
$('#realm_domains_table tbody').set_find_results(
|
||||
'tr',
|
||||
$.create('realm-tr-stub')
|
||||
$.create('realm-tr-stub'),
|
||||
);
|
||||
|
||||
let appended;
|
||||
|
@ -111,12 +111,12 @@ function test_realms_domain_modal(add_realm_domain) {
|
|||
|
||||
$('#add-realm-domain-widget').set_find_results(
|
||||
'.new-realm-domain',
|
||||
$.create('new-realm-domain-stub')
|
||||
$.create('new-realm-domain-stub'),
|
||||
);
|
||||
|
||||
$('#add-realm-domain-widget').set_find_results(
|
||||
'.new-realm-domain-allow-subdomains',
|
||||
$.create('new-realm-domain-allow-subdomains-stub')
|
||||
$.create('new-realm-domain-allow-subdomains-stub'),
|
||||
);
|
||||
|
||||
let posted;
|
||||
|
@ -147,23 +147,23 @@ function createSaveButtons(subsection) {
|
|||
const stub_discard_button = $(`#org-discard-${subsection}`);
|
||||
const stub_save_button_text = $('.icon-button-text');
|
||||
stub_save_button_header.set_find_results(
|
||||
'.subsection-failed-status p', $('<failed status element>')
|
||||
'.subsection-failed-status p', $('<failed status element>'),
|
||||
);
|
||||
stub_save_button.closest = () => stub_save_button_header;
|
||||
save_button_controls.set_find_results(
|
||||
'.save-button', stub_save_button
|
||||
'.save-button', stub_save_button,
|
||||
);
|
||||
stub_save_button.set_find_results(
|
||||
'.icon-button-text', stub_save_button_text
|
||||
'.icon-button-text', stub_save_button_text,
|
||||
);
|
||||
stub_save_button_header.set_find_results(
|
||||
'.save-button-controls', save_button_controls
|
||||
'.save-button-controls', save_button_controls,
|
||||
);
|
||||
stub_save_button_header.set_find_results(
|
||||
'.subsection-changes-discard .button', $(`#org-discard-${subsection}`)
|
||||
'.subsection-changes-discard .button', $(`#org-discard-${subsection}`),
|
||||
);
|
||||
save_button_controls.set_find_results(
|
||||
'.discard-button', stub_discard_button
|
||||
'.discard-button', stub_discard_button,
|
||||
);
|
||||
const props = {};
|
||||
props.hidden = false;
|
||||
|
@ -429,21 +429,21 @@ function test_extract_property_name() {
|
|||
$('#id_realm_allow_message_editing').attr('id', 'id_realm_allow_message_editing');
|
||||
assert.equal(
|
||||
settings_org.extract_property_name($('#id_realm_allow_message_editing')),
|
||||
'realm_allow_message_editing'
|
||||
'realm_allow_message_editing',
|
||||
);
|
||||
|
||||
$('#id_realm_message_content_edit_limit_minutes_label').attr(
|
||||
'id', 'id_realm_message_content_edit_limit_minutes_label');
|
||||
assert.equal(
|
||||
settings_org.extract_property_name($('#id_realm_message_content_edit_limit_minutes_label')),
|
||||
'realm_message_content_edit_limit_minutes_label'
|
||||
'realm_message_content_edit_limit_minutes_label',
|
||||
);
|
||||
|
||||
$('#id-realm-allow-message-deleting').attr(
|
||||
'id', 'id-realm-allow-message-deleting');
|
||||
assert.equal(
|
||||
settings_org.extract_property_name($('#id-realm-allow-message-deleting')),
|
||||
'realm_allow_message_deleting'
|
||||
'realm_allow_message_deleting',
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -203,7 +203,7 @@ run_test('subscribers', () => {
|
|||
fred.user_id,
|
||||
not_fred.user_id,
|
||||
george.user_id,
|
||||
]
|
||||
],
|
||||
);
|
||||
|
||||
stream_data.set_subscribers(sub, [me.user_id, fred.user_id, george.user_id]);
|
||||
|
@ -217,7 +217,7 @@ run_test('subscribers', () => {
|
|||
potential_subscriber_ids(),
|
||||
[
|
||||
not_fred.user_id,
|
||||
]
|
||||
],
|
||||
);
|
||||
|
||||
stream_data.set_subscribers(sub, []);
|
||||
|
@ -572,7 +572,7 @@ run_test('default_stream_names', () => {
|
|||
[
|
||||
announce.stream_id,
|
||||
general.stream_id,
|
||||
]
|
||||
],
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -842,7 +842,7 @@ run_test('remove_default_stream', () => {
|
|||
run_test('canonicalized_name', () => {
|
||||
assert.deepStrictEqual(
|
||||
stream_data.canonicalized_name('Stream_Bar'),
|
||||
"stream_bar"
|
||||
"stream_bar",
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -1004,7 +1004,7 @@ run_test('is_subscriber_subset', () => {
|
|||
for (const row of matrix) {
|
||||
assert.equal(
|
||||
stream_data.is_subscriber_subset(row[0], row[1]),
|
||||
row[2]
|
||||
row[2],
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -625,7 +625,7 @@ run_test('update_count_in_dom', () => {
|
|||
const stream_li = make_elem(
|
||||
$('<stream li>'),
|
||||
'<stream-count>',
|
||||
'<stream-value>'
|
||||
'<stream-value>',
|
||||
);
|
||||
|
||||
$('<stream li>').length = 0;
|
||||
|
|
|
@ -108,19 +108,19 @@ run_test('update_count_in_dom', () => {
|
|||
make_elem(
|
||||
$(".top_left_mentions"),
|
||||
'<mentioned-count>',
|
||||
'<mentioned-value>'
|
||||
'<mentioned-value>',
|
||||
);
|
||||
|
||||
make_elem(
|
||||
$(".top_left_all_messages"),
|
||||
'<home-count>',
|
||||
'<home-value>'
|
||||
'<home-value>',
|
||||
);
|
||||
|
||||
make_elem(
|
||||
$(".top_left_starred_messages"),
|
||||
'<starred-count>',
|
||||
'<starred-value>'
|
||||
'<starred-value>',
|
||||
);
|
||||
|
||||
top_left_corner.update_dom_with_unread_counts(counts);
|
||||
|
|
|
@ -35,7 +35,7 @@ run_test('get_emoji_matcher', () => {
|
|||
const matcher = typeahead.get_emoji_matcher(query);
|
||||
assert.deepEqual(
|
||||
emojis.filter(matcher),
|
||||
expected
|
||||
expected,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ run_test('triage', () => {
|
|||
{
|
||||
matches: [alice, Alicia],
|
||||
rest: [steve, Stephanie],
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
assert.deepEqual(
|
||||
|
@ -75,7 +75,7 @@ run_test('triage', () => {
|
|||
{
|
||||
matches: [Alicia, alice],
|
||||
rest: [steve, Stephanie],
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
assert.deepEqual(
|
||||
|
@ -83,7 +83,7 @@ run_test('triage', () => {
|
|||
{
|
||||
matches: [Stephanie, steve],
|
||||
rest: [alice, Alicia],
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
assert.deepEqual(
|
||||
|
@ -91,7 +91,7 @@ run_test('triage', () => {
|
|||
{
|
||||
matches: [],
|
||||
rest: [alice, Alicia, steve, Stephanie],
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -119,7 +119,7 @@ run_test('sort_emojis th', () => {
|
|||
thermometer,
|
||||
thumbs_down,
|
||||
mother_nature,
|
||||
]
|
||||
],
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -143,7 +143,7 @@ run_test('sort_emojis sm', () => {
|
|||
slight_smile,
|
||||
small_airplane,
|
||||
big_smile,
|
||||
]
|
||||
],
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ let next_id = 0;
|
|||
function assertSameEmails(lst1, lst2) {
|
||||
assert.deepEqual(
|
||||
lst1.map((r) => r.email),
|
||||
lst2.map((r) => r.email)
|
||||
lst2.map((r) => r.email),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -207,7 +207,7 @@ function get_typeahead_result(query, current_stream, current_topic) {
|
|||
people.get_realm_users(),
|
||||
query,
|
||||
current_stream,
|
||||
current_topic
|
||||
current_topic,
|
||||
);
|
||||
return result.map((person) => person.email);
|
||||
}
|
||||
|
@ -322,7 +322,7 @@ run_test('sort_recipients all mention', () => {
|
|||
test_objs,
|
||||
'a',
|
||||
'Linux',
|
||||
'Linux Topic'
|
||||
'Linux Topic',
|
||||
);
|
||||
|
||||
assertSameEmails(results, [
|
||||
|
@ -431,7 +431,7 @@ run_test('sort broadcast mentions', () => {
|
|||
|
||||
assert.deepEqual(
|
||||
results.map((r) => r.email),
|
||||
['all', 'everyone', 'stream']
|
||||
['all', 'everyone', 'stream'],
|
||||
);
|
||||
|
||||
// Reverse the list to test actual sorting
|
||||
|
@ -452,7 +452,7 @@ run_test('sort broadcast mentions', () => {
|
|||
'everyone',
|
||||
'stream',
|
||||
a_user.email,
|
||||
zman.email]
|
||||
zman.email],
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -128,7 +128,7 @@ const ui_init = rewiremock.proxy(
|
|||
"../../static/js/emojisets": {
|
||||
initialize: () => {},
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
set_global('$', global.make_zjquery());
|
||||
|
|
|
@ -109,7 +109,7 @@ run_test('changing_topics', () => {
|
|||
assert.deepEqual(unread.get_unread_message_ids([15, 16]), [15, 16]);
|
||||
assert.deepEqual(
|
||||
unread.get_unread_messages([message, other_message]),
|
||||
[message, other_message]
|
||||
[message, other_message],
|
||||
);
|
||||
|
||||
count = unread.num_unread_for_topic(stream_id, 'Lunch');
|
||||
|
@ -563,7 +563,7 @@ run_test('mention updates', () => {
|
|||
unread.update_message_for_mention(message);
|
||||
assert.equal(
|
||||
unread.unread_mentions_counter.has(message.id),
|
||||
counted
|
||||
counted,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ run_test('get_item', () => {
|
|||
{
|
||||
name: "Error",
|
||||
message: "Missing config",
|
||||
}
|
||||
},
|
||||
);
|
||||
assert.throws(
|
||||
() => {
|
||||
|
@ -84,7 +84,7 @@ run_test('get_item', () => {
|
|||
{
|
||||
name: "Error",
|
||||
message: "Missing row in config",
|
||||
}
|
||||
},
|
||||
);
|
||||
assert.throws(
|
||||
() => {
|
||||
|
@ -93,7 +93,7 @@ run_test('get_item', () => {
|
|||
{
|
||||
name: "Error",
|
||||
message: "Invalid upload mode!",
|
||||
}
|
||||
},
|
||||
);
|
||||
assert.throws(
|
||||
() => {
|
||||
|
@ -102,7 +102,7 @@ run_test('get_item', () => {
|
|||
{
|
||||
name: "Error",
|
||||
message: 'Invalid key name for mode "compose"',
|
||||
}
|
||||
},
|
||||
);
|
||||
assert.throws(
|
||||
() => {
|
||||
|
@ -111,7 +111,7 @@ run_test('get_item', () => {
|
|||
{
|
||||
name: "Error",
|
||||
message: 'Invalid key name for mode "edit"',
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -299,12 +299,12 @@ run_test("clean_user_content_links", () => {
|
|||
'<a href="http://zulip.zulipdev.com/user_uploads/w/ha/tever/file.png">upload</a> ' +
|
||||
'<a href="http://localhost:NNNN">invalid</a> ' +
|
||||
'<a href="javascript:alert(1)">unsafe</a> ' +
|
||||
'<a href="/#fragment" target="_blank">fragment</a>'
|
||||
'<a href="/#fragment" target="_blank">fragment</a>',
|
||||
),
|
||||
'<a href="http://example.com" target="_blank" rel="noopener noreferrer" title="http://example.com/">good</a> ' +
|
||||
'<a href="http://zulip.zulipdev.com/user_uploads/w/ha/tever/file.png" target="_blank" rel="noopener noreferrer" title="file.png">upload</a> ' +
|
||||
'<a>invalid</a> ' +
|
||||
'<a>unsafe</a> ' +
|
||||
'<a href="/#fragment" title="http://zulip.zulipdev.com/#fragment">fragment</a>'
|
||||
'<a href="/#fragment" title="http://zulip.zulipdev.com/#fragment">fragment</a>',
|
||||
);
|
||||
});
|
||||
|
|
|
@ -16,7 +16,7 @@ run_test('basics', () => {
|
|||
assert.equal(
|
||||
html,
|
||||
'<ul class="foo" title="cats & <"dogs">">\n\n' +
|
||||
'</ul>'
|
||||
'</ul>',
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -40,7 +40,7 @@ run_test('attribute escaping', () => {
|
|||
assert.equal(
|
||||
html,
|
||||
'<ul class="">something evil<div class="" ' +
|
||||
'title="apples & oranges">\n\n</ul>'
|
||||
'title="apples & oranges">\n\n</ul>',
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -61,7 +61,7 @@ run_test('attribute updates', () => {
|
|||
assert.equal(
|
||||
html,
|
||||
'<ul class="same" color="blue" id="101">\n\n' +
|
||||
'</ul>'
|
||||
'</ul>',
|
||||
);
|
||||
|
||||
let updated;
|
||||
|
@ -144,7 +144,7 @@ run_test('children', () => {
|
|||
'<li>foo1</li>\n' +
|
||||
'<li>foo2</li>\n' +
|
||||
'<li>foo3</li>\n' +
|
||||
'</ul>'
|
||||
'</ul>',
|
||||
);
|
||||
|
||||
// Force a complete redraw.
|
||||
|
@ -164,7 +164,7 @@ run_test('children', () => {
|
|||
'<ul class="main">\n' +
|
||||
'<li>foo4</li>\n' +
|
||||
'<li>foo5</li>\n' +
|
||||
'</ul>'
|
||||
'</ul>',
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -194,7 +194,7 @@ run_test('partial updates', () => {
|
|||
'<li>foo1</li>\n' +
|
||||
'<li>foo2</li>\n' +
|
||||
'<li>foo3</li>\n' +
|
||||
'</ul>'
|
||||
'</ul>',
|
||||
);
|
||||
|
||||
replace_content = () => {
|
||||
|
|
|
@ -244,7 +244,7 @@ class CommonUtils {
|
|||
await this.send_message(
|
||||
page,
|
||||
msg.stream !== undefined ? 'stream' : 'private',
|
||||
msg
|
||||
msg,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,6 +53,6 @@ require.extensions[".hbs"] = (module, filename) => {
|
|||
out.code +
|
||||
"\n//# sourceMappingURL=data:application/json;charset=utf-8;base64," +
|
||||
Buffer.from(out.map.toString()).toString("base64"),
|
||||
filename
|
||||
filename,
|
||||
);
|
||||
};
|
||||
|
|
|
@ -59,7 +59,7 @@ class MarkdownComparer {
|
|||
return false;
|
||||
}
|
||||
return _.zip(node1.content.childNodes, node2.content.childNodes).every(([child1, child2]) =>
|
||||
child1.isEqualNode(child2)
|
||||
child1.isEqualNode(child2),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ class MarkdownComparer {
|
|||
throw new assert.AssertionError({
|
||||
message: message + this._output_formatter(
|
||||
comparison_results.html.actual,
|
||||
comparison_results.html.expected
|
||||
comparison_results.html.expected,
|
||||
),
|
||||
});
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ function apply_color(input_string, changes) {
|
|||
if (formatter.has(change.tag)) {
|
||||
processed_string += input_string.slice(previous_index, change.beginning_index);
|
||||
processed_string += formatter.get(change.tag)(
|
||||
input_string.slice(change.beginning_index, change.ending_index)
|
||||
input_string.slice(change.beginning_index, change.ending_index),
|
||||
);
|
||||
previous_index = change.ending_index;
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ if (require.main === module) {
|
|||
" string_0" +
|
||||
" string_1" +
|
||||
"\n" +
|
||||
"Where string_0 and string_1 are the strings to be diffed"
|
||||
"Where string_0 and string_1 are the strings to be diffed",
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ exports.build_bot_create_widget = function () {
|
|||
file_name_field,
|
||||
input_error,
|
||||
clear_button,
|
||||
upload_button
|
||||
upload_button,
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -36,7 +36,7 @@ exports.build_bot_edit_widget = function (target) {
|
|||
file_name_field,
|
||||
input_error,
|
||||
clear_button,
|
||||
upload_button
|
||||
upload_button,
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -74,7 +74,7 @@ exports.build_user_avatar_widget = function (upload_function) {
|
|||
$("#user-avatar-upload-widget .image_file_input_error").expectOne(),
|
||||
$("#user-avatar-upload-widget .image_upload_button").expectOne(),
|
||||
upload_function,
|
||||
page_params.max_avatar_file_size_mib
|
||||
page_params.max_avatar_file_size_mib,
|
||||
);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -71,7 +71,7 @@ exports.format_money = function (cents) {
|
|||
|
||||
exports.update_charged_amount = function (prices, schedule) {
|
||||
$("#charged_amount").text(
|
||||
exports.format_money(page_params.seat_count * prices[schedule])
|
||||
exports.format_money(page_params.seat_count * prices[schedule]),
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ export function clean_path(full_path: string): string {
|
|||
}
|
||||
|
||||
export function clean_function_name(
|
||||
function_name: string | undefined
|
||||
function_name: string | undefined,
|
||||
): { scope: string; name: string } | undefined {
|
||||
if (function_name === undefined) {
|
||||
return undefined;
|
||||
|
@ -78,7 +78,7 @@ export async function display_stacktrace(error: string, stack: string): Promise<
|
|||
const location = await stack_trace_gps.getMappedLocation(
|
||||
// Work around mistake in ErrorStackParser.StackFrame definition
|
||||
// https://github.com/stacktracejs/error-stack-parser/pull/49
|
||||
(stack_frame as unknown) as StackFrame
|
||||
(stack_frame as unknown) as StackFrame,
|
||||
);
|
||||
return {
|
||||
full_path: location.getFileName(),
|
||||
|
@ -87,11 +87,11 @@ export async function display_stacktrace(error: string, stack: string): Promise<
|
|||
function_name: clean_function_name(location.getFunctionName()),
|
||||
context: await get_context(location),
|
||||
};
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
const $alert = $("<div class='stacktrace'>").html(
|
||||
render_blueslip_stacktrace({ error, stackframes })
|
||||
render_blueslip_stacktrace({ error, stackframes }),
|
||||
);
|
||||
$(".alert-box").append($alert);
|
||||
$alert.addClass("show");
|
||||
|
|
|
@ -220,7 +220,7 @@ exports.get_title_data = function (user_ids_string, is_group) {
|
|||
if (bot_owner) {
|
||||
const bot_owner_name = i18n.t(
|
||||
'Owner: __name__',
|
||||
{name: bot_owner.full_name}
|
||||
{name: bot_owner.full_name},
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
|
@ -607,10 +607,10 @@ exports.initialize = function () {
|
|||
// NB: This just binds to current elements, and won't bind to elements
|
||||
// created after ready() is called.
|
||||
$('#compose-send-status .compose-send-status-close').click(
|
||||
() => { $('#compose-send-status').stop(true).fadeOut(500); }
|
||||
() => { $('#compose-send-status').stop(true).fadeOut(500); },
|
||||
);
|
||||
$('#nonexistent_stream_reply_error .compose-send-status-close').click(
|
||||
() => { $('#nonexistent_stream_reply_error').stop(true).fadeOut(500); }
|
||||
() => { $('#nonexistent_stream_reply_error').stop(true).fadeOut(500); },
|
||||
);
|
||||
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ exports.toggle = function (opts) {
|
|||
if (opts.callback) {
|
||||
opts.callback(
|
||||
opts.values[idx].label,
|
||||
opts.values[idx].key
|
||||
opts.values[idx].key,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -423,7 +423,7 @@ exports.get_invalid_recipient_emails = function () {
|
|||
const private_recipients = util.extract_pm_recipients(
|
||||
compose_state.private_message_recipient());
|
||||
const invalid_recipients = private_recipients.filter(
|
||||
(email) => !people.is_valid_email_for_compose(email)
|
||||
(email) => !people.is_valid_email_for_compose(email),
|
||||
);
|
||||
|
||||
return invalid_recipients;
|
||||
|
@ -1118,7 +1118,7 @@ exports.initialize = function () {
|
|||
window.location.host +
|
||||
"/calls/zoom/register",
|
||||
"_blank",
|
||||
"width=800,height=500,noopener,noreferrer"
|
||||
"width=800,height=500,noopener,noreferrer",
|
||||
);
|
||||
}
|
||||
} else if (
|
||||
|
|
|
@ -68,7 +68,7 @@ exports.replace_syntax = function (old_syntax, new_syntax, textarea) {
|
|||
// replace() function treating `$`s in new_syntax as special syntax. See
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Description
|
||||
// for details.
|
||||
new_syntax
|
||||
new_syntax,
|
||||
));
|
||||
};
|
||||
|
||||
|
|
|
@ -496,7 +496,7 @@ exports.get_person_suggestions = function (query, opts) {
|
|||
const cutoff_length = exports.max_num_items;
|
||||
|
||||
const filtered_message_persons = filter_persons(
|
||||
people.get_active_message_people()
|
||||
people.get_active_message_people(),
|
||||
);
|
||||
|
||||
let filtered_persons;
|
||||
|
@ -505,7 +505,7 @@ exports.get_person_suggestions = function (query, opts) {
|
|||
filtered_persons = filtered_message_persons;
|
||||
} else {
|
||||
filtered_persons = filter_persons(
|
||||
people.get_realm_users()
|
||||
people.get_realm_users(),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -515,7 +515,7 @@ exports.get_person_suggestions = function (query, opts) {
|
|||
opts.stream,
|
||||
opts.topic,
|
||||
filtered_groups,
|
||||
exports.max_num_items
|
||||
exports.max_num_items,
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ IterationProfiler.prototype = {
|
|||
if (diff > 1) {
|
||||
this.sections.set(
|
||||
"_rest_of_iteration",
|
||||
(this.sections.get("_rest_of_iteration") || 0) + diff
|
||||
(this.sections.get("_rest_of_iteration") || 0) + diff,
|
||||
);
|
||||
}
|
||||
this.last_time = now;
|
||||
|
|
|
@ -175,7 +175,7 @@ exports.restore_draft = function (draft_id) {
|
|||
{operator: "stream", operand: compose_args.stream},
|
||||
{operator: "topic", operand: compose_args.topic},
|
||||
],
|
||||
{trigger: "restore draft"}
|
||||
{trigger: "restore draft"},
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
@ -184,7 +184,7 @@ exports.restore_draft = function (draft_id) {
|
|||
[
|
||||
{operator: "pm-with", operand: compose_args.private_message_recipient},
|
||||
],
|
||||
{trigger: "restore draft"}
|
||||
{trigger: "restore draft"},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ exports.launch = function () {
|
|||
const unsorted_raw_drafts = Object.values(data);
|
||||
|
||||
const sorted_raw_drafts = unsorted_raw_drafts.sort(
|
||||
(draft_a, draft_b) => draft_b.updatedAt - draft_a.updatedAt
|
||||
(draft_a, draft_b) => draft_b.updatedAt - draft_a.updatedAt,
|
||||
);
|
||||
|
||||
const sorted_formatted_drafts = sorted_raw_drafts.map(exports.format_draft).filter(Boolean);
|
||||
|
|
|
@ -104,7 +104,7 @@ function show_emoji_catalog() {
|
|||
exports.generate_emoji_picker_data = function (realm_emojis) {
|
||||
const catalog = new Map();
|
||||
catalog.set("Custom", Array.from(realm_emojis.keys(), (realm_emoji_name) =>
|
||||
emoji.emojis_by_name.get(realm_emoji_name)
|
||||
emoji.emojis_by_name.get(realm_emoji_name),
|
||||
));
|
||||
|
||||
for (const [category, codepoints] of Object.entries(emoji_codes.emoji_catalog)) {
|
||||
|
@ -730,7 +730,7 @@ exports.register_click_handlers = function () {
|
|||
$emoji_map,
|
||||
emoji_coordinates.section,
|
||||
emoji_coordinates.index,
|
||||
true
|
||||
true,
|
||||
);
|
||||
});
|
||||
};
|
||||
|
|
|
@ -362,7 +362,7 @@ Filter.prototype = {
|
|||
page_params.narrow_stream !== undefined &&
|
||||
value.operator === "stream" &&
|
||||
value.operand.toLowerCase() === page_params.narrow_stream.toLowerCase()
|
||||
)
|
||||
),
|
||||
);
|
||||
return safe_to_return;
|
||||
},
|
||||
|
@ -376,13 +376,13 @@ Filter.prototype = {
|
|||
|
||||
has_negated_operand: function (operator, operand) {
|
||||
return this._operators.some(
|
||||
(elem) => elem.negated && (elem.operator === operator && elem.operand === operand)
|
||||
(elem) => elem.negated && (elem.operator === operator && elem.operand === operand),
|
||||
);
|
||||
},
|
||||
|
||||
has_operand: function (operator, operand) {
|
||||
return this._operators.some(
|
||||
(elem) => !elem.negated && (elem.operator === operator && elem.operand === operand)
|
||||
(elem) => !elem.negated && (elem.operator === operator && elem.operand === operand),
|
||||
);
|
||||
},
|
||||
|
||||
|
@ -750,7 +750,7 @@ Filter.prototype = {
|
|||
term.operand = people.update_email_in_reply_to(
|
||||
term.operand,
|
||||
user_id,
|
||||
new_email
|
||||
new_email,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ function place_popover(hotspot) {
|
|||
$(hotspot.location.element),
|
||||
popover_height,
|
||||
popover_width,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
switch (orientation) {
|
||||
|
@ -151,7 +151,7 @@ function place_popover(hotspot) {
|
|||
default:
|
||||
blueslip.error(
|
||||
'Invalid popover placement value for hotspot \'' +
|
||||
hotspot.name + '\''
|
||||
hotspot.name + '\'',
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
@ -237,7 +237,7 @@ exports.close_hotspot_icon = function (elem) {
|
|||
function close_read_hotspots(new_hotspots) {
|
||||
const unwanted_hotspots = _.difference(
|
||||
Array.from(HOTSPOT_LOCATIONS.keys()),
|
||||
new_hotspots.map((hotspot) => hotspot.name)
|
||||
new_hotspots.map((hotspot) => hotspot.name),
|
||||
);
|
||||
|
||||
for (const hotspot_name of unwanted_hotspots) {
|
||||
|
|
|
@ -70,7 +70,7 @@ function display_video(payload) {
|
|||
// Use data: to load the player in a unique origin for security.
|
||||
source = "data:text/html," + window.encodeURIComponent(
|
||||
"<!DOCTYPE html><style>iframe{position:absolute;left:0;top:0;width:100%;height:100%;box-sizing:border-box}</style>" +
|
||||
payload.source
|
||||
payload.source,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ exports.get_filtered_items = (value, list, opts) => {
|
|||
if (get_item) {
|
||||
return opts.filter.filterer(
|
||||
list.map(get_item),
|
||||
value
|
||||
value,
|
||||
);
|
||||
}
|
||||
return opts.filter.filterer(list, value);
|
||||
|
@ -159,12 +159,12 @@ exports.create = function ($container, list, opts) {
|
|||
meta.filtered_list = exports.get_filtered_items(
|
||||
meta.filter_value,
|
||||
meta.list,
|
||||
opts
|
||||
opts,
|
||||
);
|
||||
|
||||
if (meta.sorting_function) {
|
||||
meta.filtered_list.sort(
|
||||
meta.sorting_function
|
||||
meta.sorting_function,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -817,13 +817,13 @@ exports.delete_message = function (msg_id) {
|
|||
success: function () {
|
||||
$('#delete_message_modal').modal("hide");
|
||||
currently_deleting_messages = currently_deleting_messages.filter(
|
||||
(id) => id !== msg_id
|
||||
(id) => id !== msg_id,
|
||||
);
|
||||
hide_delete_btn_show_spinner(false);
|
||||
},
|
||||
error: function (xhr) {
|
||||
currently_deleting_messages = currently_deleting_messages.filter(
|
||||
(id) => id !== msg_id
|
||||
(id) => id !== msg_id,
|
||||
);
|
||||
hide_delete_btn_show_spinner(false);
|
||||
ui_report.error(i18n.t("Error deleting message"), xhr,
|
||||
|
|
|
@ -170,7 +170,7 @@ MessageListData.prototype = {
|
|||
return messages.filter(
|
||||
(message) =>
|
||||
!muting.is_topic_muted(message.stream_id, message.topic) ||
|
||||
message.mentioned
|
||||
message.mentioned,
|
||||
);
|
||||
},
|
||||
|
||||
|
@ -345,7 +345,7 @@ MessageListData.prototype = {
|
|||
this._items = this._items.filter((message) => !msg_ids_to_remove.has(message.id));
|
||||
if (this.muting_enabled) {
|
||||
this._all_items = this._all_items.filter(
|
||||
(message) => !msg_ids_to_remove.has(message.id)
|
||||
(message) => !msg_ids_to_remove.has(message.id),
|
||||
);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1026,7 +1026,7 @@ MessageListView.prototype = {
|
|||
// Since we don't have a way to get a message group from
|
||||
// the containing message container, we just do a search
|
||||
// to find it.
|
||||
(message_group) => message_group.message_group_id === message_group_id
|
||||
(message_group) => message_group.message_group_id === message_group_id,
|
||||
);
|
||||
},
|
||||
|
||||
|
@ -1100,7 +1100,7 @@ MessageListView.prototype = {
|
|||
let message_containers = messages.map((message) => self.message_containers.get(message.id));
|
||||
// We may not have the message_container if the stream or topic was muted
|
||||
message_containers = message_containers.filter(
|
||||
(message_container) => message_container !== undefined
|
||||
(message_container) => message_container !== undefined,
|
||||
);
|
||||
|
||||
const message_groups = [];
|
||||
|
|
|
@ -435,7 +435,7 @@ exports.maybe_add_local_messages = function (opts) {
|
|||
// need to look at unread here.
|
||||
id_info.final_select_id = min_defined(
|
||||
id_info.target_id,
|
||||
unread_info.msg_id
|
||||
unread_info.msg_id,
|
||||
);
|
||||
|
||||
if (!load_local_messages(msg_data)) {
|
||||
|
@ -601,7 +601,7 @@ exports.narrow_to_next_topic = function () {
|
|||
|
||||
const next_narrow = topic_generator.get_next_topic(
|
||||
curr_info.stream,
|
||||
curr_info.topic
|
||||
curr_info.topic,
|
||||
);
|
||||
|
||||
if (!next_narrow) {
|
||||
|
|
|
@ -28,8 +28,8 @@ if (window.electron_bridge && window.electron_bridge.new_notification) {
|
|||
Object.assign(
|
||||
this,
|
||||
window.electron_bridge.new_notification(title, options, (type, eventInit) =>
|
||||
this.dispatchEvent(new Event(type, eventInit))
|
||||
)
|
||||
this.dispatchEvent(new Event(type, eventInit)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ exports.get_by_email = function (email) {
|
|||
if (person.email.toLowerCase() !== email.toLowerCase()) {
|
||||
blueslip.warn(
|
||||
'Obsolete email passed to get_by_email: ' + email +
|
||||
' new email = ' + person.email
|
||||
' new email = ' + person.email,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -849,7 +849,7 @@ exports.get_message_people = function () {
|
|||
semantics
|
||||
*/
|
||||
const message_people = message_store.user_ids().map(
|
||||
(user_id) => people_by_user_id_dict.get(user_id)
|
||||
(user_id) => people_by_user_id_dict.get(user_id),
|
||||
).filter(Boolean);
|
||||
|
||||
return message_people;
|
||||
|
@ -858,7 +858,7 @@ exports.get_message_people = function () {
|
|||
exports.get_active_message_people = function () {
|
||||
const message_people = exports.get_message_people();
|
||||
const active_message_people = message_people.filter((item) =>
|
||||
active_user_dict.has(item.user_id)
|
||||
active_user_dict.has(item.user_id),
|
||||
);
|
||||
return active_message_people;
|
||||
};
|
||||
|
|
|
@ -16,14 +16,14 @@ async function decrypt_manual() {
|
|||
document.querySelector("#submit").disabled = tokenElement.value === "";
|
||||
try {
|
||||
const data = new Uint8Array(
|
||||
tokenElement.value.match(/../g).map((b) => parseInt(b, 16))
|
||||
tokenElement.value.match(/../g).map((b) => parseInt(b, 16)),
|
||||
);
|
||||
const iv = data.slice(0, 12);
|
||||
const ciphertext = data.slice(12);
|
||||
const plaintext = await crypto.subtle.decrypt(
|
||||
{ name: "AES-GCM", iv },
|
||||
key,
|
||||
ciphertext
|
||||
ciphertext,
|
||||
);
|
||||
resolve(new TextDecoder().decode(plaintext));
|
||||
} catch {
|
||||
|
@ -50,7 +50,7 @@ async function decrypt_manual() {
|
|||
(window.location.search ? window.location.search + "&" : "?") +
|
||||
"desktop_flow_otp=" +
|
||||
encodeURIComponent(keyHex),
|
||||
"_blank"
|
||||
"_blank",
|
||||
);
|
||||
|
||||
const token = await pasted;
|
||||
|
|
|
@ -91,7 +91,7 @@ function update_categories() {
|
|||
|
||||
$('.integration-lozenges').animate(
|
||||
{ opacity: 1 },
|
||||
{ duration: 400 }
|
||||
{ duration: 400 },
|
||||
);
|
||||
|
||||
adjust_font_sizing();
|
||||
|
@ -174,11 +174,11 @@ function hide_catalog_show_integration() {
|
|||
|
||||
$("html, body").animate(
|
||||
{ scrollTop: 0 },
|
||||
{ duration: 200 }
|
||||
{ duration: 200 },
|
||||
);
|
||||
$('#integration-instructions-group').animate(
|
||||
{ opacity: 1 },
|
||||
{ duration: 300 }
|
||||
{ duration: 300 },
|
||||
);
|
||||
|
||||
adjust_font_sizing();
|
||||
|
@ -207,7 +207,7 @@ function hide_integration_show_catalog() {
|
|||
function show_catalog() {
|
||||
$("html, body").animate(
|
||||
{ scrollTop: 0 },
|
||||
{ duration: 200 }
|
||||
{ duration: 200 },
|
||||
);
|
||||
|
||||
$(".integration-categories-dropdown").css('display', '');
|
||||
|
|
|
@ -53,7 +53,7 @@ function update_ui_and_send_reaction_ajax(message_id, reaction_info) {
|
|||
const local_id = exports.get_local_reaction_id(reaction_info);
|
||||
const has_reacted = exports.current_user_has_reacted_to_emoji(
|
||||
message,
|
||||
local_id
|
||||
local_id,
|
||||
);
|
||||
const operation = has_reacted ? 'remove' : 'add';
|
||||
const reaction = create_reaction(message_id, reaction_info);
|
||||
|
|
|
@ -24,7 +24,7 @@ exports.build_realm_icon_widget = function (upload_function) {
|
|||
$("#realm-icon-upload-widget .image_file_input_error").expectOne(),
|
||||
$("#realm-icon-upload-widget .image_upload_button").expectOne(),
|
||||
upload_function,
|
||||
page_params.max_icon_file_size
|
||||
page_params.max_icon_file_size,
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ exports.build_realm_logo_widget = function (upload_function, is_night) {
|
|||
file_input_error_elem.expectOne(),
|
||||
upload_button_elem.expectOne(),
|
||||
upload_function,
|
||||
page_params.max_logo_file_size
|
||||
page_params.max_logo_file_size,
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ exports.get_topic_recent_senders = function (stream_id, topic) {
|
|||
}
|
||||
|
||||
const sorted_senders = Array.from(sender_message_ids.entries()).sort(
|
||||
(s1, s2) => s1[1] - s2[1]
|
||||
(s1, s2) => s1[1] - s2[1],
|
||||
);
|
||||
const recent_senders = [];
|
||||
for (const item of sorted_senders) {
|
||||
|
|
|
@ -140,7 +140,7 @@ exports.reify_message_id_if_available = function (opts) {
|
|||
function get_sorted_topics() {
|
||||
// Sort all recent topics by last message time.
|
||||
return new Map(
|
||||
Array.from(topics.entries()).sort((a, b) => b[1].last_msg_id - a[1].last_msg_id)
|
||||
Array.from(topics.entries()).sort((a, b) => b[1].last_msg_id - a[1].last_msg_id),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ exports.schedule_message = function (request) {
|
|||
const message = raw_message.slice(1).join('\n');
|
||||
|
||||
const deferred_message_type = deferred_message_types.filter(
|
||||
(props) => command_line.match(props.test) !== null
|
||||
(props) => command_line.match(props.test) !== null,
|
||||
)[0];
|
||||
const command = command_line.match(deferred_message_type.test)[0];
|
||||
|
||||
|
@ -67,7 +67,7 @@ exports.schedule_message = function (request) {
|
|||
}
|
||||
|
||||
request = patch_request_for_scheduling(
|
||||
request, message, deliver_at, deferred_message_type.delivery_type
|
||||
request, message, deliver_at, deferred_message_type.delivery_type,
|
||||
);
|
||||
|
||||
const success = function (data) {
|
||||
|
@ -143,7 +143,7 @@ exports.do_set_reminder_for_message = function (message_id, timestamp) {
|
|||
|
||||
reminder_message = patch_request_for_scheduling(
|
||||
reminder_message, reminder_msg_content, timestamp,
|
||||
deferred_message_types.reminders.delivery_type
|
||||
deferred_message_types.reminders.delivery_type,
|
||||
);
|
||||
transmit.send_message(reminder_message, success, error);
|
||||
};
|
||||
|
|
|
@ -35,14 +35,14 @@ exports.scroll_delta = function (opts) {
|
|||
if (elem_top < 0) {
|
||||
delta = Math.max(
|
||||
elem_top,
|
||||
elem_bottom - container_height
|
||||
elem_bottom - container_height,
|
||||
);
|
||||
delta = Math.min(0, delta);
|
||||
} else {
|
||||
if (elem_bottom > container_height) {
|
||||
delta = Math.min(
|
||||
elem_top,
|
||||
elem_bottom - container_height
|
||||
elem_bottom - container_height,
|
||||
);
|
||||
delta = Math.max(0, delta);
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ function get_events_success(events) {
|
|||
messages.forEach(message_store.set_message_booleans);
|
||||
|
||||
const sent_by_this_client = messages.some((msg) =>
|
||||
sent_messages.messages.has(msg.local_id)
|
||||
sent_messages.messages.has(msg.local_id),
|
||||
);
|
||||
// If some message in this batch of events was sent by this
|
||||
// client, almost every time, this message will be the only one
|
||||
|
|
|
@ -376,7 +376,7 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) {
|
|||
stream_events.update_property(
|
||||
event.stream_id,
|
||||
event.property,
|
||||
event.value
|
||||
event.value,
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -262,12 +262,12 @@ const other_notification_settings = desktop_notification_settings.concat(
|
|||
mobile_notification_settings,
|
||||
email_notification_settings,
|
||||
presence_notification_settings,
|
||||
["notification_sound"]
|
||||
["notification_sound"],
|
||||
);
|
||||
|
||||
exports.all_notification_settings = other_notification_settings.concat(
|
||||
pm_mention_notification_settings,
|
||||
exports.stream_notification_settings
|
||||
exports.stream_notification_settings,
|
||||
);
|
||||
|
||||
exports.all_notifications = () => ({
|
||||
|
|
|
@ -130,7 +130,7 @@ exports.build_emoji_upload_widget = function () {
|
|||
clear_button,
|
||||
upload_button,
|
||||
preview_text,
|
||||
preview_image
|
||||
preview_image,
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -33,13 +33,13 @@ exports.populate_exports_table = function (exports) {
|
|||
|
||||
if (failed_timestamp !== null) {
|
||||
failed_timestamp = timerender.last_seen_status_from_date(
|
||||
new XDate(failed_timestamp * 1000)
|
||||
new XDate(failed_timestamp * 1000),
|
||||
);
|
||||
}
|
||||
|
||||
if (deleted_timestamp !== null) {
|
||||
deleted_timestamp = timerender.last_seen_status_from_date(
|
||||
new XDate(deleted_timestamp * 1000)
|
||||
new XDate(deleted_timestamp * 1000),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ exports.populate_exports_table = function (exports) {
|
|||
acting_user: people.get_full_name(data.acting_user_id),
|
||||
// Convert seconds -> milliseconds
|
||||
event_time: timerender.last_seen_status_from_date(
|
||||
new XDate(data.export_time * 1000)
|
||||
new XDate(data.export_time * 1000),
|
||||
),
|
||||
url: data.export_url,
|
||||
time_failed: failed_timestamp,
|
||||
|
|
|
@ -105,7 +105,7 @@ exports.set_up = function () {
|
|||
|
||||
$("#send_test_notification").click(() => {
|
||||
notifications.send_test_notification(
|
||||
i18n.t("This is what a Zulip notification looks like.")
|
||||
i18n.t("This is what a Zulip notification looks like."),
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -264,7 +264,7 @@ exports.populate_realm_domains = function (realm_domains) {
|
|||
}
|
||||
|
||||
const domains_list = realm_domains.map(
|
||||
(realm_domain) => realm_domain.allow_subdomains ? "*." + realm_domain.domain : realm_domain.domain
|
||||
(realm_domain) => realm_domain.allow_subdomains ? "*." + realm_domain.domain : realm_domain.domain,
|
||||
);
|
||||
let domains = domains_list.join(', ');
|
||||
if (domains.length === 0) {
|
||||
|
@ -279,7 +279,7 @@ exports.populate_realm_domains = function (realm_domains) {
|
|||
realm_domains_table_body.append(
|
||||
render_settings_admin_realm_domains_list({
|
||||
realm_domain: realm_domain,
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
};
|
||||
|
@ -680,7 +680,7 @@ exports.build_page = function () {
|
|||
data.allow_message_editing = true;
|
||||
data.message_content_edit_limit_seconds =
|
||||
settings_config.msg_edit_limit_dropdown_values.get(
|
||||
edit_limit_setting_value
|
||||
edit_limit_setting_value,
|
||||
).seconds;
|
||||
}
|
||||
const delete_limit_setting_value = $("#id_realm_msg_delete_limit_setting").val();
|
||||
|
@ -694,7 +694,7 @@ exports.build_page = function () {
|
|||
data.allow_message_deleting = true;
|
||||
data.message_content_delete_limit_seconds =
|
||||
settings_config.msg_delete_limit_dropdown_values.get(
|
||||
delete_limit_setting_value
|
||||
delete_limit_setting_value,
|
||||
).seconds;
|
||||
}
|
||||
} else if (subsection === 'notifications') {
|
||||
|
@ -1011,7 +1011,7 @@ exports.build_page = function () {
|
|||
url: '/json/realm/deactivate',
|
||||
error: function (xhr) {
|
||||
ui_report.error(
|
||||
i18n.t("Failed"), xhr, $('#admin-realm-deactivation-status').expectOne()
|
||||
i18n.t("Failed"), xhr, $('#admin-realm-deactivation-status').expectOne(),
|
||||
);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -244,7 +244,7 @@ function set_up_choices_field_edit_form(profile_field, field_data) {
|
|||
choice_list.append(
|
||||
render_settings_profile_field_choice({
|
||||
text: choice.text,
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -369,7 +369,7 @@ exports.do_populate_profile_fields = function (profile_fields_data) {
|
|||
},
|
||||
can_modify: page_params.is_admin,
|
||||
realm_default_external_accounts: page_params.realm_default_external_accounts,
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@ exports.populate_user_groups = function () {
|
|||
except_class);
|
||||
if ($(event.relatedTarget).closest('#user-groups #' + data.id).length) {
|
||||
return blur_exceptions.some(
|
||||
(class_name) => $(event.relatedTarget).closest(class_name).length
|
||||
(class_name) => $(event.relatedTarget).closest(class_name).length,
|
||||
);
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -24,7 +24,7 @@ function sort_email(a, b) {
|
|||
const email_b = settings_data.email_for_user_settings(b) || '';
|
||||
return compare_a_b(
|
||||
email_a.toLowerCase(),
|
||||
email_b.toLowerCase()
|
||||
email_b.toLowerCase(),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -52,14 +52,14 @@ function sort_bot_owner(a, b) {
|
|||
|
||||
return compare_a_b(
|
||||
owner_name(a),
|
||||
owner_name(b)
|
||||
owner_name(b),
|
||||
);
|
||||
}
|
||||
|
||||
function sort_last_active(a, b) {
|
||||
return compare_a_b(
|
||||
presence.last_active_date(a.user_id) || 0,
|
||||
presence.last_active_date(b.user_id) || 0
|
||||
presence.last_active_date(b.user_id) || 0,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -401,7 +401,7 @@ function open_human_form(person) {
|
|||
element,
|
||||
user_id,
|
||||
true,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
|
@ -170,7 +170,7 @@ function populate_messages_sent_over_time(data) {
|
|||
|
||||
const start_dates = data.end_times.map((timestamp) =>
|
||||
// data.end_times are the ends of hour long intervals.
|
||||
new Date(timestamp * 1000 - 60 * 60 * 1000)
|
||||
new Date(timestamp * 1000 - 60 * 60 * 1000),
|
||||
);
|
||||
|
||||
function aggregate_data(aggregation) {
|
||||
|
@ -322,8 +322,8 @@ function round_to_percentages(values, total) {
|
|||
6, // this is the max precision (two #, 4 decimal points; 99.9999%).
|
||||
Math.max(
|
||||
2, // the minimum amount of precision (40% or 6.0%).
|
||||
Math.floor(-Math.log10(100 - unrounded)) + 3
|
||||
)
|
||||
Math.floor(-Math.log10(100 - unrounded)) + 3,
|
||||
),
|
||||
);
|
||||
|
||||
return unrounded.toPrecision(precision) + '%';
|
||||
|
@ -528,7 +528,7 @@ function populate_messages_sent_by_message_type(data) {
|
|||
const plot_data = compute_summary_chart_data(
|
||||
time_series_data,
|
||||
num_steps,
|
||||
data.display_order
|
||||
data.display_order,
|
||||
);
|
||||
const labels = [];
|
||||
for (let i = 0; i < plot_data.labels.length; i += 1) {
|
||||
|
@ -800,7 +800,7 @@ function populate_messages_read_over_time(data) {
|
|||
|
||||
const start_dates = data.end_times.map((timestamp) =>
|
||||
// data.end_times are the ends of hour long intervals.
|
||||
new Date(timestamp * 1000 - 60 * 60 * 1000)
|
||||
new Date(timestamp * 1000 - 60 * 60 * 1000),
|
||||
);
|
||||
|
||||
function aggregate_data(aggregation) {
|
||||
|
@ -949,25 +949,25 @@ function get_chart_data(data, callback) {
|
|||
|
||||
get_chart_data(
|
||||
{chart_name: 'messages_sent_over_time', min_length: '10'},
|
||||
populate_messages_sent_over_time
|
||||
populate_messages_sent_over_time,
|
||||
);
|
||||
|
||||
get_chart_data(
|
||||
{chart_name: 'messages_sent_by_client', min_length: '10'},
|
||||
populate_messages_sent_by_client
|
||||
populate_messages_sent_by_client,
|
||||
);
|
||||
|
||||
get_chart_data(
|
||||
{chart_name: 'messages_sent_by_message_type', min_length: '10'},
|
||||
populate_messages_sent_by_message_type
|
||||
populate_messages_sent_by_message_type,
|
||||
);
|
||||
|
||||
get_chart_data(
|
||||
{chart_name: 'number_of_humans', min_length: '10'},
|
||||
populate_number_of_users
|
||||
populate_number_of_users,
|
||||
);
|
||||
|
||||
get_chart_data(
|
||||
{chart_name: 'messages_read_over_time', min_length: '10'},
|
||||
populate_messages_read_over_time
|
||||
populate_messages_read_over_time,
|
||||
);
|
||||
|
|
|
@ -318,7 +318,7 @@ exports.get_non_default_stream_names = function () {
|
|||
let subs = Array.from(stream_info.values());
|
||||
subs = subs.filter(
|
||||
(sub) =>
|
||||
!exports.is_default_stream_id(sub.stream_id) && (sub.subscribed || !sub.invite_only)
|
||||
!exports.is_default_stream_id(sub.stream_id) && (sub.subscribed || !sub.invite_only),
|
||||
);
|
||||
const names = subs.map((sub) => sub.name);
|
||||
return names;
|
||||
|
|
|
@ -175,7 +175,7 @@ exports.update_stream_description = function (sub) {
|
|||
const stream_settings = exports.settings_for_sub(sub);
|
||||
stream_settings.find('input.description').val(sub.description);
|
||||
stream_settings.find('.stream-description-editable').html(
|
||||
util.clean_user_content_links(sub.rendered_description)
|
||||
util.clean_user_content_links(sub.rendered_description),
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -569,7 +569,7 @@ exports.change_stream_description = function (e) {
|
|||
},
|
||||
error: function (xhr) {
|
||||
sub_settings.find('.stream-description-editable').html(
|
||||
util.clean_user_content_links(sub.rendered_description)
|
||||
util.clean_user_content_links(sub.rendered_description),
|
||||
);
|
||||
ui_report.error(i18n.t("Error"), xhr, $(".stream_change_property_info"));
|
||||
},
|
||||
|
|
|
@ -594,7 +594,7 @@ exports.register_topic_handlers = function () {
|
|||
num_after: 0,
|
||||
narrow: JSON.stringify(
|
||||
[{operator: "stream", operand: current_stream_id},
|
||||
{operator: "topic", operand: old_topic_name}]
|
||||
{operator: "topic", operand: old_topic_name}],
|
||||
),
|
||||
};
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ Handlebars.registerHelper('tr', (context, options) => {
|
|||
|
||||
Handlebars.registerHelper(
|
||||
"rendered_markdown",
|
||||
(content) => new Handlebars.SafeString(util.clean_user_content_links(content))
|
||||
(content) => new Handlebars.SafeString(util.clean_user_content_links(content)),
|
||||
);
|
||||
|
||||
window.templates = exports;
|
||||
|
|
|
@ -222,7 +222,7 @@ exports.get_next_topic = function (curr_stream, curr_topic) {
|
|||
get_unmuted_topics,
|
||||
has_unread_messages,
|
||||
curr_stream,
|
||||
curr_topic
|
||||
curr_topic,
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -243,7 +243,7 @@ exports.sort_people_for_relevance = function (objs, current_stream_name, current
|
|||
objs.sort((person_a, person_b) => exports.compare_people_for_relevance(
|
||||
person_a,
|
||||
person_b,
|
||||
exports.compare_by_pms
|
||||
exports.compare_by_pms,
|
||||
));
|
||||
} else {
|
||||
const stream_id = current_stream.stream_id;
|
||||
|
@ -255,9 +255,9 @@ exports.sort_people_for_relevance = function (objs, current_stream_name, current
|
|||
user_a,
|
||||
user_b,
|
||||
stream_id,
|
||||
current_topic
|
||||
current_topic,
|
||||
),
|
||||
current_stream.name
|
||||
current_stream.name,
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -296,7 +296,7 @@ exports.sort_recipients = function (
|
|||
current_stream,
|
||||
current_topic,
|
||||
groups,
|
||||
max_num_items
|
||||
max_num_items,
|
||||
) {
|
||||
if (!groups) {
|
||||
groups = [];
|
||||
|
|
|
@ -78,7 +78,7 @@ exports.display_notification = function (event) {
|
|||
TYPING_STARTED_EXPIRY_PERIOD,
|
||||
() => {
|
||||
exports.hide_notification(event);
|
||||
}
|
||||
},
|
||||
);
|
||||
};
|
||||
window.typing_events = exports;
|
||||
|
|
|
@ -141,7 +141,7 @@ exports.get_hotkey_deprecation_notice = function (originalHotkey, replacementHot
|
|||
return i18n.t(
|
||||
'We\'ve replaced the "__originalHotkey__" hotkey with "__replacementHotkey__" '
|
||||
+ 'to make this common shortcut easier to trigger.',
|
||||
{ originalHotkey: originalHotkey, replacementHotkey: replacementHotkey }
|
||||
{ originalHotkey: originalHotkey, replacementHotkey: replacementHotkey },
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -224,7 +224,7 @@ exports.initialize_kitchen_sink_stuff = function () {
|
|||
selected_id_from_idx: messages[event.msg_list.selected_idx()].id,
|
||||
msg_list_sorted: _.isEqual(
|
||||
messages.map((message) => message.id),
|
||||
_.chain(current_msg_list.all_messages()).pluck('id').clone().value().sort()
|
||||
_.chain(current_msg_list.all_messages()).pluck('id').clone().value().sort(),
|
||||
),
|
||||
found_in_dom: row_from_dom.length,
|
||||
});
|
||||
|
@ -386,41 +386,41 @@ exports.initialize_everything = function () {
|
|||
}
|
||||
|
||||
const alert_words_params = pop_fields(
|
||||
'alert_words'
|
||||
'alert_words',
|
||||
);
|
||||
|
||||
const bot_params = pop_fields(
|
||||
'realm_bots'
|
||||
'realm_bots',
|
||||
);
|
||||
|
||||
const people_params = pop_fields(
|
||||
'realm_users',
|
||||
'realm_non_active_users',
|
||||
'cross_realm_bots'
|
||||
'cross_realm_bots',
|
||||
);
|
||||
|
||||
const pm_conversations_params = pop_fields(
|
||||
'recent_private_conversations'
|
||||
'recent_private_conversations',
|
||||
);
|
||||
|
||||
const presence_params = pop_fields(
|
||||
'presences',
|
||||
'initial_servertime'
|
||||
'initial_servertime',
|
||||
);
|
||||
|
||||
const stream_data_params = pop_fields(
|
||||
'subscriptions',
|
||||
'unsubscribed',
|
||||
'never_subscribed',
|
||||
'realm_default_streams'
|
||||
'realm_default_streams',
|
||||
);
|
||||
|
||||
const user_groups_params = pop_fields(
|
||||
'realm_user_groups'
|
||||
'realm_user_groups',
|
||||
);
|
||||
|
||||
const user_status_params = pop_fields(
|
||||
'user_status'
|
||||
'user_status',
|
||||
);
|
||||
|
||||
alert_words.initialize(alert_words_params);
|
||||
|
@ -459,7 +459,7 @@ exports.initialize_everything = function () {
|
|||
emoji.initialize();
|
||||
markdown.initialize(
|
||||
page_params.realm_filters,
|
||||
markdown_config.get_helpers()
|
||||
markdown_config.get_helpers(),
|
||||
);
|
||||
compose.initialize();
|
||||
composebox_typeahead.initialize(); // Must happen after compose.initialize()
|
||||
|
|
|
@ -50,7 +50,7 @@ exports.generic_embed_error = function (error) {
|
|||
exports.generic_row_button_error = function (xhr, btn) {
|
||||
if (xhr.status.toString().charAt(0) === "4") {
|
||||
btn.closest("td").html(
|
||||
$("<p>").addClass("text-error").text(JSON.parse(xhr.responseText).msg)
|
||||
$("<p>").addClass("text-error").text(JSON.parse(xhr.responseText).msg),
|
||||
);
|
||||
} else {
|
||||
btn.text(i18n.t("Failed!"));
|
||||
|
|
|
@ -404,13 +404,13 @@ exports.update_unread_topics = function (msg, event) {
|
|||
}
|
||||
|
||||
exports.unread_topic_counter.delete(
|
||||
msg.id
|
||||
msg.id,
|
||||
);
|
||||
|
||||
exports.unread_topic_counter.add(
|
||||
new_stream_id || msg.stream_id,
|
||||
new_topic || msg.topic,
|
||||
msg.id
|
||||
msg.id,
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -430,7 +430,7 @@ exports.process_loaded_messages = function (messages) {
|
|||
exports.unread_topic_counter.add(
|
||||
message.stream_id,
|
||||
message.topic,
|
||||
message.id
|
||||
message.id,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ exports.setup_upload = function (config) {
|
|||
timedOut: i18n.t('Upload stalled for %{seconds} seconds, aborting.'),
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
uppy.use(ProgressBar, {
|
||||
|
|
|
@ -23,7 +23,7 @@ exports.build_widget = function (
|
|||
upload_button, // jQuery button to open file dialog
|
||||
preview_text = null,
|
||||
preview_image = null,
|
||||
max_file_upload_size
|
||||
max_file_upload_size,
|
||||
) {
|
||||
// default value of max uploaded file size
|
||||
max_file_upload_size = max_file_upload_size || default_max_file_size;
|
||||
|
@ -119,7 +119,7 @@ exports.build_direct_upload_widget = function (
|
|||
input_error, // jQuery object for error text
|
||||
upload_button, // jQuery button to open file dialog
|
||||
upload_function,
|
||||
max_file_upload_size
|
||||
max_file_upload_size,
|
||||
) {
|
||||
// default value of max uploaded file size
|
||||
max_file_upload_size = max_file_upload_size || default_max_file_size;
|
||||
|
|
|
@ -126,7 +126,7 @@ exports.update = (replace_content, find, new_dom, old_dom) => {
|
|||
const same_structure = exports.eq_array(
|
||||
new_opts.keyed_nodes,
|
||||
old_opts.keyed_nodes,
|
||||
(a, b) => a.key === b.key
|
||||
(a, b) => a.key === b.key,
|
||||
);
|
||||
|
||||
if (!same_structure) {
|
||||
|
@ -161,7 +161,7 @@ exports.update = (replace_content, find, new_dom, old_dom) => {
|
|||
exports.update_attrs(
|
||||
find(),
|
||||
new_opts.attrs,
|
||||
old_opts.attrs
|
||||
old_opts.attrs,
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ exports.validate_extra_data = function (data) {
|
|||
return schema.check_array(
|
||||
field_name,
|
||||
val,
|
||||
check_choice_item
|
||||
check_choice_item,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@ export function sort_emojis(objs, query) {
|
|||
const triage_results = triage(
|
||||
query,
|
||||
others,
|
||||
(x) => x.emoji_name
|
||||
(x) => x.emoji_name,
|
||||
);
|
||||
|
||||
return [
|
||||
|
|
|
@ -48,7 +48,7 @@ export function start_or_extend_idle_timer(worker) {
|
|||
}
|
||||
state.idle_timer = setTimeout(
|
||||
on_idle_timeout,
|
||||
TYPING_STOPPED_WAIT_PERIOD
|
||||
TYPING_STOPPED_WAIT_PERIOD,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -47,10 +47,10 @@ export default class DebugRequirePlugin {
|
|||
__dirname,
|
||||
"./debug-require.js",
|
||||
{},
|
||||
(err?: Error, result?: string) => err ? reject(err) : resolve(result)
|
||||
)
|
||||
(err?: Error, result?: string) => err ? reject(err) : resolve(result),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
compiler.hooks.compilation.tap("DebugRequirePlugin", (compilation: any) => {
|
||||
|
@ -72,7 +72,7 @@ export default class DebugRequirePlugin {
|
|||
}
|
||||
return false;
|
||||
},
|
||||
() => true
|
||||
() => true,
|
||||
);
|
||||
|
||||
if (debugRequireId === undefined) {
|
||||
|
@ -84,10 +84,10 @@ export default class DebugRequirePlugin {
|
|||
return Template.asString([
|
||||
source,
|
||||
`${requireFn}(${JSON.stringify(
|
||||
debugRequireId
|
||||
debugRequireId,
|
||||
)}).initialize(${JSON.stringify(Object.fromEntries(ids), null, "\t")});`,
|
||||
]);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue