lint: Add dangling commas in JavaScript objects.

This commit is contained in:
Tim Abbott 2017-01-11 15:17:43 -08:00
parent 7ca2d21d97
commit 998dff9e50
63 changed files with 302 additions and 302 deletions

View File

@ -45,7 +45,7 @@ casper.then(function () {
full_name: "IagoNew", full_name: "IagoNew",
old_password: test_credentials.default_user.password, old_password: test_credentials.default_user.password,
new_password: "qwertyuiop", new_password: "qwertyuiop",
confirm_password: "qwertyuiop" confirm_password: "qwertyuiop",
}); });
casper.click('input[name="change_settings"]'); casper.click('input[name="change_settings"]');
}); });
@ -76,7 +76,7 @@ casper.then(function () {
full_name: "Iago", full_name: "Iago",
old_password: "qwertyuiop", old_password: "qwertyuiop",
new_password: test_credentials.default_user.password, new_password: test_credentials.default_user.password,
confirm_password: test_credentials.default_user.password confirm_password: test_credentials.default_user.password,
}); });
casper.click('input[name="change_settings"]'); casper.click('input[name="change_settings"]');
}); });
@ -111,7 +111,7 @@ casper.then(function create_bot() {
bot_name: 'Bot 1', bot_name: 'Bot 1',
bot_short_name: '1', bot_short_name: '1',
bot_default_sending_stream: 'Denmark', bot_default_sending_stream: 'Denmark',
bot_default_events_register_stream: 'Rome' bot_default_events_register_stream: 'Rome',
}); });
casper.test.info('Submiting the create bot form'); casper.test.info('Submiting the create bot form');

View File

@ -150,7 +150,7 @@ casper.then(function () {
casper.waitForSelector('.admin-emoji-form', function () { casper.waitForSelector('.admin-emoji-form', function () {
casper.fill('form.admin-emoji-form', { casper.fill('form.admin-emoji-form', {
name: 'MouseFace', name: 'MouseFace',
url: 'http://zulipdev.com:9991/static/images/integrations/logos/jenkins.png' url: 'http://zulipdev.com:9991/static/images/integrations/logos/jenkins.png',
}); });
casper.click('form.admin-emoji-form input.button'); casper.click('form.admin-emoji-form input.button');
}); });
@ -180,7 +180,7 @@ casper.then(function () {
casper.waitForSelector('.admin-filter-form', function () { casper.waitForSelector('.admin-filter-form', function () {
casper.fill('form.admin-filter-form', { casper.fill('form.admin-filter-form', {
pattern: '#(?P<id>[0-9]+)', pattern: '#(?P<id>[0-9]+)',
url_format_string: 'https://trac.example.com/ticket/%(id)s' url_format_string: 'https://trac.example.com/ticket/%(id)s',
}); });
casper.click('form.admin-filter-form input.btn'); casper.click('form.admin-filter-form input.btn');
}); });
@ -202,7 +202,7 @@ casper.waitWhileSelector('.filter_row', function () {
casper.waitForSelector('.admin-filter-form', function () { casper.waitForSelector('.admin-filter-form', function () {
casper.fill('form.admin-filter-form', { casper.fill('form.admin-filter-form', {
pattern: 'a$', pattern: 'a$',
url_format_string: 'https://trac.example.com/ticket/%(id)s' url_format_string: 'https://trac.example.com/ticket/%(id)s',
}); });
casper.click('form.admin-filter-form input.btn'); casper.click('form.admin-filter-form input.btn');
}); });
@ -227,7 +227,7 @@ function select_from_suggestions(item) {
casper.evaluate(function (item) { casper.evaluate(function (item) {
var tah = $('.create_default_stream').data().typeahead; var tah = $('.create_default_stream').data().typeahead;
tah.mouseenter({ tah.mouseenter({
currentTarget: $('.typeahead:visible li:contains("'+item+'")')[0] currentTarget: $('.typeahead:visible li:contains("'+item+'")')[0],
}); });
tah.select(); tah.select();
}, {item: item}); }, {item: item});
@ -281,12 +281,12 @@ var content2 = 'admin: edit test message 2';
common.then_send_message('stream', { common.then_send_message('stream', {
stream: 'Verona', stream: 'Verona',
subject: 'edits', subject: 'edits',
content: content1 content: content1,
}); });
common.then_send_message('stream', { common.then_send_message('stream', {
stream: 'Verona', stream: 'Verona',
subject: 'edits', subject: 'edits',
content: content2 content: content2,
}); });
casper.then(function () { casper.then(function () {

View File

@ -263,7 +263,7 @@ activity.presence_info[norbert.user_id] = { status: activity.ACTIVE };
num_unread: 0, num_unread: 0,
type: 'active', type: 'active',
type_desc: 'is active', type_desc: 'is active',
mobile: undefined mobile: undefined,
}, },
{ {
name: 'Jill Hill', name: 'Jill Hill',
@ -271,7 +271,7 @@ activity.presence_info[norbert.user_id] = { status: activity.ACTIVE };
num_unread: 0, num_unread: 0,
type: 'active', type: 'active',
type_desc: 'is active', type_desc: 'is active',
mobile: undefined mobile: undefined,
}, },
{ {
name: 'Norbert Oswald', name: 'Norbert Oswald',
@ -279,7 +279,7 @@ activity.presence_info[norbert.user_id] = { status: activity.ACTIVE };
num_unread: 0, num_unread: 0,
type: 'active', type: 'active',
type_desc: 'is active', type_desc: 'is active',
mobile: undefined mobile: undefined,
}, },
{ {
name: 'Alice Smith', name: 'Alice Smith',
@ -287,7 +287,7 @@ activity.presence_info[norbert.user_id] = { status: activity.ACTIVE };
num_unread: 0, num_unread: 0,
type: 'idle', type: 'idle',
type_desc: 'is not active', type_desc: 'is not active',
mobile: undefined mobile: undefined,
}, },
{ {
name: 'Marky Mark', name: 'Marky Mark',
@ -295,7 +295,7 @@ activity.presence_info[norbert.user_id] = { status: activity.ACTIVE };
num_unread: 0, num_unread: 0,
type: 'idle', type: 'idle',
type_desc: 'is not active', type_desc: 'is not active',
mobile: undefined mobile: undefined,
}, },
]); ]);
}()); }());
@ -314,8 +314,8 @@ activity.presence_info[norbert.user_id] = { status: activity.ACTIVE };
num_unread: 0, num_unread: 0,
type: 'active', type: 'active',
type_desc: 'is active', type_desc: 'is active',
mobile: undefined mobile: undefined,
}, ]); } ]);
// Test if user index in presence_info is the expected one // Test if user index in presence_info is the expected one
var all_users = activity._filter_and_sort(activity.presence_info); var all_users = activity._filter_and_sort(activity.presence_info);
@ -331,8 +331,8 @@ activity.presence_info[norbert.user_id] = { status: activity.ACTIVE };
num_unread: 0, num_unread: 0,
type: 'active', type: 'active',
type_desc: 'is active', type_desc: 'is active',
mobile: undefined mobile: undefined,
}, ]); } ]);
all_users = activity._filter_and_sort(activity.presence_info); all_users = activity._filter_and_sort(activity.presence_info);
assert.equal(all_users.indexOf(mark.user_id.toString()), 3); assert.equal(all_users.indexOf(mark.user_id.toString()), 3);

View File

@ -35,24 +35,24 @@ var editability_types = message_edit.editability_types;
// For the rest of these tests, we only consider messages sent by the // For the rest of these tests, we only consider messages sent by the
// user, and that were successfully sent (i.e. no failed_request or local_id) // user, and that were successfully sent (i.e. no failed_request or local_id)
var message = { var message = {
sent_by_me: true sent_by_me: true,
}; };
global.page_params = { global.page_params = {
realm_allow_message_editing: false realm_allow_message_editing: false,
}; };
assert.equal(get_editability(message), editability_types.NO); assert.equal(get_editability(message), editability_types.NO);
global.page_params = { global.page_params = {
realm_allow_message_editing: true, realm_allow_message_editing: true,
// Limit of 0 means no time limit on editing messages // Limit of 0 means no time limit on editing messages
realm_message_content_edit_limit_seconds: 0 realm_message_content_edit_limit_seconds: 0,
}; };
assert.equal(get_editability(message), editability_types.FULL); assert.equal(get_editability(message), editability_types.FULL);
global.page_params = { global.page_params = {
realm_allow_message_editing: true, realm_allow_message_editing: true,
realm_message_content_edit_limit_seconds: 10 realm_message_content_edit_limit_seconds: 10,
}; };
var now = new Date(); var now = new Date();
var current_timestamp = now/1000; var current_timestamp = now/1000;

View File

@ -26,7 +26,7 @@ var settings = require("js/settings.js");
(function test_generate_zuliprc_content() { (function test_generate_zuliprc_content() {
var user = { var user = {
email: "admin12@chatting.net", email: "admin12@chatting.net",
api_key: "nSlA0mUm7G42LP85lMv7syqFTzDE2q34" api_key: "nSlA0mUm7G42LP85lMv7syqFTzDE2q34",
}; };
var content = settings.generate_zuliprc_content(user.email, user.api_key); var content = settings.generate_zuliprc_content(user.email, user.api_key);
var expected = "[api]\nemail=admin12@chatting.net\n" + var expected = "[api]\nemail=admin12@chatting.net\n" +

View File

@ -34,12 +34,12 @@ i18n.init({
var poland = { var poland = {
subscribed: true, subscribed: true,
name: 'Poland', name: 'Poland',
stream_id: 2 stream_id: 2,
}; };
var pomona = { var pomona = {
subscribed: true, subscribed: true,
name: 'Pomona', name: 'Pomona',
stream_id: 3 stream_id: 3,
}; };
var elem_1 = $(global.render_template("subscription", denmark)); var elem_1 = $(global.render_template("subscription", denmark));

View File

@ -562,7 +562,7 @@ function render(template_name, args) {
(function message_reaction() { (function message_reaction() {
var args = { var args = {
emoji_name: 'smile', emoji_name: 'smile',
message_id: '1' message_id: '1',
}; };
var html = ''; var html = '';

View File

@ -12,7 +12,7 @@ add_dependencies({
stream_data.create_streams([ stream_data.create_streams([
{name: 'Dev', subscribed: true, color: 'blue', stream_id: 1}, {name: 'Dev', subscribed: true, color: 'blue', stream_id: 1},
{name: 'Linux', subscribed: true, color: 'red', stream_id: 2} {name: 'Linux', subscribed: true, color: 'red', stream_id: 2},
]); ]);
var matches = [ var matches = [
@ -52,7 +52,7 @@ var matches = [
is_admin: false, is_admin: false,
is_bot: false, is_bot: false,
user_id: 6, user_id: 6,
} },
]; ];
_.each(matches, function (person) { _.each(matches, function (person) {
@ -74,7 +74,7 @@ _.each(matches, function (person) {
'b_bot@example.com', 'b_bot@example.com',
'a_user@zulip.org', 'a_user@zulip.org',
'zman@test.net', 'zman@test.net',
'a_bot@zulip.com' 'a_bot@zulip.com',
]); ]);
global.compose.stream_name = function () { return "Dev"; }; global.compose.stream_name = function () { return "Dev"; };
@ -86,7 +86,7 @@ _.each(matches, function (person) {
'b_bot@example.com', 'b_bot@example.com',
'a_user@zulip.org', 'a_user@zulip.org',
'zman@test.net', 'zman@test.net',
'a_bot@zulip.com' 'a_bot@zulip.com',
]); ]);
// No match // No match
@ -97,7 +97,7 @@ _.each(matches, function (person) {
'b_user_2@zulip.net', 'b_user_2@zulip.net',
'zman@test.net', 'zman@test.net',
'a_bot@zulip.com', 'a_bot@zulip.com',
'b_bot@example.com' 'b_bot@example.com',
]); ]);
}()); }());

View File

@ -26,7 +26,7 @@ function is_mobile(device) {
var presence_descriptions = { var presence_descriptions = {
active: 'is active', active: 'is active',
idle: 'is not active' idle: 'is not active',
}; };
/* Keep in sync with views.py:update_active_status_backend() */ /* Keep in sync with views.py:update_active_status_backend() */
@ -299,7 +299,7 @@ exports.update_users = function (user_list) {
num_unread: get_num_unread(user_id), num_unread: get_num_unread(user_id),
type: presence, type: presence,
type_desc: presence_descriptions[presence], type_desc: presence_descriptions[presence],
mobile: exports.presence_info[user_id].mobile mobile: exports.presence_info[user_id].mobile,
}; };
} }
@ -354,7 +354,7 @@ exports.update_huddles = function () {
user_ids_string: huddle, user_ids_string: huddle,
name: exports.full_huddle_name(huddle), name: exports.full_huddle_name(huddle),
fraction_present: exports.huddle_fraction_present(huddle, exports.presence_info), fraction_present: exports.huddle_fraction_present(huddle, exports.presence_info),
short_name: exports.short_huddle_name(huddle) short_name: exports.short_huddle_name(huddle),
}; };
}); });
@ -440,7 +440,7 @@ function focus_ping() {
}); });
exports.update_users(); exports.update_users();
exports.update_huddles(); exports.update_huddles();
} },
}); });
} }

View File

@ -138,7 +138,7 @@ exports.update_default_streams_table = function () {
function make_stream_default(stream_name) { function make_stream_default(stream_name) {
var data = { var data = {
stream_name: stream_name stream_name: stream_name,
}; };
channel.post({ channel.post({
@ -151,7 +151,7 @@ function make_stream_default(stream_name) {
} else { } else {
$(".active_stream_row button").text("Failed!"); $(".active_stream_row button").text("Failed!");
} }
} },
}); });
} }
@ -174,8 +174,8 @@ exports.populate_emoji = function (emoji_data) {
emoji: { emoji: {
name: name, source_url: data.source_url, name: name, source_url: data.source_url,
display_url: data.display_url, display_url: data.display_url,
author: data.author author: data.author,
} },
})); }));
}); });
loading.destroy_indicator($('#admin_page_emoji_loading_indicator')); loading.destroy_indicator($('#admin_page_emoji_loading_indicator'));
@ -191,8 +191,8 @@ exports.populate_filters = function (filters_data) {
filter: { filter: {
pattern: filter[0], pattern: filter[0],
url_format_string: filter[1], url_format_string: filter[1],
id: filter[2] id: filter[2],
} },
} }
) )
); );
@ -226,8 +226,8 @@ exports.populate_auth_methods = function (auth_methods) {
auth_methods_table.append(templates.render('admin_auth_methods_list', { auth_methods_table.append(templates.render('admin_auth_methods_list', {
method: { method: {
method: key, method: key,
enabled: auth_methods[key] enabled: auth_methods[key],
} },
})); }));
}); });
loading.destroy_indicator($('#admin_page_auth_methods_loading_indicator')); loading.destroy_indicator($('#admin_page_auth_methods_loading_indicator'));
@ -247,7 +247,7 @@ function _setup_page() {
Math.ceil(page_params.realm_message_content_edit_limit_seconds / 60), Math.ceil(page_params.realm_message_content_edit_limit_seconds / 60),
language_list: page_params.language_list, language_list: page_params.language_list,
realm_default_language: page_params.realm_default_language, realm_default_language: page_params.realm_default_language,
realm_waiting_period_threshold: page_params.realm_waiting_period_threshold realm_waiting_period_threshold: page_params.realm_waiting_period_threshold,
}; };
var admin_tab = templates.render('admin_tab', options); var admin_tab = templates.render('admin_tab', options);
$("#administration").html(admin_tab); $("#administration").html(admin_tab);
@ -284,7 +284,7 @@ function _setup_page() {
idempotent: true, idempotent: true,
timeout: 10*1000, timeout: 10*1000,
success: populate_users, success: populate_users,
error: failed_listing_users error: failed_listing_users,
}); });
// Populate streams table // Populate streams table
@ -293,7 +293,7 @@ function _setup_page() {
timeout: 10*1000, timeout: 10*1000,
idempotent: true, idempotent: true,
success: populate_streams, success: populate_streams,
error: failed_listing_streams error: failed_listing_streams,
}); });
// Populate authentication methods table // Populate authentication methods table
@ -362,7 +362,7 @@ function _setup_page() {
success: function () { success: function () {
var row = $(".active_default_stream_row"); var row = $(".active_default_stream_row");
row.remove(); row.remove();
} },
}); });
}); });
@ -382,7 +382,7 @@ function _setup_page() {
highlight: true, highlight: true,
updater: function (stream_name) { updater: function (stream_name) {
make_stream_default(stream_name); make_stream_default(stream_name);
} },
}); });
$("#do_deactivate_user_button").expectOne().click(function () { $("#do_deactivate_user_button").expectOne().click(function () {
@ -413,7 +413,7 @@ function _setup_page() {
button.text(i18n.t("Reactivate")); button.text(i18n.t("Reactivate"));
meta.current_deactivate_user_modal_row.addClass("deactivated_user"); meta.current_deactivate_user_modal_row.addClass("deactivated_user");
meta.current_deactivate_user_modal_row.find(".user-admin-settings").hide(); meta.current_deactivate_user_modal_row.find(".user-admin-settings").hide();
} },
}); });
}); });
@ -444,7 +444,7 @@ function _setup_page() {
button.removeClass("deactivate"); button.removeClass("deactivate");
button.text(i18n.t("Reactivate")); button.text(i18n.t("Reactivate"));
row.addClass("deactivated_user"); row.addClass("deactivated_user");
} },
}); });
}); });
@ -477,7 +477,7 @@ function _setup_page() {
button.removeClass("reactivate"); button.removeClass("reactivate");
button.text(i18n.t("Deactivate")); button.text(i18n.t("Deactivate"));
row.removeClass("deactivated_user"); row.removeClass("deactivated_user");
} },
}); });
}); });
@ -566,7 +566,7 @@ function _setup_page() {
message_content_edit_limit_seconds: message_content_edit_limit_seconds:
JSON.stringify(parseInt(new_message_content_edit_limit_minutes, 10) * 60), JSON.stringify(parseInt(new_message_content_edit_limit_minutes, 10) * 60),
default_language: JSON.stringify(new_default_language), default_language: JSON.stringify(new_default_language),
waiting_period_threshold: JSON.stringify(parseInt(new_waiting_period_threshold, 10)) waiting_period_threshold: JSON.stringify(parseInt(new_waiting_period_threshold, 10)),
}; };
channel.patch({ channel.patch({
@ -665,7 +665,7 @@ function _setup_page() {
} else { } else {
ui.report_error(i18n.t("Failed!"), xhr, name_status); ui.report_error(i18n.t("Failed!"), xhr, name_status);
} }
} },
}); });
}); });
@ -679,7 +679,7 @@ function _setup_page() {
var url = "/json/users/" + email; var url = "/json/users/" + email;
var data = { var data = {
is_admin: JSON.stringify(true) is_admin: JSON.stringify(true),
}; };
channel.patch({ channel.patch({
@ -696,7 +696,7 @@ function _setup_page() {
error: function (xhr) { error: function (xhr) {
var status = row.find(".admin-user-status"); var status = row.find(".admin-user-status");
ui.report_error(i18n.t("Failed!"), xhr, status); ui.report_error(i18n.t("Failed!"), xhr, status);
} },
}); });
}); });
@ -710,7 +710,7 @@ function _setup_page() {
var url = "/json/users/" + email; var url = "/json/users/" + email;
var data = { var data = {
is_admin: JSON.stringify(false) is_admin: JSON.stringify(false),
}; };
channel.patch({ channel.patch({
@ -727,7 +727,7 @@ function _setup_page() {
error: function (xhr) { error: function (xhr) {
var status = row.find(".admin-user-status"); var status = row.find(".admin-user-status");
ui.report_error(i18n.t("Failed!"), xhr, status); ui.report_error(i18n.t("Failed!"), xhr, status);
} },
}); });
}); });
@ -756,7 +756,7 @@ function _setup_page() {
var url = "/json/users/" + email; var url = "/json/users/" + email;
var data = { var data = {
full_name: JSON.stringify(full_name.val()) full_name: JSON.stringify(full_name.val()),
}; };
channel.patch({ channel.patch({
@ -765,7 +765,7 @@ function _setup_page() {
success: function () { success: function () {
ui.report_success(i18n.t('Name successfully updated!'), admin_status); ui.report_success(i18n.t('Name successfully updated!'), admin_status);
}, },
error: failed_changing_name error: failed_changing_name,
}); });
}); });
}); });
@ -792,7 +792,7 @@ function _setup_page() {
success: function () { success: function () {
var row = $(".active_stream_row"); var row = $(".active_stream_row");
row.remove(); row.remove();
} },
}); });
}); });
@ -815,7 +815,7 @@ function _setup_page() {
success: function () { success: function () {
var row = btn.parents('tr'); var row = btn.parents('tr');
row.remove(); row.remove();
} },
}); });
}); });
@ -841,7 +841,7 @@ function _setup_page() {
var errors = JSON.parse(xhr.responseText).msg; var errors = JSON.parse(xhr.responseText).msg;
xhr.responseText = JSON.stringify({msg: errors}); xhr.responseText = JSON.stringify({msg: errors});
ui.report_error(i18n.t("Failed!"), xhr, emoji_status); ui.report_error(i18n.t("Failed!"), xhr, emoji_status);
} },
}); });
}); });
@ -864,7 +864,7 @@ function _setup_page() {
success: function () { success: function () {
var row = btn.parents('tr'); var row = btn.parents('tr');
row.remove(); row.remove();
} },
}); });
}); });
@ -903,7 +903,7 @@ function _setup_page() {
xhr.responseText = JSON.stringify({msg: errors.__all__}); xhr.responseText = JSON.stringify({msg: errors.__all__});
ui.report_error(i18n.t("Failed"), xhr, filter_status); ui.report_error(i18n.t("Failed"), xhr, filter_status);
} }
} },
}); });
}); });
@ -922,7 +922,7 @@ function _setup_page() {
aliases_info.removeClass("text-success"); aliases_info.removeClass("text-success");
aliases_info.addClass("text-error"); aliases_info.addClass("text-error");
aliases_info.text(JSON.parse(xhr.responseText).msg); aliases_info.text(JSON.parse(xhr.responseText).msg);
} },
}); });
}); });
@ -945,7 +945,7 @@ function _setup_page() {
aliases_info.removeClass("text-success"); aliases_info.removeClass("text-success");
aliases_info.addClass("text-error"); aliases_info.addClass("text-error");
aliases_info.text(JSON.parse(xhr.responseText).msg); aliases_info.text(JSON.parse(xhr.responseText).msg);
} },
}); });
}); });

View File

@ -12,7 +12,7 @@ function is_image_format(file) {
'image/jpeg', 'image/jpeg',
'image/png', 'image/png',
'image/gif', 'image/gif',
'image/tiff' 'image/tiff',
]; ];
return _.indexOf(supported_types, type) >= 0; return _.indexOf(supported_types, type) >= 0;
} }
@ -138,7 +138,7 @@ exports.build_widget = function (
clear: clear, clear: clear,
// Call back to close() when you are truly done with the widget, // Call back to close() when you are truly done with the widget,
// so you can release handlers. // so you can release handlers.
close: close close: close,
}; };
}; };
@ -162,7 +162,7 @@ exports.build_user_avatar_widget = function (upload_function) {
// where you try to upload the same image you just deleted. // where you try to upload the same image you just deleted.
var file_input = $("#user_avatar_file_input"); var file_input = $("#user_avatar_file_input");
file_input.replaceWith(file_input.clone(true)); file_input.replaceWith(file_input.clone(true));
} },
}); });
}); });

View File

@ -382,8 +382,8 @@ $(function () {
relay_url: "https://webathena.mit.edu/relay.html", relay_url: "https://webathena.mit.edu/relay.html",
params: { params: {
realm: "ATHENA.MIT.EDU", realm: "ATHENA.MIT.EDU",
principal: principal principal: principal,
} },
}, function (err, r) { }, function (err, r) {
if (err) { if (err) {
blueslip.warn(err); blueslip.warn(err);
@ -402,7 +402,7 @@ $(function () {
}, },
error: function () { error: function () {
$("#zephyr-mirror-error").show(); $("#zephyr-mirror-error").show();
} },
}); });
}); });
$('#settings-dropdown').dropdown("toggle"); $('#settings-dropdown').dropdown("toggle");
@ -440,13 +440,13 @@ $(function () {
if ($target.parent().hasClass("youtube-video")) { if ($target.parent().hasClass("youtube-video")) {
ui.lightbox({ ui.lightbox({
type: "youtube", type: "youtube",
id: $target.data("id") id: $target.data("id"),
}); });
} else { } else {
ui.lightbox({ ui.lightbox({
type: "photo", type: "photo",
image: img, image: img,
user: user user: user,
}); });
} }
}); });

View File

@ -22,7 +22,7 @@ exports.toggle = (function () {
var meta = { var meta = {
retrieved: false, retrieved: false,
$ind_tab: component.find(".ind-tab") $ind_tab: component.find(".ind-tab"),
}; };
(function () { (function () {
@ -56,14 +56,14 @@ exports.toggle = (function () {
}, },
get: function () { get: function () {
return component; return component;
} },
}; };
if (opts.name) { if (opts.name) {
keys[opts.name] = { keys[opts.name] = {
opts: opts, opts: opts,
component: component, component: component,
value: prototype.value value: prototype.value,
}; };
} }

View File

@ -191,7 +191,7 @@ function update_fade() {
$(function () { $(function () {
$('#stream,#subject,#private_message_recipient').bind({ $('#stream,#subject,#private_message_recipient').bind({
keyup: update_fade, keyup: update_fade,
change: update_fade change: update_fade,
}); });
}); });
@ -201,7 +201,7 @@ function fill_in_opts_from_current_narrowed_view(msg_type, opts) {
stream: '', stream: '',
subject: '', subject: '',
private_message_recipient: '', private_message_recipient: '',
trigger: 'unknown' trigger: 'unknown',
}; };
// Set default parameters based on the current narrowed view. // Set default parameters based on the current narrowed view.
@ -424,7 +424,7 @@ function send_message_ajax(request, success, error) {
var response = channel.xhr_error_message("Error sending message", xhr); var response = channel.xhr_error_message("Error sending message", xhr);
error(response); error(response);
} },
}); });
} }
@ -438,7 +438,7 @@ function report_send_time(send_time, receive_time, display_time, locally_echoed,
} }
channel.post({ channel.post({
url: '/json/report_send_time', url: '/json/report_send_time',
data: data data: data,
}); });
} }
@ -751,7 +751,7 @@ exports.check_stream_existence = function (stream_name, autosubscribe) {
} else { } else {
result = "error"; result = "error";
} }
} },
}); });
return result; return result;
}; };
@ -1053,7 +1053,7 @@ $(function () {
loading.destroy_indicator($("#markdown_preview_spinner")); loading.destroy_indicator($("#markdown_preview_spinner"));
} }
$("#preview_content").html(i18n.t("Failed to generate preview")); $("#preview_content").html(i18n.t("Failed to generate preview"));
} },
}); });
} }
}); });
@ -1076,7 +1076,7 @@ $(function () {
// Optional. A value of false (default) limits selection to a single file, while // Optional. A value of false (default) limits selection to a single file, while
// true enables multiple file selection. // true enables multiple file selection.
multiselect: true, multiselect: true,
iframe: true iframe: true,
}; };
Dropbox.choose(options); Dropbox.choose(options);
}); });
@ -1174,7 +1174,7 @@ $(function () {
maxfilesize: page_params.maxfilesize, maxfilesize: page_params.maxfilesize,
data: { data: {
// the token isn't automatically included in filedrop's post // the token isn't automatically included in filedrop's post
csrfmiddlewaretoken: csrf_token csrfmiddlewaretoken: csrf_token,
}, },
raw_droppable: ['text/uri-list', 'text/plain'], raw_droppable: ['text/uri-list', 'text/plain'],
drop: uploadStarted, drop: uploadStarted,
@ -1188,7 +1188,7 @@ $(function () {
} }
textbox.val(textbox.val() + contents); textbox.val(textbox.val() + contents);
exports.autosize_textarea(); exports.autosize_textarea();
} },
}); });
if (page_params.narrow !== undefined) { if (page_params.narrow !== undefined) {

View File

@ -16,7 +16,7 @@ exports.set_focused_recipient = function (msg_type) {
// Construct focused_recipient as a mocked up element which has all the // Construct focused_recipient as a mocked up element which has all the
// fields of a message used by util.same_recipient() // fields of a message used by util.same_recipient()
focused_recipient = { focused_recipient = {
type: msg_type type: msg_type,
}; };
if (focused_recipient.type === "stream") { if (focused_recipient.type === "stream") {

View File

@ -251,12 +251,12 @@ exports.compose_content_begins_typeahead = function (query) {
// Always sort above, under the assumption that names will // Always sort above, under the assumption that names will
// be longer and only contain "all" as a substring. // be longer and only contain "all" as a substring.
pm_recipient_count: Infinity, pm_recipient_count: Infinity,
full_name: "all" full_name: "all",
}; };
var everyone_item = { var everyone_item = {
special_item_text: "everyone (Notify everyone)", special_item_text: "everyone (Notify everyone)",
email: "everyone", email: "everyone",
full_name: "everyone" full_name: "everyone",
}; };
var persons = people.get_realm_persons(); var persons = people.get_realm_persons();
return [].concat(persons, [all_item, everyone_item]); return [].concat(persons, [all_item, everyone_item]);
@ -349,7 +349,7 @@ exports.initialize_compose_typeahead = function (selector, completions) {
}, },
updater: exports.content_typeahead_selected, updater: exports.content_typeahead_selected,
stopAdvance: true, // Do not advance to the next field on a tab or enter stopAdvance: true, // Do not advance to the next field on a tab or enter
completions: completions completions: completions,
}); });
}; };
@ -378,7 +378,7 @@ exports.initialize = function () {
return channel.post({ return channel.post({
url: '/json/users/me/enter-sends', url: '/json/users/me/enter-sends',
idempotent: true, idempotent: true,
data: {enter_sends: page_params.enter_sends} data: {enter_sends: page_params.enter_sends},
}); });
}); });
$("#enter_sends").prop('checked', page_params.enter_sends); $("#enter_sends").prop('checked', page_params.enter_sends);
@ -402,7 +402,7 @@ exports.initialize = function () {
// because we want to avoid mixing up streams. // because we want to avoid mixing up streams.
var q = this.query.trim().toLowerCase(); var q = this.query.trim().toLowerCase();
return (item.toLowerCase().indexOf(q) === 0); return (item.toLowerCase().indexOf(q) === 0);
} },
}); });
$( "#subject" ).typeahead({ $( "#subject" ).typeahead({
@ -419,7 +419,7 @@ exports.initialize = function () {
sorted.unshift(this.query); sorted.unshift(this.query);
} }
return sorted; return sorted;
} },
}); });
$( "#private_message_recipient" ).typeahead({ $( "#private_message_recipient" ).typeahead({
@ -459,7 +459,7 @@ exports.initialize = function () {
} }
return previous_recipients + item.email + ", "; return previous_recipients + item.email + ", ";
}, },
stopAdvance: true // Do not advance to the next field on a tab or enter stopAdvance: true, // Do not advance to the next field on a tab or enter
}); });
exports.initialize_compose_typeahead("#new_message_content", {mention: true, emoji: true, stream: true}); exports.initialize_compose_typeahead("#new_message_content", {mention: true, emoji: true, stream: true});

View File

@ -13,8 +13,8 @@ var exports = {};
channel.post({ channel.post({
url: '/json/users/me/subscriptions', url: '/json/users/me/subscriptions',
data: { data: {
subscriptions: JSON.stringify([{name: stream_name}]) subscriptions: JSON.stringify([{name: stream_name}]),
} },
}).then( }).then(
function (data) { function (data) {
if (!$.isEmptyObject(data.already_subscribed)) { if (!$.isEmptyObject(data.already_subscribed)) {
@ -33,8 +33,8 @@ var exports = {};
channel.del({ channel.del({
url: '/json/users/me/subscriptions', url: '/json/users/me/subscriptions',
data: { data: {
subscriptions: JSON.stringify([stream_name]) subscriptions: JSON.stringify([stream_name]),
} },
}).then( }).then(
function () { function () {
$status_message.hide(); $status_message.hide();

View File

@ -43,7 +43,7 @@ function check_duplicate_ids() {
id: o.id, id: o.id,
count: 1, count: 1,
node: "<" + tag + " className='" + o.className + "' id='" + o.id + "'>" + node: "<" + tag + " className='" + o.className + "' id='" + o.id + "'>" +
"</" + tag + ">" "</" + tag + ">",
}); });
} else { } else {
el.count += 1; el.count += 1;
@ -55,7 +55,7 @@ function check_duplicate_ids() {
return { return {
collisions: collisions, collisions: collisions,
total_collisions: total_collisions total_collisions: total_collisions,
}; };
} }
@ -129,5 +129,5 @@ IterationProfiler.prototype = {
console.log(prop, this.sections[prop]); console.log(prop, this.sections[prop]);
} }
} }
} },
}; };

View File

@ -121,7 +121,7 @@ Dict.prototype = {
return _.each(this._items, function (mapping) { return _.each(this._items, function (mapping) {
f(mapping.v, mapping.k); f(mapping.v, mapping.k);
}); });
} },
}; };
}()); }());

View File

@ -18,7 +18,7 @@ var bugdown_re = [
/[^\s]*(?:\.bmp|\.gif|\.jpg|\.jpeg|\.png|\.webp)\s+/m, /[^\s]*(?:\.bmp|\.gif|\.jpg|\.jpeg|\.png|\.webp)\s+/m,
/[^\s]*(?:\.bmp|\.gif|\.jpg|\.jpeg|\.png|\.webp)$/m, /[^\s]*(?:\.bmp|\.gif|\.jpg|\.jpeg|\.png|\.webp)$/m,
// Twitter and youtube links are given previews // Twitter and youtube links are given previews
/[^\s]*(?:twitter|youtube).com\/[^\s]*/ /[^\s]*(?:twitter|youtube).com\/[^\s]*/,
]; ];
exports.contains_bugdown = function contains_bugdown(content) { exports.contains_bugdown = function contains_bugdown(content) {
@ -417,7 +417,7 @@ $(function () {
function disable_markdown_regex(rules, name) { function disable_markdown_regex(rules, name) {
rules[name] = {exec: function () { rules[name] = {exec: function () {
return false; return false;
} },
}; };
} }
@ -500,7 +500,7 @@ $(function () {
streamHandler: handleStream, streamHandler: handleStream,
realmFilterHandler: handleRealmFilter, realmFilterHandler: handleRealmFilter,
renderer: r, renderer: r,
preprocessors: [preprocess_code_blocks] preprocessors: [preprocess_code_blocks],
}); });
function on_failed_action(action, callback) { function on_failed_action(action, callback) {

View File

@ -18,7 +18,7 @@ var unicode_emoji_names = ["1f198", "1f3ed", "0034", "1f341", "1f3d7", "26f9", "
emoji_names.push("zulip"); emoji_names.push("zulip");
exports.realm_emojis.zulip = { exports.realm_emojis.zulip = {
emoji_name: 'zulip', emoji_name: 'zulip',
emoji_url: '/static/third/gemoji/images/emoji/zulip.png' emoji_url: '/static/third/gemoji/images/emoji/zulip.png',
}; };
_.each(emoji_names, function (value) { _.each(emoji_names, function (value) {

View File

@ -87,7 +87,7 @@ exports.process_fenced_code = function (content) {
output_lines.push(text); output_lines.push(text);
output_lines.push(''); output_lines.push('');
handler_stack.pop(); handler_stack.pop();
} },
}; };
} }
return { return {
@ -107,7 +107,7 @@ exports.process_fenced_code = function (content) {
output_lines.push(placeholder); output_lines.push(placeholder);
output_lines.push(''); output_lines.push('');
handler_stack.pop(); handler_stack.pop();
} },
}; };
}()); }());
} }
@ -119,7 +119,7 @@ exports.process_fenced_code = function (content) {
}, },
done: function () { done: function () {
handler_stack.pop(); handler_stack.pop();
} },
}; };
} }

View File

@ -175,7 +175,7 @@ Filter.canonicalize_term = function (opts) {
return { return {
negated: negated, negated: negated,
operator: operator, operator: operator,
operand: operand operand: operand,
}; };
}; };
@ -373,7 +373,7 @@ Filter.prototype = {
return ok; return ok;
}); });
}; };
} },
}; };
Filter.operator_to_prefix = function (operator, negated) { Filter.operator_to_prefix = function (operator, negated) {

View File

@ -146,7 +146,7 @@ function do_hashchange(from_reload) {
var narrow_opts = { var narrow_opts = {
select_first_unread: true, select_first_unread: true,
change_hash: false, // already set change_hash: false, // already set
trigger: 'hash change' trigger: 'hash change',
}; };
if (from_reload !== undefined && page_params.initial_narrow_pointer !== undefined) { if (from_reload !== undefined && page_params.initial_narrow_pointer !== undefined) {
narrow_opts.from_reload = true; narrow_opts.from_reload = true;
@ -187,7 +187,7 @@ function do_hashchange(from_reload) {
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- // // -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- //
var ignore = { var ignore = {
flag: false, flag: false,
prev: null prev: null,
}; };
function get_main_hash(hash) { function get_main_hash(hash) {

View File

@ -12,7 +12,7 @@ var actions_dropdown_hotkeys = [
'up_arrow', 'up_arrow',
'vim_up', 'vim_up',
'vim_down', 'vim_down',
'enter' 'enter',
]; ];
// Note that multiple keys can map to the same event_name, which // Note that multiple keys can map to the same event_name, which
@ -22,7 +22,7 @@ var actions_dropdown_hotkeys = [
var hotkeys_shift = { var hotkeys_shift = {
// these can be triggered by shift + key only // these can be triggered by shift + key only
9: {name: 'shift_tab', message_view_only: false}, // tab 9: {name: 'shift_tab', message_view_only: false}, // tab
32: {name: 'page_up', message_view_only: true} // space bar 32: {name: 'page_up', message_view_only: true}, // space bar
}; };
var hotkeys_no_modifiers = { var hotkeys_no_modifiers = {
// these can be triggered by key only (without shift) // these can be triggered by key only (without shift)
@ -33,7 +33,7 @@ var hotkeys_no_modifiers = {
35: {name: 'end', message_view_only: true}, // end 35: {name: 'end', message_view_only: true}, // end
36: {name: 'home', message_view_only: true}, // home 36: {name: 'home', message_view_only: true}, // home
38: {name: 'up_arrow', message_view_only: true}, // up arrow 38: {name: 'up_arrow', message_view_only: true}, // up arrow
40: {name: 'down_arrow', message_view_only: true} // down arrow 40: {name: 'down_arrow', message_view_only: true}, // down arrow
}; };
var hotkeys_shift_insensitive = { var hotkeys_shift_insensitive = {
// these can be triggered by key or shift + key // these can be triggered by key or shift + key
@ -59,7 +59,7 @@ var hotkeys_shift_insensitive = {
114: {name: 'reply_message', message_view_only: true}, // 'r' 114: {name: 'reply_message', message_view_only: true}, // 'r'
115: {name: 'narrow_by_recipient', message_view_only: true}, // 's' 115: {name: 'narrow_by_recipient', message_view_only: true}, // 's'
118: {name: 'narrow_private', message_view_only: true}, // 'v' 118: {name: 'narrow_private', message_view_only: true}, // 'v'
119: {name: 'query_streams', message_view_only: false} // 'w' 119: {name: 'query_streams', message_view_only: false}, // 'w'
}; };
var tab_up_down = (function () { var tab_up_down = (function () {
@ -76,7 +76,7 @@ var tab_up_down = (function () {
}, },
prev: function () { prev: function () {
return $target.closest("li").prev().find("a"); return $target.closest("li").prev().find("a");
} },
}; };
}; };
}()); }());

View File

@ -110,7 +110,7 @@ exports.initialize = function () {
} }
} },
}); });
$(document).on('click', '.invite_check_all_button', function (e) { $(document).on('click', '.invite_check_all_button', function (e) {

View File

@ -12,7 +12,7 @@ var editability_types = {
// Similar story for messages whose topic you can change only because // Similar story for messages whose topic you can change only because
// you are an admin. // you are an admin.
TOPIC_ONLY: 3, TOPIC_ONLY: 3,
FULL: 4 FULL: 4,
}; };
exports.editability_types = editability_types; exports.editability_types = editability_types;
@ -120,7 +120,7 @@ exports.save = function (row, from_topic_edited_only) {
var message = channel.xhr_error_message("Error saving edit", xhr); var message = channel.xhr_error_message("Error saving edit", xhr);
row.find(".edit_error").text(message).show(); row.find(".edit_error").text(message).show();
} }
} },
}); });
// The message will automatically get replaced via message_list.update_message. // The message will automatically get replaced via message_list.update_message.
}; };
@ -220,7 +220,7 @@ function edit_message(row, raw_content) {
animation: false, animation: false,
placement: 'left', placement: 'left',
template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div>' + template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div>' +
'<div class="tooltip-inner message-edit-tooltip-inner"></div></div>' '<div class="tooltip-inner message-edit-tooltip-inner"></div></div>',
}); });
} }
@ -313,7 +313,7 @@ exports.start = function (row) {
message.raw_content = data.raw_content; message.raw_content = data.raw_content;
start_edit_maintaining_scroll(row, data.raw_content); start_edit_maintaining_scroll(row, data.raw_content);
} }
} },
}); });
}; };

View File

@ -31,7 +31,7 @@ function batched_updater(flag, op, immediate) {
data: {messages: JSON.stringify(real_msg_ids), data: {messages: JSON.stringify(real_msg_ids),
op: op, op: op,
flag: flag}, flag: flag},
success: on_success success: on_success,
}); });
} }

View File

@ -7,7 +7,7 @@ exports.narrowed = undefined;
exports.MessageList = function (table_name, filter, opts) { exports.MessageList = function (table_name, filter, opts) {
_.extend(this, { _.extend(this, {
collapse_messages: true, collapse_messages: true,
muting_enabled: true muting_enabled: true,
}, opts); }, opts);
this.view = new MessageListView(this, table_name, this.collapse_messages); this.view = new MessageListView(this, table_name, this.collapse_messages);
@ -150,11 +150,11 @@ exports.MessageList.prototype = {
use_closest: false, use_closest: false,
empty_ok: false, empty_ok: false,
mark_read: true, mark_read: true,
force_rerender: false force_rerender: false,
}, opts, { }, opts, {
id: id, id: id,
msg_list: this, msg_list: this,
previously_selected: this._selected_id previously_selected: this._selected_id,
}); });
id = parseFloat(id); id = parseFloat(id);
@ -179,7 +179,7 @@ exports.MessageList.prototype = {
var error_data = { var error_data = {
table_name: this.table_name, table_name: this.table_name,
id: id, id: id,
items_length: this._items.length items_length: this._items.length,
}; };
blueslip.fatal("Cannot select id -1", error_data); blueslip.fatal("Cannot select id -1", error_data);
} }
@ -621,7 +621,7 @@ exports.MessageList.prototype = {
} }
} }
}, 0); }, 0);
} },
}; };
exports.all = new exports.MessageList( exports.all = new exports.MessageList(

View File

@ -130,7 +130,7 @@ MessageListView.prototype = {
function start_group() { function start_group() {
return { return {
message_containers: [], message_containers: [],
message_group_id: _.uniqueId('message_group_') message_group_id: _.uniqueId('message_group_'),
}; };
} }
@ -280,7 +280,7 @@ MessageListView.prototype = {
prepend_groups: [], prepend_groups: [],
rerender_groups: [], rerender_groups: [],
append_messages: [], append_messages: [],
rerender_messages: [] rerender_messages: [],
}; };
var first_group; var first_group;
var second_group; var second_group;
@ -446,7 +446,7 @@ MessageListView.prototype = {
rendered_groups = $(templates.render('message_group', { rendered_groups = $(templates.render('message_group', {
message_groups: message_actions.prepend_groups, message_groups: message_actions.prepend_groups,
use_match_properties: self.list.filter.is_search(), use_match_properties: self.list.filter.is_search(),
table_name: self.table_name table_name: self.table_name,
})); }));
dom_messages = rendered_groups.find('.message_row'); dom_messages = rendered_groups.find('.message_row');
@ -473,7 +473,7 @@ MessageListView.prototype = {
rendered_groups = $(templates.render('message_group', { rendered_groups = $(templates.render('message_group', {
message_groups: [message_group], message_groups: [message_group],
use_match_properties: self.list.filter.is_search(), use_match_properties: self.list.filter.is_search(),
table_name: self.table_name table_name: self.table_name,
})); }));
dom_messages = rendered_groups.find('.message_row'); dom_messages = rendered_groups.find('.message_row');
@ -529,7 +529,7 @@ MessageListView.prototype = {
rendered_groups = $(templates.render('message_group', { rendered_groups = $(templates.render('message_group', {
message_groups: message_actions.append_groups, message_groups: message_actions.append_groups,
use_match_properties: self.list.filter.is_search(), use_match_properties: self.list.filter.is_search(),
table_name: self.table_name table_name: self.table_name,
})); }));
dom_messages = rendered_groups.find('.message_row'); dom_messages = rendered_groups.find('.message_row');
@ -896,7 +896,7 @@ MessageListView.prototype = {
var rendered_trailing_bookend = $(templates.render('bookend', { var rendered_trailing_bookend = $(templates.render('bookend', {
bookend_content: trailing_bookend_content, bookend_content: trailing_bookend_content,
trailing: true, trailing: true,
subscribed: subscribed subscribed: subscribed,
})); }));
rows.get_table(this.table_name).append(rendered_trailing_bookend); rows.get_table(this.table_name).append(rendered_trailing_bookend);
}, },
@ -936,7 +936,7 @@ MessageListView.prototype = {
} else { } else {
message_container.status_message = false; message_container.status_message = false;
} }
} },
}; };
}()); }());

View File

@ -267,7 +267,7 @@ exports.update_messages = function update_messages(events) {
var operators = new_filter.operators(); var operators = new_filter.operators();
var opts = { var opts = {
trigger: 'topic change', trigger: 'topic change',
then_select_id: current_id then_select_id: current_id,
}; };
narrow.activate(operators, opts); narrow.activate(operators, opts);
changed_narrow = true; changed_narrow = true;
@ -496,7 +496,7 @@ exports.load_old_messages = function load_old_messages(opts) {
setTimeout(function () { setTimeout(function () {
exports.load_old_messages(opts); exports.load_old_messages(opts);
}, 5000); }, 5000);
} },
}); });
}; };
@ -529,7 +529,7 @@ exports.load_more_messages = function load_more_messages(msg_list) {
if (messages.length >= batch_size) { if (messages.length >= batch_size) {
load_more_enabled = true; load_more_enabled = true;
} }
} },
}); });
}; };
@ -561,7 +561,7 @@ util.execute_early(function () {
num_before: 0, num_before: 0,
num_after: 400, num_after: 400,
msg_list: home_msg_list, msg_list: home_msg_list,
cont: load_more cont: load_more,
}); });
return; return;
} }
@ -578,7 +578,7 @@ util.execute_early(function () {
anchor: first_id, anchor: first_id,
num_before: backfill_batch_size, num_before: backfill_batch_size,
num_after: 0, num_after: 0,
msg_list: home_msg_list msg_list: home_msg_list,
}); });
}}); }});
} }
@ -589,7 +589,7 @@ util.execute_early(function () {
num_before: 200, num_before: 200,
num_after: 200, num_after: 200,
msg_list: home_msg_list, msg_list: home_msg_list,
cont: load_more cont: load_more,
}); });
} else { } else {
server_events.home_view_loaded(); server_events.home_view_loaded();

View File

@ -22,7 +22,7 @@ exports.notify_with_undo_option = (function () {
topic: null, topic: null,
hide_me_time: null, hide_me_time: null,
alert_hover_state: false, alert_hover_state: false,
$mute: null $mute: null,
}; };
var animate = { var animate = {
fadeOut: function () { fadeOut: function () {
@ -34,7 +34,7 @@ exports.notify_with_undo_option = (function () {
if (meta.$mute) { if (meta.$mute) {
meta.$mute.fadeIn(500).addClass("show"); meta.$mute.fadeIn(500).addClass("show");
} }
} },
}; };
setInterval(function () { setInterval(function () {
if (meta.hide_me_time < new Date().getTime() && !meta.alert_hover_state) { if (meta.hide_me_time < new Date().getTime() && !meta.alert_hover_state) {
@ -92,13 +92,13 @@ exports.persist_and_rerender = function () {
// die down before the next reload anyway, making the muting moot. // die down before the next reload anyway, making the muting moot.
exports.rerender(); exports.rerender();
var data = { var data = {
muted_topics: JSON.stringify(muting.get_muted_topics()) muted_topics: JSON.stringify(muting.get_muted_topics()),
}; };
last_topic_update = timestamp_ms(); last_topic_update = timestamp_ms();
channel.post({ channel.post({
url: '/json/set_muted_topics', url: '/json/set_muted_topics',
idempotent: true, idempotent: true,
data: data data: data,
}); });
}; };

View File

@ -113,7 +113,7 @@ function report_narrow_time(initial_core_time, initial_free_time, network_time)
url: '/json/report_narrow_time', url: '/json/report_narrow_time',
data: {initial_core: initial_core_time.toString(), data: {initial_core: initial_core_time.toString(),
initial_free: initial_free_time.toString(), initial_free: initial_free_time.toString(),
network: network_time.toString()} network: network_time.toString()},
}); });
} }
@ -142,7 +142,7 @@ function report_unnarrow_time() {
channel.post({ channel.post({
url: '/json/report_unnarrow_time', url: '/json/report_unnarrow_time',
data: {initial_core: initial_core_time.toString(), data: {initial_core: initial_core_time.toString(),
initial_free: initial_free_time.toString()} initial_free: initial_free_time.toString()},
}); });
unnarrow_times = {}; unnarrow_times = {};
@ -198,7 +198,7 @@ exports.activate = function (raw_operators, opts) {
first_unread_from_server: false, first_unread_from_server: false,
from_reload: false, from_reload: false,
change_hash: true, change_hash: true,
trigger: 'unknown' trigger: 'unknown',
}); });
if (filter.has_operator("near")) { if (filter.has_operator("near")) {
opts.then_select_id = parseInt(filter.operands("near")[0], 10); opts.then_select_id = parseInt(filter.operands("near")[0], 10);
@ -241,7 +241,7 @@ exports.activate = function (raw_operators, opts) {
selected_idx_exact: current_msg_list._items.indexOf( selected_idx_exact: current_msg_list._items.indexOf(
current_msg_list.get(current_msg_list.selected_id())), current_msg_list.get(current_msg_list.selected_id())),
render_start: current_msg_list.view._render_win_start, render_start: current_msg_list.view._render_win_start,
render_end: current_msg_list.view._render_win_end render_end: current_msg_list.view._render_win_end,
}); });
} }
current_msg_list.pre_narrow_offset = current_msg_list.selected_row().offset().top; current_msg_list.pre_narrow_offset = current_msg_list.selected_row().offset().top;
@ -257,7 +257,7 @@ exports.activate = function (raw_operators, opts) {
var msg_list = new message_list.MessageList('zfilt', current_filter, { var msg_list = new message_list.MessageList('zfilt', current_filter, {
collapse_messages: ! current_filter.is_search(), collapse_messages: ! current_filter.is_search(),
muting_enabled: muting_enabled muting_enabled: muting_enabled,
}); });
msg_list.start_time = start_time; msg_list.start_time = start_time;
@ -292,7 +292,7 @@ exports.activate = function (raw_operators, opts) {
message_list.narrowed.select_id(then_select_id, {then_scroll: then_scroll, message_list.narrowed.select_id(then_select_id, {then_scroll: then_scroll,
use_closest: true, use_closest: true,
force_rerender: true force_rerender: true,
}); });
if (preserve_pre_narrowing_screen_position) { if (preserve_pre_narrowing_screen_position) {
@ -327,7 +327,7 @@ exports.activate = function (raw_operators, opts) {
msg_list.network_time = new Date(); msg_list.network_time = new Date();
maybe_report_narrow_time(msg_list); maybe_report_narrow_time(msg_list);
}, },
cont_will_add_messages: false cont_will_add_messages: false,
}); });
if (! defer_selecting_closest) { if (! defer_selecting_closest) {
@ -384,7 +384,7 @@ exports.by_subject = function (target_id, opts) {
unread.mark_message_as_read(original); unread.mark_message_as_read(original);
var search_terms = [ var search_terms = [
{operator: 'stream', operand: original.stream}, {operator: 'stream', operand: original.stream},
{operator: 'topic', operand: original.subject} {operator: 'topic', operand: original.subject},
]; ];
opts = _.defaults({}, opts, {then_select_id: target_id}); opts = _.defaults({}, opts, {then_select_id: target_id});
exports.activate(search_terms, opts); exports.activate(search_terms, opts);
@ -472,7 +472,7 @@ exports.deactivate = function () {
var select_opts = { var select_opts = {
then_scroll: true, then_scroll: true,
use_closest: true, use_closest: true,
empty_ok: true empty_ok: true,
}; };
// We fall back to the closest selected id, if the user has removed a // We fall back to the closest selected id, if the user has removed a

View File

@ -36,7 +36,7 @@ if (window.webkitNotifications) {
notification_object.show = function () {}; notification_object.show = function () {};
notification_object.cancel = function () { notification_object.close(); }; notification_object.cancel = function () { notification_object.close(); };
return notification_object; return notification_object;
} },
}; };
} }
@ -229,17 +229,17 @@ function in_browser_notify(message, title, content, raw_operators, opts) {
$(".top-right").notify({ $(".top-right").notify({
message: { message: {
html: notification_html html: notification_html,
}, },
fadeOut: { fadeOut: {
enabled: true, enabled: true,
delay: 4000 delay: 4000,
} },
}).show(); }).show();
$(".notification[data-message-id='" + message.id + "']").expectOne().data("narrow", { $(".notification[data-message-id='" + message.id + "']").expectOne().data("narrow", {
raw_operators: raw_operators, raw_operators: raw_operators,
opts_notif: opts opts_notif: opts,
}); });
} }
@ -345,7 +345,7 @@ function process_notification(notification) {
obj: notifications_api.createNotification( obj: notifications_api.createNotification(
icon_url, title, content, message.id), icon_url, title, content, message.id),
msg_count: msg_count, msg_count: msg_count,
message_id: message.id message_id: message.id,
}; };
notification_object = notice_memory[key].obj; notification_object = notice_memory[key].obj;
notification_object.onclick = function () { notification_object.onclick = function () {
@ -365,7 +365,7 @@ function process_notification(notification) {
notification_object = new Notification(title, { notification_object = new Notification(title, {
body: content, body: content,
iconUrl: ui.small_avatar_url(message), iconUrl: ui.small_avatar_url(message),
tag: message.id tag: message.id,
}); });
} else { } else {
in_browser_notify(message, title, content, raw_operators, opts); in_browser_notify(message, title, content, raw_operators, opts);

View File

@ -258,7 +258,7 @@ exports.extract_people_from_message = function (message) {
user_id: person.user_id || person.id, user_id: person.user_id || person.id,
full_name: person.full_name, full_name: person.full_name,
is_admin: person.is_realm_admin || false, is_admin: person.is_realm_admin || false,
is_bot: person.is_bot || false is_bot: person.is_bot || false,
}); });
} }
@ -314,7 +314,7 @@ exports.update = function update(person) {
} }
$(".inline_profile_picture.u-" + person.id).css({ $(".inline_profile_picture.u-" + person.id).css({
"background-image": "url(" + url + ")" "background-image": "url(" + url + ")",
}); });
} }
}; };

View File

@ -113,7 +113,7 @@ exports._build_private_messages_list = function (active_conversation, max_privat
unread: num_unread, unread: num_unread,
is_zero: num_unread === 0, is_zero: num_unread === 0,
zoom_out_hide: !always_visible, zoom_out_hide: !always_visible,
url: narrow.pm_with_uri(reply_to) url: narrow.pm_with_uri(reply_to),
}; };
display_messages.push(display_message); display_messages.push(display_message);
}); });

View File

@ -28,7 +28,7 @@ function update_pointer() {
}, },
error: function () { error: function () {
pointer_update_in_flight = false; pointer_update_in_flight = false;
} },
}); });
} }
// Return an empty, resolved Deferred. // Return an empty, resolved Deferred.
@ -72,7 +72,7 @@ exports.fast_forward_pointer = function () {
save_compose: true}); save_compose: true});
}); });
}); });
} },
}); });
}; };

View File

@ -29,7 +29,7 @@ function show_message_info_popover(element, id) {
message: message, message: message,
pm_with_uri: narrow.pm_with_uri(message.sender_email), pm_with_uri: narrow.pm_with_uri(message.sender_email),
sent_by_uri: narrow.by_sender_uri(message.sender_email), sent_by_uri: narrow.by_sender_uri(message.sender_email),
narrowed: narrow.active() narrowed: narrow.active(),
}; };
var ypos = elt.offset().top - viewport.scrollTop(); var ypos = elt.offset().top - viewport.scrollTop();
@ -37,7 +37,7 @@ function show_message_info_popover(element, id) {
placement: (ypos > (viewport.height() - 300)) ? 'top' : 'bottom', placement: (ypos > (viewport.height() - 300)) ? 'top' : 'bottom',
title: templates.render('message_info_popover_title', args), title: templates.render('message_info_popover_title', args),
content: templates.render('message_info_popover_content', args), content: templates.render('message_info_popover_content', args),
trigger: "manual" trigger: "manual",
}); });
elt.popover("show"); elt.popover("show");
current_message_info_popover_elem = elt; current_message_info_popover_elem = elt;
@ -65,7 +65,7 @@ exports.toggle_reactions_popover = function (element, id) {
emojis[realm_emoji_name] = { emojis[realm_emoji_name] = {
name: realm_emoji_name, name: realm_emoji_name,
is_realm_emoji: true, is_realm_emoji: true,
url: realm_emoji.emoji_url url: realm_emoji.emoji_url,
}; };
}); });
_.each(emojis_used, function (emoji_name) { _.each(emojis_used, function (emoji_name) {
@ -76,7 +76,7 @@ exports.toggle_reactions_popover = function (element, id) {
has_reacted: true, has_reacted: true,
css_class: emoji.emoji_name_to_css_class(emoji_name), css_class: emoji.emoji_name_to_css_class(emoji_name),
is_realm_emoji: is_realm_emoji, is_realm_emoji: is_realm_emoji,
url: url url: url,
}; };
}); });
@ -108,7 +108,7 @@ exports.toggle_reactions_popover = function (element, id) {
placement: placement, placement: placement,
title: "", title: "",
content: templates.render('reaction_popover_content', args), content: templates.render('reaction_popover_content', args),
trigger: "manual" trigger: "manual",
}); });
elt.popover("show"); elt.popover("show");
elt.prop('title', 'Add reaction...'); elt.prop('title', 'Add reaction...');
@ -162,7 +162,7 @@ exports.toggle_actions_popover = function (element, id) {
can_unmute_topic: can_unmute_topic, can_unmute_topic: can_unmute_topic,
should_display_add_reaction_option: message.sent_by_me, should_display_add_reaction_option: message.sent_by_me,
conversation_time_uri: narrow.by_conversation_and_time_uri(message), conversation_time_uri: narrow.by_conversation_and_time_uri(message),
narrowed: narrow.active() narrowed: narrow.active(),
}; };
var ypos = elt.offset().top - viewport.scrollTop(); var ypos = elt.offset().top - viewport.scrollTop();
@ -170,7 +170,7 @@ exports.toggle_actions_popover = function (element, id) {
placement: (ypos > (viewport.height() - 300)) ? 'top' : 'bottom', placement: (ypos > (viewport.height() - 300)) ? 'top' : 'bottom',
title: "", title: "",
content: templates.render('actions_popover_content', args), content: templates.render('actions_popover_content', args),
trigger: "manual" trigger: "manual",
}); });
elt.popover("show"); elt.popover("show");
current_actions_popover_elem = elt; current_actions_popover_elem = elt;
@ -239,7 +239,7 @@ exports.topic_ops = {
popovers.hide_topic_sidebar_popover(); popovers.hide_topic_sidebar_popover();
muting.unmute_topic(stream, topic); muting.unmute_topic(stream, topic);
muting_ui.persist_and_rerender(); muting_ui.persist_and_rerender();
} },
}; };
function message_info_popped() { function message_info_popped() {
@ -347,7 +347,7 @@ exports.hide_user_sidebar_popover = function () {
function render_emoji_popover() { function render_emoji_popover() {
var content = templates.render('emoji_popover_content', { var content = templates.render('emoji_popover_content', {
emoji_list: emoji.emojis_name_to_css_class emoji_list: emoji.emojis_name_to_css_class,
}); });
$('.emoji_popover').append(content); $('.emoji_popover').append(content);
@ -397,11 +397,11 @@ exports.register_click_handlers = function () {
var meta = { var meta = {
drag: false, drag: false,
c: { c: {
y: null y: null,
}, },
$popover: $(".emoji_popover"), $popover: $(".emoji_popover"),
MIN_HEIGHT: 25, MIN_HEIGHT: 25,
MAX_HEIGHT: 300 MAX_HEIGHT: 300,
}; };
// drag must start within the .drag zone. // drag must start within the .drag zone.
@ -545,7 +545,7 @@ exports.register_click_handlers = function () {
content: content, content: content,
placement: userlist_placement === "left" ? "right" : "left", placement: userlist_placement === "left" ? "right" : "left",
trigger: "manual", trigger: "manual",
fixed: true fixed: true,
}); });
target.popover("show"); target.popover("show");
current_user_sidebar_user_id = user_id; current_user_sidebar_user_id = user_id;
@ -578,13 +578,13 @@ exports.register_click_handlers = function () {
stream_name: stream_name, stream_name: stream_name,
topic_name: topic_name, topic_name: topic_name,
can_mute_topic: can_mute_topic, can_mute_topic: can_mute_topic,
can_unmute_topic: can_unmute_topic can_unmute_topic: can_unmute_topic,
}); });
$(elt).popover({ $(elt).popover({
content: content, content: content,
trigger: "manual", trigger: "manual",
fixed: true fixed: true,
}); });
$(elt).popover("show"); $(elt).popover("show");
@ -602,7 +602,7 @@ exports.register_click_handlers = function () {
var operators = [ var operators = [
{operator: 'stream', operand: stream_name}, {operator: 'stream', operand: stream_name},
{operator: 'topic', operand: topic_name} {operator: 'topic', operand: topic_name},
]; ];
var opts = {select_first_unread: true, trigger: 'sidebar'}; var opts = {select_first_unread: true, trigger: 'sidebar'};
narrow.activate(operators, opts); narrow.activate(operators, opts);
@ -652,7 +652,7 @@ exports.register_click_handlers = function () {
$(elt).popover({ $(elt).popover({
content: templates.render('stream_sidebar_actions', {stream: stream_data.get_sub(stream)}), content: templates.render('stream_sidebar_actions', {stream: stream_data.get_sub(stream)}),
trigger: "manual", trigger: "manual",
fixed: true fixed: true,
}); });
// This little function is a workaround for the fact that // This little function is a workaround for the fact that

View File

@ -18,7 +18,7 @@ $(function () {
$('#registration, #password_reset').validate({ $('#registration, #password_reset').validate({
rules: { rules: {
password: 'password_strength', password: 'password_strength',
new_password1: 'password_strength' new_password1: 'password_strength',
}, },
errorElement: "p", errorElement: "p",
errorPlacement: function (error, element) { errorPlacement: function (error, element) {
@ -27,7 +27,7 @@ $(function () {
error.insertAfter(element).addClass('help-inline'); error.insertAfter(element).addClass('help-inline');
}, },
highlight: highlight('error'), highlight: highlight('error'),
unhighlight: highlight('success') unhighlight: highlight('success'),
}); });
$('#id_password, #id_new_password1').on('change keyup', function () { $('#id_password, #id_new_password1').on('change keyup', function () {
@ -45,11 +45,11 @@ $(function () {
}, },
success: function () { success: function () {
$('#errors').empty(); $('#errors').empty();
} },
}); });
$("#login_form").validate({ $("#login_form").validate({
errorClass: "text-error", errorClass: "text-error",
wrapper: "div" wrapper: "div",
}); });
}); });

View File

@ -6,7 +6,7 @@ function populate_messages_sent_to_realm(data) {
y: data.humans, y: data.humans,
mode: 'lines', mode: 'lines',
name: 'Messages from humans', name: 'Messages from humans',
hoverinfo: 'y' hoverinfo: 'y',
}; };
var trace_bots = { var trace_bots = {
@ -16,7 +16,7 @@ function populate_messages_sent_to_realm(data) {
y: data.bots, y: data.bots,
mode: 'lines', mode: 'lines',
name: 'Messages from bots', name: 'Messages from bots',
hoverinfo: 'y' hoverinfo: 'y',
}; };
var layout = { var layout = {
@ -27,7 +27,7 @@ function populate_messages_sent_to_realm(data) {
yaxis: { yaxis: {
fixedrange: true, fixedrange: true,
rangemode: 'tozero', rangemode: 'tozero',
} },
}; };
Plotly.newPlot('id_messages_sent_to_realm', [trace_humans, trace_bots], layout, {displayModeBar: false}); Plotly.newPlot('id_messages_sent_to_realm', [trace_humans, trace_bots], layout, {displayModeBar: false});
@ -42,5 +42,5 @@ $.get({
}, },
error: function (xhr) { error: function (xhr) {
$('#id_stats_errors').text($.parseJSON(xhr.responseText).msg); $('#id_stats_errors').text($.parseJSON(xhr.responseText).msg);
} },
}); });

