diff --git a/.eslintrc b/.eslintrc index 9703fa9..cbac6a9 100644 --- a/.eslintrc +++ b/.eslintrc @@ -21,6 +21,7 @@ "eqeqeq": [2, "smart"], "guard-for-in": 2, "key-spacing": [2, {"beforeColon": false, "afterColon": true}], + "no-implied-eval": 2, "no-mixed-spaces-and-tabs": 2, "no-nested-ternary": 2, "no-reserved-keys": 2, @@ -30,6 +31,9 @@ "no-unused-vars": [2, {"vars": "local", "args": "none"}], "semi": [2, "always"], "space-after-keywords": [2, "always", {"checkFunctionKeyword": true}], + "space-before-blocks": [2, "always"], + "space-in-brackets": [2, "never"], + "space-in-parens": [2, "never"], "spaced-line-comment": [2, "always"], "strict": 2, // Warnings. diff --git a/core/misc/ajax.js b/core/misc/ajax.js index d659389..40ab702 100644 --- a/core/misc/ajax.js +++ b/core/misc/ajax.js @@ -44,7 +44,7 @@ $('.use-ajax').once('ajax', function () { var element_settings = {}; // Clicked links look better with the throbber than the progress bar. - element_settings.progress = { 'type': 'throbber' }; + element_settings.progress = {'type': 'throbber'}; // For anchor tags, these will go to the target of the anchor rather // than the usual location. @@ -71,7 +71,7 @@ // Form buttons use the 'click' event rather than mousedown. element_settings.event = 'click'; // Clicked form buttons look better with the throbber than the progress bar. - element_settings.progress = { 'type': 'throbber' }; + element_settings.progress = {'type': 'throbber'}; var baseUseAjaxSubmit = $(this).attr('id'); Drupal.ajax[baseUseAjaxSubmit] = new Drupal.ajax(baseUseAjaxSubmit, this, element_settings); @@ -106,7 +106,7 @@ // Again, we don't have a way to know for sure whether accessing // xmlhttp.responseText is going to throw an exception. So we'll catch it. try { - responseText = "\n" + Drupal.t("ResponseText: !responseText", {'!responseText': $.trim(xmlhttp.responseText) }); + responseText = "\n" + Drupal.t("ResponseText: !responseText", {'!responseText': $.trim(xmlhttp.responseText)}); } catch (e) {} diff --git a/core/misc/autocomplete.js b/core/misc/autocomplete.js index af64521..83b3c7d 100644 --- a/core/misc/autocomplete.js +++ b/core/misc/autocomplete.js @@ -115,7 +115,7 @@ showSuggestions(autocomplete.cache[elementId][term]); } else { - var options = $.extend({ success: sourceCallbackHandler, data: { q: term } }, autocomplete.ajax); + var options = $.extend({success: sourceCallbackHandler, data: {q: term}}, autocomplete.ajax); /*jshint validthis:true */ $.ajax(this.element.attr('data-autocomplete-path'), options); } diff --git a/core/misc/dialog/dialog.position.js b/core/misc/dialog/dialog.position.js index 3b97a35..084ba24 100644 --- a/core/misc/dialog/dialog.position.js +++ b/core/misc/dialog/dialog.position.js @@ -3,7 +3,7 @@ "use strict"; // autoResize option will turn off resizable and draggable. - drupalSettings.dialog = $.extend({ autoResize: true, maxHeight: '95%' }, drupalSettings.dialog); + drupalSettings.dialog = $.extend({autoResize: true, maxHeight: '95%'}, drupalSettings.dialog); /** * Resets the current options for positioning. @@ -61,10 +61,10 @@ $(window).on({ 'dialog:aftercreate': function (event, dialog, $element, settings) { var autoResize = debounce(resetSize, 20); - var eventData = { settings: settings, $element: $element }; + var eventData = {settings: settings, $element: $element}; if (settings.autoResize === true || settings.autoResize === 'true') { $element - .dialog('option', { resizable: false, draggable: false }) + .dialog('option', {resizable: false, draggable: false}) .dialog('widget').css('position', 'fixed'); $(window) .on('resize.dialogResize scroll.dialogResize', eventData, autoResize) diff --git a/core/misc/displace.js b/core/misc/displace.js index ce99181..6dca569 100644 --- a/core/misc/displace.js +++ b/core/misc/displace.js @@ -126,7 +126,7 @@ var displacement = 0; var horizontal = (edge === 'left' || edge === 'right'); // Get the offset of the element itself. - var placement = $el.offset()[ horizontal ? 'left' : 'top']; + var placement = $el.offset()[horizontal ? 'left' : 'top']; // Subtract scroll distance from placement to get the distance // to the edge of the viewport. placement -= window['scroll' + (horizontal ? 'X' : 'Y')] || document.documentElement['scroll' + (horizontal) ? 'Left' : 'Top'] || 0; diff --git a/core/misc/drupal.js b/core/misc/drupal.js index dcfad00..acafce3 100644 --- a/core/misc/drupal.js +++ b/core/misc/drupal.js @@ -1,7 +1,7 @@ /** * Base framework for Drupal-specific JavaScript, behaviors, and settings. */ -window.Drupal = { behaviors: {}, locale: {} }; +window.Drupal = {behaviors: {}, locale: {}}; // Class indicating that JS is enabled; used for styling purpose. document.documentElement.className += ' js'; @@ -90,7 +90,7 @@ if (window.jQuery) { behaviors[i].attach(context, settings); } catch (e) { - errors.push({ behavior: i, error: e }); + errors.push({behavior: i, error: e}); } } } @@ -156,7 +156,7 @@ if (window.jQuery) { behaviors[i].detach(context, settings, trigger); } catch (e) { - errors.push({ behavior: i, error: e }); + errors.push({behavior: i, error: e}); } } } diff --git a/core/misc/states.js b/core/misc/states.js index abac1da..680e86e 100644 --- a/core/misc/states.js +++ b/core/misc/states.js @@ -55,7 +55,7 @@ * AND and OR clauses. */ states.Dependent = function (args) { - $.extend(this, { values: {}, oldValue: null }, args); + $.extend(this, {values: {}, oldValue: null}, args); this.dependees = this.getDependees(); for (var selector in this.dependees) { @@ -124,7 +124,7 @@ $(selector).on('state:' + state, {selector: selector, state: state}, stateEventHandler); // Make sure the event we just bound ourselves to is actually fired. - new states.Trigger({ selector: selector, state: state }); + new states.Trigger({selector: selector, state: state}); } } }, @@ -190,7 +190,7 @@ // By adding "trigger: true", we ensure that state changes don't go into // infinite loops. - this.element.trigger({ type: 'state:' + this.state, value: value, trigger: true }); + this.element.trigger({type: 'state:' + this.state, value: value, trigger: true}); } }, @@ -355,14 +355,14 @@ var value = valueFn.call(this.element, e); // Only trigger the event if the value has actually changed. if (oldValue !== value) { - this.element.trigger({ type: 'state:' + this.state, value: value, oldValue: oldValue }); + this.element.trigger({type: 'state:' + this.state, value: value, oldValue: oldValue}); oldValue = value; } }, this)); states.postponed.push($.proxy(function () { // Trigger the event once for initialization purposes. - this.element.trigger({ type: 'state:' + this.state, value: oldValue, oldValue: null }); + this.element.trigger({type: 'state:' + this.state, value: oldValue, oldValue: null}); }, this)); } }; @@ -520,7 +520,7 @@ $(document).on('state:required', function (e) { if (e.trigger) { if (e.value) { - var $label = $(e.target).attr({ 'required': 'required', 'aria-required': 'aria-required' }).closest('.form-item, .form-wrapper').find('label'); + var $label = $(e.target).attr({'required': 'required', 'aria-required': 'aria-required'}).closest('.form-item, .form-wrapper').find('label'); // Avoids duplicate required markers on initialization. if (!$label.hasClass('form-required').length) { $label.addClass('form-required'); diff --git a/core/misc/tabledrag.js b/core/misc/tabledrag.js index bb310bc..1e61eff 100644 --- a/core/misc/tabledrag.js +++ b/core/misc/tabledrag.js @@ -62,7 +62,7 @@ this.rtl = $(this.table).css('direction') === 'rtl' ? -1 : 1; // Direction of the table. // Configure the scroll settings. - this.scrollSettings = { amount: 4, interval: 50, trigger: 70 }; + this.scrollSettings = {amount: 4, interval: 50, trigger: 70}; this.scrollInterval = null; this.scrollY = 0; this.windowHeight = 0; @@ -639,7 +639,7 @@ */ Drupal.tableDrag.prototype.pointerCoords = function (event) { if (event.pageX || event.pageY) { - return { x: event.pageX, y: event.pageY }; + return {x: event.pageX, y: event.pageY}; } return { x: event.clientX + document.body.scrollLeft - document.body.clientLeft, @@ -654,7 +654,7 @@ Drupal.tableDrag.prototype.getPointerOffset = function (target, event) { var docPos = $(target).offset(); var pointerPos = this.pointerCoords(event); - return { x: pointerPos.x - docPos.left, y: pointerPos.y - docPos.top }; + return {x: pointerPos.x - docPos.left, y: pointerPos.y - docPos.top}; }; /** @@ -1126,7 +1126,7 @@ } } - return { 'min': minIndent, 'max': maxIndent }; + return {'min': minIndent, 'max': maxIndent}; }; /** diff --git a/core/misc/tableselect.js b/core/misc/tableselect.js index a55b97c..9f43ca0 100644 --- a/core/misc/tableselect.js +++ b/core/misc/tableselect.js @@ -18,7 +18,7 @@ // Keep track of the table, which checkbox is checked and alias the settings. var table = this, checkboxes, lastChecked; var $table = $(table); - var strings = { 'selectAll': Drupal.t('Select all rows in this table'), 'selectNone': Drupal.t('Deselect all rows in this table') }; + var strings = {'selectAll': Drupal.t('Select all rows in this table'), 'selectNone': Drupal.t('Deselect all rows in this table')}; var updateSelectAll = function (state) { // Update table's select-all checkbox (and sticky header's if available). $table.prev('table.sticky-header').addBack().find('th.select-all input[type="checkbox"]').each(function () { diff --git a/core/misc/timezone.js b/core/misc/timezone.js index 9978971..e7667b8 100644 --- a/core/misc/timezone.js +++ b/core/misc/timezone.js @@ -53,7 +53,7 @@ $.ajax({ async: false, url: Drupal.url(path), - data: { date: dateString }, + data: {date: dateString}, dataType: 'json', success: function (data) { if (data) { diff --git a/core/modules/ckeditor/js/ckeditor.drupalimage.admin.js b/core/modules/ckeditor/js/ckeditor.drupalimage.admin.js index 1315b24..44072df 100644 --- a/core/modules/ckeditor/js/ckeditor.drupalimage.admin.js +++ b/core/modules/ckeditor/js/ckeditor.drupalimage.admin.js @@ -23,7 +23,7 @@ } var output = ''; - output += Drupal.t('Uploads enabled, max size: @size @dimensions', { '@size': maxFileSize, '@dimensions': maxDimensions }); + output += Drupal.t('Uploads enabled, max size: @size @dimensions', {'@size': maxFileSize, '@dimensions': maxDimensions}); if ($scheme.length) { output += '
' + $scheme.attr('data-label'); } diff --git a/core/modules/ckeditor/js/ckeditor.js b/core/modules/ckeditor/js/ckeditor.js index 67e2399..1596808 100644 --- a/core/modules/ckeditor/js/ckeditor.js +++ b/core/modules/ckeditor/js/ckeditor.js @@ -166,7 +166,7 @@ selector: '.ckeditor-dialog-loading-link', url: url, event: 'ckeditor-internal.ckeditor', - progress: { 'type': 'throbber' }, + progress: {'type': 'throbber'}, submit: { editor_object: existingValues } @@ -177,7 +177,7 @@ // After a short delay, show "Loading…" message. window.setTimeout(function () { - $content.find('span').animate({ top: '0px' }); + $content.find('span').animate({top: '0px'}); }, 1000); // Store the save callback to be executed when this dialog is closed. @@ -187,7 +187,7 @@ // Respond to new dialogs that are opened by CKEditor, closing the AJAX loader. $(window).on('dialog:beforecreate', function (e, dialog, $element, settings) { - $('.ckeditor-dialog-loading').animate({ top: '-40px' }, function () { + $('.ckeditor-dialog-loading').animate({top: '-40px'}, function () { $(this).remove(); }); }); diff --git a/core/modules/ckeditor/js/ckeditor.stylescombo.admin.js b/core/modules/ckeditor/js/ckeditor.stylescombo.admin.js index fcefb80..d9c585a 100644 --- a/core/modules/ckeditor/js/ckeditor.stylescombo.admin.js +++ b/core/modules/ckeditor/js/ckeditor.stylescombo.admin.js @@ -31,7 +31,7 @@ if (!_.isEqual(previousStylesSet, stylesSet)) { previousStylesSet = stylesSet; $ckeditorActiveToolbar.trigger('CKEditorPluginSettingsChanged', [ - { stylesSet: stylesSet } + {stylesSet: stylesSet} ]); } }); @@ -81,7 +81,7 @@ // Build the data structure CKEditor's stylescombo plugin expects. // @see http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Styles stylesSet.push({ - attributes: { 'class': classes.join(' ') }, + attributes: {'class': classes.join(' ')}, element: element, name: label }); @@ -103,7 +103,7 @@ } else { var count = $.trim(styles).split("\n").length; - return Drupal.t('@count styles configured', { '@count': count}); + return Drupal.t('@count styles configured', {'@count': count}); } }); } diff --git a/core/modules/ckeditor/js/plugins/drupalimage/plugin.js b/core/modules/ckeditor/js/plugins/drupalimage/plugin.js index 51a0bc5..d649885 100644 --- a/core/modules/ckeditor/js/plugins/drupalimage/plugin.js +++ b/core/modules/ckeditor/js/plugins/drupalimage/plugin.js @@ -180,7 +180,7 @@ editor.addCommand('editdrupalimage', { allowedContent: 'img[alt,!src,width,height,!data-entity-type,!data-entity-uuid]', requiredContent: 'img[alt,src,width,height,data-entity-type,data-entity-uuid]', - modes: { wysiwyg: 1 }, + modes: {wysiwyg: 1}, canUndo: true, exec: function (editor, data) { var dialogSettings = { diff --git a/core/modules/ckeditor/js/plugins/drupalimagecaption/plugin.js b/core/modules/ckeditor/js/plugins/drupalimagecaption/plugin.js index 1780856..cbb6160 100644 --- a/core/modules/ckeditor/js/plugins/drupalimagecaption/plugin.js +++ b/core/modules/ckeditor/js/plugins/drupalimagecaption/plugin.js @@ -114,9 +114,9 @@ data.align = attrs['data-align']; delete attrs['data-align']; } - data['data-entity-type' ] = attrs['data-entity-type']; + data['data-entity-type'] = attrs['data-entity-type']; delete attrs['data-entity-type']; - data['data-entity-uuid' ] = attrs['data-entity-uuid']; + data['data-entity-uuid'] = attrs['data-entity-uuid']; delete attrs['data-entity-uuid']; if (captionFilterEnabled) { diff --git a/core/modules/ckeditor/js/plugins/drupallink/plugin.js b/core/modules/ckeditor/js/plugins/drupallink/plugin.js index affdeb4..76e6de2 100644 --- a/core/modules/ckeditor/js/plugins/drupallink/plugin.js +++ b/core/modules/ckeditor/js/plugins/drupallink/plugin.js @@ -13,7 +13,7 @@ editor.addCommand('drupallink', { allowedContent: 'a[!href,target]', requiredContent: 'a[href]', - modes: { wysiwyg: 1 }, + modes: {wysiwyg: 1}, canUndo: true, exec: function (editor) { var linkElement = getSelectedLink(editor); @@ -64,7 +64,7 @@ } // Create the new link by applying a style to the new text. - var style = new CKEDITOR.style({ element: 'a', attributes: returnValues.attributes }); + var style = new CKEDITOR.style({element: 'a', attributes: returnValues.attributes}); style.type = CKEDITOR.STYLE_INLINE; style.applyToRange(range); range.select(); @@ -111,7 +111,7 @@ allowedContent: 'a[!href]', requiredContent: 'a[href]', exec: function (editor) { - var style = new CKEDITOR.style({ element: 'a', type: CKEDITOR.STYLE_INLINE, alwaysRemoveElement: 1 }); + var style = new CKEDITOR.style({element: 'a', type: CKEDITOR.STYLE_INLINE, alwaysRemoveElement: 1}); editor.removeStyle(style); }, refresh: function (editor, path) { @@ -185,7 +185,7 @@ var menu = {}; if (anchor.getAttribute('href') && anchor.getChildCount()) { - menu = { link: CKEDITOR.TRISTATE_OFF, unlink: CKEDITOR.TRISTATE_OFF }; + menu = {link: CKEDITOR.TRISTATE_OFF, unlink: CKEDITOR.TRISTATE_OFF}; } return menu; }); diff --git a/core/modules/comment/js/node-new-comments-link.js b/core/modules/comment/js/node-new-comments-link.js index 2c89cf9..97c7871 100644 --- a/core/modules/comment/js/node-new-comments-link.js +++ b/core/modules/comment/js/node-new-comments-link.js @@ -122,7 +122,7 @@ $.ajax({ url: Drupal.url('comments/render_new_comments_node_links'), type: 'POST', - data: { 'node_ids[]': nodeIDs, 'field_name': fieldName }, + data: {'node_ids[]': nodeIDs, 'field_name': fieldName}, dataType: 'json', success: render }); diff --git a/core/modules/contextual/js/contextual.js b/core/modules/contextual/js/contextual.js index 8018c63..e00b011 100644 --- a/core/modules/contextual/js/contextual.js +++ b/core/modules/contextual/js/contextual.js @@ -66,14 +66,14 @@ var model = new contextual.StateModel({ title: $region.find('h2:first').text().trim() }); - var viewOptions = $.extend({ el: $contextual, model: model }, options); + var viewOptions = $.extend({el: $contextual, model: model}, options); contextual.views.push({ visual: new contextual.VisualView(viewOptions), aural: new contextual.AuralView(viewOptions), keyboard: new contextual.KeyboardView(viewOptions) }); contextual.regionViews.push(new contextual.RegionView( - $.extend({ el: $region, model: model }, options)) + $.extend({el: $region, model: model}, options)) ); // Add the model to the collection. This must happen after the views have been @@ -128,7 +128,7 @@ $trigger.addClass('visually-hidden'); // Adjust nested contextual link's position. - $nestedContextual.css({ top: $nestedContextual.position().top + height }); + $nestedContextual.css({top: $nestedContextual.position().top + height}); } } @@ -178,7 +178,7 @@ $.ajax({ url: Drupal.url('contextual/render'), type: 'POST', - data: { 'ids[]': uncachedIDs }, + data: {'ids[]': uncachedIDs}, dataType: 'json', success: function (results) { _.each(results, function (html, contextualID) { @@ -217,7 +217,7 @@ }; // A Backbone.Collection of Drupal.contextual.StateModel instances. - Drupal.contextual.collection = new Backbone.Collection([], { model: Drupal.contextual.StateModel }); + Drupal.contextual.collection = new Backbone.Collection([], {model: Drupal.contextual.StateModel}); /** * A trigger is an interactive element often bound to a click handler. diff --git a/core/modules/editor/js/editor.admin.js b/core/modules/editor/js/editor.admin.js index c8b1870..74a38b2 100644 --- a/core/modules/editor/js/editor.admin.js +++ b/core/modules/editor/js/editor.admin.js @@ -84,22 +84,22 @@ * * This generates an object of this form: * var universe = { - * a: { - * 'touchedByAllowedPropertyRule': false, - * 'tag': false, - * 'attributes:href': false, - * 'classes:external': false, - * }, - * strong: { - * 'touchedByAllowedPropertyRule': false, - * 'tag': false, - * }, - * img: { - * 'touchedByAllowedPropertyRule': false, - * 'tag': false, - * 'attributes:src': false - * } - * }; + * a: { + * 'touchedByAllowedPropertyRule': false, + * 'tag': false, + * 'attributes:href': false, + * 'classes:external': false, + * }, + * strong: { + * 'touchedByAllowedPropertyRule': false, + * 'tag': false, + * }, + * img: { + * 'touchedByAllowedPropertyRule': false, + * 'tag': false, + * 'attributes:src': false + * } + * }; * * In this example, the given text editor feature resulted in the above * universe, which shows that it must be allowed to generate the a, strong @@ -550,8 +550,8 @@ * - classes: ['external', 'internal'] */ Drupal.EditorFeatureHTMLRule = function () { - this.required = { tags: [], attributes: [], styles: [], classes: [] }; - this.allowed = { tags: [], attributes: [], styles: [], classes: [] }; + this.required = {tags: [], attributes: [], styles: [], classes: []}; + this.allowed = {tags: [], attributes: [], styles: [], classes: []}; this.raw = null; }; @@ -616,36 +616,36 @@ * Examples: * - Whitelist the "p", "strong" and "a" HTML tags: * { - * tags: ['p', 'strong', 'a'], - * allow: true, - * restrictedTags: { - * tags: [], - * allowed: { attributes: [], styles: [], classes: [] }, - * forbidden: { attributes: [], styles: [], classes: [] } - * } - * } + * tags: ['p', 'strong', 'a'], + * allow: true, + * restrictedTags: { + * tags: [], + * allowed: { attributes: [], styles: [], classes: [] }, + * forbidden: { attributes: [], styles: [], classes: [] } + * } + * } * - For the "a" HTML tag, only allow the "href" attribute and the "external" * class and disallow the "target" attribute. * { - * tags: [], - * allow: null, - * restrictedTags: { - * tags: ['a'], - * allowed: { attributes: ['href'], styles: [], classes: ['external'] }, - * forbidden: { attributes: ['target'], styles: [], classes: [] } - * } - * } + * tags: [], + * allow: null, + * restrictedTags: { + * tags: ['a'], + * allowed: { attributes: ['href'], styles: [], classes: ['external'] }, + * forbidden: { attributes: ['target'], styles: [], classes: [] } + * } + * } * - For all tags, allow the "data-*" attribute (that is, any attribute that * begins with "data-"). * { - * tags: [], - * allow: null, - * restrictedTags: { - * tags: ['*'], - * allowed: { attributes: ['data-*'], styles: [], classes: [] }, - * forbidden: { attributes: [], styles: [], classes: [] } - * } - * } + * tags: [], + * allow: null, + * restrictedTags: { + * tags: ['*'], + * allowed: { attributes: ['data-*'], styles: [], classes: [] }, + * forbidden: { attributes: [], styles: [], classes: [] } + * } + * } */ Drupal.FilterHTMLRule = function () { return { @@ -655,8 +655,8 @@ // Apply restrictions to properties set on tags. restrictedTags: { tags: [], - allowed: { attributes: [], styles: [], classes: [] }, - forbidden: { attributes: [], styles: [], classes: [] } + allowed: {attributes: [], styles: [], classes: []}, + forbidden: {attributes: [], styles: [], classes: []} } }; }; diff --git a/core/modules/editor/js/editor.formattedTextEditor.js b/core/modules/editor/js/editor.formattedTextEditor.js index 97f261f..75b20b6 100644 --- a/core/modules/editor/js/editor.formattedTextEditor.js +++ b/core/modules/editor/js/editor.formattedTextEditor.js @@ -146,7 +146,7 @@ * {@inheritdoc} */ getQuickEditUISettings: function () { - return { padding: true, unifiedToolbar: true, fullWidthToolbar: true, popup: false }; + return {padding: true, unifiedToolbar: true, fullWidthToolbar: true, popup: false}; }, /** @@ -174,8 +174,8 @@ var textLoaderAjax = new Drupal.ajax(fieldID, this.$el, { url: Drupal.quickedit.util.buildUrl(fieldID, Drupal.url('editor/!entity_type/!id/!field_name/!langcode/!view_mode')), event: 'editor-internal.editor', - submit: { nocssjs: true }, - progress: { type: null } // No progress indicator. + submit: {nocssjs: true}, + progress: {type: null} // No progress indicator. }); // Implement a scoped editorGetUntransformedText AJAX command: calls the diff --git a/core/modules/file/file.js b/core/modules/file/file.js index fa34513..fcefad1 100644 --- a/core/modules/file/file.js +++ b/core/modules/file/file.js @@ -22,7 +22,7 @@ function initFileValidation(selector) { $context.find(selector) .once('fileValidate') - .on('change.fileValidate', { extensions: elements[selector] }, Drupal.file.validateExtension); + .on('change.fileValidate', {extensions: elements[selector]}, Drupal.file.validateExtension); } if (settings.file && settings.file.elements) { diff --git a/core/modules/filter/filter.filter_html.admin.js b/core/modules/filter/filter.filter_html.admin.js index ed0284c..a11fca5 100644 --- a/core/modules/filter/filter.filter_html.admin.js +++ b/core/modules/filter/filter.filter_html.admin.js @@ -177,7 +177,7 @@ var html = ''; var tagList = '<' + tags.join('> <') + '>'; html += '

'; - html += Drupal.t('Based on the text editor configuration, these tags have automatically been added: @tag-list.', { '@tag-list': tagList }); + html += Drupal.t('Based on the text editor configuration, these tags have automatically been added: @tag-list.', {'@tag-list': tagList}); html += '

'; return html; }; diff --git a/core/modules/history/js/history.js b/core/modules/history/js/history.js index c598dd4..5030790 100644 --- a/core/modules/history/js/history.js +++ b/core/modules/history/js/history.js @@ -39,7 +39,7 @@ $.ajax({ url: Drupal.url('history/get_node_read_timestamps'), type: 'POST', - data: { 'node_ids[]': nodeIDs }, + data: {'node_ids[]': nodeIDs}, dataType: 'json', success: function (results) { for (var nodeID in results) { diff --git a/core/modules/node/node.js b/core/modules/node/node.js index 7c2743d..60db08f 100644 --- a/core/modules/node/node.js +++ b/core/modules/node/node.js @@ -30,8 +30,8 @@ var name = $authorContext.find('.field-name-uid input').val(), date = $authorContext.find('.field-name-created input').val(); return date ? - Drupal.t('By @name on @date', { '@name': name, '@date': date }) : - Drupal.t('By @name', { '@name': name }); + Drupal.t('By @name on @date', {'@name': name, '@date': date}) : + Drupal.t('By @name', {'@name': name}); }); $context.find('.node-form-options').drupalSetSummary(function (context) { diff --git a/core/modules/path/path.js b/core/modules/path/path.js index a4d0b6c..aa91bb2 100644 --- a/core/modules/path/path.js +++ b/core/modules/path/path.js @@ -12,7 +12,7 @@ var path = $('.form-item-path-0-alias input').val(); return path ? - Drupal.t('Alias: @alias', { '@alias': path }) : + Drupal.t('Alias: @alias', {'@alias': path}) : Drupal.t('No alias'); }); } diff --git a/core/modules/quickedit/js/editors/formEditor.js b/core/modules/quickedit/js/editors/formEditor.js index 149e125..7660bce 100644 --- a/core/modules/quickedit/js/editors/formEditor.js +++ b/core/modules/quickedit/js/editors/formEditor.js @@ -56,7 +56,7 @@ * {@inheritdoc} */ getQuickEditUISettings: function () { - return { padding: true, unifiedToolbar: true, fullWidthToolbar: true, popup: true }; + return {padding: true, unifiedToolbar: true, fullWidthToolbar: true, popup: true}; }, /** diff --git a/core/modules/quickedit/js/editors/plainTextEditor.js b/core/modules/quickedit/js/editors/plainTextEditor.js index c7440d5..f380a40 100644 --- a/core/modules/quickedit/js/editors/plainTextEditor.js +++ b/core/modules/quickedit/js/editors/plainTextEditor.js @@ -100,7 +100,7 @@ * {@inheritdoc} */ getQuickEditUISettings: function () { - return { padding: true, unifiedToolbar: false, fullWidthToolbar: false, popup: false }; + return {padding: true, unifiedToolbar: false, fullWidthToolbar: false, popup: false}; }, /** diff --git a/core/modules/quickedit/js/models/EntityModel.js b/core/modules/quickedit/js/models/EntityModel.js index ee6f6ce..052ab3a 100644 --- a/core/modules/quickedit/js/models/EntityModel.js +++ b/core/modules/quickedit/js/models/EntityModel.js @@ -290,7 +290,7 @@ if (fieldState === 'invalid') { // A state change in reaction to another state change must be deferred. _.defer(function () { - entityModel.set('state', 'opened', { reason: 'invalid' }); + entityModel.set('state', 'opened', {reason: 'invalid'}); }); } else { @@ -315,9 +315,9 @@ entityModel.set('isCommitting', false); // Change the state back to "opened", to allow the user to hit the // "Save" button again. - entityModel.set('state', 'opened', { reason: 'networkerror' }); + entityModel.set('state', 'opened', {reason: 'networkerror'}); // Show a modal to inform the user of the network error. - var message = Drupal.t('Your changes to @entity-title could not be saved, either due to a website problem or a network connection problem.
Please try again.', { '@entity-title': entityModel.get('label') }); + var message = Drupal.t('Your changes to @entity-title could not be saved, either due to a website problem or a network connection problem.
Please try again.', {'@entity-title': entityModel.get('label')}); Drupal.quickedit.util.networkErrorModal(Drupal.t('Sorry!'), message); } }); @@ -368,7 +368,7 @@ var entitySaverAjax = new Drupal.ajax(id, $el, { url: Drupal.url('quickedit/entity/' + entityModel.get('entityID')), event: 'quickedit-save.quickedit', - progress: { type: 'none' }, + progress: {type: 'none'}, error: function () { $el.off('quickedit-save.quickedit'); // Let the Drupal.quickedit.EntityModel Backbone model's error()= diff --git a/core/modules/quickedit/js/models/FieldModel.js b/core/modules/quickedit/js/models/FieldModel.js index d381fdb..5737383 100644 --- a/core/modules/quickedit/js/models/FieldModel.js +++ b/core/modules/quickedit/js/models/FieldModel.js @@ -147,7 +147,7 @@ // Find all instances of fields that display the same logical field (same // entity, same field, just a different instance and maybe a different // view mode). - .where({ logicalFieldID: currentField.get('logicalFieldID') }) + .where({logicalFieldID: currentField.get('logicalFieldID')}) .forEach(function (field) { // Ignore the current field. if (field === currentField) { diff --git a/core/modules/quickedit/js/quickedit.js b/core/modules/quickedit/js/quickedit.js index 86d6551..539fc3e 100644 --- a/core/modules/quickedit/js/quickedit.js +++ b/core/modules/quickedit/js/quickedit.js @@ -295,13 +295,13 @@ // If an EntityModel for this field already exists (and hence also a "Quick // edit" contextual link), then initialize it immediately. - if (Drupal.quickedit.collections.entities.findWhere({ entityID: entityID, entityInstanceID: entityInstanceID })) { + if (Drupal.quickedit.collections.entities.findWhere({entityID: entityID, entityInstanceID: entityInstanceID})) { initializeField(fieldElement, fieldID, entityID, entityInstanceID); } // Otherwise: queue the field. It is now available to be set up when its // corresponding entity becomes in-place editable. else { - fieldsAvailableQueue.push({ el: fieldElement, fieldID: fieldID, entityID: entityID, entityInstanceID: entityInstanceID }); + fieldsAvailableQueue.push({el: fieldElement, fieldID: fieldID, entityID: entityID, entityInstanceID: entityInstanceID}); } } @@ -417,9 +417,9 @@ var loadEditorsAjax = new Drupal.ajax(id, $el, { url: Drupal.url('quickedit/attachments'), event: 'quickedit-internal.quickedit', - submit: { 'editors[]': missingEditors }, + submit: {'editors[]': missingEditors}, // No progress indicator. - progress: { type: null } + progress: {type: null} }); // Implement a scoped insert AJAX command: calls the callback after all AJAX // command functions have been executed (hence the deferred calling). diff --git a/core/modules/quickedit/js/theme.js b/core/modules/quickedit/js/theme.js index 4a97130..a6d1d91 100644 --- a/core/modules/quickedit/js/theme.js +++ b/core/modules/quickedit/js/theme.js @@ -102,7 +102,7 @@ html += ' id="' + settings.id + '"'; } html += '>'; - html += Drupal.theme('quickeditButtons', { buttons: settings.buttons }); + html += Drupal.theme('quickeditButtons', {buttons: settings.buttons}); html += ''; return html; }; @@ -133,7 +133,7 @@ var attrMap = settings.buttons[i].attributes || {}; for (var attr in attrMap) { if (attrMap.hasOwnProperty(attr)) { - attributes.push(attr + ((attrMap[attr]) ? '="' + attrMap[attr] + '"' : '' )); + attributes.push(attr + ((attrMap[attr]) ? '="' + attrMap[attr] + '"' : '')); } } html += '