From 651f6938d3f11b80c06062a3eccf591092dbaed1 Mon Sep 17 00:00:00 2001 From: Damien McKenna <damien@mc-kenna.com> Date: Wed, 17 Jul 2024 14:54:57 -0400 Subject: [PATCH] Issue #3444839 by nagy.balint: Coding standards fixes. --- js/ajax.js | 20 ++++++++++---------- js/ajax_view.js | 6 +++--- js/base.js | 6 +++--- js/views-admin.js | 30 +++++++++++++++--------------- views.module | 2 +- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/js/ajax.js b/js/ajax.js index d63688e1..799413db 100644 --- a/js/ajax.js +++ b/js/ajax.js @@ -131,7 +131,7 @@ } Drupal.behaviors.viewsAjax = { - collapseReplaced: FALSE, + collapseReplaced: false, attach: function (context, settings) { if (!settings.views) { return; @@ -139,11 +139,11 @@ // Create a jQuery UI dialog, but leave it closed. var dialog_area = $(settings.views.ajax.popup, context); dialog_area.dialog({ - 'autoOpen': FALSE, + 'autoOpen': false, 'dialogClass': 'views-ui-dialog', - 'modal': TRUE, + 'modal': true, 'position': 'center', - 'resizable': FALSE, + 'resizable': false, 'width': 750 }); @@ -168,14 +168,14 @@ .once('views-ajax-processed').each(function () { // We don't bind to links without a URL. if (!$(this).attr('href')) { - return TRUE; + return true; } var element_settings = base_element_settings; // Set the URL to go to the anchor. element_settings.url = $(this).attr('href'); if (Drupal.Views.getPath(element_settings.url).substring(0, 21) != 'admin/structure/views') { - return TRUE; + return true; } element_settings.wrapper = 'views-live-preview'; @@ -192,13 +192,13 @@ .once('views-ajax-processed').each(function (event) { $(this).click(function () { this.form.clk = this; - return TRUE; + return true; }); var element_settings = base_element_settings; // Set the URL to go to the anchor. element_settings.url = $(this.form).attr('action'); if (Drupal.Views.getPath(element_settings.url).substring(0, 21) != 'admin/structure/views') { - return TRUE; + return true; } element_settings.wrapper = 'views-live-preview'; @@ -210,7 +210,7 @@ }); if (!this.collapseReplaced && Drupal.collapseScrollIntoView) { - this.collapseReplaced = TRUE; + this.collapseReplaced = true; Drupal.collapseScrollIntoView = function (node) { for (var $parent = $(node); $parent.get(0) != document && $parent.length != 0; $parent = $parent.parent()) { if ($parent.css('overflow') == 'scroll' || $parent.css('overflow') == 'auto') { @@ -218,7 +218,7 @@ // If the modal is already at the max height, don't bother with // this since the only reason to do it is to grow the modal. if ($('.views-ui-dialog').height() < parseInt($(window).height() * .8)) { - Drupal.viewsUi.resizeModal('', TRUE); + Drupal.viewsUi.resizeModal('', true); } } return; diff --git a/js/ajax_view.js b/js/ajax_view.js index e05b19c1..b7286adb 100644 --- a/js/ajax_view.js +++ b/js/ajax_view.js @@ -55,7 +55,7 @@ this.element_settings = { url: ajax_path + queryString, submit: settings, - setClick: TRUE, + setClick: true, event: 'click', selector: selector, progress: { @@ -122,7 +122,7 @@ var href = $link.attr('href'); // Don't attach to pagers inside nested views. if ($link.closest('.view')[0] !== this.$view[0] && - $link.closest('.view').parent().hasClass('attachment') === FALSE) { + $link.closest('.view').parent().hasClass('attachment') === false) { return; } @@ -151,7 +151,7 @@ // then overriding submit with viewData. var pager_settings = $.extend({}, this.element_settings); pager_settings.submit = viewData; - this.pagerAjax = new Drupal.ajax(FALSE, $link, pager_settings); + this.pagerAjax = new Drupal.ajax(false, $link, pager_settings); this.links.push(this.pagerAjax); }; diff --git a/js/base.js b/js/base.js index 4d0b52bb..69fa9ab5 100644 --- a/js/base.js +++ b/js/base.js @@ -20,7 +20,7 @@ $('a.views-remove-link').once('views-processed').click(function (event) { var id = $(this).attr('id').replace('views-remove-link-', ''); $('#views-row-' + id).hide(); - $('#views-removed-' + id).get(0).checked = TRUE; + $('#views-removed-' + id).get(0).checked = true; event.preventDefault(); }); // Here is to handle display deletion @@ -30,8 +30,8 @@ .click(function () { var id = $(this).attr('id').replace('display-remove-link-', ''); $('#display-row-' + id).hide(); - $('#display-removed-' + id).get(0).checked = TRUE; - return FALSE; + $('#display-removed-' + id).get(0).checked = true; + return false; }); } }; diff --git a/js/views-admin.js b/js/views-admin.js index 26b3e286..0df462d1 100644 --- a/js/views-admin.js +++ b/js/views-admin.js @@ -92,7 +92,7 @@ Drupal.viewsUi.FormFieldFiller = function ($target, exclude, replace, suffix) { var $ = jQuery; this.source = $('#edit-human-name'); this.target = $target; - this.exclude = exclude || FALSE; + this.exclude = exclude || false; this.replace = replace || ''; this.suffix = suffix || ''; @@ -215,7 +215,7 @@ Drupal.viewsUi.addItemForm.prototype.handleCheck = function (event) { Drupal.viewsUi.addItemForm.prototype.refreshCheckedItems = function () { // Perhaps we should precache the text div, too. this.$selected_div.find('.views-selected-options').html(Drupal.checkPlain(this.checkedItems.join(', '))); - Drupal.viewsUi.resizeModal('', TRUE); + Drupal.viewsUi.resizeModal('', true); } @@ -369,12 +369,12 @@ Drupal.viewsUi.OptionsSearch.prototype.handleKeyup = function (event) { for (i = 0; i < length; i++) { // Use a local variable for the option being searched, for performance. option = this.options[i]; - found = TRUE; + found = true; // Each word in the search string has to match the item in order for the // item to be shown. for (j = 0; j < wordsLength; j++) { if (option.searchText.indexOf(words[j]) === -1) { - found = FALSE; + found = false; } } if (found) { @@ -532,7 +532,7 @@ Drupal.viewsUi.rearrangeFilterHandler.prototype.clickAddGroupButton = function ( // .mousedown() and .submit() events. this.addGroupButton.mousedown(); this.addGroupButton.submit(); - return FALSE; + return false; }; /** @@ -547,7 +547,7 @@ Drupal.viewsUi.rearrangeFilterHandler.prototype.clickRemoveGroupButton = functio // Drupal.viewsUi.rearrangeFilterHandler.prototype.clickAddGroupButton() // where we had to trigger .mousedown() also. jQuery('input#' + event.data.buttonId, this.table).submit(); - return FALSE; + return false; }; /** @@ -779,14 +779,14 @@ Drupal.behaviors.viewsFilterConfigSelectAll.attach = function (context) { var checked = $(this).is(':checked'); // Update all checkbox beside the select all checkbox. $(this).parents('.form-checkboxes').find('input[type=checkbox]').each(function () { - $(this).get(0).checked = TRUE; + $(this).get(0).checked = true; }); }); // Uncheck the select all checkbox if any of the others are unchecked. $('#views-ui-config-item-form div.form-type-checkbox').not($('.form-item-options-value-all')).find('input[type=checkbox]').each(function () { $(this).click(function () { if ($(this).is('checked') == 0 && $('#edit-options-value-all').length) { - $('#edit-options-value-all').get(0).checked = FALSE; + $('#edit-options-value-all').get(0).checked = false; } }); }); @@ -917,7 +917,7 @@ Drupal.behaviors.viewsUiOverrideSelect.attach = function (context, settings) { $submit.once('views-ui-override-button-text') .bind('mouseup', function () { $(this).val(old_value); - return TRUE; + return true; }); $(this).bind('change', function () { @@ -977,7 +977,7 @@ Drupal.viewsUi.resizeModal = function (e, no_shrink) { if (w > width) { width = w; } - scrollHeight += $(this).outerHeight(TRUE); + scrollHeight += $(this).outerHeight(true); }); // Now, calculate what the difference between the scroll and the modal @@ -985,11 +985,11 @@ Drupal.viewsUi.resizeModal = function (e, no_shrink) { var difference = 0; difference += parseInt($scroll.css('padding-top')); difference += parseInt($scroll.css('padding-bottom')); - difference += $('.views-override').outerHeight(TRUE) || 0; - difference += $('.views-messages').outerHeight(TRUE) || 0; - difference += $('#views-ajax-title').outerHeight(TRUE) || 0; - difference += $('.views-add-form-selected').outerHeight(TRUE) || 0; - difference += $('.form-buttons', $modal).outerHeight(TRUE) || 0; + difference += $('.views-override').outerHeight(true) || 0; + difference += $('.views-messages').outerHeight(true) || 0; + difference += $('#views-ajax-title').outerHeight(true) || 0; + difference += $('.views-add-form-selected').outerHeight(true) || 0; + difference += $('.form-buttons', $modal).outerHeight(true) || 0; height = scrollHeight + difference; diff --git a/views.module b/views.module index 6a9ff93a..d28303e3 100644 --- a/views.module +++ b/views.module @@ -2616,7 +2616,7 @@ function views_clean_css_identifier( '/' => '-', '[' => '-', ']' => '', - ), + ) ) { // By default, we filter using Drupal's coding standards. $identifier = strtr($identifier, $filter); -- GitLab