View File

@ -13,7 +13,7 @@ function send_reaction_ajax(message_id, emoji_name, operation) {
error: function (xhr) { error: function (xhr) {
var response = channel.xhr_error_message("Error sending reaction", xhr); var response = channel.xhr_error_message("Error sending reaction", xhr);
blueslip.error(response); blueslip.error(response);
} },
}; };
if (operation === 'add') { if (operation === 'add') {
channel.put(args); channel.put(args);
@ -179,7 +179,7 @@ exports.get_message_reactions = function (message) {
emoji_name: item[0], emoji_name: item[0],
emoji_name_css_class: emoji.emoji_name_to_css_class(item[0]), emoji_name_css_class: emoji.emoji_name_to_css_class(item[0]),
count: item[1].length, count: item[1].length,
title: generate_title(item[0], item[1]) title: generate_title(item[0], item[1]),
}; };
if (emoji.realm_emojis[reaction.emoji_name]) { if (emoji.realm_emojis[reaction.emoji_name]) {
reaction.is_realm_emoji = true; reaction.is_realm_emoji = true;

View File

@ -77,7 +77,7 @@ $(function () {
// We ignore errors from the server because // We ignore errors from the server because
// they're unlikely and we'll get an email either // they're unlikely and we'll get an email either
// way // way
} },
}); });
show_and_fade_elem($("#tell-a-friend-success")); show_and_fade_elem($("#tell-a-friend-success"));
@ -90,7 +90,7 @@ $(function () {
showErrors: function () { showErrors: function () {
this.defaultShowErrors(); this.defaultShowErrors();
resize.resize_page_components(); resize.resize_page_components();
} },
}); });
$("#referral-form input").on('blur', function () { $("#referral-form input").on('blur', function () {

View File

@ -196,7 +196,7 @@ exports.initiate = function (options) {
save_pointer: true, save_pointer: true,
save_narrow: true, save_narrow: true,
save_compose: true, save_compose: true,
send_after_reload: false send_after_reload: false,
}); });
if (options.save_pointer === undefined || if (options.save_pointer === undefined ||

View File

@ -33,11 +33,11 @@ function set_user_list_heights(res, usable_height, user_presences, group_pms) {
// res.group_pms_max_height // res.group_pms_max_height
var blocks = [ var blocks = [
{ {
real_height: user_presences.prop('scrollHeight') real_height: user_presences.prop('scrollHeight'),
}, },
{ {
real_height: group_pms.prop('scrollHeight') real_height: group_pms.prop('scrollHeight'),
} },
]; ];
size_blocks(blocks, usable_height); size_blocks(blocks, usable_height);
@ -143,14 +143,14 @@ function left_userlist_get_new_heights() {
var blocks = [ var blocks = [
{ {
real_height: stream_filters_real_height real_height: stream_filters_real_height,
}, },
{ {
real_height: user_list_real_height real_height: user_list_real_height,
}, },
{ {
real_height: group_pms_real_height real_height: group_pms_real_height,
} },
]; ];
size_blocks(blocks, res.total_leftlist_height); size_blocks(blocks, res.total_leftlist_height);

View File

@ -51,7 +51,7 @@ exports.id = function (message_row) {
var valid_table_names = { var valid_table_names = {
zhome: true, zhome: true,
zfilt: true zfilt: true,
}; };
exports.get_table = function (table_name) { exports.get_table = function (table_name) {

View File

@ -2,7 +2,7 @@ $(function () {
$("#stream-filters-container").perfectScrollbar({ $("#stream-filters-container").perfectScrollbar({
suppressScrollX: true, suppressScrollX: true,
useKeyboard: false, useKeyboard: false,
wheelSpeed: 20 wheelSpeed: 20,
}); });
}); });

View File

@ -66,7 +66,7 @@ exports.initialize = function () {
updater: narrow_or_search_for_term, updater: narrow_or_search_for_term,
sorter: function (items) { sorter: function (items) {
return items; return items;
} },
}); });
$("#searchbox_form").keydown(function (e) { $("#searchbox_form").keydown(function (e) {

View File

@ -66,7 +66,7 @@ function get_stream_suggestions(operators) {
var description = prefix + ' ' + highlighted_stream; var description = prefix + ' ' + highlighted_stream;
var term = { var term = {
operator: 'stream', operator: 'stream',
operand: stream operand: stream,
}; };
var search_string = Filter.unparse([term]); var search_string = Filter.unparse([term]);
return {description: description, search_string: search_string}; return {description: description, search_string: search_string};
@ -142,7 +142,7 @@ function get_private_suggestions(all_people, operators, person_operator_matches)
var term = { var term = {
operator: matching_operator, operator: matching_operator,
operand: person.email, operand: person.email,
negated: negated negated: negated,
}; };
var name = highlight_person(query, person); var name = highlight_person(query, person);
var description = prefix + ' ' + name; var description = prefix + ' ' + name;
@ -156,7 +156,7 @@ function get_private_suggestions(all_people, operators, person_operator_matches)
suggestions.push({ suggestions.push({
search_string: 'is:private', search_string: 'is:private',
description: 'Private messages' description: 'Private messages',
}); });
return suggestions; return suggestions;
@ -324,32 +324,32 @@ function get_special_filter_suggestions(query, operators) {
var suggestions = [ var suggestions = [
{ {
search_string: '', search_string: '',
description: 'Home' description: 'Home',
}, },
{ {
search_string: 'in:all', search_string: 'in:all',
description: 'All messages' description: 'All messages',
}, },
{ {
search_string: 'is:private', search_string: 'is:private',
description: 'Private messages' description: 'Private messages',
}, },
{ {
search_string: 'is:starred', search_string: 'is:starred',
description: 'Starred messages' description: 'Starred messages',
}, },
{ {
search_string: 'is:mentioned', search_string: 'is:mentioned',
description: '@-mentions' description: '@-mentions',
}, },
{ {
search_string: 'is:alerted', search_string: 'is:alerted',
description: 'Alerted messages' description: 'Alerted messages',
}, },
{ {
search_string: 'sender:' + page_params.email, search_string: 'sender:' + page_params.email,
description: 'Sent by me' description: 'Sent by me',
} },
]; ];
query = query.toLowerCase(); query = query.toLowerCase();
@ -421,7 +421,7 @@ exports.get_suggestions = function (query) {
}); });
return { return {
strings: strings, strings: strings,
lookup_table: lookup_table lookup_table: lookup_table,
}; };
}; };

View File

@ -37,7 +37,7 @@ function dispatch_normal_event(event) {
var reload_options = {save_pointer: true, var reload_options = {save_pointer: true,
save_narrow: true, save_narrow: true,
save_compose: true, save_compose: true,
message: "The application has been updated; reloading!" message: "The application has been updated; reloading!",
}; };
if (event.immediate) { if (event.immediate) {
reload_options.immediate = true; reload_options.immediate = true;
@ -422,7 +422,7 @@ function get_events(options) {
} }
var retry_sec = Math.min(90, Math.exp(get_events_failures/2)); var retry_sec = Math.min(90, Math.exp(get_events_failures/2));
get_events_timeout = setTimeout(get_events, retry_sec*1000); get_events_timeout = setTimeout(get_events, retry_sec*1000);
} },
}); });
} }
@ -480,7 +480,7 @@ exports.cleanup_event_queue = function cleanup_event_queue() {
page_params.event_queue_expired = true; page_params.event_queue_expired = true;
channel.del({ channel.del({
url: '/json/events', url: '/json/events',
data: {queue_id: page_params.event_queue_id} data: {queue_id: page_params.event_queue_id},
}); });
}; };

View File

@ -120,7 +120,7 @@ function render_bots() {
zuliprc: 'zuliprc', // Most browsers do not allow filename starting with `.` zuliprc: 'zuliprc', // Most browsers do not allow filename starting with `.`
default_sending_stream: elem.default_sending_stream, default_sending_stream: elem.default_sending_stream,
default_events_register_stream: elem.default_events_register_stream, default_events_register_stream: elem.default_events_register_stream,
default_all_public_streams: elem.default_all_public_streams default_all_public_streams: elem.default_all_public_streams,
}); });
}); });
} }
@ -160,7 +160,7 @@ function _setup_page() {
$('#create_bot_default_events_register_stream'), $('#create_bot_default_events_register_stream'),
[['__all_public__', 'All public streams']] [['__all_public__', 'All public streams']]
); );
} },
}); });
} }
@ -270,7 +270,7 @@ function _setup_page() {
// Whether successful or not, clear the password boxes. // Whether successful or not, clear the password boxes.
// TODO: Clear these earlier, while the request is still pending. // TODO: Clear these earlier, while the request is still pending.
clear_password_change(); clear_password_change();
} },
}); });
function update_notification_settings_success(resp, statusText, xhr) { function update_notification_settings_success(resp, statusText, xhr) {
@ -333,7 +333,7 @@ function _setup_page() {
url: "/json/settings/notifications", url: "/json/settings/notifications",
data: notification_changes, data: notification_changes,
success: success_func, success: success_func,
error: error_func error: error_func,
}); });
} }
@ -361,7 +361,7 @@ function _setup_page() {
url: "/json/settings/notifications", url: "/json/settings/notifications",
data: data, data: data,
success: update_notification_settings_success, success: update_notification_settings_success,
error: update_notification_settings_error error: update_notification_settings_error,
}); });
} }
@ -422,7 +422,7 @@ function _setup_page() {
}, },
error: function (xhr) { error: function (xhr) {
ui.report_error(i18n.t("Error updating user list placement setting"), xhr, $('#display-settings-status').expectOne()); ui.report_error(i18n.t("Error updating user list placement setting"), xhr, $('#display-settings-status').expectOne());
} },
}); });
}); });
@ -446,7 +446,7 @@ function _setup_page() {
}, },
error: function (xhr) { error: function (xhr) {
ui.report_error(i18n.t("Error updating time format setting"), xhr, $('#display-settings-status').expectOne()); ui.report_error(i18n.t("Error updating time format setting"), xhr, $('#display-settings-status').expectOne());
} },
}); });
}); });
@ -475,7 +475,7 @@ function _setup_page() {
}, },
error: function (xhr) { error: function (xhr) {
ui.report_error(i18n.t("Error updating default language setting"), xhr, $('#display-settings-status').expectOne()); ui.report_error(i18n.t("Error updating default language setting"), xhr, $('#display-settings-status').expectOne());
} },
}); });
}); });
@ -500,7 +500,7 @@ function _setup_page() {
}, },
error: function (xhr) { error: function (xhr) {
ui.report_error(i18n.t("Error deactivating account"), xhr, $('#settings-status').expectOne()); ui.report_error(i18n.t("Error deactivating account"), xhr, $('#settings-status').expectOne());
} },
}); });
}); });
@ -522,7 +522,7 @@ function _setup_page() {
ui.report_error(i18n.t("Error getting API key"), xhr, $('#settings-status').expectOne()); ui.report_error(i18n.t("Error getting API key"), xhr, $('#settings-status').expectOne());
$("#show_api_key_box").hide(); $("#show_api_key_box").hide();
$("#get_api_key_box").show(); $("#get_api_key_box").show();
} },
}); });
function upload_avatar(file_input) { function upload_avatar(file_input) {
@ -548,7 +548,7 @@ function _setup_page() {
$("#user-settings-avatar").expectOne().attr("src", url); $("#user-settings-avatar").expectOne().attr("src", url);
$("#user_avatar_delete_button").show(); $("#user_avatar_delete_button").show();
exports.avatar_stamp += 1; exports.avatar_stamp += 1;
} },
}); });
} }
@ -612,9 +612,9 @@ function _setup_page() {
}, },
complete: function () { complete: function () {
$('#create_bot_button').val('Create bot').prop('disabled', false); $('#create_bot_button').val('Create bot').prop('disabled', false);
} },
}); });
} },
}); });
$("#bots_list").on("click", "button.delete_bot", function (e) { $("#bots_list").on("click", "button.delete_bot", function (e) {
@ -627,7 +627,7 @@ function _setup_page() {
}, },
error: function (xhr) { error: function (xhr) {
$('#bot_delete_error').text(JSON.parse(xhr.responseText).msg).show(); $('#bot_delete_error').text(JSON.parse(xhr.responseText).msg).show();
} },
}); });
}); });
@ -644,7 +644,7 @@ function _setup_page() {
error: function (xhr) { error: function (xhr) {
var row = $(e.currentTarget).closest("li"); var row = $(e.currentTarget).closest("li");
row.find(".api_key_error").text(JSON.parse(xhr.responseText).msg).show(); row.find(".api_key_error").text(JSON.parse(xhr.responseText).msg).show();
} },
}); });
}); });
@ -729,9 +729,9 @@ function _setup_page() {
loading.destroy_indicator(spinner); loading.destroy_indicator(spinner);
edit_button.show(); edit_button.show();
errors.text(JSON.parse(xhr.responseText).msg).show(); errors.text(JSON.parse(xhr.responseText).msg).show();
} },
}); });
} },
}); });
@ -763,7 +763,7 @@ function _setup_page() {
}, },
error: function (xhr) { error: function (xhr) {
$('#user_api_key_error').text(JSON.parse(xhr.responseText).msg).show(); $('#user_api_key_error').text(JSON.parse(xhr.responseText).msg).show();
} },
}); });
}); });
@ -792,7 +792,7 @@ function _setup_page() {
}, },
error: function (xhr) { error: function (xhr) {
ui.report_error(i18n.t("Error changing settings"), xhr, $('#ui-settings-status').expectOne()); ui.report_error(i18n.t("Error changing settings"), xhr, $('#ui-settings-status').expectOne());
} },
}); });
}); });
} }

