mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 02:48:00 +00:00
js: Fix a bunch of indentation issues found by eslint.
This is preparation for enabling an eslint indentation configuration. 90% of these changes are just fixes for indentation errors that have snuck into the codebase over the years; the others are more significant reformatting to make eslint happy (that are not otherwise actually improvements). The one area that we do not attempt to work on here is the "switch/case" indentation.
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
/* eslint indent: "off" */
|
||||||
|
|
||||||
var bot_data = (function () {
|
var bot_data = (function () {
|
||||||
var exports = {};
|
var exports = {};
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
/* eslint indent: "off" */
|
||||||
|
|
||||||
var buddy_list = (function () {
|
var buddy_list = (function () {
|
||||||
var self = {};
|
var self = {};
|
||||||
|
|
||||||
|
|||||||
@@ -285,8 +285,9 @@ exports.respond_to_message = function (opts) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg_type = 'stream'; // Set msg_type to stream by default
|
// Set msg_type to stream by default in the case of an empty
|
||||||
// in the case of an empty home view.
|
// home view.
|
||||||
|
msg_type = 'stream';
|
||||||
if (narrow_state.narrowed_by_pm_reply()) {
|
if (narrow_state.narrowed_by_pm_reply()) {
|
||||||
msg_type = 'private';
|
msg_type = 'private';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -526,9 +526,12 @@ exports.compose_matches_sorter = function (matches) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var recipients = typeahead_helper.sort_recipients(users, this.token,
|
var recipients = typeahead_helper.sort_recipients(
|
||||||
|
users,
|
||||||
|
this.token,
|
||||||
compose_state.stream_name(),
|
compose_state.stream_name(),
|
||||||
compose_state.subject(), groups);
|
compose_state.subject(),
|
||||||
|
groups);
|
||||||
return recipients;
|
return recipients;
|
||||||
} else if (this.completing === 'stream') {
|
} else if (this.completing === 'stream') {
|
||||||
return typeahead_helper.sort_streams(matches, this.token);
|
return typeahead_helper.sort_streams(matches, this.token);
|
||||||
|
|||||||
@@ -50,9 +50,7 @@ function construct_copy_div(div, start_id, end_id) {
|
|||||||
var should_include_start_recipient_header = false;
|
var should_include_start_recipient_header = false;
|
||||||
|
|
||||||
var last_recipient_row_id = start_recipient_row_id;
|
var last_recipient_row_id = start_recipient_row_id;
|
||||||
for (var row = start_row;
|
for (var row = start_row; rows.id(row) <= end_id; row = rows.next_visible(row)) {
|
||||||
rows.id(row) <= end_id;
|
|
||||||
row = rows.next_visible(row)) {
|
|
||||||
var recipient_row_id = rows.id_for_recipient_row(rows.get_message_recipient_row(row));
|
var recipient_row_id = rows.id_for_recipient_row(rows.get_message_recipient_row(row));
|
||||||
// if we found a message from another recipient,
|
// if we found a message from another recipient,
|
||||||
// it means that we have messages from several recipients,
|
// it means that we have messages from several recipients,
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
/* eslint indent: "off" */
|
||||||
|
|
||||||
// This is a public instance of the `DynamicText` class.
|
// This is a public instance of the `DynamicText` class.
|
||||||
// The `DynamicText` object serves to resize text that is set through its
|
// The `DynamicText` object serves to resize text that is set through its
|
||||||
// public methods so that the text won't ever overrun the parent container.
|
// public methods so that the text won't ever overrun the parent container.
|
||||||
|
|||||||
@@ -192,8 +192,7 @@ function insert_hotspot_into_DOM(hotspot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// reposition on any event that might update the UI
|
// reposition on any event that might update the UI
|
||||||
['resize', 'scroll', 'onkeydown', 'click']
|
['resize', 'scroll', 'onkeydown', 'click'].forEach(function (event_name) {
|
||||||
.forEach(function (event_name) {
|
|
||||||
window.addEventListener(event_name, _.debounce(function () {
|
window.addEventListener(event_name, _.debounce(function () {
|
||||||
if (place_icon(hotspot)) {
|
if (place_icon(hotspot)) {
|
||||||
place_popover(hotspot);
|
place_popover(hotspot);
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
/* eslint indent: "off" */
|
||||||
|
|
||||||
var LightboxCanvas = (function () {
|
var LightboxCanvas = (function () {
|
||||||
var events = {
|
var events = {
|
||||||
documentMouseup: [],
|
documentMouseup: [],
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
/* eslint indent: "off" */
|
||||||
|
|
||||||
var list_render = (function () {
|
var list_render = (function () {
|
||||||
var DEFAULTS = {
|
var DEFAULTS = {
|
||||||
INITIAL_RENDER_COUNT: 80,
|
INITIAL_RENDER_COUNT: 80,
|
||||||
|
|||||||
@@ -328,8 +328,7 @@ exports.initialize = 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;
|
||||||
},
|
}};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configure the marked markdown parser for our usage
|
// Configure the marked markdown parser for our usage
|
||||||
|
|||||||
@@ -148,8 +148,7 @@ MessageListView.prototype = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
add_subscription_marker: function MessageListView__add_subscription_marker(
|
add_subscription_marker: function (group, last_msg_container, first_msg_container) {
|
||||||
group, last_msg_container, first_msg_container) {
|
|
||||||
if (last_msg_container === undefined) {
|
if (last_msg_container === undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -980,8 +979,7 @@ MessageListView.prototype = {
|
|||||||
trailing_bookend.remove();
|
trailing_bookend.remove();
|
||||||
},
|
},
|
||||||
|
|
||||||
render_trailing_bookend: function MessageListView_render_trailing_bookend(
|
render_trailing_bookend: function (trailing_bookend_content, subscribed, show_button) {
|
||||||
trailing_bookend_content, subscribed, show_button) {
|
|
||||||
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: show_button,
|
trailing: show_button,
|
||||||
|
|||||||
@@ -357,7 +357,8 @@ exports.update_selection = function (opts) {
|
|||||||
|
|
||||||
var then_scroll = !preserve_pre_narrowing_screen_position;
|
var then_scroll = !preserve_pre_narrowing_screen_position;
|
||||||
|
|
||||||
message_list.narrowed.select_id(msg_id, {then_scroll: then_scroll,
|
message_list.narrowed.select_id(msg_id, {
|
||||||
|
then_scroll: then_scroll,
|
||||||
use_closest: true,
|
use_closest: true,
|
||||||
force_rerender: true,
|
force_rerender: true,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -96,11 +96,13 @@ exports.initialize = function () {
|
|||||||
supports_sound = true;
|
supports_sound = true;
|
||||||
$("#notifications-area").append(audio);
|
$("#notifications-area").append(audio);
|
||||||
if (audio[0].canPlayType('audio/ogg; codecs="vorbis"')) {
|
if (audio[0].canPlayType('audio/ogg; codecs="vorbis"')) {
|
||||||
audio.append($("<source>").attr("type", "audio/ogg")
|
audio.append(
|
||||||
|
$("<source>").attr("type", "audio/ogg")
|
||||||
.attr("loop", "yes")
|
.attr("loop", "yes")
|
||||||
.attr("src", "/static/audio/zulip.ogg"));
|
.attr("src", "/static/audio/zulip.ogg"));
|
||||||
} else {
|
} else {
|
||||||
audio.append($("<source>").attr("type", "audio/mpeg")
|
audio.append(
|
||||||
|
$("<source>").attr("type", "audio/mpeg")
|
||||||
.attr("loop", "yes")
|
.attr("loop", "yes")
|
||||||
.attr("src", "/static/audio/zulip.mp3"));
|
.attr("src", "/static/audio/zulip.mp3"));
|
||||||
}
|
}
|
||||||
@@ -338,15 +340,16 @@ function process_notification(notification) {
|
|||||||
|
|
||||||
if (message.type === "stream") {
|
if (message.type === "stream") {
|
||||||
title += " (to " + message.stream + " > " + message.subject + ")";
|
title += " (to " + message.stream + " > " + message.subject + ")";
|
||||||
raw_operators = [{operator: "stream", operand: message.stream},
|
raw_operators = [
|
||||||
{operator: "topic", operand: message.subject}];
|
{operator: "stream", operand: message.stream},
|
||||||
|
{operator: "topic", operand: message.subject},
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window.bridge === undefined && notification.webkit_notify === true) {
|
if (window.bridge === undefined && notification.webkit_notify === true) {
|
||||||
var icon_url = people.small_avatar_url(message);
|
var icon_url = people.small_avatar_url(message);
|
||||||
notice_memory[key] = {
|
notice_memory[key] = {
|
||||||
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,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -137,8 +137,8 @@ exports.rebuild_recent = function (active_conversation) {
|
|||||||
if (private_messages_open) {
|
if (private_messages_open) {
|
||||||
var max_private_messages = 5;
|
var max_private_messages = 5;
|
||||||
var private_li = get_filter_li();
|
var private_li = get_filter_li();
|
||||||
var private_messages_dom = exports._build_private_messages_list(active_conversation,
|
var private_messages_dom = exports._build_private_messages_list(
|
||||||
max_private_messages);
|
active_conversation, max_private_messages);
|
||||||
|
|
||||||
private_li.append(private_messages_dom);
|
private_li.append(private_messages_dom);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint indent: "off" */
|
||||||
import PerfectScrollbar from 'perfect-scrollbar';
|
import PerfectScrollbar from 'perfect-scrollbar';
|
||||||
|
|
||||||
function registerCodeSection($codeSection) {
|
function registerCodeSection($codeSection) {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint indent: "off" */
|
||||||
var realm_icon = (function () {
|
var realm_icon = (function () {
|
||||||
|
|
||||||
var exports = {};
|
var exports = {};
|
||||||
|
|||||||
@@ -102,9 +102,8 @@ exports.initialize = function () {
|
|||||||
$('#search_exit').on('click', exports.clear_search);
|
$('#search_exit').on('click', exports.clear_search);
|
||||||
|
|
||||||
var query = $('#search_query');
|
var query = $('#search_query');
|
||||||
query.on('focus', exports.focus_search)
|
query.on('focus', exports.focus_search);
|
||||||
.on('blur' , function () {
|
query.on('blur' , function () {
|
||||||
|
|
||||||
// The search query box is a visual cue as to
|
// The search query box is a visual cue as to
|
||||||
// whether search or narrowing is active. If
|
// whether search or narrowing is active. If
|
||||||
// the user blurs the search box, then we should
|
// the user blurs the search box, then we should
|
||||||
|
|||||||
@@ -90,7 +90,8 @@ exports.add_custom_profile_fields_to_settings = function () {
|
|||||||
value = "";
|
value = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
var html = templates.render("custom-user-profile-field", {field: field,
|
var html = templates.render("custom-user-profile-field", {
|
||||||
|
field: field,
|
||||||
field_type: type,
|
field_type: type,
|
||||||
field_value: value,
|
field_value: value,
|
||||||
is_long_text_field: is_long_text,
|
is_long_text_field: is_long_text,
|
||||||
|
|||||||
@@ -393,9 +393,11 @@ function update_dependent_subsettings(property_name) {
|
|||||||
} else if (property_name === 'realm_invite_required') {
|
} else if (property_name === 'realm_invite_required') {
|
||||||
settings_ui.disable_sub_setting_onchange(page_params.realm_invite_required,
|
settings_ui.disable_sub_setting_onchange(page_params.realm_invite_required,
|
||||||
"id_realm_invite_by_admins_only", true);
|
"id_realm_invite_by_admins_only", true);
|
||||||
} else if (property_name === 'realm_video_chat_provider' || property_name === 'realm_google_hangouts_domain') {
|
} else if (property_name === 'realm_video_chat_provider' ||
|
||||||
|
property_name === 'realm_google_hangouts_domain') {
|
||||||
set_video_chat_provider_dropdown();
|
set_video_chat_provider_dropdown();
|
||||||
} else if (property_name === 'realm_msg_edit_limit_setting' || property_name === 'realm_message_content_edit_limit_minutes') {
|
} else if (property_name === 'realm_msg_edit_limit_setting' ||
|
||||||
|
property_name === 'realm_message_content_edit_limit_minutes') {
|
||||||
set_msg_edit_limit_dropdown();
|
set_msg_edit_limit_dropdown();
|
||||||
} else if (property_name === 'realm_msg_delete_limit_setting' ||
|
} else if (property_name === 'realm_msg_delete_limit_setting' ||
|
||||||
property_name === 'realm_message_content_delete_limit_minutes') {
|
property_name === 'realm_message_content_delete_limit_minutes') {
|
||||||
@@ -654,8 +656,8 @@ function _set_up() {
|
|||||||
var add_emoji_permission = $("#id_realm_add_emoji_by_admins_only").val();
|
var add_emoji_permission = $("#id_realm_add_emoji_by_admins_only").val();
|
||||||
var new_message_retention_days = $("#id_realm_message_retention_days").val();
|
var new_message_retention_days = $("#id_realm_message_retention_days").val();
|
||||||
|
|
||||||
if (parseInt(new_message_retention_days, 10).toString() !==
|
if (parseInt(new_message_retention_days, 10).toString() !== new_message_retention_days
|
||||||
new_message_retention_days && new_message_retention_days !== "") {
|
&& new_message_retention_days !== "") {
|
||||||
new_message_retention_days = "";
|
new_message_retention_days = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,8 +84,7 @@ exports.populate_user_groups = function () {
|
|||||||
});
|
});
|
||||||
pill_container.find('.pill').hover(function () {
|
pill_container.find('.pill').hover(function () {
|
||||||
pill_container.find('.pill').find('.exit').css('opacity', '0.5');
|
pill_container.find('.pill').find('.exit').css('opacity', '0.5');
|
||||||
}, function () {}
|
}, function () {});
|
||||||
);
|
|
||||||
}
|
}
|
||||||
update_membership(data.id);
|
update_membership(data.id);
|
||||||
|
|
||||||
|
|||||||
@@ -32,8 +32,14 @@ function Socket(url) {
|
|||||||
that._try_to_reconnect({reason: 'unsuspend'});
|
that._try_to_reconnect({reason: 'unsuspend'});
|
||||||
});
|
});
|
||||||
|
|
||||||
this._supported_protocols = ['websocket', 'xdr-streaming', 'xhr-streaming',
|
this._supported_protocols = [
|
||||||
'xdr-polling', 'xhr-polling', 'jsonp-polling'];
|
'websocket',
|
||||||
|
'xdr-streaming',
|
||||||
|
'xhr-streaming',
|
||||||
|
'xdr-polling',
|
||||||
|
'xhr-polling',
|
||||||
|
'jsonp-polling',
|
||||||
|
];
|
||||||
if (page_params.test_suite) {
|
if (page_params.test_suite) {
|
||||||
this._supported_protocols = _.reject(this._supported_protocols,
|
this._supported_protocols = _.reject(this._supported_protocols,
|
||||||
function (x) { return x === 'xhr-streaming'; });
|
function (x) { return x === 'xhr-streaming'; });
|
||||||
|
|||||||
@@ -5,12 +5,14 @@ var exports = {};
|
|||||||
exports.default_color = "#c2c2c2";
|
exports.default_color = "#c2c2c2";
|
||||||
// Auto-assigned colors should be from the default palette so it's easy to undo
|
// Auto-assigned colors should be from the default palette so it's easy to undo
|
||||||
// changes, so if that palette changes, change these colors.
|
// changes, so if that palette changes, change these colors.
|
||||||
var stream_assignment_colors = ["#76ce90", "#fae589", "#a6c7e5", "#e79ab5",
|
var stream_assignment_colors = [
|
||||||
|
"#76ce90", "#fae589", "#a6c7e5", "#e79ab5",
|
||||||
"#bfd56f", "#f4ae55", "#b0a5fd", "#addfe5",
|
"#bfd56f", "#f4ae55", "#b0a5fd", "#addfe5",
|
||||||
"#f5ce6e", "#c2726a", "#94c849", "#bd86e5",
|
"#f5ce6e", "#c2726a", "#94c849", "#bd86e5",
|
||||||
"#ee7e4a", "#a6dcbf", "#95a5fd", "#53a063",
|
"#ee7e4a", "#a6dcbf", "#95a5fd", "#53a063",
|
||||||
"#9987e1", "#e4523d", "#c2c2c2", "#4f8de4",
|
"#9987e1", "#e4523d", "#c2c2c2", "#4f8de4",
|
||||||
"#c6a8ad", "#e7cc4d", "#c8bebf", "#a47462"];
|
"#c6a8ad", "#e7cc4d", "#c8bebf", "#a47462",
|
||||||
|
];
|
||||||
|
|
||||||
// Classes which could be returned by get_color_class.
|
// Classes which could be returned by get_color_class.
|
||||||
exports.color_classes = 'dark_background';
|
exports.color_classes = 'dark_background';
|
||||||
@@ -85,7 +87,8 @@ var subscriptions_table_colorpicker_options = {
|
|||||||
|
|
||||||
exports.set_colorpicker_color = function (colorpicker, color) {
|
exports.set_colorpicker_color = function (colorpicker, color) {
|
||||||
colorpicker.spectrum(_.extend(subscriptions_table_colorpicker_options,
|
colorpicker.spectrum(_.extend(subscriptions_table_colorpicker_options,
|
||||||
{color: color, container: "#subscription_overlay .subscription_settings.show"}));
|
{color: color,
|
||||||
|
container: "#subscription_overlay .subscription_settings.show"}));
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.update_stream_color = function (sub, color, opts) {
|
exports.update_stream_color = function (sub, color, opts) {
|
||||||
|
|||||||
@@ -178,7 +178,8 @@ function create_stream() {
|
|||||||
|
|
||||||
loading.make_indicator($('#stream_creating_indicator'), {text: i18n.t('Creating stream...')});
|
loading.make_indicator($('#stream_creating_indicator'), {text: i18n.t('Creating stream...')});
|
||||||
|
|
||||||
ajaxSubscribeForCreation(stream_name,
|
ajaxSubscribeForCreation(
|
||||||
|
stream_name,
|
||||||
description,
|
description,
|
||||||
principals,
|
principals,
|
||||||
is_invite_only,
|
is_invite_only,
|
||||||
@@ -408,7 +409,8 @@ exports.set_up_handlers = function () {
|
|||||||
|
|
||||||
container.on("mouseover", "#announce-stream-docs", function (e) {
|
container.on("mouseover", "#announce-stream-docs", function (e) {
|
||||||
var announce_stream_docs = $("#announce-stream-docs");
|
var announce_stream_docs = $("#announce-stream-docs");
|
||||||
announce_stream_docs.popover({placement: "right",
|
announce_stream_docs.popover({
|
||||||
|
placement: "right",
|
||||||
content: templates.render('announce_stream_docs', {
|
content: templates.render('announce_stream_docs', {
|
||||||
notifications_stream: page_params.notifications_stream}),
|
notifications_stream: page_params.notifications_stream}),
|
||||||
trigger: "manual"});
|
trigger: "manual"});
|
||||||
|
|||||||
@@ -225,8 +225,7 @@ exports.all_subscribed_streams_are_in_home_view = function () {
|
|||||||
exports.home_view_stream_names = function () {
|
exports.home_view_stream_names = function () {
|
||||||
var home_view_subs = _.filter(exports.subscribed_subs(), function (sub) {
|
var home_view_subs = _.filter(exports.subscribed_subs(), function (sub) {
|
||||||
return sub.in_home_view;
|
return sub.in_home_view;
|
||||||
}
|
});
|
||||||
);
|
|
||||||
return _.map(home_view_subs, function (sub) {
|
return _.map(home_view_subs, function (sub) {
|
||||||
return sub.name;
|
return sub.name;
|
||||||
});
|
});
|
||||||
@@ -554,7 +553,8 @@ exports.get_newbie_stream = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
exports.remove_default_stream = function (stream_id) {
|
exports.remove_default_stream = function (stream_id) {
|
||||||
page_params.realm_default_streams = _.reject(page_params.realm_default_streams,
|
page_params.realm_default_streams = _.reject(
|
||||||
|
page_params.realm_default_streams,
|
||||||
function (stream) {
|
function (stream) {
|
||||||
return stream.stream_id === stream_id;
|
return stream.stream_id === stream_id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -543,8 +543,7 @@ $(function () {
|
|||||||
|
|
||||||
function invite_failure() {
|
function invite_failure() {
|
||||||
stream_subscription_info_elem.text(i18n.t("Could not add user to this stream."))
|
stream_subscription_info_elem.text(i18n.t("Could not add user to this stream."))
|
||||||
.addClass("text-error")
|
.addClass("text-error").removeClass("text-success");
|
||||||
.removeClass("text-success");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.invite_user_to_stream(principal, sub, invite_success, invite_failure);
|
exports.invite_user_to_stream(principal, sub, invite_success, invite_failure);
|
||||||
@@ -580,8 +579,7 @@ $(function () {
|
|||||||
|
|
||||||
function removal_failure() {
|
function removal_failure() {
|
||||||
stream_subscription_info_elem.text(i18n.t("Error removing user from this stream."))
|
stream_subscription_info_elem.text(i18n.t("Error removing user from this stream."))
|
||||||
.addClass("text-error")
|
.addClass("text-error").removeClass("text-success");
|
||||||
.removeClass("text-success");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.remove_user_from_stream(principal, sub, removal_success,
|
exports.remove_user_from_stream(principal, sub, removal_success,
|
||||||
|
|||||||
@@ -215,7 +215,8 @@ exports.set_in_home_view = function (stream_id, in_home) {
|
|||||||
|
|
||||||
function build_stream_sidebar_li(sub) {
|
function build_stream_sidebar_li(sub) {
|
||||||
var name = sub.name;
|
var name = sub.name;
|
||||||
var args = {name: name,
|
var args = {
|
||||||
|
name: name,
|
||||||
id: sub.stream_id,
|
id: sub.stream_id,
|
||||||
uri: narrow.by_stream_uri(name),
|
uri: narrow.by_stream_uri(name),
|
||||||
not_in_home_view: (stream_data.in_home_view(sub.stream_id) === false),
|
not_in_home_view: (stream_data.in_home_view(sub.stream_id) === false),
|
||||||
|
|||||||
@@ -195,14 +195,9 @@ function build_all_messages_popover(e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.register_click_handlers = function () {
|
exports.register_click_handlers = function () {
|
||||||
$('#stream_filters').on('click',
|
$('#stream_filters').on('click', '.stream-sidebar-arrow', build_stream_popover);
|
||||||
'.stream-sidebar-arrow', build_stream_popover);
|
$('#stream_filters').on('click', '.topic-sidebar-arrow', build_topic_popover);
|
||||||
|
$('#global_filters').on('click', '.stream-sidebar-arrow', build_all_messages_popover);
|
||||||
$('#stream_filters').on('click',
|
|
||||||
'.topic-sidebar-arrow', build_topic_popover);
|
|
||||||
|
|
||||||
$('#global_filters').on('click',
|
|
||||||
'.stream-sidebar-arrow', build_all_messages_popover);
|
|
||||||
|
|
||||||
exports.register_stream_handlers();
|
exports.register_stream_handlers();
|
||||||
exports.register_topic_handlers();
|
exports.register_topic_handlers();
|
||||||
|
|||||||
@@ -301,7 +301,8 @@ exports.set_click_handlers = function (callbacks) {
|
|||||||
var sub = stream_data.get_sub_by_id(stream_id);
|
var sub = stream_data.get_sub_by_id(stream_id);
|
||||||
var topic = $(e.target).parents('li').attr('data-topic-name');
|
var topic = $(e.target).parents('li').attr('data-topic-name');
|
||||||
|
|
||||||
narrow.activate([{operator: 'stream', operand: sub.name},
|
narrow.activate([
|
||||||
|
{operator: 'stream', operand: sub.name},
|
||||||
{operator: 'topic', operand: topic}],
|
{operator: 'topic', operand: topic}],
|
||||||
{trigger: 'sidebar'});
|
{trigger: 'sidebar'});
|
||||||
|
|
||||||
|
|||||||
@@ -273,8 +273,8 @@ exports.sort_languages = function (matches, query) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
exports.sort_recipients = function (users, query, current_stream, current_subject, groups) {
|
exports.sort_recipients = function (users, query, current_stream, current_subject, groups) {
|
||||||
var users_name_results = util.prefix_sort(query, users,
|
var users_name_results = util.prefix_sort(
|
||||||
function (x) { return x.full_name; });
|
query, users, function (x) { return x.full_name; });
|
||||||
var result = exports.sort_for_at_mentioning(
|
var result = exports.sort_for_at_mentioning(
|
||||||
users_name_results.matches,
|
users_name_results.matches,
|
||||||
current_stream,
|
current_stream,
|
||||||
|
|||||||
@@ -192,7 +192,8 @@ $(function () {
|
|||||||
// Scroll to place the message within the current view;
|
// Scroll to place the message within the current view;
|
||||||
// but if this is the initial placement of the pointer,
|
// but if this is the initial placement of the pointer,
|
||||||
// just place it in the very center
|
// just place it in the very center
|
||||||
message_viewport.recenter_view(row, {from_scroll: event.from_scroll,
|
message_viewport.recenter_view(row,
|
||||||
|
{from_scroll: event.from_scroll,
|
||||||
force_center: event.previously_selected === -1});
|
force_center: event.previously_selected === -1});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -205,17 +206,17 @@ $(function () {
|
|||||||
timerender.set_full_datetime(message, time_elem);
|
timerender.set_full_datetime(message, time_elem);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#streams_header h4').tooltip({ placement: 'right',
|
$('#streams_header h4').tooltip({placement: 'right',
|
||||||
animation: false });
|
animation: false});
|
||||||
|
|
||||||
$('#streams_header i[data-toggle="tooltip"]').tooltip({ placement: 'left',
|
$('#streams_header i[data-toggle="tooltip"]').tooltip({placement: 'left',
|
||||||
animation: false });
|
animation: false});
|
||||||
|
|
||||||
$('#userlist-header #userlist-title').tooltip({ placement: 'right',
|
$('#userlist-header #userlist-title').tooltip({placement: 'right',
|
||||||
animation: false });
|
animation: false});
|
||||||
|
|
||||||
$('#userlist-header #user_filter_icon').tooltip({ placement: 'left',
|
$('#userlist-header #user_filter_icon').tooltip({placement: 'left',
|
||||||
animation: false });
|
animation: false});
|
||||||
|
|
||||||
$('.message_failed i[data-toggle="tooltip"]').tooltip();
|
$('.message_failed i[data-toggle="tooltip"]').tooltip();
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,8 @@ exports.mark_stream_as_read = function (stream_id, cont) {
|
|||||||
url: '/json/mark_stream_as_read',
|
url: '/json/mark_stream_as_read',
|
||||||
idempotent: true,
|
idempotent: true,
|
||||||
data: {stream_id: stream_id},
|
data: {stream_id: stream_id},
|
||||||
success: cont});
|
success: cont,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.mark_topic_as_read = function (stream_id, topic, cont) {
|
exports.mark_topic_as_read = function (stream_id, topic, cont) {
|
||||||
@@ -117,7 +118,8 @@ exports.mark_topic_as_read = function (stream_id, topic, cont) {
|
|||||||
url: '/json/mark_topic_as_read',
|
url: '/json/mark_topic_as_read',
|
||||||
idempotent: true,
|
idempotent: true,
|
||||||
data: {stream_id: stream_id, topic_name: topic},
|
data: {stream_id: stream_id, topic_name: topic},
|
||||||
success: cont});
|
success: cont,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint indent: "off" */
|
||||||
var upload_widget = (function () {
|
var upload_widget = (function () {
|
||||||
|
|
||||||
var exports = {};
|
var exports = {};
|
||||||
|
|||||||
@@ -2,8 +2,11 @@
|
|||||||
// global variables from Zulip (everything is being moved into
|
// global variables from Zulip (everything is being moved into
|
||||||
// modules). Please don't add things here.
|
// modules). Please don't add things here.
|
||||||
|
|
||||||
var home_msg_list = new message_list.MessageList('zhome',
|
var home_msg_list = new message_list.MessageList(
|
||||||
new Filter([{operator: "in", operand: "home"}]), {muting_enabled: true}
|
'zhome',
|
||||||
|
new Filter([{operator: "in",
|
||||||
|
operand: "home"}]),
|
||||||
|
{muting_enabled: true}
|
||||||
);
|
);
|
||||||
var current_msg_list = home_msg_list;
|
var current_msg_list = home_msg_list;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user