website-utilities 1.0.275 → 1.0.278
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/package.json +3 -3
- package/readme.md +151 -118
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';if(typeof module!=='undefined'&&module!==null&&eval('typeof require')!=='undefined'&&eval('require')!==null&&'main'in eval('require')&&eval('typeof require.main')!=='undefined'&&eval('require.main')!==null){var ORIGINAL_MAIN_MODULE=module;if(module!==eval('require.main')&&'paths'in module&&'paths'in eval('require.main')&&typeof __dirname!=='undefined'&&__dirname!==null)module.paths=eval('require.main.paths').concat(module.paths.filter(function(path){return eval('require.main.paths').includes(path)}))};if(typeof window==='undefined'||window===null)var window=(typeof global==='undefined'||global===null)?{}:global;!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/regenerator"),require("clientnode")):"function"==typeof define&&define.amd?define("index",["@babel/runtime/helpers/asyncToGenerator","@babel/runtime/helpers/extends","@babel/runtime/helpers/inheritsLoose","@babel/runtime/regenerator","clientnode"],e):"object"==typeof exports?exports.index=e(require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/regenerator"),require("clientnode")):(t.index=t.index||{},t.index.indexCss=e(t["@babel/runtime/helpers/asyncToGenerator"],t["@babel/runtime/helpers/extends"],t["@babel/runtime/helpers/inheritsLoose"],t["@babel/runtime/regenerator"],t.clientnode))}(this,(function(t,e,o,n,i){return function(){"use strict";var r=[,function(e){e.exports=t},function(t){t.exports=e},function(t){t.exports=o},function(t){t.exports=n},function(t){t.exports=i}],s={};function a(t){var e=s[t];if(void 0!==e)return e.exports;var o=s[t]={exports:{}};return r[t](o,o.exports,a),o.exports}a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,{a:e}),e},a.d=function(t,e){for(var o in e)a.o(e,o)&&!a.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var l={};return function(){a.r(l),a.d(l,{WebsiteUtilities:function(){return T},default:function(){return x}});var t=a(1),e=a.n(t),o=a(2),n=a.n(o),i=a(3),r=a.n(i),s=a(4),d=a.n(s),c=a(5),u=a.n(c),p=function(){return p=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},p.apply(this,arguments)},h={lines:12,length:7,width:5,radius:10,scale:1,corners:1,color:"#000",fadeColor:"transparent",animation:"spinner-line-fade-default",rotate:0,direction:1,speed:1,zIndex:2e9,className:"spinner",top:"50%",left:"50%",shadow:"0 0 1px transparent",position:"absolute"},m=function(){function t(t){void 0===t&&(t={}),this.opts=p(p({},h),t)}return t.prototype.spin=function(t){return this.stop(),this.el=document.createElement("div"),this.el.className=this.opts.className,this.el.setAttribute("role","progressbar"),f(this.el,{position:this.opts.position,width:0,zIndex:this.opts.zIndex,left:this.opts.left,top:this.opts.top,transform:"scale("+this.opts.scale+")"}),t&&t.insertBefore(this.el,t.firstChild||null),function(t,e){var o=Math.round(e.corners*e.width*500)/1e3+"px",n="none";!0===e.shadow?n="0 2px 4px #000":"string"==typeof e.shadow&&(n=e.shadow);for(var i=function(t){for(var e=/^\s*([a-zA-Z]+\s+)?(-?\d+(\.\d+)?)([a-zA-Z]*)\s+(-?\d+(\.\d+)?)([a-zA-Z]*)(.*)$/,o=[],n=0,i=t.split(",");n<i.length;n++){var r=i[n].match(e);if(null!==r){var s=+r[2],a=+r[5],l=r[4],d=r[7];0!==s||l||(l=d),0!==a||d||(d=l),l===d&&o.push({prefix:r[1]||"",x:s,y:a,xUnits:l,yUnits:d,end:r[8]})}}return o}(n),r=0;r<e.lines;r++){var s=~~(360/e.lines*r+e.rotate),a=f(document.createElement("div"),{position:"absolute",top:-e.width/2+"px",width:e.length+e.width+"px",height:e.width+"px",background:g(e.fadeColor,r),borderRadius:o,transformOrigin:"left",transform:"rotate("+s+"deg) translateX("+e.radius+"px)"}),l=r*e.direction/e.lines/e.speed;l-=1/e.speed;var d=f(document.createElement("div"),{width:"100%",height:"100%",background:g(e.color,r),borderRadius:o,boxShadow:w(i,s),animation:1/e.speed+"s linear "+l+"s infinite "+e.animation});a.appendChild(d),t.appendChild(a)}}(this.el,this.opts),this},t.prototype.stop=function(){return this.el&&("undefined"!=typeof requestAnimationFrame?cancelAnimationFrame(this.animateId):clearTimeout(this.animateId),this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=void 0),this},t}();function f(t,e){for(var o in e)t.style[o]=e[o];return t}function g(t,e){return"string"==typeof t?t:t[e%t.length]}function w(t,e){for(var o=[],n=0,i=t;n<i.length;n++){var r=i[n],s=v(r.x,r.y,e);o.push(r.prefix+s[0]+r.xUnits+" "+s[1]+r.yUnits+r.end)}return o.join(", ")}function v(t,e,o){var n=o*Math.PI/180,i=Math.sin(n),r=Math.cos(n);return[Math.round(1e3*(t*r+e*i))/1e3,Math.round(1e3*(-t*i+e*r))/1e3]}function b(t,e){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(o)return(o=o.call(t)).next.bind(o);if(Array.isArray(t)||(o=function(t,e){if(!t)return;if("string"==typeof t)return y(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return y(t,e)}(t))||e&&t&&"number"==typeof t.length){o&&(t=o);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,n=new Array(e);o<e;o++)n[o]=t[o];return n}var T=function(t){function o(){for(var e,o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this).options=null,e.$domNodes=null,e.currentMediaQueryMode="",e.currentSectionName="home",e.languageHandler=null,e.startUpAnimationIsComplete=!1,e.viewportIsOnTop=!1,e.windowLoaded=!1,e.windowLoadingSpinner=null,e._onViewportMovesToTop=u().debounce((function(){"hidden"===e.$domNodes.scrollToTopButton.css("visibility")?e.$domNodes.scrollToTopButton.css("opacity",0):(e.options.scrollToTop.button.hideAnimationOptions.always=function(){return e.$domNodes.scrollToTopButton.css({bottom:"-="+e.options.scrollToTop.button.slideDistanceInPixel,display:"none"})},e.$domNodes.scrollToTopButton.finish().animate({bottom:"+="+String(e.options.scrollToTop.button.slideDistanceInPixel),opacity:0},e.options.scrollToTop.button.hideAnimationOptions))})),e._onViewportMovesAwayFromTop=u().debounce((function(){"hidden"===e.$domNodes.scrollToTopButton.css("visibility")?e.$domNodes.scrollToTopButton.css("opacity",1):e.$domNodes.scrollToTopButton.finish().css({bottom:"+="+String(e.options.scrollToTop.button.slideDistanceInPixel),display:"block",opacity:0}).animate({bottom:"-="+String(e.options.scrollToTop.button.slideDistanceInPixel),queue:!1,opacity:1},e.options.scrollToTop.button.showAnimationOptions)})),e}r()(o,t);var i=o.prototype;return i.initialize=function(e){var n=this;return void 0===e&&(e={}),t.prototype.initialize.call(this,u().extend(!0,{},o._defaultOptions,e)),this.$domNodes=this.grabDomNodes(this.options.domNodes),this.disableScrolling(),new Promise((function(t){n.$domNodes.windowLoadingSpinner.length&&(n.windowLoadingSpinner=new m(n.options.windowLoadingSpinner),n.windowLoadingSpinner.spin(n.$domNodes.windowLoadingSpinner[0])),n._bindScrollEvents(),n.$domNodes.parent.show();var e=function(){n.windowLoaded||(n.windowLoaded=!0,n._removeLoadingCover().then((function(){n._performStartUpEffects(),t(n)})))};(0,c.$)((function(){u().timeout(e,n.options.windowLoadedTimeoutAfterDocLoadedInMSec)})),n.on(n.$domNodes.window,"load",e),n._bindClickTracking(),n.options.language.logging||(n.options.language.logging=n.options.logging),n.options.activateLanguageSupport&&!n.languageHandler&&(0,c.$)(n.$domNodes.parent).Internationalisation(n.options.language).then((function(t){n.languageHandler=t.data("Internationalisation")})),n._bindNavigationEvents(),n._bindMediaQueryChangeEvents(),n._triggerWindowResizeEvents()}))},i.scrollToTop=function(){return c.globalContext.document&&(0,c.$)("html, body").stop().animate({scrollTop:0},this.options.scrollToTop.options),this},i.disableScrolling=function(){return this.$domNodes.parent.addClass("disable-scrolling").on("touchmove",(function(t){return t.preventDefault()})),this},i.enableScrolling=function(){return this.$domNodes.parent.removeClass(["disable-scrolling","touchmove"]),this.off(this.$domNodes.parent),this},i.track=function(t){if(c.globalContext.window.location&&this.options.tracking){var e=n()({context:c.globalContext.window.location.pathname+"#"+this.currentSectionName},t);(isNaN(e.value)||"number"!=typeof e.value)&&(e.value=1),this.debug('Run tracking code: "event" with arguments:'),this.debug(e);try{this.options.tracking.track(e)}catch(t){this.warn('Problem in tracking "'+u().represent(e)+'": '+u().represent(t))}}return this},i._onChangeMediaQueryMode=function(t,e){},i._onChangeToLargeMode=function(t,e){},i._onChangeToMediumMode=function(t,e){},i._onChangeToSmallMode=function(t,e){},i._onChangeToExtraSmallMode=function(t,e){},i._onSwitchSection=function(t){var e;if(c.globalContext.window.location&&null!=(e=this.options.tracking)&&e.sectionSwitch&&this.currentSectionName!==t){this.currentSectionName=t,this.debug('Run section switch tracking on section "'+this.currentSectionName+'".');try{this.options.tracking.sectionSwitch.call(this,this.currentSectionName)}catch(t){this.warn('Problem due to track section switch to "'+this.currentSectionName+'": '+u().represent(t))}}},i._onStartUpAnimationComplete=function(){this.startUpAnimationIsComplete=!0},i._bindMediaQueryChangeEvents=function(){this.on(this.$domNodes.window,"resize",this._triggerWindowResizeEvents.bind(this))},i._triggerWindowResizeEvents=function(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];for(var n,i=b(this.options.mediaQueryClassNameIndicator);!(n=i()).done;){var r=n.value;this.$domNodes.mediaQueryIndicator.prependTo(this.$domNodes.parent).addClass("hidden-"+r[1]),this.$domNodes.mediaQueryIndicator.is(":hidden")&&r[0]!==this.currentMediaQueryMode&&(this.fireEvent.apply(this,["changeMediaQueryMode",!1,this,this.currentMediaQueryMode,r[0]].concat(e)),this.fireEvent.apply(this,["changeTo"+u().stringCapitalize(r[0])+"Mode",!1,this,this.currentMediaQueryMode,r[0]].concat(e)),this.currentMediaQueryMode=r[0]),this.$domNodes.mediaQueryIndicator.removeClass("hidden-"+r[1])}},i._bindScrollEvents=function(){for(var t=this,e=arguments.length,o=new Array(e),n=0;n<e;n++)o[n]=arguments[n];var i=(0,c.$)("body, html").add(this.$domNodes.window);i.on(this.options.knownScrollEventNames.join(" "),(function(e){t.options.switchToManualScrollingIndicator(e)&&i.stop(!0)})),this.on(this.$domNodes.window,"scroll",(function(){t.$domNodes.window.scrollTop()?t.viewportIsOnTop&&(t.viewportIsOnTop=!1,t.fireEvent.apply(t,["viewportMovesAwayFromTop",!1,t].concat(o))):t.viewportIsOnTop||(t.viewportIsOnTop=!0,t.fireEvent.apply(t,["viewportMovesToTop",!1,t].concat(o)))})),this.$domNodes.window.scrollTop()?(this.viewportIsOnTop=!1,this.fireEvent.apply(this,["viewportMovesAwayFromTop",!1,this].concat(o))):(this.viewportIsOnTop=!0,this.fireEvent.apply(this,["viewportMovesToTop",!1,this].concat(o)))},i._removeLoadingCover=function(){var t=e()(d().mark((function t(){var e=this;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u().timeout(this.options.additionalPageLoadingTimeInMilliseconds);case 2:return(0,c.$)(u().stringFormat('[class^="{1}"], [class*=" {1}"]',this.sliceDomNodeSelectorPrefix(this.options.domNodes.startUpAnimationClassPrefix).substr(1))).css(this.options.startUpHide),t.next=5,new Promise((function(t){e.$domNodes.windowLoadingCover.length?(e.enableScrolling(),e.$domNodes.windowLoadingCover.animate(e.options.windowLoadingCoverHideAnimation,{always:function(){return t()}})):t()}));case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),i._performStartUpEffects=function(){var t=e()(d().mark((function t(e){var o,n=this;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===e&&(e=1),this.$domNodes.windowLoadingCover.hide(),this.windowLoadingSpinner&&this.windowLoadingSpinner.stop(),!(0,c.$)(u().stringFormat('[class^="{1}"], [class*=" {1}"]',this.sliceDomNodeSelectorPrefix(this.options.domNodes.startUpAnimationClassPrefix).substr(1))).length){t.next=17;break}return t.next=6,u().timeout(this.options.startUpAnimationElementDelayInMiliseconds);case 6:if(o=!1,(0,c.$)(this.options.domNodes.startUpAnimationClassPrefix+""+e).animate(this.options.startUpShowAnimation,{always:function(){o&&n.fireEvent("startUpAnimationComplete")}}),!(0,c.$)(this.options.domNodes.startUpAnimationClassPrefix+""+(e+1)).length){t.next=14;break}return t.next=12,this._performStartUpEffects(e+1);case 12:t.next=15;break;case 14:o=!0;case 15:t.next=18;break;case 17:this.fireEvent("startUpAnimationComplete");case 18:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),i._bindNavigationEvents=function(){var t=this;c.globalContext.window.addEventListener("hashchange",(function(){t.startUpAnimationIsComplete&&t.fireEvent("switchSection",!1,t,location.hash.substring("#".length))}),!1),this._bindScrollToTopButton()},i._bindScrollToTopButton=function(){var t=this;this.on(this.$domNodes.scrollToTopButton,"click",(function(e){e.preventDefault(),t.scrollToTop()}))},i._bindClickTracking=function(){var t=this;this.options.tracking&&(this.options.tracking.linkClick&&this.on(this.$domNodes.parent.find("a"),"click",(function(e){return t.options.tracking.linkClick.call(t,(0,c.$)(e.target),e)})),this.options.tracking.buttonClick&&this.on(this.$domNodes.parent.find("button"),"click",(function(e){return t.options.tracking.buttonClick.call(t,(0,c.$)(e.target),e)})))},o}(u());T._defaultOptions={activateLanguageSupport:!0,additionalPageLoadingTimeInMilliseconds:0,domain:"auto",domNodes:{mediaQueryIndicator:'<div class="wu-media-query-indicator">',scrollToTopButton:'a[href="#top"]',startUpAnimationClassPrefix:".wu-start-up-animation-number-",top:"header",windowLoadingCover:".window-loading-cover, .wu-window-loading-cover",windowLoadingSpinner:".window-loading-cover > div, .wu-window-loading-cover > div"},domNodeSelectorInfix:"wu",domNodeSelectorPrefix:"body.{1}",initialSectionName:"home",knownScrollEventNames:["DOMMouseScroll","keyup","mousedown","mousewheel","scroll","touchmove","wheel"],language:{},mediaQueryClassNameIndicator:[["extraSmall","xs"],["small","sm"],["medium","md"],["large","lg"]],name:"WebsiteUtilities",onChangeMediaQueryMode:u().noop,onChangeToExtraSmallMode:u().noop,onChangeToLargeMode:u().noop,onChangeToMediumMode:u().noop,onChangeToSmallMode:u().noop,onViewportMovesAwayFromTop:u().noop,onViewportMovesToTop:u().noop,onSwitchSection:u().noop,onStartUpAnimationComplete:u().noop,scrollToTop:{button:{hideAnimationOptions:{},showAnimationOptions:{},slideDistanceInPixel:30},options:{duration:"fast"}},startUpAnimationElementDelayInMiliseconds:100,startUpHide:{opacity:0},startUpShowAnimation:{opacity:1},switchToManualScrollingIndicator:function(t){return"number"==typeof t.which&&t.which>0||"mousedown"===t.type||"mousewheel"===t.type||"touchmove"===t.type},tracking:{buttonClick:function(t,e){this.track({event:"buttonClick",eventType:"click",label:t.text(),reference:t.attr("action")||t.attr("target")||t.attr("type")||t.text(),subject:"button",value:parseInt(t.attr("website-analytics-value")),userInteraction:!0})},linkClick:function(t,e){this.track({event:"linkClick",eventType:"click",label:t.text(),reference:t.attr("href")||t.attr("action")||t.attr("target")||t.attr("type")||t.text(),subject:"link",value:parseInt(t.attr("website-analytics-value")),userInteraction:!0})},sectionSwitch:function(t){this.track({event:"sectionSwitch",eventType:"sectionSwitch",label:t,reference:c.globalContext.window.location.pathname+"#"+t,subject:"url",userInteraction:!1})},track:function(t){var e;null==(e=c.globalContext.dataLayer)||e.push(t)}},windowLoadingCoverHideAnimation:{opacity:0},windowLoadingSpinner:{animation:"spinner-line-fade-quick",className:"spinner",color:"#000",corners:1,direction:1,fadeColor:"transparent",left:"auto",length:23,lines:9,position:"absolute",radius:40,rotate:0,scale:1,shadow:!1,speed:1.1,top:"auto",width:11,zIndex:2e9},windowLoadedTimeoutAfterDocLoadedInMSec:2e3};var x=T;c.$.WebsiteUtilities=function(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return u().controller(T,e)},c.$.WebsiteUtilities.class=T}(),l}()}));
|
|
1
|
+
'use strict';if(typeof module!=='undefined'&&module!==null&&eval('typeof require')!=='undefined'&&eval('require')!==null&&'main'in eval('require')&&eval('typeof require.main')!=='undefined'&&eval('require.main')!==null){var ORIGINAL_MAIN_MODULE=module;if(module!==eval('require.main')&&'paths'in module&&'paths'in eval('require.main')&&typeof __dirname!=='undefined'&&__dirname!==null)module.paths=eval('require.main.paths').concat(module.paths.filter(function(path){return eval('require.main.paths').includes(path)}))};if(typeof window==='undefined'||window===null)var window=(typeof global==='undefined'||global===null)?{}:global;!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/regenerator"),require("clientnode")):"function"==typeof define&&define.amd?define("index",["@babel/runtime/helpers/asyncToGenerator","@babel/runtime/helpers/extends","@babel/runtime/helpers/inheritsLoose","@babel/runtime/regenerator","clientnode"],e):"object"==typeof exports?exports.index=e(require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/inheritsLoose"),require("@babel/runtime/regenerator"),require("clientnode")):(t.index=t.index||{},t.index.indexCss=e(t["@babel/runtime/helpers/asyncToGenerator"],t["@babel/runtime/helpers/extends"],t["@babel/runtime/helpers/inheritsLoose"],t["@babel/runtime/regenerator"],t.clientnode))}(this,(function(t,e,o,n,i){return function(){"use strict";var r=[,function(e){e.exports=t},function(t){t.exports=e},function(t){t.exports=o},function(t){t.exports=n},function(t){t.exports=i}],s={};function a(t){var e=s[t];if(void 0!==e)return e.exports;var o=s[t]={exports:{}};return r[t](o,o.exports,a),o.exports}a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,{a:e}),e},a.d=function(t,e){for(var o in e)a.o(e,o)&&!a.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var l={};return function(){a.r(l),a.d(l,{WebsiteUtilities:function(){return T},default:function(){return x}});var t=a(1),e=a.n(t),o=a(2),n=a.n(o),i=a(3),r=a.n(i),s=a(4),d=a.n(s),c=a(5),u=a.n(c),p=function(){return p=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var i in e=arguments[o])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},p.apply(this,arguments)},h={lines:12,length:7,width:5,radius:10,scale:1,corners:1,color:"#000",fadeColor:"transparent",animation:"spinner-line-fade-default",rotate:0,direction:1,speed:1,zIndex:2e9,className:"spinner",top:"50%",left:"50%",shadow:"0 0 1px transparent",position:"absolute"},m=function(){function t(t){void 0===t&&(t={}),this.opts=p(p({},h),t)}return t.prototype.spin=function(t){return this.stop(),this.el=document.createElement("div"),this.el.className=this.opts.className,this.el.setAttribute("role","progressbar"),f(this.el,{position:this.opts.position,width:0,zIndex:this.opts.zIndex,left:this.opts.left,top:this.opts.top,transform:"scale("+this.opts.scale+")"}),t&&t.insertBefore(this.el,t.firstChild||null),function(t,e){var o=Math.round(e.corners*e.width*500)/1e3+"px",n="none";!0===e.shadow?n="0 2px 4px #000":"string"==typeof e.shadow&&(n=e.shadow);for(var i=function(t){for(var e=/^\s*([a-zA-Z]+\s+)?(-?\d+(\.\d+)?)([a-zA-Z]*)\s+(-?\d+(\.\d+)?)([a-zA-Z]*)(.*)$/,o=[],n=0,i=t.split(",");n<i.length;n++){var r=i[n].match(e);if(null!==r){var s=+r[2],a=+r[5],l=r[4],d=r[7];0!==s||l||(l=d),0!==a||d||(d=l),l===d&&o.push({prefix:r[1]||"",x:s,y:a,xUnits:l,yUnits:d,end:r[8]})}}return o}(n),r=0;r<e.lines;r++){var s=~~(360/e.lines*r+e.rotate),a=f(document.createElement("div"),{position:"absolute",top:-e.width/2+"px",width:e.length+e.width+"px",height:e.width+"px",background:g(e.fadeColor,r),borderRadius:o,transformOrigin:"left",transform:"rotate("+s+"deg) translateX("+e.radius+"px)"}),l=r*e.direction/e.lines/e.speed;l-=1/e.speed;var d=f(document.createElement("div"),{width:"100%",height:"100%",background:g(e.color,r),borderRadius:o,boxShadow:w(i,s),animation:1/e.speed+"s linear "+l+"s infinite "+e.animation});a.appendChild(d),t.appendChild(a)}}(this.el,this.opts),this},t.prototype.stop=function(){return this.el&&("undefined"!=typeof requestAnimationFrame?cancelAnimationFrame(this.animateId):clearTimeout(this.animateId),this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=void 0),this},t}();function f(t,e){for(var o in e)t.style[o]=e[o];return t}function g(t,e){return"string"==typeof t?t:t[e%t.length]}function w(t,e){for(var o=[],n=0,i=t;n<i.length;n++){var r=i[n],s=v(r.x,r.y,e);o.push(r.prefix+s[0]+r.xUnits+" "+s[1]+r.yUnits+r.end)}return o.join(", ")}function v(t,e,o){var n=o*Math.PI/180,i=Math.sin(n),r=Math.cos(n);return[Math.round(1e3*(t*r+e*i))/1e3,Math.round(1e3*(-t*i+e*r))/1e3]}function b(t,e){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(o)return(o=o.call(t)).next.bind(o);if(Array.isArray(t)||(o=function(t,e){if(!t)return;if("string"==typeof t)return y(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return y(t,e)}(t))||e&&t&&"number"==typeof t.length){o&&(t=o);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,n=new Array(e);o<e;o++)n[o]=t[o];return n}var T=function(t){function o(){for(var e,o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this).options=null,e.$domNodes=null,e.currentMediaQueryMode="",e.currentSectionName="home",e.languageHandler=null,e.startUpAnimationIsComplete=!1,e.viewportIsOnTop=!1,e.windowLoaded=!1,e.windowLoadingSpinner=null,e._onViewportMovesToTop=u().debounce((function(){"hidden"===e.$domNodes.scrollToTopButton.css("visibility")?e.$domNodes.scrollToTopButton.css("opacity",0):(e.options.scrollToTop.button.hideAnimationOptions.always=function(){return e.$domNodes.scrollToTopButton.css({bottom:"-="+e.options.scrollToTop.button.slideDistanceInPixel,display:"none"})},e.$domNodes.scrollToTopButton.finish().animate({bottom:"+="+String(e.options.scrollToTop.button.slideDistanceInPixel),opacity:0},e.options.scrollToTop.button.hideAnimationOptions))})),e._onViewportMovesAwayFromTop=u().debounce((function(){"hidden"===e.$domNodes.scrollToTopButton.css("visibility")?e.$domNodes.scrollToTopButton.css("opacity",1):e.$domNodes.scrollToTopButton.finish().css({bottom:"+="+String(e.options.scrollToTop.button.slideDistanceInPixel),display:"block",opacity:0}).animate({bottom:"-="+String(e.options.scrollToTop.button.slideDistanceInPixel),queue:!1,opacity:1},e.options.scrollToTop.button.showAnimationOptions)})),e}r()(o,t);var i=o.prototype;return i.initialize=function(e){var n=this;return void 0===e&&(e={}),t.prototype.initialize.call(this,u().extend(!0,{},o._defaultOptions,e)),this.$domNodes=this.grabDomNodes(this.options.domNodes),this.disableScrolling(),new Promise((function(t){n.$domNodes.windowLoadingSpinner.length&&(n.windowLoadingSpinner=new m(n.options.windowLoadingSpinner),n.windowLoadingSpinner.spin(n.$domNodes.windowLoadingSpinner[0])),n._bindScrollEvents(),n.$domNodes.parent.show();var e=function(){n.windowLoaded||(n.windowLoaded=!0,n._removeLoadingCover().then((function(){n._performStartUpEffects(),t(n)})))};(0,c.$)((function(){u().timeout(e,n.options.windowLoadedTimeoutAfterDocLoadedInMSec)})),n.on(n.$domNodes.window,"load",e),n._bindClickTracking(),n.options.language.logging||(n.options.language.logging=n.options.logging),n.options.activateLanguageSupport&&!n.languageHandler&&(0,c.$)(n.$domNodes.parent).Internationalisation(n.options.language).then((function(t){n.languageHandler=t.data("Internationalisation")})),n._bindNavigationEvents(),n._bindMediaQueryChangeEvents(),n._triggerWindowResizeEvents()}))},i.scrollToTop=function(){return c.globalContext.document&&(0,c.$)("html, body").stop().animate({scrollTop:0},this.options.scrollToTop.options),this},i.disableScrolling=function(){return this.$domNodes.parent.addClass("disable-scrolling").on("touchmove",(function(t){return t.preventDefault()})),this},i.enableScrolling=function(){return this.$domNodes.parent.removeClass(["disable-scrolling","touchmove"]),this.off(this.$domNodes.parent),this},i.track=function(t){if(c.globalContext.window.location&&this.options.tracking){var e=n()({context:c.globalContext.window.location.pathname+"#"+this.currentSectionName},t);(isNaN(e.value)||"number"!=typeof e.value)&&(e.value=1),this.debug('Run tracking code: "event" with arguments:'),this.debug(e);try{this.options.tracking.track(e)}catch(t){this.warn('Problem in tracking "'+u().represent(e)+'": '+u().represent(t))}}return this},i._onChangeMediaQueryMode=function(t,e){},i._onChangeToLargeMode=function(t,e){},i._onChangeToMediumMode=function(t,e){},i._onChangeToSmallMode=function(t,e){},i._onChangeToExtraSmallMode=function(t,e){},i._onSwitchSection=function(t){var e;if(c.globalContext.window.location&&null!=(e=this.options.tracking)&&e.sectionSwitch&&this.currentSectionName!==t){this.currentSectionName=t,this.debug('Run section switch tracking on section "'+this.currentSectionName+'".');try{this.options.tracking.sectionSwitch.call(this,this.currentSectionName)}catch(t){this.warn('Problem due to track section switch to "'+this.currentSectionName+'": '+u().represent(t))}}},i._onStartUpAnimationComplete=function(){this.startUpAnimationIsComplete=!0},i._bindMediaQueryChangeEvents=function(){this.on(this.$domNodes.window,"resize",this._triggerWindowResizeEvents.bind(this))},i._triggerWindowResizeEvents=function(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];for(var n,i=b(this.options.mediaQueryClassNameIndicator);!(n=i()).done;){var r=n.value;this.$domNodes.mediaQueryIndicator.prependTo(this.$domNodes.parent).addClass("hidden-"+r[1]),this.$domNodes.mediaQueryIndicator.is(":hidden")&&r[0]!==this.currentMediaQueryMode&&(this.fireEvent.apply(this,["changeMediaQueryMode",!1,this,this.currentMediaQueryMode,r[0]].concat(e)),this.fireEvent.apply(this,["changeTo"+u().stringCapitalize(r[0])+"Mode",!1,this,this.currentMediaQueryMode,r[0]].concat(e)),this.currentMediaQueryMode=r[0]),this.$domNodes.mediaQueryIndicator.removeClass("hidden-"+r[1])}},i._bindScrollEvents=function(){for(var t=this,e=arguments.length,o=new Array(e),n=0;n<e;n++)o[n]=arguments[n];var i=(0,c.$)("body, html").add(this.$domNodes.window);i.on(this.options.knownScrollEventNames.join(" "),(function(e){t.options.switchToManualScrollingIndicator(e)&&i.stop(!0)})),this.on(this.$domNodes.window,"scroll",(function(){t.$domNodes.window.scrollTop()?t.viewportIsOnTop&&(t.viewportIsOnTop=!1,t.fireEvent.apply(t,["viewportMovesAwayFromTop",!1,t].concat(o))):t.viewportIsOnTop||(t.viewportIsOnTop=!0,t.fireEvent.apply(t,["viewportMovesToTop",!1,t].concat(o)))})),this.$domNodes.window.scrollTop()?(this.viewportIsOnTop=!1,this.fireEvent.apply(this,["viewportMovesAwayFromTop",!1,this].concat(o))):(this.viewportIsOnTop=!0,this.fireEvent.apply(this,["viewportMovesToTop",!1,this].concat(o)))},i._removeLoadingCover=function(){var t=e()(d().mark((function t(){var e=this;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u().timeout(this.options.additionalPageLoadingTimeInMilliseconds);case 2:return(0,c.$)(u().stringFormat('[class^="{1}"], [class*=" {1}"]',this.sliceDomNodeSelectorPrefix(this.options.domNodes.startUpAnimationClassPrefix).substr(1))).css(this.options.startUpHide),t.next=5,new Promise((function(t){e.$domNodes.windowLoadingCover.length?(e.enableScrolling(),e.$domNodes.windowLoadingCover.animate(e.options.windowLoadingCoverHideAnimation,{always:function(){return t()}})):t()}));case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),i._performStartUpEffects=function(){var t=e()(d().mark((function t(e){var o,n=this;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===e&&(e=1),this.$domNodes.windowLoadingCover.hide(),this.windowLoadingSpinner&&this.windowLoadingSpinner.stop(),!(0,c.$)(u().stringFormat('[class^="{1}"], [class*=" {1}"]',this.sliceDomNodeSelectorPrefix(this.options.domNodes.startUpAnimationClassPrefix).substr(1))).length){t.next=17;break}return t.next=6,u().timeout(this.options.startUpAnimationElementDelayInMiliseconds);case 6:if(o=!1,(0,c.$)(this.options.domNodes.startUpAnimationClassPrefix+""+e).animate(this.options.startUpShowAnimation,{always:function(){o&&n.fireEvent("startUpAnimationComplete")}}),!(0,c.$)(this.options.domNodes.startUpAnimationClassPrefix+""+(e+1)).length){t.next=14;break}return t.next=12,this._performStartUpEffects(e+1);case 12:t.next=15;break;case 14:o=!0;case 15:t.next=18;break;case 17:this.fireEvent("startUpAnimationComplete");case 18:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),i._bindNavigationEvents=function(){var t=this;c.globalContext.window.addEventListener("hashchange",(function(e){t.startUpAnimationIsComplete&&t.fireEvent("switchSection",!1,t,location.hash.substring("#".length),e)}),!1),this._bindScrollToTopButton()},i._bindScrollToTopButton=function(){var t=this;this.on(this.$domNodes.scrollToTopButton,"click",(function(e){e.preventDefault(),t.scrollToTop()}))},i._bindClickTracking=function(){var t=this;this.options.tracking&&(this.options.tracking.linkClick&&this.on(this.$domNodes.parent.find("a"),"click",(function(e){return t.options.tracking.linkClick.call(t,(0,c.$)(e.target),e)})),this.options.tracking.buttonClick&&this.on(this.$domNodes.parent.find("button"),"click",(function(e){return t.options.tracking.buttonClick.call(t,(0,c.$)(e.target),e)})))},o}(u());T._defaultOptions={activateLanguageSupport:!0,additionalPageLoadingTimeInMilliseconds:0,domain:"auto",domNodes:{mediaQueryIndicator:'<div class="wu-media-query-indicator">',scrollToTopButton:'a[href="#top"]',startUpAnimationClassPrefix:".wu-start-up-animation-number-",top:"header",windowLoadingCover:".window-loading-cover, .wu-window-loading-cover",windowLoadingSpinner:".window-loading-cover > div, .wu-window-loading-cover > div"},domNodeSelectorInfix:"wu",domNodeSelectorPrefix:"body.{1}",initialSectionName:"home",knownScrollEventNames:["DOMMouseScroll","keyup","mousedown","mousewheel","scroll","touchmove","wheel"],language:{},mediaQueryClassNameIndicator:[["extraSmall","xs"],["small","sm"],["medium","md"],["large","lg"]],name:"WebsiteUtilities",onChangeMediaQueryMode:u().noop,onChangeToExtraSmallMode:u().noop,onChangeToLargeMode:u().noop,onChangeToMediumMode:u().noop,onChangeToSmallMode:u().noop,onViewportMovesAwayFromTop:u().noop,onViewportMovesToTop:u().noop,onSwitchSection:u().noop,onStartUpAnimationComplete:u().noop,scrollToTop:{button:{hideAnimationOptions:{},showAnimationOptions:{},slideDistanceInPixel:30},options:{duration:"fast"}},startUpAnimationElementDelayInMiliseconds:100,startUpHide:{opacity:0},startUpShowAnimation:{opacity:1},switchToManualScrollingIndicator:function(t){return"number"==typeof t.which&&t.which>0||"mousedown"===t.type||"mousewheel"===t.type||"touchmove"===t.type},tracking:{buttonClick:function(t,e){this.track({event:"buttonClick",eventType:"click",label:t.text(),reference:t.attr("action")||t.attr("target")||t.attr("type")||t.text(),subject:"button",value:parseInt(t.attr("website-analytics-value")),userInteraction:!0})},linkClick:function(t,e){this.track({event:"linkClick",eventType:"click",label:t.text(),reference:t.attr("href")||t.attr("action")||t.attr("target")||t.attr("type")||t.text(),subject:"link",value:parseInt(t.attr("website-analytics-value")),userInteraction:!0})},sectionSwitch:function(t){this.track({event:"sectionSwitch",eventType:"sectionSwitch",label:t,reference:c.globalContext.window.location.pathname+"#"+t,subject:"url",userInteraction:!1})},track:function(t){var e;null==(e=c.globalContext.dataLayer)||e.push(t)}},windowLoadingCoverHideAnimation:{opacity:0},windowLoadingSpinner:{animation:"spinner-line-fade-quick",className:"spinner",color:"#000",corners:1,direction:1,fadeColor:"transparent",left:"auto",length:23,lines:9,position:"absolute",radius:40,rotate:0,scale:1,shadow:!1,speed:1.1,top:"auto",width:11,zIndex:2e9},windowLoadedTimeoutAfterDocLoadedInMSec:2e3};var x=T;c.$.WebsiteUtilities=function(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return u().controller(T,e)},c.$.WebsiteUtilities.class=T}(),l}()}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "website-utilities",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.278",
|
|
4
4
|
"description": "extend your web app",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jquery",
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "yarn build:types; yarn build:deploy; yarn build:web",
|
|
41
41
|
"build:deploy": "weboptimizer build '{__reference__: \"target:deploy\"}'",
|
|
42
|
-
"build:export": "
|
|
42
|
+
"build:export": "yarn build:types; yarn build:deploy; yarn build:export:web",
|
|
43
|
+
"build:export:web": "weboptimizer build '{__reference__: \"target:export\"}'",
|
|
43
44
|
"build:types": "weboptimizer build:types",
|
|
44
45
|
"build:web": "weboptimizer build",
|
|
45
46
|
"check": "yarn check:types; yarn lint",
|
|
@@ -67,7 +68,6 @@
|
|
|
67
68
|
"@babel/plugin-transform-proto-to-assign": "*",
|
|
68
69
|
"@types/ejs": "*",
|
|
69
70
|
"@types/html-minifier": "*",
|
|
70
|
-
"@types/jest": "*",
|
|
71
71
|
"@types/jquery": "*",
|
|
72
72
|
"@types/jsdom": "*",
|
|
73
73
|
"@types/node": "*",
|
package/readme.md
CHANGED
|
@@ -73,12 +73,11 @@ Use cases
|
|
|
73
73
|
<li>Handle google tracking.<!--deDE:Verbindung zu google tracking.--></li>
|
|
74
74
|
</ul>
|
|
75
75
|
|
|
76
|
-
<!--|deDE:Inhalt-->
|
|
77
|
-
Content
|
|
78
|
-
-------
|
|
79
|
-
|
|
80
76
|
<!--Place for automatic generated table of contents.-->
|
|
81
|
-
|
|
77
|
+
<div class="doc-toc" style="display:none">
|
|
78
|
+
<!--|deDE:Inhalt-->
|
|
79
|
+
<h2 id="content">Content</h2>
|
|
80
|
+
</div>
|
|
82
81
|
|
|
83
82
|
<!--|deDE:Installation-->
|
|
84
83
|
Installation
|
|
@@ -94,17 +93,31 @@ after needed dependencies:
|
|
|
94
93
|
Script-Tag in deine Webseite integrieren:
|
|
95
94
|
-->
|
|
96
95
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
96
|
+
```HTML
|
|
97
|
+
<script
|
|
98
|
+
src="https://code.jquery.com/jquery-3.6.0.min.js"
|
|
99
|
+
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
|
|
100
|
+
crossorigin="anonymous"
|
|
101
|
+
></script>
|
|
102
|
+
<script
|
|
103
|
+
src="https://torben.website/clientnode/data/distributionBundle/index.js"
|
|
104
|
+
></script>
|
|
105
|
+
<script
|
|
106
|
+
src="https://torben.website/internationalisation/data/distributionBundle/index.js"
|
|
107
|
+
></script>
|
|
108
|
+
<!--Inject downloaded file:
|
|
109
|
+
<script src="index.js"></script>
|
|
110
|
+
-->
|
|
111
|
+
<!--Or integrate via cdn:-->
|
|
112
|
+
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
|
|
113
|
+
<!--Inject downloaded file:-->
|
|
114
|
+
<script src="index.compiled.js"></script>
|
|
115
|
+
<!--Or integrate via cdn:
|
|
116
|
+
<script
|
|
117
|
+
src="https://torben.website/website-utilities/data/distributionBundle/index.js"
|
|
118
|
+
></script>
|
|
119
|
+
-->
|
|
120
|
+
```
|
|
108
121
|
|
|
109
122
|
The compiled bundle supports AMD, commonjs, commonjs2 and variable injection
|
|
110
123
|
into given context (UMD) as export format: You can use a module bundler if you
|
|
@@ -125,15 +138,15 @@ If you are using npm as package manager you can simply add this tool to your
|
|
|
125
138
|
<strong>package.json</strong> erweitern:
|
|
126
139
|
-->
|
|
127
140
|
|
|
128
|
-
|
|
129
|
-
|
|
141
|
+
```JSON
|
|
142
|
+
...
|
|
143
|
+
"dependencies": {
|
|
130
144
|
...
|
|
131
|
-
"
|
|
132
|
-
...
|
|
133
|
-
"website-utilities": "latest",
|
|
134
|
-
...
|
|
135
|
-
},
|
|
145
|
+
"website-utilities": "latest",
|
|
136
146
|
...
|
|
147
|
+
},
|
|
148
|
+
...
|
|
149
|
+
```
|
|
137
150
|
|
|
138
151
|
After updating your packages you can simply depend on this script and let
|
|
139
152
|
a module bundler do the hard stuff or access it via an exported variable name
|
|
@@ -144,29 +157,29 @@ in given context.
|
|
|
144
157
|
Context referenzieren.
|
|
145
158
|
-->
|
|
146
159
|
|
|
147
|
-
|
|
160
|
+
```JavaScript
|
|
161
|
+
...
|
|
162
|
+
$ = require('website-utilities')
|
|
163
|
+
...
|
|
164
|
+
$.Website().isEquivalentDom('<div>', '<script>') // false
|
|
165
|
+
...
|
|
148
166
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
value instanceof Website
|
|
166
|
-
// or
|
|
167
|
-
$ = require('website-utilities').$
|
|
168
|
-
$.Website()
|
|
169
|
-
...
|
|
167
|
+
...
|
|
168
|
+
import Website from 'website-utilities'
|
|
169
|
+
class SpecialWebsite extends Website...
|
|
170
|
+
Website({options..})
|
|
171
|
+
// or
|
|
172
|
+
import {$} from 'website-utilities'
|
|
173
|
+
$.Website().isEquivalentDom('<div>', '<script>') // false
|
|
174
|
+
class SpecialWebsite extends $.Website.class ...
|
|
175
|
+
// or
|
|
176
|
+
Website = require('website-utilities').default
|
|
177
|
+
value instanceof Website
|
|
178
|
+
// or
|
|
179
|
+
$ = require('website-utilities').$
|
|
180
|
+
$.Website()
|
|
181
|
+
...
|
|
182
|
+
```
|
|
170
183
|
|
|
171
184
|
<!--deDE:Verwendung-->
|
|
172
185
|
Usage
|
|
@@ -178,80 +191,100 @@ Here you can see the initialisation with all available plugin options:
|
|
|
178
191
|
gesetzt werden können angegeben:
|
|
179
192
|
-->
|
|
180
193
|
|
|
181
|
-
|
|
194
|
+
```HTML
|
|
195
|
+
<script
|
|
196
|
+
src="https://code.jquery.com/jquery-3.6.0.min.js"
|
|
197
|
+
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
|
|
198
|
+
crossorigin="anonymous"
|
|
199
|
+
></script>
|
|
200
|
+
<script
|
|
201
|
+
src="https://torben.website/clientnode/data/distributionBundle/index.js"
|
|
202
|
+
></script>
|
|
203
|
+
<script
|
|
204
|
+
src="https://torben.website/internationalisation/data/distributionBundle/index.js"
|
|
205
|
+
></script>
|
|
206
|
+
<!--Inject downloaded file:
|
|
207
|
+
<script src="index.js"></script>
|
|
208
|
+
-->
|
|
209
|
+
<!--Or integrate via cdn:-->
|
|
210
|
+
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
|
|
211
|
+
<!--Inject downloaded file:-->
|
|
212
|
+
<script src="index.compiled.js"></script>
|
|
213
|
+
<!--Or integrate via cdn:
|
|
214
|
+
<script
|
|
215
|
+
src="https://torben.website/website-utilities/data/distributionBundle/index.js"
|
|
216
|
+
></script>
|
|
182
217
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}))
|
|
254
|
-
</script>
|
|
218
|
+
<script>
|
|
219
|
+
$(($) => $.Website({
|
|
220
|
+
activateLanguageSupport: true,
|
|
221
|
+
additionalPageLoadingTimeInMilliseconds: 0,
|
|
222
|
+
domain: 'auto',
|
|
223
|
+
domNode: {
|
|
224
|
+
mediaQueryIndicator: '<div class="media-query-indicator">',
|
|
225
|
+
top: '> div.navbar-wrapper',
|
|
226
|
+
scrollToTopButton: 'a[href="#top"]',
|
|
227
|
+
startUpAnimationClassPrefix:
|
|
228
|
+
'.website-start-up-animation-number-',
|
|
229
|
+
windowLoadingCover: 'div.website-window-loading-cover',
|
|
230
|
+
windowLoadingSpinner: 'div.website-window-loading-cover > div'
|
|
231
|
+
},
|
|
232
|
+
domNodeSelectorPrefix: 'body.{1}',
|
|
233
|
+
knownScrollEventNames:
|
|
234
|
+
'scroll mousedown wheel DOMMouseScroll mousewheel keyup ' +
|
|
235
|
+
'touchmove',
|
|
236
|
+
language: {},
|
|
237
|
+
mediaQueryClassNameIndicator: [
|
|
238
|
+
['extraSmall', 'xs'], ['small', 'sm'], ['medium', 'md'],
|
|
239
|
+
['large', 'lg']
|
|
240
|
+
],
|
|
241
|
+
onViewportMovesToTop: $.noop(),
|
|
242
|
+
onViewportMovesAwayFromTop: $.noop(),
|
|
243
|
+
onChangeToLargeMode: $.noop(),
|
|
244
|
+
onChangeToMediumMode: $.noop(),
|
|
245
|
+
onChangeToSmallMode: $.noop(),
|
|
246
|
+
onChangeToExtraSmallMode: $.noop(),
|
|
247
|
+
onChangeMediaQueryMode: $.noop(),
|
|
248
|
+
onSwitchSection: $.noop(),
|
|
249
|
+
onStartUpAnimationComplete: $.noop(),
|
|
250
|
+
startUpAnimationElementDelayInMiliseconds: 100,
|
|
251
|
+
startUpShowAnimation: [{opacity: 1}, {}],
|
|
252
|
+
startUpHide: {opacity: 0},
|
|
253
|
+
switchToManualScrollingIndicator: (event:Object):boolean => (
|
|
254
|
+
event.which > 0 || event.type === 'mousedown' ||
|
|
255
|
+
event.type === 'mousewheel' || event.type === 'touchmove'),
|
|
256
|
+
scrollToTop: {
|
|
257
|
+
inLinearTime: true,
|
|
258
|
+
options: {duration: 'normal'},
|
|
259
|
+
button: {
|
|
260
|
+
slideDistanceInPixel: 30,
|
|
261
|
+
showAnimation: {duration: 'normal'},
|
|
262
|
+
hideAnimation: {duration: 'normal'}
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
trackingCode: null,
|
|
266
|
+
windowLoadingCoverHideAnimation: [{opacity: 0}, {}],
|
|
267
|
+
windowLoadingSpinner: {
|
|
268
|
+
lines: 9, // The number of lines to draw
|
|
269
|
+
length: 23, // The length of each line
|
|
270
|
+
width: 11, // The line thickness
|
|
271
|
+
radius: 40, // The radius of the inner circle
|
|
272
|
+
corners: 1, // Corner roundness (0..1)
|
|
273
|
+
rotate: 75, // The rotation offset
|
|
274
|
+
color: '#000', // #rgb or #rrggbb
|
|
275
|
+
speed: 1.1, // Rounds per second
|
|
276
|
+
trail: 58, // Afterglow percentage
|
|
277
|
+
shadow: false, // Whether to render a shadow
|
|
278
|
+
hwaccel: false, // Whether to use hardware acceleration
|
|
279
|
+
className: 'spinner', // CSS class to assign to the spinner
|
|
280
|
+
zIndex: 2e9, // The z-index (defaults to 2000000000)
|
|
281
|
+
top: 'auto', // Top position relative to parent in px
|
|
282
|
+
left: 'auto' // Left position relative to parent in px
|
|
283
|
+
},
|
|
284
|
+
windowLoadedTimeoutAfterDocumentLoadedInMilliseconds: 3000
|
|
285
|
+
}))
|
|
286
|
+
</script>
|
|
287
|
+
```
|
|
255
288
|
|
|
256
289
|
<!-- region modline
|
|
257
290
|
vim: set tabstop=4 shiftwidth=4 expandtab:
|