Unverified Commit f1e57201 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3253148 by mherchel, longwave, ckrina, droplet: Remove IE from core's...

Issue #3253148 by mherchel, longwave, ckrina, droplet: Remove IE from core's browserlist, remove non-essential CSS importing and recompile assets
parent 00ad1d75
Loading
Loading
Loading
Loading
+17 −21
Original line number Diff line number Diff line
@@ -7,41 +7,37 @@

(function (Drupal, drupalSettings) {
  Drupal.behaviors.activeLinks = {
    attach: function attach(context) {
      var path = drupalSettings.path;
      var queryString = JSON.stringify(path.currentQuery);
      var querySelector = path.currentQuery ? "[data-drupal-link-query='".concat(queryString, "']") : ':not([data-drupal-link-query])';
      var originalSelectors = ["[data-drupal-link-system-path=\"".concat(path.currentPath, "\"]")];
      var selectors;
    attach(context) {
      const path = drupalSettings.path;
      const queryString = JSON.stringify(path.currentQuery);
      const querySelector = path.currentQuery ? `[data-drupal-link-query='${queryString}']` : ':not([data-drupal-link-query])';
      const originalSelectors = [`[data-drupal-link-system-path="${path.currentPath}"]`];
      let selectors;

      if (path.isFront) {
        originalSelectors.push('[data-drupal-link-system-path="<front>"]');
      }

      selectors = [].concat(originalSelectors.map(function (selector) {
        return "".concat(selector, ":not([hreflang])");
      }), originalSelectors.map(function (selector) {
        return "".concat(selector, "[hreflang=\"").concat(path.currentLanguage, "\"]");
      }));
      selectors = selectors.map(function (current) {
        return current + querySelector;
      });
      var activeLinks = context.querySelectorAll(selectors.join(','));
      var il = activeLinks.length;
      selectors = [].concat(originalSelectors.map(selector => `${selector}:not([hreflang])`), originalSelectors.map(selector => `${selector}[hreflang="${path.currentLanguage}"]`));
      selectors = selectors.map(current => current + querySelector);
      const activeLinks = context.querySelectorAll(selectors.join(','));
      const il = activeLinks.length;

      for (var i = 0; i < il; i++) {
      for (let i = 0; i < il; i++) {
        activeLinks[i].classList.add('is-active');
      }
    },
    detach: function detach(context, settings, trigger) {

    detach(context, settings, trigger) {
      if (trigger === 'unload') {
        var activeLinks = context.querySelectorAll('[data-drupal-link-system-path].is-active');
        var il = activeLinks.length;
        const activeLinks = context.querySelectorAll('[data-drupal-link-system-path].is-active');
        const il = activeLinks.length;

        for (var i = 0; i < il; i++) {
        for (let i = 0; i < il; i++) {
          activeLinks[i].classList.remove('is-active');
        }
      }
    }

  };
})(Drupal, drupalSettings);
 No newline at end of file
+145 −151

File changed.

Preview size limit exceeded, changes collapsed.

+11 −10
Original line number Diff line number Diff line
@@ -6,10 +6,10 @@
**/

(function (Drupal, debounce) {
  var liveElement;
  var announcements = [];
  let liveElement;
  const announcements = [];
  Drupal.behaviors.drupalAnnounce = {
    attach: function attach(context) {
    attach(context) {
      if (!liveElement) {
        liveElement = document.createElement('div');
        liveElement.id = 'drupal-live-announce';
@@ -19,15 +19,16 @@
        document.body.appendChild(liveElement);
      }
    }

  };

  function announce() {
    var text = [];
    var priority = 'polite';
    var announcement;
    var il = announcements.length;
    const text = [];
    let priority = 'polite';
    let announcement;
    const il = announcements.length;

    for (var i = 0; i < il; i++) {
    for (let i = 0; i < il; i++) {
      announcement = announcements.pop();
      text.unshift(announcement.text);

@@ -47,8 +48,8 @@

  Drupal.announce = function (text, priority) {
    announcements.push({
      text: text,
      priority: priority
      text,
      priority
    });
    return debounce(announce, 200)();
  };
+27 −25
Original line number Diff line number Diff line
@@ -6,16 +6,16 @@
**/

(function ($, Drupal) {
  var autocomplete;
  let autocomplete;

  function autocompleteSplitValues(value) {
    var result = [];
    var quote = false;
    var current = '';
    var valueLength = value.length;
    var character;
    const result = [];
    let quote = false;
    let current = '';
    const valueLength = value.length;
    let character;

    for (var i = 0; i < valueLength; i++) {
    for (let i = 0; i < valueLength; i++) {
      character = value.charAt(i);

      if (character === '"') {
@@ -41,13 +41,13 @@
  }

  function searchHandler(event) {
    var options = autocomplete.options;
    const options = autocomplete.options;

    if (options.isComposing) {
      return false;
    }

    var term = autocomplete.extractLastTerm(event.target.value);
    const term = autocomplete.extractLastTerm(event.target.value);

    if (term.length > 0 && options.firstCharacterBlacklist.indexOf(term[0]) !== -1) {
      return false;
@@ -57,18 +57,18 @@
  }

  function sourceData(request, response) {
    var elementId = this.element.attr('id');
    const elementId = this.element.attr('id');

    if (!(elementId in autocomplete.cache)) {
      autocomplete.cache[elementId] = {};
    }

    function showSuggestions(suggestions) {
      var tagged = autocomplete.splitValues(request.term);
      var il = tagged.length;
      const tagged = autocomplete.splitValues(request.term);
      const il = tagged.length;

      for (var i = 0; i < il; i++) {
        var index = suggestions.indexOf(tagged[i]);
      for (let i = 0; i < il; i++) {
        const index = suggestions.indexOf(tagged[i]);

        if (index >= 0) {
          suggestions.splice(index, 1);
@@ -78,7 +78,7 @@
      response(suggestions);
    }

    var term = autocomplete.extractLastTerm(request.term);
    const term = autocomplete.extractLastTerm(request.term);

    function sourceCallbackHandler(data) {
      autocomplete.cache[elementId][term] = data;
@@ -88,7 +88,7 @@
    if (autocomplete.cache[elementId].hasOwnProperty(term)) {
      showSuggestions(autocomplete.cache[elementId][term]);
    } else {
      var options = $.extend({
      const options = $.extend({
        success: sourceCallbackHandler,
        data: {
          q: term
@@ -103,7 +103,7 @@
  }

  function selectHandler(event, ui) {
    var terms = autocomplete.splitValues(event.target.value);
    const terms = autocomplete.splitValues(event.target.value);
    terms.pop();
    terms.push(ui.item.value);
    event.target.value = terms.join(', ');
@@ -115,41 +115,43 @@
  }

  Drupal.behaviors.autocomplete = {
    attach: function attach(context) {
      var $autocomplete = $(once('autocomplete', 'input.form-autocomplete', context));
    attach(context) {
      const $autocomplete = $(once('autocomplete', 'input.form-autocomplete', context));

      if ($autocomplete.length) {
        var blacklist = $autocomplete.attr('data-autocomplete-first-character-blacklist');
        const blacklist = $autocomplete.attr('data-autocomplete-first-character-blacklist');
        $.extend(autocomplete.options, {
          firstCharacterBlacklist: blacklist || ''
        });
        $autocomplete.autocomplete(autocomplete.options).each(function () {
          $(this).data('ui-autocomplete')._renderItem = autocomplete.options.renderItem;
        });
        $autocomplete.on('compositionstart.autocomplete', function () {
        $autocomplete.on('compositionstart.autocomplete', () => {
          autocomplete.options.isComposing = true;
        });
        $autocomplete.on('compositionend.autocomplete', function () {
        $autocomplete.on('compositionend.autocomplete', () => {
          autocomplete.options.isComposing = false;
        });
      }
    },
    detach: function detach(context, settings, trigger) {

    detach(context, settings, trigger) {
      if (trigger === 'unload') {
        $(once.remove('autocomplete', 'input.form-autocomplete', context)).autocomplete('destroy');
      }
    }

  };
  autocomplete = {
    cache: {},
    splitValues: autocompleteSplitValues,
    extractLastTerm: extractLastTerm,
    extractLastTerm,
    options: {
      source: sourceData,
      focus: focusHandler,
      search: searchHandler,
      select: selectHandler,
      renderItem: renderItem,
      renderItem,
      minLength: 1,
      firstCharacterBlacklist: '',
      isComposing: false
+7 −6
Original line number Diff line number Diff line
@@ -7,15 +7,15 @@

(function ($, Drupal) {
  Drupal.behaviors.batch = {
    attach: function attach(context, settings) {
      var batch = settings.batch;
      var $progress = $(once('batch', '[data-drupal-progress]'));
      var progressBar;
    attach(context, settings) {
      const batch = settings.batch;
      const $progress = $(once('batch', '[data-drupal-progress]'));
      let progressBar;

      function updateCallback(progress, status, pb) {
        if (progress === '100') {
          pb.stopMonitoring();
          window.location = "".concat(batch.uri, "&op=finished");
          window.location = `${batch.uri}&op=finished`;
        }
      }

@@ -27,10 +27,11 @@
      if ($progress.length) {
        progressBar = new Drupal.ProgressBar('updateprogress', updateCallback, 'POST', errorCallback);
        progressBar.setProgress(-1, batch.initMessage);
        progressBar.startMonitoring("".concat(batch.uri, "&op=do"), 10);
        progressBar.startMonitoring(`${batch.uri}&op=do`, 10);
        $progress.empty();
        $progress.append(progressBar.element);
      }
    }

  };
})(jQuery, Drupal);
 No newline at end of file
Loading