diff --git a/core/misc/ajax.js b/core/misc/ajax.js index 09621b20f22..f6ca48d3c0e 100644 --- a/core/misc/ajax.js +++ b/core/misc/ajax.js @@ -107,7 +107,8 @@ // xmlhttp.responseText is going to throw an exception. So we'll catch it. try { responseText = "\n" + Drupal.t("ResponseText: !responseText", {'!responseText': $.trim(xmlhttp.responseText) }); - } catch (e) {} + } + catch (e) {} // Make the responseText more readable by stripping HTML tags and newlines. responseText = responseText.replace(/<("[^"]*"|'[^']*'|[^'">])*>/gi, ""); diff --git a/core/misc/autocomplete.js b/core/misc/autocomplete.js index 66e820d3cc3..27369c0295e 100644 --- a/core/misc/autocomplete.js +++ b/core/misc/autocomplete.js @@ -162,10 +162,10 @@ * * @return {Object} */ - function renderItem (ul, item) { + function renderItem(ul, item) { return $("
anymore. if (element.parent.name === 'p' && caption) { - var index = element.getIndex(), - splitBefore = index > 0, - splitAfter = index + 1 < element.parent.children.length; + var index = element.getIndex(); + var splitBefore = index > 0; + var splitAfter = index + 1 < element.parent.children.length; if (splitBefore) { element.parent.split(index); @@ -203,7 +203,7 @@ * @param String name * @return CKEDITOR.htmlParser.element */ - function findElementByName (element, name) { + function findElementByName(element, name) { if (element.name === name) { return element; } diff --git a/core/modules/ckeditor/js/plugins/drupallink/plugin.js b/core/modules/ckeditor/js/plugins/drupallink/plugin.js index 541aaf93cab..762ac07e8a5 100644 --- a/core/modules/ckeditor/js/plugins/drupallink/plugin.js +++ b/core/modules/ckeditor/js/plugins/drupallink/plugin.js @@ -192,7 +192,6 @@ } }); - /** * Get the surrounding link element of current selection. * diff --git a/core/modules/comment/js/node-new-comments-link.js b/core/modules/comment/js/node-new-comments-link.js index 490f25f2cad..e1e10b20b61 100644 --- a/core/modules/comment/js/node-new-comments-link.js +++ b/core/modules/comment/js/node-new-comments-link.js @@ -113,6 +113,7 @@ } } } + if (drupalSettings.comment && drupalSettings.comment.newCommentsLinks) { render(drupalSettings.comment.newCommentsLinks.node[fieldName]); } diff --git a/core/modules/contextual/js/contextual.js b/core/modules/contextual/js/contextual.js index b01b07f406b..505b2a80fc6 100644 --- a/core/modules/contextual/js/contextual.js +++ b/core/modules/contextual/js/contextual.js @@ -41,7 +41,7 @@ * @param string html * The server-side rendered HTML for this contextual link. */ - function initContextual ($contextual, html) { + function initContextual($contextual, html) { var $region = $contextual.closest('.contextual-region'); var contextual = Drupal.contextual; @@ -101,7 +101,7 @@ * A contextual links placeholder DOM element, containing the actual * contextual links as rendered by the server. */ - function adjustIfNestedAndOverlapping ($contextual) { + function adjustIfNestedAndOverlapping($contextual) { var $contextuals = $contextual // @todo confirm that .closest() is not sufficient .parents('.contextual-region').eq(-1) @@ -156,7 +156,7 @@ }); // Update all contextual links placeholders whose HTML is cached. - var uncachedIDs = _.filter(ids, function initIfCached (contextualID) { + var uncachedIDs = _.filter(ids, function initIfCached(contextualID) { var html = storage.getItem('Drupal.contextual.' + contextualID); if (html !== null) { // Initialize after the current executation cycle, to make the AJAX diff --git a/core/modules/contextual/js/toolbar/models/StateModel.js b/core/modules/contextual/js/toolbar/models/StateModel.js index 048524fb14d..79f8bc77427 100644 --- a/core/modules/contextual/js/toolbar/models/StateModel.js +++ b/core/modules/contextual/js/toolbar/models/StateModel.js @@ -25,7 +25,6 @@ tabbingContext: null }, - /** * {@inheritdoc} * diff --git a/core/modules/editor/js/editor.js b/core/modules/editor/js/editor.js index d538b682a4f..fba4cc95c9b 100644 --- a/core/modules/editor/js/editor.js +++ b/core/modules/editor/js/editor.js @@ -259,7 +259,7 @@ * A callback to be called (with no parameters) after the field's value has * been XSS filtered. */ - function filterXssWhenSwitching (field, format, originalFormatID, callback) { + function filterXssWhenSwitching(field, format, originalFormatID, callback) { // A text editor that already is XSS-safe needs no additional measures. if (format.editor.isXssSafe) { callback(field, format); diff --git a/core/modules/field_ui/field_ui.js b/core/modules/field_ui/field_ui.js index acf53a777da..3fed9ef652d 100644 --- a/core/modules/field_ui/field_ui.js +++ b/core/modules/field_ui/field_ui.js @@ -166,7 +166,6 @@ } }; - /** * Row handlers for the 'Manage display' screen. */ diff --git a/core/modules/file/file.js b/core/modules/file/file.js index d10f6e1d92c..fa345136ad4 100644 --- a/core/modules/file/file.js +++ b/core/modules/file/file.js @@ -19,7 +19,7 @@ var $context = $(context); var elements; - function initFileValidation (selector) { + function initFileValidation(selector) { $context.find(selector) .once('fileValidate') .on('change.fileValidate', { extensions: elements[selector] }, Drupal.file.validateExtension); @@ -34,7 +34,7 @@ var $context = $(context); var elements; - function removeFileValidation (selector) { + function removeFileValidation(selector) { $context.find(selector) .removeOnce('fileValidate') .off('change.fileValidate', Drupal.file.validateExtension); diff --git a/core/modules/language/language.admin.js b/core/modules/language/language.admin.js index 3dc2dbe6570..0c146192cce 100644 --- a/core/modules/language/language.admin.js +++ b/core/modules/language/language.admin.js @@ -18,6 +18,7 @@ .find('table, .tabledrag-toggle-weight') .toggle($checkbox.prop('checked')); } + // Bind hide/show and rearrange customization checkboxes. $configForm.once('negotiation-language-admin-bind').on('change', inputSelector, function (event) { toggleTable(event.target); diff --git a/core/modules/quickedit/js/editors/formEditor.js b/core/modules/quickedit/js/editors/formEditor.js index e9429a83d14..149e1252a1c 100644 --- a/core/modules/quickedit/js/editors/formEditor.js +++ b/core/modules/quickedit/js/editors/formEditor.js @@ -70,9 +70,9 @@ // Render form container. var $formContainer = this.$formContainer = $(Drupal.theme('quickeditFormContainer', { - id: id, - loadingMsg: Drupal.t('Loading…') - } + id: id, + loadingMsg: Drupal.t('Loading…') + } )); $formContainer .find('.quickedit-form') diff --git a/core/modules/quickedit/js/quickedit.js b/core/modules/quickedit/js/quickedit.js index 98a7e27dad8..15e516262a4 100644 --- a/core/modules/quickedit/js/quickedit.js +++ b/core/modules/quickedit/js/quickedit.js @@ -563,6 +563,7 @@ function hasOtherRegion(contextualLink) { return contextualLink.region !== entityElement; } + contextualLinksQueue = _.filter(contextualLinksQueue, hasOtherRegion); }); @@ -576,6 +577,7 @@ function hasOtherFieldElement(field) { return field.el !== fieldElement; } + fieldsMetadataQueue = _.filter(fieldsMetadataQueue, hasOtherFieldElement); fieldsAvailableQueue = _.filter(fieldsAvailableQueue, hasOtherFieldElement); }); diff --git a/core/modules/quickedit/js/views/AppView.js b/core/modules/quickedit/js/views/AppView.js index 227862c6197..81629347892 100644 --- a/core/modules/quickedit/js/views/AppView.js +++ b/core/modules/quickedit/js/views/AppView.js @@ -325,7 +325,7 @@ var that = this; var discardDialog; - function closeDiscardDialog (action) { + function closeDiscardDialog(action) { discardDialog.close(action); // The active modal has been removed. that.model.set('activeModal', null); diff --git a/core/modules/quickedit/js/views/ContextualLinkView.js b/core/modules/quickedit/js/views/ContextualLinkView.js index 6e73be1adcb..6c50617222f 100644 --- a/core/modules/quickedit/js/views/ContextualLinkView.js +++ b/core/modules/quickedit/js/views/ContextualLinkView.js @@ -15,6 +15,7 @@ event.preventDefault(); event.target.click(); } + return { 'click a': function (event) { event.preventDefault(); diff --git a/core/modules/simpletest/simpletest.js b/core/modules/simpletest/simpletest.js index 477b162bf1d..7e365bd3d65 100644 --- a/core/modules/simpletest/simpletest.js +++ b/core/modules/simpletest/simpletest.js @@ -52,6 +52,7 @@ }); $groupCheckbox.prop('checked', allChecked); } + $testCheckboxes.on('change', updateGroupCheckbox); }); } diff --git a/core/modules/system/system.modules.js b/core/modules/system/system.modules.js index 0d465f5bcdb..95a544eafbc 100644 --- a/core/modules/system/system.modules.js +++ b/core/modules/system/system.modules.js @@ -18,6 +18,7 @@ var $table = $($input.attr('data-table')); var $rowsAndDetails, $rows, $details; var searching = false; + function hidePackageDetails(index, element) { var $packDetails = $(element); var $visibleRows = $packDetails.find('table:not(.sticky-header)').find('tbody tr:visible'); diff --git a/core/modules/toolbar/js/toolbar.menu.js b/core/modules/toolbar/js/toolbar.menu.js index 11002782bc1..1cfe3ead75e 100644 --- a/core/modules/toolbar/js/toolbar.menu.js +++ b/core/modules/toolbar/js/toolbar.menu.js @@ -20,6 +20,7 @@ 'handleOpen': Drupal.t('Extend'), 'handleClose': Drupal.t('Collapse') }; + /** * Handle clicks from the disclosure button on an item with sub-items. * @@ -35,6 +36,7 @@ var $openItems = $item.siblings().filter('.open'); toggleList($openItems, false); } + /** * Toggle the open/close state of a list is a menu. * @@ -58,6 +60,7 @@ // Expand Structure, Collapse Structure .text((switcher) ? ui.handleClose : ui.handleOpen); } + /** * Add markup to the menu elements. * @@ -88,6 +91,7 @@ } }); } + /** * Adds a level class to each list based on its depth in the menu. * @@ -108,6 +112,7 @@ markListLevels($lists, level + 1); } } + /** * On page load, open the active menu item. * @@ -128,6 +133,7 @@ toggleList($activeTrail, true); } } + // Bind event handlers. $(document) .on('click.toolbar', '.toolbar-handle', toggleClickHandler); diff --git a/core/modules/tour/js/tour.js b/core/modules/tour/js/tour.js index 7578f39f611..acede2b201d 100644 --- a/core/modules/tour/js/tour.js +++ b/core/modules/tour/js/tour.js @@ -103,9 +103,9 @@ if ($tour.find('li').length) { $tour.joyride({ postRideCallback: function () { that.model.set('isActive', false); }, - template : { // HTML segments for tip layout - link : '×', - button : '' + template: { // HTML segments for tip layout + link: '×', + button: '' } }); this.model.set({ isActive: true, activeTour: $tour }); diff --git a/core/modules/user/user.js b/core/modules/user/user.js index 1748a2c2e4a..bccbfa1115f 100644 --- a/core/modules/user/user.js +++ b/core/modules/user/user.js @@ -153,13 +153,16 @@ if (strength < 60) { indicatorText = translate.weak; indicatorColor = '#bb5555'; - } else if (strength < 70) { + } + else if (strength < 70) { indicatorText = translate.fair; indicatorColor = '#bbbb55'; - } else if (strength < 80) { + } + else if (strength < 80) { indicatorText = translate.good; indicatorColor = '#4863a0'; - } else if (strength <= 100) { + } + else if (strength <= 100) { indicatorText = translate.strong; indicatorColor = '#47c965'; } diff --git a/core/modules/views_ui/js/views-admin.js b/core/modules/views_ui/js/views-admin.js index b4a1c914dcc..bbb408d66d2 100644 --- a/core/modules/views_ui/js/views-admin.js +++ b/core/modules/views_ui/js/views-admin.js @@ -141,7 +141,7 @@ _populate: function () { var transliterated = this.getTransliterated(); var suffix = this.suffix; - this.target.each( function (i) { + this.target.each(function (i) { // Ensure that the maxlength is not exceeded by prepopulating the field. var maxlength = $(this).attr('maxlength') - suffix.length; $(this).val(transliterated.substr(0, maxlength) + suffix); @@ -165,7 +165,6 @@ } }); - Drupal.behaviors.addItemForm = { attach: function (context) { var $context = $(context); @@ -764,7 +763,6 @@ } }); - /** * Add a select all checkbox, which checks each checkbox at once. */ @@ -835,6 +833,7 @@ $('input.default-radios').show(); } } + // Update on widget change. $('input[name="options[group_info][multiple]"]') .on('change', changeDefaultWidget) diff --git a/core/themes/bartik/color/preview.js b/core/themes/bartik/color/preview.js index cb57121169c..b9fb4d1299f 100644 --- a/core/themes/bartik/color/preview.js +++ b/core/themes/bartik/color/preview.js @@ -8,7 +8,7 @@ Drupal.color = { logoChanged: false, - callback: function(context, settings, form, farb, height, width) { + callback: function (context, settings, form, farb, height, width) { // Change the logo to be the real one. if (!this.logoChanged) { $('#preview #preview-logo img').attr('src', drupalSettings.color.logo); diff --git a/core/themes/seven/js/mobile.install.js b/core/themes/seven/js/mobile.install.js index 28268bfe0d7..7830720c1ac 100644 --- a/core/themes/seven/js/mobile.install.js +++ b/core/themes/seven/js/mobile.install.js @@ -2,7 +2,7 @@ "use strict"; - function findActiveStep (steps) { + function findActiveStep(steps) { for (var i = 0; i < steps.length; i++) { if (steps[i].className === 'active') { return i + 1; @@ -15,7 +15,7 @@ return 0; } - function installStepsSetup () { + function installStepsSetup() { var steps = document.querySelectorAll('.task-list li'); if (steps.length) { var header = document.querySelector('header[role="banner"]'); diff --git a/core/themes/seven/js/nav-tabs.js b/core/themes/seven/js/nav-tabs.js index d48711aed81..071e60cb006 100644 --- a/core/themes/seven/js/nav-tabs.js +++ b/core/themes/seven/js/nav-tabs.js @@ -11,20 +11,20 @@ "use strict"; - function init (i, tab) { + function init(i, tab) { var $tab = $(tab); var $target = $tab.find('[data-drupal-nav-tabs-target]'); var isCollapsible = $tab.hasClass('is-collapsible'); - function openMenu (e) { + function openMenu(e) { $target.toggleClass('is-open'); } - function handleResize (e) { + function handleResize(e) { $tab.addClass('is-horizontal'); var isHorizontal = $tab.parent().width() > $tab.intrinsic('width'); $tab.toggleClass('is-horizontal', isHorizontal); - if(isCollapsible) { + if (isCollapsible) { $tab.toggleClass('is-collapse-enabled', !isHorizontal); } if (isHorizontal) {