updated javascript dependencies and changed 'theme' to a constant in zulma_switchcss
This commit is contained in:
parent
435dfd6968
commit
4879e7c276
9 changed files with 4693 additions and 4530 deletions
|
@ -1,16 +1,16 @@
|
||||||
{
|
{
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.4.4",
|
"@babel/core": "^7.6.4",
|
||||||
"@babel/preset-env": "^7.4.4",
|
"@babel/preset-env": "^7.6.3",
|
||||||
"babel-loader": "^8.0.5",
|
"babel-loader": "^8.0.6",
|
||||||
"eslint": "^5.16.0",
|
"eslint": "^6.6.0",
|
||||||
"eslint-config-standard": "^12.0.0",
|
"eslint-config-standard": "^14.1.0",
|
||||||
"eslint-loader": "^2.1.2",
|
"eslint-loader": "^3.0.2",
|
||||||
"eslint-plugin-import": "^2.17.2",
|
"eslint-plugin-import": "^2.18.2",
|
||||||
"eslint-plugin-node": "^9.0.1",
|
"eslint-plugin-node": "^10.0.0",
|
||||||
"eslint-plugin-promise": "^4.1.1",
|
"eslint-plugin-promise": "^4.2.1",
|
||||||
"eslint-plugin-standard": "^4.0.0",
|
"eslint-plugin-standard": "^4.0.1",
|
||||||
"webpack": "^4.30.0",
|
"webpack": "^4.41.2",
|
||||||
"webpack-cli": "^3.3.2"
|
"webpack-cli": "^3.3.9"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
(function(switch_css) {
|
(function(switch_css) {
|
||||||
//Constants
|
//Constants
|
||||||
const THEME_KEY = "ZULMA_THEME";
|
const THEME_KEY = "ZULMA_THEME";
|
||||||
|
const THEME = localStorage.getItem(THEME_KEY);
|
||||||
const STOP_BLINK_CSS_ID = "stop-blink";
|
const STOP_BLINK_CSS_ID = "stop-blink";
|
||||||
const STYLESHEET_CLASSNAME = "stylesheet";
|
const STYLESHEET_CLASSNAME = "stylesheet";
|
||||||
|
|
||||||
//Variables
|
//Variables
|
||||||
let previousLink = null;
|
let previousLink = null;
|
||||||
let theme = localStorage.getItem(THEME_KEY);
|
|
||||||
|
|
||||||
//Events
|
//Events
|
||||||
/* The function called when the css has finished loading */
|
/* The function called when the css has finished loading */
|
||||||
|
@ -143,13 +143,13 @@
|
||||||
//Public Methods
|
//Public Methods
|
||||||
switch_css.init = function() {
|
switch_css.init = function() {
|
||||||
//if user has selected and theme and it is not the current theme
|
//if user has selected and theme and it is not the current theme
|
||||||
if (theme && !document.getElementById(theme)) {
|
if (THEME && !document.getElementById(THEME)) {
|
||||||
//hide the body to stop FOUC
|
//hide the body to stop FOUC
|
||||||
hideBody();
|
hideBody();
|
||||||
//change the theme
|
//change the theme
|
||||||
changeTheme(theme, true);
|
changeTheme(THEME, true);
|
||||||
//when the DOM is loaded, change the select to their current choice
|
//when the DOM is loaded, change the select to their current choice
|
||||||
updateThemeSelect(theme, true);
|
updateThemeSelect(THEME, true);
|
||||||
}
|
}
|
||||||
//when the DOM is loaded, set the dropdown to trigger the theme change
|
//when the DOM is loaded, set the dropdown to trigger the theme change
|
||||||
window.addEventListener("DOMContentLoaded", () => {
|
window.addEventListener("DOMContentLoaded", () => {
|
||||||
|
|
9179
javascript/yarn.lock
9179
javascript/yarn.lock
File diff suppressed because it is too large
Load diff
|
@ -1,2 +1,2 @@
|
||||||
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t){var r,n;r=document.querySelector(".burger"),n=document.querySelector("#"+r.dataset.target),r.addEventListener("click",function(){r.classList.toggle("is-active"),n.classList.toggle("is-active")})}]);
|
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t){var r,n;r=document.querySelector(".burger"),n=document.querySelector("#"+r.dataset.target),r.addEventListener("click",(function(){r.classList.toggle("is-active"),n.classList.toggle("is-active")}))}]);
|
||||||
//# sourceMappingURL=zulma_navbar.js.map
|
//# sourceMappingURL=zulma_navbar.js.map
|
File diff suppressed because one or more lines are too long
|
@ -1,2 +1,2 @@
|
||||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},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=1)}([,function(e,t){function n(e,t){return'<div class="search-results__item box">'+'<a href="'.concat(e.ref,'">').concat(e.doc.title,"</a>")+"<div>".concat(function(e,t){var n=t.map(function(e){return elasticlunr.stemmer(e.toLowerCase())}),r=!1,o=0,u=[],i=e.toLowerCase().split(". ");for(var l in i){var a=i[l].split(" "),c=8;for(var s in a){if((g=a[s]).length>0){for(var d in n)elasticlunr.stemmer(g).startsWith(n[d])&&(c=40,r=!0);u.push([g,c,o]),c=2}o+=g.length,o+=1}o+=1}if(0===u.length)return e;var f=[],p=Math.min(u.length,30),m=0;for(l=0;l<p;l++)m+=u[l][1];for(f.push(m),l=0;l<u.length-p;l++)m-=u[l][1],m+=u[l+p][1],f.push(m);var v=0;if(r){var h=0;for(l=f.length-1;l>=0;l--)f[l]>h&&(h=f[l],v=l)}var y=[],b=u[v][2];for(l=v;l<v+p;l++){var g;b<(g=u[l])[2]&&(y.push(e.substring(b,g[2])),b=g[2]),40===g[1]&&y.push("<b>"),b=g[2]+g[0].length,y.push(e.substring(g[2],b)),40===g[1]&&y.push("</b>")}return y.push("…"),y.join("")}(e.doc.body,t),"</div>")+"</div>"}function r(){var e,t,r,o=document.getElementById("search"),u=document.querySelector(".search-results"),i=document.querySelector(".search-results__items"),l={bool:"AND",fields:{title:{boost:2},body:{boost:1}}},a=elasticlunr.Index.load(window.searchIndex);o.addEventListener("keyup",(e=function(){var e=o.value.trim();if(a&&(u.style.display=""===e?"none":"block",i.innerHTML="",""!==e)){var t=a.search(e,l);if(0!==t.length){e;for(var r=0;r<Math.min(t.length,10);r++){var c=document.createElement("li");c.innerHTML=n(t[r],e.split(" ")),i.appendChild(c)}}else u.style.display="none"}},t=150,function(){var n=this,o=arguments;clearTimeout(r),r=setTimeout(function(){r=null,e.apply(n,o)},t)}))}"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?r():document.addEventListener("DOMContentLoaded",r)}]);
|
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},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=1)}([,function(e,t){function n(e,t){return'<div class="search-results__item box">'+'<a href="'.concat(e.ref,'">').concat(e.doc.title,"</a>")+"<div>".concat(function(e,t){var n=t.map((function(e){return elasticlunr.stemmer(e.toLowerCase())})),r=!1,o=0,u=[],i=e.toLowerCase().split(". ");for(var l in i){var a=i[l].split(" "),c=8;for(var s in a){if((g=a[s]).length>0){for(var d in n)elasticlunr.stemmer(g).startsWith(n[d])&&(c=40,r=!0);u.push([g,c,o]),c=2}o+=g.length,o+=1}o+=1}if(0===u.length)return e;var f=[],p=Math.min(u.length,30),m=0;for(l=0;l<p;l++)m+=u[l][1];for(f.push(m),l=0;l<u.length-p;l++)m-=u[l][1],m+=u[l+p][1],f.push(m);var v=0;if(r){var h=0;for(l=f.length-1;l>=0;l--)f[l]>h&&(h=f[l],v=l)}var y=[],b=u[v][2];for(l=v;l<v+p;l++){var g;b<(g=u[l])[2]&&(y.push(e.substring(b,g[2])),b=g[2]),40===g[1]&&y.push("<b>"),b=g[2]+g[0].length,y.push(e.substring(g[2],b)),40===g[1]&&y.push("</b>")}return y.push("…"),y.join("")}(e.doc.body,t),"</div>")+"</div>"}function r(){var e,t,r,o=document.getElementById("search"),u=document.querySelector(".search-results"),i=document.querySelector(".search-results__items"),l={bool:"AND",fields:{title:{boost:2},body:{boost:1}}},a=elasticlunr.Index.load(window.searchIndex);o.addEventListener("keyup",(e=function(){var e=o.value.trim();if(a&&(u.style.display=""===e?"none":"block",i.innerHTML="",""!==e)){var t=a.search(e,l);if(0!==t.length){e;for(var r=0;r<Math.min(t.length,10);r++){var c=document.createElement("li");c.innerHTML=n(t[r],e.split(" ")),i.appendChild(c)}}else u.style.display="none"}},t=150,function(){var n=this,o=arguments;clearTimeout(r),r=setTimeout((function(){r=null,e.apply(n,o)}),t)}))}"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?r():document.addEventListener("DOMContentLoaded",r)}]);
|
||||||
//# sourceMappingURL=zulma_search.js.map
|
//# sourceMappingURL=zulma_search.js.map
|
File diff suppressed because one or more lines are too long
|
@ -1,2 +1,2 @@
|
||||||
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.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 r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));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=2)}({2:function(e,t){!function(e){var t="ZULMA_THEME",n="stop-blink",o="stylesheet",r=null,c=localStorage.getItem(t),l=function e(t){var n=t.currentTarget;n.removeEventListener("load",e),n.removeEventListener("error",i),a(),n.className+=o,r=null,d()},i=function e(n){var c=n.currentTarget;c.removeEventListener("load",l),c.removeEventListener("error",e),localStorage.removeItem(t),s(c.id,!1),c.remove(),r&&document.getElementsByTagName("head")[0].appendChild(r),s(document.querySelectorAll(".".concat(o))[0].id,!0),d()};function u(e,n){var c=document.createElement("link");c.rel="stylesheet",c.type="text/css",c.href="/".concat(e,".css"),c.id=e;var u=document.getElementsByTagName("head")[0].appendChild(c);u.addEventListener("load",l),u.addEventListener("error",i),n&&(r=document.querySelectorAll(".".concat(o))[0],a()),function(e){localStorage.setItem(t,e)}(e)}function a(){document.querySelectorAll(".".concat(o)).forEach(function(e){e.remove()})}function d(){var e=document.getElementById(n);e&&e.remove()}function s(e,t){var n=document.querySelectorAll("#theme-select>option");n.length?n.forEach(function(n){n.value===e&&(t?n.selected="selected":n.remove())}):window.addEventListener("DOMContentLoaded",function(){s(e,t)})}e.init=function(){var e,t,o;c&&!document.getElementById(c)&&(e=document.getElementsByTagName("head")[0],t=document.createElement("style"),o="body{visibility:hidden;}",t.id=n,t.setAttribute("type","text/css"),t.styleSheet?t.styleSheet.cssText=o:t.appendChild(document.createTextNode(o)),e.appendChild(t),u(c,!0),s(c,!0)),window.addEventListener("DOMContentLoaded",function(){document.getElementById("theme-select").onchange=function(){u(this.value)}})}}(switch_css=window.switch_css||{}),switch_css.init()}});
|
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.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 r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));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=2)}({2:function(e,t){!function(e){var t="ZULMA_THEME",n=localStorage.getItem(t),o="stop-blink",r="stylesheet",c=null,l=function e(t){var n=t.currentTarget;n.removeEventListener("load",e),n.removeEventListener("error",i),a(),n.className+=r,c=null,d()},i=function e(n){var o=n.currentTarget;o.removeEventListener("load",l),o.removeEventListener("error",e),localStorage.removeItem(t),s(o.id,!1),o.remove(),c&&document.getElementsByTagName("head")[0].appendChild(c),s(document.querySelectorAll(".".concat(r))[0].id,!0),d()};function u(e,n){var o=document.createElement("link");o.rel="stylesheet",o.type="text/css",o.href="/".concat(e,".css"),o.id=e;var u=document.getElementsByTagName("head")[0].appendChild(o);u.addEventListener("load",l),u.addEventListener("error",i),n&&(c=document.querySelectorAll(".".concat(r))[0],a()),function(e){localStorage.setItem(t,e)}(e)}function a(){document.querySelectorAll(".".concat(r)).forEach((function(e){e.remove()}))}function d(){var e=document.getElementById(o);e&&e.remove()}function s(e,t){var n=document.querySelectorAll("#theme-select>option");n.length?n.forEach((function(n){n.value===e&&(t?n.selected="selected":n.remove())})):window.addEventListener("DOMContentLoaded",(function(){s(e,t)}))}e.init=function(){var e,t,r;n&&!document.getElementById(n)&&(e=document.getElementsByTagName("head")[0],t=document.createElement("style"),r="body{visibility:hidden;}",t.id=o,t.setAttribute("type","text/css"),t.styleSheet?t.styleSheet.cssText=r:t.appendChild(document.createTextNode(r)),e.appendChild(t),u(n,!0),s(n,!0)),window.addEventListener("DOMContentLoaded",(function(){document.getElementById("theme-select").onchange=function(){u(this.value)}}))}}(switch_css=window.switch_css||{}),switch_css.init()}});
|
||||||
//# sourceMappingURL=zulma_switchcss.js.map
|
//# sourceMappingURL=zulma_switchcss.js.map
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue