uhr/dist/lib/uhr.js

2 lines
17 KiB
JavaScript
Raw Normal View History

!function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=12)}({0:function(t,e){t.exports=Cookies},1:function(t,e){t.exports=jQuery},12:function(t,e,n){"use strict";n.r(e);var i=function(){function t(){}return t.registerTheme=function(e,n){t.themes.some(function(t){return t.name===e})?console.log("Theme with name '"+e+"' already registered; ignoring register request for styleClass '"+n+"'."):t.themes.push({name:e,styleClass:n})},t.hasThemes=function(){return t.themes.length>0},t.hasMultipleThemes=function(){return t.themes.length>1},t.getFirstTheme=function(){return t.getTheme(0)},t.getTheme=function(e){return t.themes[e]},t.getThemes=function(){return t.themes},t.registerLayout=function(e){!t.layouts.some(function(t){return e.code===t.code&&(e.prettyName!==t.prettyName&&console.error("Error: Language code '"+e.code+"' cannot be registered for layout '"+e.prettyName+"' because it is already registered for layout '"+t.prettyName+"'!"),!0)})&&(t.layouts.push(e),t.layouts.sort(function(t,e){return t.prettyName.localeCompare(e.prettyName)}))},t.hasLayouts=function(){return t.layouts.length>0},t.hasMultipleLayouts=function(){return t.layouts.length>1},t.getFirstLayout=function(){return t.layouts[0]},t.getLayouts=function(){return t.layouts},t.layouts=[],t.themes=[],t}(),o={code:null,hours:null,letters:[],minutes:null,permanent:[],prettyName:null,version:2},s=n(0),r=function(){function t(t,e){this.widgetId=t,this.cookiePath=e}return t.prototype.getLayout=function(){var t=this.getCookie("uhr-language");return t&&(this.removeCookie("uhr-language"),this.setLayout(t)),this.getCookie("uhr-layout")},t.prototype.setLayout=function(t){this.setCookie("uhr-layout",t)},t.prototype.getMode=function(){return this.getCookie("uhr-mode")},t.prototype.setMode=function(t){this.setCookie("uhr-mode",t)},t.prototype.getStatus=function(){return this.getCookie("uhr-status")},t.prototype.setStatus=function(t){this.setCookie("uhr-status",t)},t.prototype.getTheme=function(){return this.getCookie("uhr-theme")},t.prototype.setTheme=function(t){this.setCookie("uhr-theme",t)},t.prototype.getCookie=function(t){return s.get(t+this.widgetId)},t.prototype.setCookie=function(t,e){var n;n=this.cookiePath?{expires:365,path:this.cookiePath}:{expires:365},s.set(t+this.widgetId,e,n)},t.prototype.removeCookie=function(t){this.cookiePath?s.remove(t+this.widgetId,{path:this.cookiePath}):s.remove(t+this.widgetId)},t}(),h=function(){function t(t,e){this.style="",this.value=t,e&&(this.style=e)}return t.prototype.addStyle=function(t){""===this.style?this.style=t:this.style+=" "+t},t.prototype.toString=function(){return'<span class="item letter '+this.style+'">'+this.value+"</span>"},t}(),a=function(){function t(t){this.layout=t}return t.prototype.parse=function(){var e=[];return this.layout.letters.forEach(function(t){for(var n=[],i=0;i<t.length;i++)n.push(new h(t[i]));e.push(n)}),this.parseArrayOrObject(e,"on",this.layout.permanent),void 0!==this.layout.seconds&&null!==this.layout.seconds?this.parseTimeDefinition(e,"second",this.layout.seconds):this.parseTimeDefinition(e,"second",t.seconds),this.parseTimeDefinition(e,"minute",this.layout.minutes),this.parseTimeDefinition(e,"hour",this.layout.hours),e},t.prototype.parseObject=function(t,e,
//# sourceMappingURL=uhr.js.map