mirror of https://github.com/zulip/zulip.git
lint: Check for space after if in javascript.
This commit is contained in:
parent
eba0d6339f
commit
0c1b5006f7
|
@ -120,7 +120,7 @@ exports.check_form = function (form_selector, expected, test_name) {
|
||||||
exports.then_send_message = function (type, params) {
|
exports.then_send_message = function (type, params) {
|
||||||
casper.waitForSelector('#compose-send-button:enabled');
|
casper.waitForSelector('#compose-send-button:enabled');
|
||||||
casper.waitForSelector('#new_message_content', function () {
|
casper.waitForSelector('#new_message_content', function () {
|
||||||
if(type === "stream") {
|
if (type === "stream") {
|
||||||
casper.page.sendEvent('keypress', "c");
|
casper.page.sendEvent('keypress', "c");
|
||||||
}
|
}
|
||||||
else if (type === "private") {
|
else if (type === "private") {
|
||||||
|
|
|
@ -232,7 +232,7 @@ exports.setup_page = function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#id_realm_invite_required").change(function () {
|
$("#id_realm_invite_required").change(function () {
|
||||||
if(this.checked) {
|
if (this.checked) {
|
||||||
$("#id_realm_invite_by_admins_only").removeAttr("disabled");
|
$("#id_realm_invite_by_admins_only").removeAttr("disabled");
|
||||||
$("#id_realm_invite_by_admins_only_label").removeClass("control-label-disabled");
|
$("#id_realm_invite_by_admins_only_label").removeClass("control-label-disabled");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -551,7 +551,7 @@ MessageListView.prototype = {
|
||||||
if (elem.is("div")) {
|
if (elem.is("div")) {
|
||||||
new_messages_height += elem.height();
|
new_messages_height += elem.height();
|
||||||
// starting from the last message, ignore message heights that weren't sent by me.
|
// starting from the last message, ignore message heights that weren't sent by me.
|
||||||
if(id_of_last_message_sent_by_us > -1) {
|
if (id_of_last_message_sent_by_us > -1) {
|
||||||
distance_to_last_message_sent_by_me += elem.height();
|
distance_to_last_message_sent_by_me += elem.height();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@ exports.initialize = function () {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (notifications_api.checkPermission() !== 0) { // 0 is PERMISSION_ALLOWED
|
if (notifications_api.checkPermission() !== 0) { // 0 is PERMISSION_ALLOWED
|
||||||
if(tutorial.is_running()) {
|
if (tutorial.is_running()) {
|
||||||
tutorial.defer(function () {
|
tutorial.defer(function () {
|
||||||
notifications_api.requestPermission(function () {
|
notifications_api.requestPermission(function () {
|
||||||
asked_permission_already = true;
|
asked_permission_already = true;
|
||||||
|
|
|
@ -147,6 +147,8 @@ js_rules = [
|
||||||
'description': 'Missing whitespace after "="'},
|
'description': 'Missing whitespace after "="'},
|
||||||
{'pattern': '^[ ]*//[A-Za-z0-9]',
|
{'pattern': '^[ ]*//[A-Za-z0-9]',
|
||||||
'description': 'Missing space after // in comment'},
|
'description': 'Missing space after // in comment'},
|
||||||
|
{'pattern': 'if[(]',
|
||||||
|
'description': 'Missing space between if and ('},
|
||||||
{'pattern': 'else{$',
|
{'pattern': 'else{$',
|
||||||
'description': 'Missing space between else and {'},
|
'description': 'Missing space between else and {'},
|
||||||
] + whitespace_rules
|
] + whitespace_rules
|
||||||
|
|
Loading…
Reference in New Issue