Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / quickedit / js / theme.es6.js
index b9355b13aa8ab4928ea2404e8ee99f676fa35142..a528404f1238836fd08dc91840042efdb5b46d47 100644 (file)
@@ -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;
    * @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;
   };
    * @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}" />`;
   };
 
    * @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(' ')}"`;
    * @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];
       // 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;
   };
    * @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">';
     html += '</div>';
     return html;
   };
-}(jQuery, Drupal));
+})(jQuery, Drupal);