mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 19:06:09 +00:00
js: Standardize indentation of switch/case statements.
This gets my current draft eslint indentation configuration passing cleaning on static/js.
This commit is contained in:
@@ -137,8 +137,11 @@ exports.restore_draft = function (draft_id) {
|
|||||||
|
|
||||||
if (draft.type === "stream") {
|
if (draft.type === "stream") {
|
||||||
if (draft.stream !== "") {
|
if (draft.stream !== "") {
|
||||||
narrow.activate([{operator: "stream", operand: draft.stream},
|
narrow.activate(
|
||||||
{operator: "topic", operand: draft.subject}],
|
[
|
||||||
|
{operator: "stream", operand: draft.stream},
|
||||||
|
{operator: "topic", operand: draft.subject},
|
||||||
|
],
|
||||||
{trigger: "restore draft"});
|
{trigger: "restore draft"});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -432,9 +432,9 @@ exports.process_hotkey = function (e, hotkey) {
|
|||||||
return exports.process_shift_tab_key();
|
return exports.process_shift_tab_key();
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (event_name) {
|
|
||||||
// TODO: break out specific handlers for up_arrow,
|
// TODO: break out specific handlers for up_arrow,
|
||||||
// down_arrow, and backspace
|
// down_arrow, and backspace
|
||||||
|
switch (event_name) {
|
||||||
case 'up_arrow':
|
case 'up_arrow':
|
||||||
case 'down_arrow':
|
case 'down_arrow':
|
||||||
case 'backspace':
|
case 'backspace':
|
||||||
|
|||||||
@@ -4,9 +4,11 @@ var exports = {};
|
|||||||
exports.view = {}; // function namespace
|
exports.view = {}; // function namespace
|
||||||
|
|
||||||
exports.get_local_reaction_id = function (reaction_info) {
|
exports.get_local_reaction_id = function (reaction_info) {
|
||||||
return [reaction_info.reaction_type,
|
return [
|
||||||
|
reaction_info.reaction_type,
|
||||||
reaction_info.emoji_name,
|
reaction_info.emoji_name,
|
||||||
reaction_info.emoji_code].join(',');
|
reaction_info.emoji_code,
|
||||||
|
].join(',');
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.get_reaction_info = function (reaction_id) {
|
exports.get_reaction_info = function (reaction_id) {
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'restart':
|
case 'restart':
|
||||||
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!",
|
||||||
@@ -92,8 +93,8 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) {
|
|||||||
settings_org.sync_realm_settings(event.property);
|
settings_org.sync_realm_settings(event.property);
|
||||||
if (event.property === 'create_stream_by_admins_only') {
|
if (event.property === 'create_stream_by_admins_only') {
|
||||||
if (!page_params.is_admin) {
|
if (!page_params.is_admin) {
|
||||||
page_params.can_create_streams = (!page_params.
|
page_params.can_create_streams = (
|
||||||
realm_create_stream_by_admins_only);
|
!page_params.realm_create_stream_by_admins_only);
|
||||||
}
|
}
|
||||||
} else if (event.property === 'notifications_stream_id') {
|
} else if (event.property === 'notifications_stream_id') {
|
||||||
settings_org.render_notifications_stream_ui(
|
settings_org.render_notifications_stream_ui(
|
||||||
|
|||||||
@@ -30,9 +30,20 @@ function floor_to_local_week(date) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function format_date(date, include_hour) {
|
function format_date(date, include_hour) {
|
||||||
var months = [i18n.t('January'), i18n.t('February'), i18n.t('March'), i18n.t('April'), i18n.t('May'), i18n.t('June'),
|
var months = [
|
||||||
i18n.t('July'), i18n.t('August'), i18n.t('September'), i18n.t('October'), i18n.t('November'),
|
i18n.t('January'),
|
||||||
i18n.t('December')];
|
i18n.t('February'),
|
||||||
|
i18n.t('March'),
|
||||||
|
i18n.t('April'),
|
||||||
|
i18n.t('May'),
|
||||||
|
i18n.t('June'),
|
||||||
|
i18n.t('July'),
|
||||||
|
i18n.t('August'),
|
||||||
|
i18n.t('September'),
|
||||||
|
i18n.t('October'),
|
||||||
|
i18n.t('November'),
|
||||||
|
i18n.t('December'),
|
||||||
|
];
|
||||||
var month_str = months[date.getMonth()];
|
var month_str = months[date.getMonth()];
|
||||||
var year = date.getFullYear();
|
var year = date.getFullYear();
|
||||||
var day = date.getDate();
|
var day = date.getDate();
|
||||||
@@ -135,10 +146,11 @@ function populate_messages_sent_over_time(data) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function make_rangeselector(x, y, button1, button2) {
|
function make_rangeselector(x, y, button1, button2) {
|
||||||
return { x: x, y: y,
|
return {x: x, y: y,
|
||||||
buttons: [$.extend({stepmode: 'backward'}, button1),
|
buttons: [
|
||||||
|
$.extend({stepmode: 'backward'}, button1),
|
||||||
$.extend({stepmode: 'backward'}, button2),
|
$.extend({stepmode: 'backward'}, button2),
|
||||||
{step: 'all', label: 'All time'}] };
|
{step: 'all', label: 'All time'}]};
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is also the cumulative rangeselector
|
// This is also the cumulative rangeselector
|
||||||
|
|||||||
@@ -220,8 +220,10 @@ exports.stringify_time = function (time) {
|
|||||||
// this is for rendering absolute time based off the preferences for twenty-four
|
// this is for rendering absolute time based off the preferences for twenty-four
|
||||||
// hour time in the format of "%mmm %d, %h:%m %p".
|
// hour time in the format of "%mmm %d, %h:%m %p".
|
||||||
exports.absolute_time = (function () {
|
exports.absolute_time = (function () {
|
||||||
var MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
var MONTHS = [
|
||||||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
||||||
|
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
|
||||||
|
];
|
||||||
|
|
||||||
var fmt_time = function (date, H_24) {
|
var fmt_time = function (date, H_24) {
|
||||||
var payload = {
|
var payload = {
|
||||||
|
|||||||
Reference in New Issue
Block a user