View File

@ -19,7 +19,7 @@ $(function () {
// Only send the token to relative URLs i.e. locally. // Only send the token to relative URLs i.e. locally.
xhr.setRequestHeader("X-CSRFToken", csrf_token); xhr.setRequestHeader("X-CSRFToken", csrf_token);
} }
} },
}); });
// For some reason, jQuery wants this to be attached to an element. // For some reason, jQuery wants this to be attached to an element.

View File

@ -6,7 +6,7 @@ var CLOSE_REASONS = {
auth_fail: {code: 4002, msg: "Authentication failed"}, auth_fail: {code: 4002, msg: "Authentication failed"},
ack_timeout: {code: 4003, msg: "ACK timeout"}, ack_timeout: {code: 4003, msg: "ACK timeout"},
cant_send: {code: 4004, msg: "User attempted to send while Socket was not ready"}, cant_send: {code: 4004, msg: "User attempted to send while Socket was not ready"},
unsuspend: {code: 4005, msg: "Got unsuspend event"} unsuspend: {code: 4005, msg: "Got unsuspend event"},
}; };
function Socket(url) { function Socket(url) {
@ -404,7 +404,7 @@ Socket.prototype = {
} }
this._save_localstorage_requests(); this._save_localstorage_requests();
} },
}; };
return Socket; return Socket;

View File

@ -7,19 +7,19 @@
var Cache = require('i18next-localstorage-cache'); var Cache = require('i18next-localstorage-cache');
var backendOptions = { var backendOptions = {
loadPath: '/static/locale/__lng__/translations.json' loadPath: '/static/locale/__lng__/translations.json',
}; };
var callbacks = []; var callbacks = [];
var initialized = false; var initialized = false;
var detectionOptions = { var detectionOptions = {
order: ['htmlTag'], order: ['htmlTag'],
htmlTag: document.documentElement htmlTag: document.documentElement,
}; };
var cacheOptions = { var cacheOptions = {
enabled: true, enabled: true,
prefix: page_params.server_generation + ':' prefix: page_params.server_generation + ':',
}; };
i18n.use(XHR) i18n.use(XHR)
@ -30,12 +30,12 @@
keySeparator: false, keySeparator: false,
interpolation: { interpolation: {
prefix: "__", prefix: "__",
suffix: "__" suffix: "__",
}, },
backend: backendOptions, backend: backendOptions,
detection: detectionOptions, detection: detectionOptions,
cache: cacheOptions, cache: cacheOptions,
fallbackLng: 'en' fallbackLng: 'en',
}, function () { }, function () {
var i; var i;
initialized = true; initialized = true;

View File

@ -73,14 +73,14 @@ var stream_color_palette = [
['a47462', 'c2726a', 'e4523d', 'e7664d', 'ee7e4a', 'f4ae55'], ['a47462', 'c2726a', 'e4523d', 'e7664d', 'ee7e4a', 'f4ae55'],
['76ce90', '53a063', '94c849', 'bfd56f', 'fae589', 'f5ce6e'], ['76ce90', '53a063', '94c849', 'bfd56f', 'fae589', 'f5ce6e'],
['a6dcbf', 'addfe5', 'a6c7e5', '4f8de4', '95a5fd', 'b0a5fd'], ['a6dcbf', 'addfe5', 'a6c7e5', '4f8de4', '95a5fd', 'b0a5fd'],
['c2c2c2', 'c8bebf', 'c6a8ad', 'e79ab5', 'bd86e5', '9987e1'] ['c2c2c2', 'c8bebf', 'c6a8ad', 'e79ab5', 'bd86e5', '9987e1'],
]; ];
var subscriptions_table_colorpicker_options = { var subscriptions_table_colorpicker_options = {
clickoutFiresChange: true, clickoutFiresChange: true,
showPalette: true, showPalette: true,
showInput: true, showInput: true,
palette: stream_color_palette palette: stream_color_palette,
}; };
exports.set_colorpicker_color = function (colorpicker, color) { exports.set_colorpicker_color = function (colorpicker, color) {
@ -119,7 +119,7 @@ exports.sidebar_popover_colorpicker_options = {
showInput: true, showInput: true,
flat: true, flat: true,
palette: stream_color_palette, palette: stream_color_palette,
change: picker_do_change_color change: picker_do_change_color,
}; };
exports.sidebar_popover_colorpicker_options_full = { exports.sidebar_popover_colorpicker_options_full = {
@ -130,7 +130,7 @@ exports.sidebar_popover_colorpicker_options_full = {
cancelText: "", cancelText: "",
chooseText: "choose", chooseText: "choose",
palette: stream_color_palette, palette: stream_color_palette,
change: picker_do_change_color change: picker_do_change_color,
}; };
var lightness_threshold; var lightness_threshold;

View File

@ -204,7 +204,7 @@ exports.create_streams = function (streams) {
// We handle subscriber stuff in other events. // We handle subscriber stuff in other events.
var attrs = _.defaults(stream, { var attrs = _.defaults(stream, {
subscribers: [], subscribers: [],
subscribed: false subscribed: false,
}); });
exports.create_sub_from_server_data(stream.name, attrs); exports.create_sub_from_server_data(stream.name, attrs);
}); });
@ -237,7 +237,7 @@ exports.create_sub_from_server_data = function (stream_name, attrs) {
invite_only: false, invite_only: false,
desktop_notifications: page_params.stream_desktop_notifications_enabled, desktop_notifications: page_params.stream_desktop_notifications_enabled,
audible_notifications: page_params.stream_sounds_enabled, audible_notifications: page_params.stream_sounds_enabled,
description: '' description: '',
}); });
exports.set_subscribers(sub, subscriber_user_ids); exports.set_subscribers(sub, subscriber_user_ids);
@ -272,7 +272,7 @@ exports.add_admin_options = function (sub) {
return _.extend(sub, { return _.extend(sub, {
is_admin: page_params.is_admin, is_admin: page_params.is_admin,
can_make_public: page_params.is_admin && sub.invite_only && sub.subscribed, can_make_public: page_params.is_admin && sub.invite_only && sub.subscribed,
can_make_private: page_params.is_admin && !sub.invite_only can_make_private: page_params.is_admin && !sub.invite_only,
}); });
}; };

View File

@ -224,7 +224,7 @@ function build_stream_sidebar_li(sub) {
not_in_home_view: (stream_data.in_home_view(name) === false), not_in_home_view: (stream_data.in_home_view(name) === false),
invite_only: sub.invite_only, invite_only: sub.invite_only,
color: stream_data.get_color(name), color: stream_data.get_color(name),
pin_to_top: sub.pin_to_top pin_to_top: sub.pin_to_top,
}; };
args.dark_background = stream_color.get_color_class(args.color); args.dark_background = stream_color.get_color_class(args.color);
var list_item = $(templates.render('stream_sidebar_row', args)); var list_item = $(templates.render('stream_sidebar_row', args));
@ -274,7 +274,7 @@ exports.redraw_stream_privacy = function (stream_name) {
var args = { var args = {
invite_only: sub.invite_only, invite_only: sub.invite_only,
dark_background: dark_background dark_background: dark_background,
}; };
if (sub.invite_only) { if (sub.invite_only) {
@ -387,7 +387,7 @@ $(function () {
// each stream. // each stream.
topic_list.set_click_handlers({ topic_list.set_click_handlers({
zoom_in: zoom_in, zoom_in: zoom_in,
zoom_out: zoom_out zoom_out: zoom_out,
}); });
pm_list.set_click_handlers(); pm_list.set_click_handlers();

View File

@ -2,7 +2,7 @@ var subs = (function () {
var meta = { var meta = {
callbacks: {}, callbacks: {},
stream_created: false stream_created: false,
}; };
var exports = {}; var exports = {};
@ -48,7 +48,7 @@ function set_stream_property(stream_name, property, value) {
return channel.post({ return channel.post({
url: '/json/subscriptions/property', url: '/json/subscriptions/property',
data: {subscription_data: JSON.stringify([sub_data])}, data: {subscription_data: JSON.stringify([sub_data])},
timeout: 10*1000 timeout: 10*1000,
}); });
} }
@ -335,7 +335,7 @@ function show_subscription_settings(sub_row) {
error: function () { error: function () {
loading.destroy_indicator(indicator_elem); loading.destroy_indicator(indicator_elem);
error_elem.removeClass("hide").text("Could not fetch subscriber list"); error_elem.removeClass("hide").text("Could not fetch subscriber list");
} },
}); });
sub_settings.find('input[name="principal"]').typeahead({ sub_settings.find('input[name="principal"]').typeahead({
@ -357,7 +357,7 @@ function show_subscription_settings(sub_row) {
sorter: typeahead_helper.sort_recipientbox_typeahead, sorter: typeahead_helper.sort_recipientbox_typeahead,
updater: function (item) { updater: function (item) {
return item.email; return item.email;
} },
}); });
var colorpicker = sub_settings.find('.colorpicker'); var colorpicker = sub_settings.find('.colorpicker');
@ -549,7 +549,7 @@ exports.setup_page = function (callback) {
callback: function () { callback: function () {
actually_filter_streams(); actually_filter_streams();
remove_temporarily_miscategorized_streams(); remove_temporarily_miscategorized_streams();
} },
}).get(); }).get();
if (should_list_all_streams()) { if (should_list_all_streams()) {
@ -568,7 +568,7 @@ exports.setup_page = function (callback) {
var template_data = { var template_data = {
can_create_streams: page_params.can_create_streams, can_create_streams: page_params.can_create_streams,
subscriptions: sub_rows, subscriptions: sub_rows,
hide_all_streams: !should_list_all_streams() hide_all_streams: !should_list_all_streams(),
}; };
var rendered = templates.render('subscription_table_body', template_data); var rendered = templates.render('subscription_table_body', template_data);
$('#subscriptions_table').append(rendered); $('#subscriptions_table').append(rendered);
@ -611,7 +611,7 @@ exports.setup_page = function (callback) {
exports.onlaunch = function (name, callback, keep) { exports.onlaunch = function (name, callback, keep) {
meta.callbacks[name] = { meta.callbacks[name] = {
func: callback, func: callback,
keep: keep keep: keep,
}; };
}; };
@ -699,7 +699,7 @@ function ajaxSubscribe(stream) {
error: function (xhr) { error: function (xhr) {
ui.report_error(i18n.t("Error adding subscription"), xhr, ui.report_error(i18n.t("Error adding subscription"), xhr,
$("#subscriptions-status"), 'subscriptions-status'); $("#subscriptions-status"), 'subscriptions-status');
} },
}); });
} }
@ -714,7 +714,7 @@ function ajaxUnsubscribe(stream) {
error: function (xhr) { error: function (xhr) {
ui.report_error(i18n.t("Error removing subscription"), xhr, ui.report_error(i18n.t("Error removing subscription"), xhr,
$("#subscriptions-status"), 'subscriptions-status'); $("#subscriptions-status"), 'subscriptions-status');
} },
}); });
} }
@ -725,7 +725,7 @@ function ajaxSubscribeForCreation(stream, description, principals, invite_only,
data: {subscriptions: JSON.stringify([{name: stream, description: description}]), data: {subscriptions: JSON.stringify([{name: stream, description: description}]),
principals: JSON.stringify(principals), principals: JSON.stringify(principals),
invite_only: JSON.stringify(invite_only), invite_only: JSON.stringify(invite_only),
announce: JSON.stringify(announce) announce: JSON.stringify(announce),
}, },
success: function () { success: function () {
$("#create_stream_name").val(""); $("#create_stream_name").val("");
@ -736,7 +736,7 @@ function ajaxSubscribeForCreation(stream, description, principals, invite_only,
error: function (xhr) { error: function (xhr) {
ui.report_error(i18n.t("Error creating stream"), xhr, ui.report_error(i18n.t("Error creating stream"), xhr,
$("#subscriptions-status"), 'subscriptions-status'); $("#subscriptions-status"), 'subscriptions-status');
} },
}); });
} }
@ -764,7 +764,7 @@ function show_new_stream_modal() {
$(".right .settings").hide(); $(".right .settings").hide();
$('#people_to_add').html(templates.render('new_stream_users', { $('#people_to_add').html(templates.render('new_stream_users', {
users: people.get_rest_of_realm(), users: people.get_rest_of_realm(),
streams: stream_data.get_streams_for_settings_page() streams: stream_data.get_streams_for_settings_page(),
})); }));
// Make the options default to the same each time: // Make the options default to the same each time:
@ -782,7 +782,7 @@ exports.invite_user_to_stream = function (user_email, stream_name, success, fail
data: {subscriptions: JSON.stringify([{name: stream_name}]), data: {subscriptions: JSON.stringify([{name: stream_name}]),
principals: JSON.stringify([user_email])}, principals: JSON.stringify([user_email])},
success: success, success: success,
error: failure error: failure,
}); });
}; };
@ -792,7 +792,7 @@ exports.remove_user_from_stream = function (user_email, stream_name, success, fa
data: {subscriptions: JSON.stringify([stream_name]), data: {subscriptions: JSON.stringify([stream_name]),
principals: JSON.stringify([user_email])}, principals: JSON.stringify([user_email])},
success: success, success: success,
error: failure error: failure,
}); });
}; };
@ -1214,7 +1214,7 @@ $(function () {
error: function (xhr) { error: function (xhr) {
ui.report_error(i18n.t("Error renaming stream"), xhr, ui.report_error(i18n.t("Error renaming stream"), xhr,
$("#subscriptions-status"), 'subscriptions-status'); $("#subscriptions-status"), 'subscriptions-status');
} },
}); });
}); });
@ -1230,7 +1230,7 @@ $(function () {
// Stream names might contain unsafe characters so we must encode it first. // Stream names might contain unsafe characters so we must encode it first.
url: '/json/streams/' + encodeURIComponent(stream_name), url: '/json/streams/' + encodeURIComponent(stream_name),
data: { data: {
description: JSON.stringify(description) description: JSON.stringify(description),
}, },
success: function () { success: function () {
// The event from the server will update the rest of the UI // The event from the server will update the rest of the UI
@ -1240,7 +1240,7 @@ $(function () {
error: function (xhr) { error: function (xhr) {
ui.report_error(i18n.t("Error updating the stream description"), xhr, ui.report_error(i18n.t("Error updating the stream description"), xhr,
$("#subscriptions-status"), 'subscriptions-status'); $("#subscriptions-status"), 'subscriptions-status');
} },
}); });
}); });
@ -1297,7 +1297,7 @@ $(function () {
var stream_settings = settings_for_sub(sub); var stream_settings = settings_for_sub(sub);
var feedback_div = stream_settings.find(".change-stream-privacy-feedback").expectOne(); var feedback_div = stream_settings.find(".change-stream-privacy-feedback").expectOne();
ui.report_error(error_message, xhr, feedback_div); ui.report_error(error_message, xhr, feedback_div);
} },
}); });
} }

View File

@ -84,7 +84,7 @@ exports.build_widget = function (parent_elem, stream, active_topic, max_topics)
unread: num_unread, unread: num_unread,
is_zero: num_unread === 0, is_zero: num_unread === 0,
is_muted: muting.is_topic_muted(stream, topic_name), is_muted: muting.is_topic_muted(stream, topic_name),
url: narrow.by_stream_subject_uri(stream, topic_name) url: narrow.by_stream_subject_uri(stream, topic_name),
}; };
var li = $(templates.render('topic_list_item', topic_info)); var li = $(templates.render('topic_list_item', topic_info));
self.topic_items.set(topic_name, li); self.topic_items.set(topic_name, li);

View File

@ -29,7 +29,7 @@ var fake_messages = [
subject: "screenshots", subject: "screenshots",
timestr: "12:11", timestr: "12:11",
timestamp: today, timestamp: today,
type: "stream" type: "stream",
}, },
{ {
id: 2, id: 2,
@ -43,7 +43,7 @@ var fake_messages = [
subject: "screenshots", subject: "screenshots",
timestr: "12:11", timestr: "12:11",
timestamp: today, timestamp: today,
type: "stream" type: "stream",
}, },
{ {
id: 3, id: 3,
@ -57,7 +57,7 @@ var fake_messages = [
subject: "screenshots", subject: "screenshots",
timestr: "12:16", timestr: "12:16",
timestamp: today, timestamp: today,
type: "stream" type: "stream",
}, },
{ {
id: 4, id: 4,
@ -71,7 +71,7 @@ var fake_messages = [
subject: "integrations", subject: "integrations",
timestr: "12:25", timestr: "12:25",
timestamp: today, timestamp: today,
type: "stream" type: "stream",
}, },
{ {
id: 5, id: 5,
@ -85,7 +85,7 @@ var fake_messages = [
subject: "integrations", subject: "integrations",
timestr: "12:25", timestr: "12:25",
timestamp: today, timestamp: today,
type: "stream" type: "stream",
}, },
{ {
id: 6, id: 6,
@ -99,7 +99,7 @@ var fake_messages = [
subject: "integrations", subject: "integrations",
timestr: "12:26", timestr: "12:26",
timestamp: today, timestamp: today,
type: "stream" type: "stream",
}, },
{ {
id: 7, id: 7,
@ -113,7 +113,7 @@ var fake_messages = [
subject: "integrations", subject: "integrations",
timestr: "12:26", timestr: "12:26",
timestamp: today, timestamp: today,
type: "stream" type: "stream",
}, },
{ {
id: 8, id: 8,
@ -127,7 +127,7 @@ var fake_messages = [
subject: "weekly meeting", subject: "weekly meeting",
timestr: "12:30", timestr: "12:30",
timestamp: today, timestamp: today,
type: "stream" type: "stream",
}, },
{ {
id: 9, id: 9,
@ -141,7 +141,7 @@ var fake_messages = [
subject: "screenshots", subject: "screenshots",
timestr: "12:32", timestr: "12:32",
timestamp: today, timestamp: today,
type: "stream" type: "stream",
}, },
{ {
id: 10, id: 10,
@ -155,7 +155,7 @@ var fake_messages = [
subject: "screenshots", subject: "screenshots",
timestr: "12:32", timestr: "12:32",
timestamp: today, timestamp: today,
type: "stream" type: "stream",
}, },
{ {
id: 11, id: 11,
@ -169,7 +169,7 @@ var fake_messages = [
subject: "screenshots", subject: "screenshots",
timestr: "12:16", timestr: "12:16",
timestamp: today, timestamp: today,
type: "stream" type: "stream",
}, },
{ {
id: 12, id: 12,
@ -183,8 +183,8 @@ var fake_messages = [
subject: "screenshots", subject: "screenshots",
timestr: "12:32", timestr: "12:32",
timestamp: today, timestamp: today,
type: "stream" type: "stream",
} },
]; ];
function send_delayed_stream_message(stream, topic, content, delay) { function send_delayed_stream_message(stream, topic, content, delay) {
@ -197,7 +197,7 @@ function send_delayed_stream_message(stream, topic, content, delay) {
dataType: 'json', dataType: 'json',
url: '/json/tutorial_send_message', url: '/json/tutorial_send_message',
type: 'POST', type: 'POST',
data: data data: data,
}); });
}, delay * 1000); // delay is in seconds. }, delay * 1000); // delay is in seconds.
} }
@ -225,7 +225,7 @@ function set_tutorial_status(status, callback) {
return channel.post({ return channel.post({
url: '/json/tutorial_status', url: '/json/tutorial_status',
data: {status: JSON.stringify(status)}, data: {status: JSON.stringify(status)},
success: callback success: callback,
}); });
} }
@ -295,7 +295,7 @@ function create_and_show_popover(target_div, placement, title, content_template)
placement: placement}), placement: placement}),
content: templates.render(content_template, {placement: placement, content: templates.render(content_template, {placement: placement,
page_params: page_params}), page_params: page_params}),
trigger: "manual" trigger: "manual",
}); });
target_div.popover("show"); target_div.popover("show");

View File

@ -512,7 +512,7 @@ $(function () {
_.pluck(event.msg_list._items, 'id'), _.pluck(event.msg_list._items, 'id'),
_.chain(current_msg_list._items).pluck('id').clone().value().sort() _.chain(current_msg_list._items).pluck('id').clone().value().sort()
), ),
found_in_dom: row_from_dom.length found_in_dom: row_from_dom.length,
}); });
} }
if (event.target_scroll_offset !== undefined) { if (event.target_scroll_offset !== undefined) {

View File

@ -353,7 +353,7 @@ exports.mark_stream_as_read = function mark_stream_as_read(stream, cont) {
all: false, all: false,
op: 'add', op: 'add',
flag: 'read', flag: 'read',
stream_name: stream stream_name: stream,
}, },
success: cont}); success: cont});
}; };
@ -367,7 +367,7 @@ exports.mark_topic_as_read = function mark_topic_as_read(stream, topic, cont) {
op: 'add', op: 'add',
flag: 'read', flag: 'read',
topic_name: topic, topic_name: topic,
stream_name: stream stream_name: stream,
}, },
success: cont}); success: cont});
}; };

View File

@ -214,7 +214,7 @@ exports.CachedValue.prototype = {
reset: function CachedValue_reset() { reset: function CachedValue_reset() {
this._value = unassigned_value_sentinel; this._value = unassigned_value_sentinel;
} },
}; };
exports.execute_early = function (func) { exports.execute_early = function (func) {

View File

@ -133,13 +133,13 @@ function add_to_visible(candidates, visible,
var top_of_feed = new util.CachedValue({ var top_of_feed = new util.CachedValue({
compute_value: function () { compute_value: function () {
return $(".floating_recipient").offset().top + $(".floating_recipient").outerHeight(); return $(".floating_recipient").offset().top + $(".floating_recipient").outerHeight();
} },
}); });
var bottom_of_feed = new util.CachedValue({ var bottom_of_feed = new util.CachedValue({
compute_value: function () { compute_value: function () {
return $("#compose")[0].getBoundingClientRect().top; return $("#compose")[0].getBoundingClientRect().top;
} },
}); });
function _visible_divs(selected_row, row_min_height, row_to_output, div_class, function _visible_divs(selected_row, row_min_height, row_to_output, div_class,
@ -232,7 +232,7 @@ function make_dimen_wrapper(dimen_name, dimen_func) {
dimensions[dimen_name] = new util.CachedValue({ dimensions[dimen_name] = new util.CachedValue({
compute_value: function () { compute_value: function () {
return dimen_func.call(exports.message_pane); return dimen_func.call(exports.message_pane);
} },
}); });
return function viewport_dimension_wrapper() { return function viewport_dimension_wrapper() {
if (arguments.length !== 0) { if (arguments.length !== 0) {
@ -268,7 +268,7 @@ exports.system_initiated_animate_scroll = function (scroll_amount) {
scrollTop: viewport_offset + scroll_amount, scrollTop: viewport_offset + scroll_amount,
always: function () { always: function () {
in_stoppable_autoscroll = false; in_stoppable_autoscroll = false;
} },
}); });
}; };
@ -279,7 +279,7 @@ exports.user_initiated_animate_scroll = function (scroll_amount) {
var viewport_offset = exports.scrollTop(); var viewport_offset = exports.scrollTop();
exports.message_pane.animate({ exports.message_pane.animate({
scrollTop: viewport_offset + scroll_amount scrollTop: viewport_offset + scroll_amount,
}); });
}; };