Commit 297148a6 authored by ROBERT PATRICK CAREY III's avatar ROBERT PATRICK CAREY III 🗿
Browse files

Removed explicit tippy dep

parent dd3399ba
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";var o={fontSize:{base:1.1,max:1.5,min:.75,increment:.5},fontFamily:"sans",viewingMode:"light",readingMode:"enable"},i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fontSize,n=void 0===t?o.fontSize.base:t,i=e.fontFamily,r=void 0===i?o.fontFamily:i,s=e.viewingMode,l=void 0===s?o.viewingMode:s,a=e.readingMode;return{fontSize:n,fontFamily:r,viewingMode:l,readingMode:void 0===a?o.readingMode:a,setFontSize:function(e){e=e||o.fontSize.base;try{e<o.fontSize.min?e=o.fontSize.min:e>o.fontSize.max&&(e=o.fontSize.max),document.body.style.fontSize=e+"rem",this.fontSize=e}catch(e){console.warn(e)}return this},setFontFamily:function(e){e=e||o.fontFamily;try{"serif"==e?(document.documentElement.classList.remove("font-sans","font-dyslexic"),document.documentElement.classList.add("font-serif")):"dyslexic"==e?(document.documentElement.classList.remove("font-sans","font-serif"),document.documentElement.classList.add("font-dyslexic")):(e="sans",document.documentElement.classList.remove("font-dyslexic","font-serif"),document.documentElement.classList.add("font-sans")),this.fontFamily=e}catch(e){console.warn(e)}return this},setViewingMode:function(e){e=e||o.viewingMode;try{if("dark"==e)document.documentElement.classList.remove("light-mode"),document.documentElement.classList.add("dark-mode");else{if("light"!=e)throw"Unsupported viewing mode: "+e;document.documentElement.classList.remove("dark-mode"),document.documentElement.classList.add("light-mode")}this.viewingMode=e}catch(e){console.warn(e)}return this},setReadingMode:function(e){e=e||o.readingMode;try{"disable"==e?document.documentElement.classList.add("reading-mode"):(e="enable",document.documentElement.classList.remove("reading-mode")),this.readingMode=e}catch(e){console.warn(e)}return this},setSelected:function(){this.setFontSize(this.fontSize),this.setFontFamily(this.fontFamily),this.setViewingMode(this.viewingMode),this.setReadingMode(this.readingMode);var e=document.querySelectorAll(".fontSlider"),t=!0,n=!1,o=void 0;try{for(var i,r=e[Symbol.iterator]();!(t=(i=r.next()).done);t=!0){i.value.value=this.fontSize}}catch(e){n=!0,o=e}finally{try{!t&&r.return&&r.return()}finally{if(n)throw o}}var s=document.querySelectorAll(".toggle-font-"+this.fontFamily),l=!0,a=!1,c=void 0;try{for(var d,u=s[Symbol.iterator]();!(l=(d=u.next()).done);l=!0){d.value.classList.add("active")}}catch(e){a=!0,c=e}finally{try{!l&&u.return&&u.return()}finally{if(a)throw c}}var f=document.querySelectorAll(".toggle-"+this.viewingMode+"-mode"),m=!0,g=!1,v=void 0;try{for(var y,h=f[Symbol.iterator]();!(m=(y=h.next()).done);m=!0){y.value.classList.add("active")}}catch(e){g=!0,v=e}finally{try{!m&&h.return&&h.return()}finally{if(g)throw v}}var S=document.querySelectorAll("."+this.readingMode+"-cards"),b=!0,p=!1,w=void 0;try{for(var F,M=S[Symbol.iterator]();!(b=(F=M.next()).done);b=!0){F.value.classList.add("active")}}catch(e){p=!0,w=e}finally{try{!b&&M.return&&M.return()}finally{if(p)throw w}}}}};document.addEventListener("DOMContentLoaded",function(e){!function(e){var t=void 0,n=function(){if("undefined"!=typeof Storage)return JSON.parse(localStorage.getItem("userPreferences"));console.warn("Unable to retrieve settings. This browser may not support local storage.")}();(t=n?i({fontSize:n.fontSize,fontFamily:n.fontFamily,viewingMode:n.viewingMode,readingMode:n.readingMode}):i()).setSelected(),e("body").fadeIn(100),window.addEventListener("resize",function(e,t,n){var o;return function(){var i=this,r=arguments,s=n&&!o;clearTimeout(o),o=setTimeout(function(){o=null,n||e.apply(i,r)},t),s&&e.apply(i,r)}}(function(){window.innerWidth<=767&&s(!0)},100));var r=document.getElementById("sidebar_collapse");function s(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0]?(document.getElementById("sidebar_first").classList.remove("collapsed"),setTimeout(function(){document.querySelector(".main-content").classList.add("col-md-9")},500)):(document.querySelector(".main-content").classList.remove("col-md-9"),document.getElementById("sidebar_first").classList.add("collapsed"))}function l(){e(".toggle-fullscreen").find("[data-fa-processed]").toggleClass("fa-expand").toggleClass("fa-compress"),"Enter Fullscreen"===e(".toggle-fullscreen").attr("data-original-title")?e(".toggle-fullscreen").attr("title","Exit Fullscreen"):e(".toggle-fullscreen").attr("title","Enter Fullscreen")}null!==r&&(r.onclick=function(){s(document.getElementById("sidebar_first").classList.contains("collapsed"))}),new MutationObserver(function(e){1==e[0].target.classList.contains("collapsed")?(document.querySelector("#sidebar_collapse svg").classList.remove("fa-arrow-alt-from-right"),document.querySelector("#sidebar_collapse svg").classList.add("fa-arrow-alt-from-left"),document.querySelector("#sidebar_collapse").setAttribute("title","Show sidebar")):(document.querySelector("#sidebar_collapse svg").classList.remove("fa-arrow-alt-from-left"),document.querySelector("#sidebar_collapse svg").classList.add("fa-arrow-alt-from-right"),document.querySelector("#sidebar_collapse").setAttribute("title","Hide sidebar"))}).observe(document.getElementById("sidebar_first"),{attributes:!0,attributeFilter:["class"],childList:!1,characterData:!1}),e(".toggle-font-serif").on("click touchstart",function(){e(".toggle-font-sans").removeClass("active"),e(".toggle-font-dyslexic").removeClass("active"),t.setFontFamily("serif")}),e(".toggle-font-sans").on("click touchstart",function(){e(".toggle-font-serif").removeClass("active"),e(".toggle-font-dyslexic").removeClass("active"),t.setFontFamily("sans")}),e(".toggle-font-dyslexic").on("click touchstart",function(){e(".toggle-font-serif").removeClass("active"),e(".toggle-font-sans").removeClass("active"),t.setFontFamily("dyslexic")}),e(".toggle-dark-mode").on("click touchstart",function(){e(".toggle-light-mode").removeClass("active"),t.setViewingMode("dark")}),e(".toggle-light-mode").on("click touchstart",function(){e(".toggle-dark-mode").removeClass("active"),t.setViewingMode("light")}),e(".disable-cards").on("click touchstart",function(){e(".enable-cards").removeClass("active"),t.setReadingMode("disable")}),e(".enable-cards").on("click touchstart",function(){e(".disable-cards").removeClass("active"),t.setReadingMode("enable")}),e(".reset-mode").on("click touchstart",function(){e("#userPreferences button").removeClass("active"),function(e){e.setFontSize(o.fontSize.base),e.setFontFamily(o.fontFamily),e.setViewingMode(o.viewingMode),e.setReadingMode(o.readingMode),e.setSelected(),"undefined"!=typeof Storage?localStorage.removeItem("userPreferences"):console.warn("Unable to store settings. This browser may not support local storage.")}(t)}),e(".save-user-preferences").on("click touchstart",function(){e("#userPreferences").modal("toggle"),function(e){"undefined"!=typeof Storage?localStorage.setItem("userPreferences",JSON.stringify(e)):console.warn("Unable to store settings. This browser may not support local storage.")}(t)}),e(".toggle-fullscreen").on("click touchstart",function(){document.fullscreen?document.exitFullscreen():document.mozFullScreen?document.mozCancelFullScreen():document.webkitIsFullScreen?document.webkitCancelFullScreen():document.msFullscreenElement?document.msExitFullscreen():function(){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen?e.webkitRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen()}()}),e(".fontSlider").on("input change",function(){t.setFontSize(this.value)}),document.addEventListener("webkitfullscreenchange",l,!1),document.addEventListener("mozfullscreenchange",l,!1),document.addEventListener("fullscreenchange",l,!1),document.addEventListener("MSFullscreenChange",l,!1)}(jQuery)})}]);
\ No newline at end of file
...@@ -190,16 +190,6 @@ document.addEventListener("DOMContentLoaded", function(event) { ...@@ -190,16 +190,6 @@ document.addEventListener("DOMContentLoaded", function(event) {
} }
}, 100)); }, 100));
/* Render all tooltips on the page using Tippy.js (an extension of Popper) */
tippy(document.querySelectorAll('[data-toggle="tooltip"]'), {
trigger: "mouseenter focus",
hideOnClick: true,
interactiveBorder: 5,
animation: "shift-away",
inertia: true,
arrow: true
});
let sidebar_collapse = document.getElementById('sidebar_collapse'); let sidebar_collapse = document.getElementById('sidebar_collapse');
if (sidebar_collapse !== null) { if (sidebar_collapse !== null) {
......
...@@ -4,7 +4,7 @@ user-preferences: ...@@ -4,7 +4,7 @@ user-preferences:
component: component:
css/user-preferences.min.css: {} css/user-preferences.min.css: {}
js: js:
js/dist/user-preferences.bundle.js: {} js/dist/user-preferences.js: {}
dependencies: dependencies:
- core/jquery - core/jquery
- core/drupalSettings - core/drupalSettings
\ No newline at end of file
...@@ -97,10 +97,10 @@ function user_preferences_node_links_alter(array &$links, NodeInterface $node, a ...@@ -97,10 +97,10 @@ function user_preferences_node_links_alter(array &$links, NodeInterface $node, a
'title' => t('<i class="fal fa-sliders-h-square">&nbsp;</i>'), 'title' => t('<i class="fal fa-sliders-h-square">&nbsp;</i>'),
'url' => Url::fromUri('internal:#togglePreferences'), 'url' => Url::fromUri('internal:#togglePreferences'),
'attributes' => [ 'attributes' => [
'title' => t('User Preferences'), 'title' => t('Preferences'),
'id' => 'toggle_preferences', 'id' => 'toggle_preferences',
'onclick' => 'jQuery("#userPreferences").modal("toggle")', 'onclick' => 'jQuery("#userPreferences").modal("toggle")',
'data-tippy-content' => t('User Preferences'), 'data-tippy-content' => t('Preferences'),
'data-toggle' => 'tooltip', 'data-toggle' => 'tooltip',
'aria-label' => 'User preferences', 'aria-label' => 'User preferences',
] ]
......
...@@ -7,7 +7,7 @@ const config = { ...@@ -7,7 +7,7 @@ const config = {
}, },
output: { output: {
path: path.resolve(__dirname, 'js/dist'), path: path.resolve(__dirname, 'js/dist'),
filename: 'user-preferences.bundle.js', filename: 'user-preferences.js',
}, },
module: { module: {
rules: [ rules: [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment