mirror of
https://github.com/locomotivemtl/locomotive-boilerplate.git
synced 2026-01-15 00:55:08 +08:00
1 line
6.7 KiB
JavaScript
1 line
6.7 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,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var f=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),g=a("./modules"),h=d(g),i=function(){function a(b){e(this,a),this.modules=h,this.globals,this.currentModules=[]}return f(a,[{key:"initGlobals",value:function(){this.globals=new this.modules.Globals}},{key:"initModules",value:function(){for(var a=document.querySelectorAll("[data-module]"),b=0,c=a.length;c>b;b++){var d=a[b],e=this.getElemData(d);e.el=d,e.$el=$(d);for(var f=e.module,g=f.replace(/\s/g,"").split(","),h=0,i=g.length;i>h;h++){var j=g[h];if("function"==typeof this.modules[j]&&-1===this.currentModules.indexOf(j)){var k=new this.modules[j](e);this.currentModules.push(k)}}}return this}},{key:"init",value:function(){this.initGlobals(),this.initModules()}},{key:"getElemData",value:function(a){var b=a.attributes,c=/^data\-(.+)$/,d={};for(var e in b){var f=b[e].name;if(f){var g=f.match(c);g&&(d[g[1]]=a.getAttribute(f))}}return d}}]),a}();$(function(){window.app=new i,window.app.init()})},{"./modules":2}],2:[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/Globals");Object.defineProperty(c,"Globals",{enumerable:!0,get:function(){return d(e)["default"]}});var f=a("./modules/Generic");Object.defineProperty(c,"Generic",{enumerable:!0,get:function(){return d(f)["default"]}});var g=a("./modules/Title");Object.defineProperty(c,"Title",{enumerable:!0,get:function(){return d(g)["default"]}})},{"./modules/Generic":3,"./modules/Globals":4,"./modules/Title":7}],3:[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=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=a("./Module"),j=d(i),k=function(a){function b(a){e(this,b);var c=f(this,Object.getPrototypeOf(b).call(this));return c.$el=a.$el,console.log("Generic module"),console.log(c.$el),c}return g(b,a),h(b,[{key:"destroy",value:function(){this.$el.off()}}]),b}(j["default"]);c["default"]=k},{"./Module":5}],4:[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")}Object.defineProperty(c,"__esModule",{value:!0});var f=a("./Svg"),g=d(f),h=function i(){e(this,i),new g["default"]};c["default"]=h},{"./Svg":6}],5:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))th
|