diff --git a/js/tabler.js b/js/tabler.js index 93260a4ae..2c5161565 100644 --- a/js/tabler.js +++ b/js/tabler.js @@ -1,22 +1,6 @@ import {CountUp} from "countup.js"; const tabler = { - hexToRgbA: function (hex, opacity) { - let c; - - opacity = opacity || 1; - - if (/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)) { - c = hex.substring(1).split(''); - if (c.length === 3) { - c = [c[0], c[0], c[1], c[1], c[2], c[2]]; - } - c = '0x' + c.join(''); - return 'rgba(' + [(c >> 16) & 255, (c >> 8) & 255, c & 255].join(',') + ',' + opacity + ')'; - } - throw new Error('Bad Hex'); - }, - toggleFullscreen: function (elem) { elem = elem || document.documentElement; if ( @@ -73,24 +57,6 @@ $(document).ready(function () { let countup = new CountUp(countups[i], parseFloat(countups[i].innerText), dataCountUp); countup.start(); } - - /* - Imask plugin - */ - if (window.IMask) { - (function () { - const $elem = $('[data-mask]'); - - if ($elem) { - $elem.each(function () { - IMask($(this).get(0), { - mask: $(this).attr('data-mask'), - lazy: $(this).attr('data-mask-visible') === 'true', - }); - }); - } - })(); - } }); window.tabler = tabler; diff --git a/pages/_includes/ui/form/input-mask.html b/pages/_includes/ui/form/input-mask.html index 153bd62c4..d55cd2f04 100644 --- a/pages/_includes/ui/form/input-mask.html +++ b/pages/_includes/ui/form/input-mask.html @@ -1 +1,19 @@ + +{% append_lib imask %} +{% capture_once scripts %} + +{% endcapture_once %}