Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
zoltan-dulac committed Feb 28, 2025
1 parent b12a5a3 commit f9d5f99
Show file tree
Hide file tree
Showing 35 changed files with 396 additions and 253 deletions.
8 changes: 7 additions & 1 deletion js/modules/es4/ablePlayerCustomizations.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
******************************************************************************/

/* global AblePlayer, jQuery */
import '../../enable-node-libs/jquery/dist/jquery.min.js';
import '../enable-libs/ableplayer/thirdparty/js.cookie.js';
import { AblePlayerInstances } from '../enable-libs/ableplayer/build/ableplayer.js';

let hasClicked = false;

function ablePlayerCustomizations($, extraCustomizations) {
Expand Down Expand Up @@ -111,4 +115,6 @@ function ablePlayerCustomizations($, extraCustomizations) {

}

ablePlayerCustomizations(jQuery);
ablePlayerCustomizations(jQuery);

export { ablePlayerCustomizations, AblePlayerInstances };
1 change: 1 addition & 0 deletions js/modules/es4/accessibility.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -860,3 +860,4 @@ accessibility = {
this.initGroup(el, options);
}
};
export default accessibility;
7 changes: 5 additions & 2 deletions js/modules/es4/checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Released under the MIT License.
******************************************************************************/

const checkbox = new (function() {
const checkbox = new function () {

this.navigate = (evt) => {
// ref is the element that fired the event.
Expand Down Expand Up @@ -65,4 +65,7 @@ const checkbox = new (function() {

this.init();

});
};


export default checkbox;
11 changes: 9 additions & 2 deletions js/modules/es4/combobox.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
* Released under the MIT License.
******************************************************************************/

import accessibility from "../../enable-node-libs/accessibility-js-routines/dist/accessibility.module.js";
import { interpolate } from "./interpolate.js";


const EnableCombobox = function(componentRoot) {
let root = null,
form = null,
Expand Down Expand Up @@ -509,7 +513,7 @@ const EnableCombobox = function(componentRoot) {
this.initCombo(componentRoot);
};

const enableComboboxes = new (function() {
const enableComboboxes = new function() {
this.isKeyboardUser = false;

this.list = [];
Expand All @@ -536,4 +540,7 @@ const enableComboboxes = new (function() {

document.addEventListener('keyup', keyUpEvent);
}
})
}


export default enableComboboxes;
7 changes: 5 additions & 2 deletions js/modules/es4/enable-animatedGif.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Released under the MIT License.
******************************************************************************/

const animatedGifPause = new (function() {
const animatedGifPause = new function () {
const detailsQuery = '.pausable-animated-gif details';
let summaryPauseClass;

Expand Down Expand Up @@ -100,4 +100,7 @@ const animatedGifPause = new (function() {
}

this.init();
})
}


export default animatedGifPause;
4 changes: 4 additions & 0 deletions js/modules/es4/enable-carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* Released under the MIT License.
******************************************************************************/

import '../../enable-node-libs/glider-js/glider.js';

let counter = 0;

const EnableCarousel = function (container, options, gliderOptions) {
Expand Down Expand Up @@ -312,3 +314,5 @@ const EnableCarousel = function (container, options, gliderOptions) {
}
};
}

export default EnableCarousel;
8 changes: 6 additions & 2 deletions js/modules/es4/enable-character-count.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const enableCharacterCount = new (function() {
import { interpolate } from "./interpolate.js";

const enableCharacterCount = new function() {
'use strict';

const defaultReadCharacterCountKey = 'Escape';
Expand Down Expand Up @@ -201,4 +203,6 @@ const enableCharacterCount = new (function() {
const characterCountText = target.dataset.characterCountText ?? 'Character Count: ${numChars} out of ${maxLength}. ${charsRemaining} characters remaining.'
return interpolate(characterCountText, { numChars, maxLength, charsRemaining });
}
})
}

export default enableCharacterCount;
8 changes: 6 additions & 2 deletions js/modules/es4/enable-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
* Released under the MIT License.
******************************************************************************/

const enableDialog = new (function() {
import accessibility from '../../enable-node-libs/accessibility-js-routines/dist/accessibility.module.js';

const enableDialog = new function() {
/**
* Updates the passed dialog to retain focus and restore it when the dialog is closed. Won't
* upgrade a dialog more than once. Supports IE11+ and is a no-op otherwise.
Expand Down Expand Up @@ -111,4 +113,6 @@ const enableDialog = new (function() {
this.registerFocusRestoreDialog(favDialog);
}
}
});
}

export default enableDialog;
6 changes: 4 additions & 2 deletions js/modules/es4/enable-drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
******************************************************************************/


const enableDrawer = new (function() {
const enableDrawer = new function() {
this.init = function() {
document.body.addEventListener("click", function(e) {
var target = e.target;
Expand All @@ -40,4 +40,6 @@ const enableDrawer = new (function() {
}
});
}
})
}

export default enableDrawer;
10 changes: 8 additions & 2 deletions js/modules/es4/enable-flyout.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
*
* Released under the MIT License.
******************************************************************************/
import accessibility from "../../enable-node-libs/accessibility-js-routines/dist/accessibility.module.js"

let EnableFlyout;



EnableFlyout = new (function() {
EnableFlyout = new function() {
// cache all the queries, classes, node lists and media queries.
const menuSel = '.enable-flyout__open-menu-button';
const topNavSel = '.enable-flyout__top-level';
Expand Down Expand Up @@ -389,4 +391,8 @@ EnableFlyout = new (function() {

$root.classList.add('enable-flyout--initialized');
}
})
}

// EnableFlyout.init();

export default EnableFlyout;
9 changes: 7 additions & 2 deletions js/modules/es4/enable-listbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
* Released under the MIT License.
******************************************************************************/

const enableListbox = new (function() {
import accessibility from '../../enable-node-libs/accessibility-js-routines/dist/accessibility.module.js';

const enableListbox = new function() {

const showEvent = new CustomEvent('enable-listbox-show', {
bubbles: true
Expand Down Expand Up @@ -247,4 +249,7 @@ const enableListbox = new (function() {
this.collapse(buttonEl, listboxEl, true);
});
}
});
}


export default enableListbox;
9 changes: 8 additions & 1 deletion js/modules/es4/enable-slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
* Released under the MIT License.
******************************************************************************/

import { interpolate, htmlToDomNode } from "../modules/interpolate.js";

/**
* keyCodes() is an object to contain key code values for the application
*/
const keyCodes = function() {
// Define values for keycodes
this.backspace = 8;
Expand All @@ -34,7 +39,7 @@ const keyCodes = function() {
this.up = 38;
this.right = 39;
this.down = 40;
};
} // end keyCodes

/**
*
Expand Down Expand Up @@ -855,3 +860,5 @@ const enableSliders = new(function() {
}
};
})();

export default enableSliders;
11 changes: 9 additions & 2 deletions js/modules/es4/enable-toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
******************************************************************************/

// import tooltip from './tooltip.js'; // Temp: disable init of tooltip since it causes unexpected behavior
const tableOfContents = new (function() {
import { addMissingIDToHeading, getCookie, setCookie } from "./helpers.js";

/**
* Represents the table of contents.
*/
const tableOfContents = new function() {
this.toc;

/**
Expand Down Expand Up @@ -404,4 +409,6 @@ const tableOfContents = new (function() {
// Add the tooltip component
// tooltip.init(); // Temp: disable init of tooltip since it causes unexpected behavior
}
});
}

export default tableOfContents;
4 changes: 3 additions & 1 deletion js/modules/es4/enable-visible-on-focus.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,6 @@ const enableVisibleOnFocus = new (function () {
destinationLink.focus();
}
};
})();
})();

export default enableVisibleOnFocus;
2 changes: 2 additions & 0 deletions js/modules/es4/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,5 @@ function setCookie(name, value) {
function deleteCookie(name) {
document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`;
}

export { scrollToEl, focusDeepLink, addMissingIDToHeading, createPermalinksForHeading, splitCookies, getCookie, setCookie, deleteCookie }
6 changes: 4 additions & 2 deletions js/modules/es4/hierarchical-checkboxes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const hierarchicalCheckboxes = new (function() {
const hierarchicalCheckboxes = new function () {

this.init = () => {
document.addEventListener('change', checkboxClickEvent, true);
Expand Down Expand Up @@ -123,4 +123,6 @@ const hierarchicalCheckboxes = new (function() {
ownerEl.setAttribute('aria-checked', 'mixed');
}
}
})
}

export default hierarchicalCheckboxes;
8 changes: 6 additions & 2 deletions js/modules/es4/horizontalScrollUI.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const horizontalScrollUI = new (function() {
import { throttle } from './performance-utils.js';

const horizontalScrollUI = new function () {
const scrollEvent = (e) => {
const { target } = e;

Expand All @@ -22,4 +24,6 @@ const horizontalScrollUI = new (function() {
}

setEvents();
})
}

export default horizontalScrollUI;
4 changes: 3 additions & 1 deletion js/modules/es4/image-gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,6 @@ function imageGallery() {
if (nextBtn) nextBtn.addEventListener('click', () => this.moveThumb(1));
}
};
}
}

export default imageGallery;
25 changes: 24 additions & 1 deletion js/modules/es4/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,25 @@
'use strict';

/* eslint-disable no-unused-vars */
'use strict';
import { ablePlayerCustomizations, AblePlayerInstances } from "ablePlayerCustomizations.js";
import comboboxes from "combobox.js";
import animatedGifPause from "enable-animatedGif.js";
import EnableCarousel from "enable-carousel.js";
import enableListbox from "enable-listbox.js";
import enableVisibleOnFocus from "enable-visible-on-focus.js";
import EnableFlyout from "enable-flyout-hamburger.js";
import { interpolate, htmlToDomNode } from "interpolate.js";
import inputMask from "input-mask.js";
import offscreenObserver from "offscreen-observer.js";
import paginationTable from "paginate.js";
import { pauseAnimControl, PauseAnimControlDef } from "pause-anim-control.js";
import checkbox from "checkbox.js";
import radiogroup from "radiogroup.js";
import readMore from "read-more.js";
import sortableTables from "sortable-tables.js";
import { spinbuttons, spinbutton } from "spinbutton.js";
import Switch from "switch.js";
import tabgroup from "tabs.js";
import tooltip from "tooltip.js";
import tableOfContents from "enable-toc.js";
import imageGallery from "image-gallery.js";
6 changes: 4 additions & 2 deletions js/modules/es4/input-mask.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Released under the MIT License.
******************************************************************************/

const inputMask = new (function() {
const inputMask = new function () {
this.bemPrefix = 'enable-input-mask';

const inputClass = `${this.bemPrefix}__input`;
Expand Down Expand Up @@ -492,4 +492,6 @@ const inputMask = new (function() {

this.init();

})
}

export default inputMask;
3 changes: 3 additions & 0 deletions js/modules/es4/interpolate.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,6 @@ const htmlToDomNode = function(html) {
const doc = interpolateDomParser.parseFromString(html, "text/html");
return doc.body.firstChild;
};


export { interpolate, htmlToDomNode };
6 changes: 4 additions & 2 deletions js/modules/es4/meter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* applied to the element.
******************************************************************************/

const meter = new (function() {
const meter = new function() {
this.init = function() {
this.meterEls = document.querySelectorAll('.enable-custom-meter');

Expand Down Expand Up @@ -57,4 +57,6 @@ const meter = new (function() {

return state;
}
})
}

export default meter;
Loading

0 comments on commit f9d5f99

Please sign in to comment.