From d62c80faf2c567579ee3fa8542aae645910f687d Mon Sep 17 00:00:00 2001 From: Chris Green Date: Fri, 9 Aug 2024 10:47:39 -0700 Subject: [PATCH] Close #3602 transpile JS with build tools `lando yarn run build` (#3603) --- modules/custom/az_card/js/az-card-no-follow.js | 10 +++++----- modules/custom/az_finder/js/active-filter-count.js | 3 +-- .../js/az_paragraphs_az_text_media_youtube.js | 6 +++--- modules/custom/az_select_menu/js/az-select-menu.js | 8 ++++---- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/modules/custom/az_card/js/az-card-no-follow.js b/modules/custom/az_card/js/az-card-no-follow.js index 4466435f02..ad2857c8be 100644 --- a/modules/custom/az_card/js/az-card-no-follow.js +++ b/modules/custom/az_card/js/az-card-no-follow.js @@ -4,12 +4,12 @@ * https://www.drupal.org/node/2815083 * @preserve **/ -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } +function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } +function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } +function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } (function (Drupal) { Drupal.behaviors.azCardNoFollow = { attach: function attach(context) { diff --git a/modules/custom/az_finder/js/active-filter-count.js b/modules/custom/az_finder/js/active-filter-count.js index 99d51ffd33..46dc896994 100644 --- a/modules/custom/az_finder/js/active-filter-count.js +++ b/modules/custom/az_finder/js/active-filter-count.js @@ -12,12 +12,11 @@ var filterCountDisplay = container.querySelector('.js-active-filter-count'); var textInputFields = container.querySelectorAll('input[type="text"], input[type="search"]'); var checkboxesAndRadios = container.querySelectorAll('input[type="checkbox"], input[type="radio"]'); - var minSearchLength = settings.azFinder.minSearchLength || 1; var alwaysDisplayResetButton = settings.azFinder.alwaysDisplayResetButton || false; var calculateActiveFilterCount = function calculateActiveFilterCount() { var count = container.querySelectorAll('input[type="checkbox"]:checked, input[type="radio"]:checked').length; textInputFields.forEach(function (inputField) { - if (inputField.value.trim().length >= minSearchLength) { + if (inputField.value.trim().length >= 1) { count += 1; } }); diff --git a/modules/custom/az_paragraphs/az_paragraphs_text_media/js/az_paragraphs_az_text_media_youtube.js b/modules/custom/az_paragraphs/az_paragraphs_text_media/js/az_paragraphs_az_text_media_youtube.js index c32b0722bf..7fcdaa07ac 100644 --- a/modules/custom/az_paragraphs/az_paragraphs_text_media/js/az_paragraphs_az_text_media_youtube.js +++ b/modules/custom/az_paragraphs/az_paragraphs_text_media/js/az_paragraphs_az_text_media_youtube.js @@ -110,7 +110,7 @@ }); }; window.onPlayerReady = function (event) { - const id = event.target.getVideoData().video_id; + var id = event.target.getVideoData().video_id; if (bgVideos[id].mute) { event.target.mute(); } @@ -120,7 +120,7 @@ dispatchEvent(azVideoPlayEvent); }; window.onPlayerStateChange = function (event) { - const id = event.target.getVideoData().video_id; + var id = event.target.getVideoData().video_id; var stateChangeContainer = document.getElementById("".concat(id, "-bg-video-container")); var parentid = stateChangeContainer.dataset.parentid; var parentContainer = document.getElementById(parentid); @@ -142,4 +142,4 @@ } } }; -})(jQuery, Drupal, drupalSettings); +})(jQuery, Drupal, drupalSettings); \ No newline at end of file diff --git a/modules/custom/az_select_menu/js/az-select-menu.js b/modules/custom/az_select_menu/js/az-select-menu.js index b006238084..84b48f8447 100644 --- a/modules/custom/az_select_menu/js/az-select-menu.js +++ b/modules/custom/az_select_menu/js/az-select-menu.js @@ -4,12 +4,12 @@ * https://www.drupal.org/node/2815083 * @preserve **/ -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } +function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } (function ($, Drupal, window, document, once) { Drupal.azSelectMenu = Drupal.azSelectMenu || {}; Drupal.behaviors.azSelectMenu = {