1 line
9.4 KiB
JavaScript
1 line
9.4 KiB
JavaScript
!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b.default=a,b}function e(a){return a&&a.__esModule?a:{default:a}}function f(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var g=a("./utils/environment"),h=a("./utils/html"),i=a("./utils/globals"),j=e(i),k=a("./modules"),l=d(k),m=function(){function a(){var b=this;f(this,a),this.modules=l,this.currentModules=[],g.$document.on("initModules.App",function(a){b.initGlobals(a.firstBlood).deleteModules().initModules()})}return a.prototype.deleteModules=function(){for(var a=this.currentModules.length;a--;)this.currentModules[a].destroy(),this.currentModules.splice(a);return this},a.prototype.initGlobals=function(a){return(0,j.default)(a),this},a.prototype.initModules=function(){for(var a=document.querySelectorAll("[data-module]"),b=0,c=a.length;b<c;b++){var d=a[b],e=(0,h.getNodeData)(d);e.el=d,e.$el=$(d);for(var f=e.module,g=f.replace(/\s/g,"").split(","),i=0,j=g.length;i<j;i++){var k=g[i];if("function"==typeof this.modules[k]){var l=new this.modules[k](e);this.currentModules.push(l)}}}return this},a}();!function(){window.App=new m,g.$document.trigger({type:"initModules.App",firstBlood:!0})}()},{"./modules":3,"./utils/environment":8,"./utils/globals":9,"./utils/html":10}],2:[function(a,b,c){"use strict";function d(a,b){var c=$.Deferred();if(a instanceof jQuery&&a.length>0&&(b=$.extend({},f,"undefined"!=typeof b?b:{}),e===!1)){e=!0;var d=$("html, body"),g=0;"undefined"!=typeof b.$container&&b.$container instanceof jQuery&&b.$container.length>0?(d=b.$container,g=a.position().top):g=a.offset().top,d.animate({scrollTop:g-b.headerOffset},b.speed,b.easing,function(){e=!1,c.resolve()})}return c.promise()}Object.defineProperty(c,"__esModule",{value:!0}),c.scrollTo=d;var e=!1,f={easing:"swing",headerOffset:60,speed:300}},{}],3:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{default:a}}Object.defineProperty(c,"__esModule",{value:!0});var e=a("./modules/Button");Object.defineProperty(c,"Button",{enumerable:!0,get:function(){return d(e).default}});var f=a("./modules/Title");Object.defineProperty(c,"Title",{enumerable:!0,get:function(){return d(f).default}})},{"./modules/Button":5,"./modules/Title":6}],4:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(c,"__esModule",{value:!0});var e=a("../utils/environment"),f=function a(b){d(this,a),this.$document=e.$document,this.$window=e.$window,this.$html=e.$html,this.$body=e.$body,this.$el=b.$el,this.el=b.el};c.default=f},{"../utils/environment":8}],5:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(c,"__esModule",{value:!0});var h=a("./AbstractModule"),i=d(h),j=function(a){function b(c){e(this,b);var d=f(this,a.call(this,c));return d.$el.on("click.Button",function(a){d.$document.trigger("Title.changeLabel",[$(a.currentTarget).val()])}),d}return g(b,a),b.prototype.destroy=function(){this.$el.off(".Button")},b}(i.default);c.default=j},{"./AbstractModule":4}],6:[function(a,b,c){"use strict";function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function g(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(c,"__esModule",{value:!0});var h=a("../utils/visibility"),i=a("./AbstractModule"),j=d(i),k=function(a){function b(c){e(this,b);var d=f(this,a.call(this,c));return d.$label=d.$el.find(".js-label"),d.$document.on("Title.changeLabel",function(a,b){d.changeLabel(b),d.destroy()}),d.hiddenCallbackIdent=(0,h.visibilityApi)({action:"addCallback",state:"hidden",callback:d.logHidden}),d.visibleCallbackIdent=(0,h.visibilityApi)({action:"addCallback",state:"visible",callback:d.logVisible}),d}return g(b,a),b.prototype.logHidden=function(){console.log("Title is hidden")},b.prototype.logVisible=function(){console.log("Title is visible")},b.prototype.changeLabel=function(a){this.$label.text(a)},b.prototype.destroy=function(){this.$document.off("Title.changeLabel"),(0,h.visibilityApi)({action:"removeCallback",state:"hidden",ident:this.hiddenCallbackIdent}),(0,h.visibilityApi)({action:"removeCallback",state:"visible",ident:this.visibleCallbackIdent}),this.$el.off(".Title")},b}(j.default);c.default=k},{"../utils/visibility":12,"./AbstractModule":4}],7:[function(a,b,c){"use strict";function d(a,b){var c=a.indexOf(b);c===-1&&a.push(b)}function e(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]==b)return!0;return!1}function f(a,b){var c;if(!(0,l.isArray)(a)||!(0,l.isArray)(b))return!1;if(a.length!==b.length)return!1;for(c=a.length;c--;)if(a[c]!==b[c])return!1;return!0}function g(a){return"string"==typeof a?[a]:void 0===a?[]:a}function h(a){return a[a.length-1]}function i(a,b){if(a){var c=a.indexOf(b);c!==-1&&a.splice(c,1)}}function j(a){for(var b=[],c=a.length;c--;)b[c]=a[c];return b}function k(a,b,c){return a.filter(function(a){return a[b]===c})}Object.defineProperty(c,"__esModule",{value:!0}),c.addToArray=d,c.arrayContains=e,c.arrayContentsMatch=f,c.ensureArray=g,c.lastItem=h,c.removeFromArray=i,c.toArray=j,c.findByKeyValue=k;var l=a("./is")},{"./is":11}],8:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d=$(document),e=$(window),f=$(document.documentElement),g=$(document.body);c.$document=d,c.$window=e,c.$html=f,c.$body=g},{}],9:[function(a,b,c){"use strict";Object.defineProperty(c,"__esModule",{value:!0}),c.default=function(){svg4everybody()}},{}],10:[function(a,b,c){"use strict";function d(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function e(a){return a.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function f(a){var b=a.attributes,c=/^data\-(.+)$/,d={};for(var e in b)if(b[e]){var f=b[e].name;if(f){var g=f.match(c);g&&(d[g[1]]=a.getAttribute(f))}}return d}Object.defineProperty(c,"__esModule",{value:!0}),c.escapeHtml=d,c.unescapeHtml=e,c.getNodeData=f},{}],11:[function(a,b,c){"use strict";function d(a){return"[object Array]"===k.call(a)}function e(a){return l.test(k.call(a))}function f(a,b){return null===a&&null===b||"object"!==("undefined"==typeof a?"undefined":j(a))&&"object"!==("undefined"==typeof b?"undefined":j(b))&&a===b}function g(a){return!isNaN(parseFloat(a))&&isFinite(a)}function h(a){return a&&"[object Object]"===k.call(a)}function i(a){var b={};return a&&"[object Function]"===b.toString.call(a)}Object.defineProperty(c,"__esModule",{value:!0});var j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};c.isArray=d,c.isArrayLike=e,c.isEqual=f,c.isNumeric=g,c.isObject=h,c.isFunction=i;var k=Object.prototype.toString,l=/^\[object (?:Array|FileList)\]$/},{}],12:[function(a,b,c){"use strict";function d(a,b){var c=b.callback||"";if(!(0,h.isFunction)(c))return console.warn("Callback is not a function"),!1;var d=n+o++;return k[a].push({ident:d,callback:c}),d}function e(a,b){var c=b.ident||"";if("undefined"==typeof c||""===c)return console.warn("Need ident to remove callback"),!1;var d=(0,i.findByKeyValue)(k[a],"ident",c)[0];return"undefined"!=typeof d?((0,i.removeFromArray)(k[a],d),!0):(console.warn("Callback could not be found"),!1)}function f(a){for(var b=k[a],c=0,d=b.length;c<d;c++)b[c].callback()}function g(a){var b=a.action||"",c=a.state||"",f=void 0;return(0,i.arrayContains)(l,b)?(0,i.arrayContains)(m,c)?("addCallback"===b?f=d(c,a):"removeCallback"===b&&(f=e(c,a)),f):(console.warn("State does not exist"),!1):(console.warn("Action does not exist"),!1)}Object.defineProperty(c,"__esModule",{value:!0}),c.visibilityApi=void 0;var h=a("./is"),i=a("./array"),j=a("./environment"),k={hidden:[],visible:[]},l=["addCallback","removeCallback"],m=["visible","hidden"],n="v-",o=0;j.$document.on("visibilitychange",function(a){f(document.hidden?"hidden":"visible")}),c.visibilityApi=g},{"./array":7,"./environment":8,"./is":11}]},{},[1,2,3,4,5,6,7,8,9,10,11,12]); |