Mercurial > hg > isophonics-drupal-site
diff core/modules/quickedit/js/theme.es6.js @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children |
line wrap: on
line diff
--- a/core/modules/quickedit/js/theme.es6.js Tue Jul 10 15:07:59 2018 +0100 +++ b/core/modules/quickedit/js/theme.es6.js Thu Feb 28 13:21:36 2019 +0000 @@ -3,7 +3,7 @@ * Provides theme functions for all of Quick Edit's client-side HTML. */ -(function ($, Drupal) { +(function($, Drupal) { /** * Theme function for a "backstage" for the Quick Edit module. * @@ -15,7 +15,7 @@ * @return {string} * The corresponding HTML. */ - Drupal.theme.quickeditBackstage = function (settings) { + Drupal.theme.quickeditBackstage = function(settings) { let html = ''; html += `<div id="${settings.id}" />`; return html; @@ -32,15 +32,19 @@ * @return {string} * The corresponding HTML. */ - Drupal.theme.quickeditEntityToolbar = function (settings) { + Drupal.theme.quickeditEntityToolbar = function(settings) { let html = ''; - html += `<div id="${settings.id}" class="quickedit quickedit-toolbar-container clearfix">`; + html += `<div id="${ + settings.id + }" class="quickedit quickedit-toolbar-container clearfix">`; html += '<i class="quickedit-toolbar-pointer"></i>'; html += '<div class="quickedit-toolbar-content">'; - html += '<div class="quickedit-toolbar quickedit-toolbar-entity clearfix icon icon-pencil">'; + html += + '<div class="quickedit-toolbar quickedit-toolbar-entity clearfix icon icon-pencil">'; html += '<div class="quickedit-toolbar-label" />'; html += '</div>'; - html += '<div class="quickedit-toolbar quickedit-toolbar-field clearfix" />'; + html += + '<div class="quickedit-toolbar quickedit-toolbar-field clearfix" />'; html += '</div><div class="quickedit-toolbar-lining"></div></div>'; return html; }; @@ -58,9 +62,11 @@ * @return {string} * The corresponding HTML. */ - Drupal.theme.quickeditEntityToolbarLabel = function (settings) { + Drupal.theme.quickeditEntityToolbarLabel = function(settings) { // @todo Add XSS regression test coverage in https://www.drupal.org/node/2547437 - return `<span class="field">${Drupal.checkPlain(settings.fieldLabel)}</span>${Drupal.checkPlain(settings.entityLabel)}`; + return `<span class="field">${Drupal.checkPlain( + settings.fieldLabel, + )}</span>${Drupal.checkPlain(settings.entityLabel)}`; }; /** @@ -69,7 +75,7 @@ * @return {string} * The corresponding HTML. */ - Drupal.theme.quickeditEntityToolbarFence = function () { + Drupal.theme.quickeditEntityToolbarFence = function() { return '<div id="quickedit-toolbar-fence" />'; }; @@ -84,7 +90,7 @@ * @return {string} * The corresponding HTML. */ - Drupal.theme.quickeditFieldToolbar = function (settings) { + Drupal.theme.quickeditFieldToolbar = function(settings) { return `<div id="${settings.id}" />`; }; @@ -103,9 +109,9 @@ * @return {string} * The corresponding HTML. */ - Drupal.theme.quickeditToolgroup = function (settings) { + Drupal.theme.quickeditToolgroup = function(settings) { // Classes. - const classes = (settings.classes || []); + const classes = settings.classes || []; classes.unshift('quickedit-toolgroup'); let html = ''; html += `<div class="${classes.join(' ')}"`; @@ -134,7 +140,7 @@ * @return {string} * The corresponding HTML. */ - Drupal.theme.quickeditButtons = function (settings) { + Drupal.theme.quickeditButtons = function(settings) { let html = ''; for (let i = 0; i < settings.buttons.length; i++) { const button = settings.buttons[i]; @@ -144,10 +150,12 @@ // Attributes. const attributes = []; const attrMap = settings.buttons[i].attributes || {}; - Object.keys(attrMap).forEach((attr) => { - attributes.push(attr + ((attrMap[attr]) ? `="${attrMap[attr]}"` : '')); + Object.keys(attrMap).forEach(attr => { + attributes.push(attr + (attrMap[attr] ? `="${attrMap[attr]}"` : '')); }); - html += `<button type="${button.type}" class="${button.classes}" ${attributes.join(' ')}>${button.label}</button>`; + html += `<button type="${button.type}" class="${ + button.classes + }" ${attributes.join(' ')}>${button.label}</button>`; } return html; }; @@ -165,7 +173,7 @@ * @return {string} * The corresponding HTML. */ - Drupal.theme.quickeditFormContainer = function (settings) { + Drupal.theme.quickeditFormContainer = function(settings) { let html = ''; html += `<div id="${settings.id}" class="quickedit-form-container">`; html += ' <div class="quickedit-form">'; @@ -176,4 +184,4 @@ html += '</div>'; return html; }; -}(jQuery, Drupal)); +})(jQuery, Drupal);