diff --git a/dist/jquery.uhr.base.js b/dist/jquery.uhr.base.js
index bbd5b72..246d96c 100644
--- a/dist/jquery.uhr.base.js
+++ b/dist/jquery.uhr.base.js
@@ -1,17 +1,17 @@
-/*! uhr - v8.0.4-dev.0 - 2016-06-27
+/*! uhr - v8.0.4-dev.0 - 2019-05-03
* http://bärneruhr.ch/
-* Copyright (c) 2016 Manuel Friedli; Licensed GPL-3.0 */
-(function($) {
+* Copyright (c) 2019 Manuel Friedli; Licensed GPL-3.0 */
+(function ($) {
'use strict';
var uhrGlobals = {
"id": 0,
"languages": [],
"themes": [],
registerLanguage: function registerLanguage(code, language) {
- var alreadyExists = uhrGlobals.languages.some(function(element) {
+ var alreadyExists = uhrGlobals.languages.some(function (element) {
if (code === element.code) {
console.error("Error: Language code '" + code + "' cannot be registered for language '" + language.language +
- "' because it is already registered for language '" + element.language + "'!");
+ "' because it is already registered for language '" + element.language + "'!");
return true;
}
return false;
@@ -24,7 +24,7 @@
};
// auto-detect themes
- $('link[rel=stylesheet]').each(function(index, item) {
+ $('link[rel=stylesheet]').each(function (index, item) {
var styleSheet = $(item);
var styleClass = styleSheet.attr('data-class');
if (styleClass !== undefined) {
@@ -41,9 +41,12 @@
}
// public interface methods (exported later)
+ var setCookie;
+ var isOn;
+ var update;
var start = function start() {
if (!isOn.bind(this)()) {
- this.timer = window.setInterval(function() {
+ this.timer = window.setInterval(function () {
this.options.time = new Date();
update.bind(this)();
}.bind(this), 1000);
@@ -66,436 +69,25 @@
this.start();
}
};
- var setLanguage = function setLanguage(languageKey) {
- if (languageKey !== this.options.language) {
- this.options.language = languageKey;
- var renderer = new UhrRenderer(language.bind(this)(), this.element.find('.letterarea'));
- renderer.render.bind(this)(function() {
- this.currentMinute = -1;
- update.bind(this)();
- }.bind(this));
- setCookie.bind(this)('uhr-language', languageKey);
- update.bind(this)();
- }
- };
- var setTheme = function setTheme(theme) {
- if (theme !== this.options.theme) {
- this.element.removeClass(this.options.theme).addClass(theme);
- $('#uhr-onoffswitch' + this.id).removeClass(this.options.theme).addClass(theme);
- this.options.theme = theme;
- setCookie.bind(this)('uhr-theme', theme);
- }
- };
- var setTime = function setTime(time) {
- this.currentMinute = -1;
- if (time === null) {
- this.options.time = new Date();
- } else {
- if (this.timer !== null) {
- window.clearInterval(this.timer);
- }
- this.options.time = time;
- }
- update.bind(this)();
- };
- var setMode = function(mode) {
- this.options.mode = mode;
- this.currentMinute = -1;
- update.bind(this)();
- setCookie.bind(this)('uhr-mode', mode);
- };
- var setWidth = function setWidth(width) {
- var e = this.element;
- e.css('width', width);
- var realWidth = e.width();
- e.width(realWidth);
- e.height(realWidth);
- e.css('font-size', (realWidth / 40) + 'px');
- };
+ var language;
- // private interface methods
- var create = function create() {
- this.id = uhrGlobals.id++;
- this.timer = null;
- this.currentMinute = -1;
- var userTime = this.options.time;
- var hash, params;
- if (this.options.time === undefined) {
- this.options.time = new Date();
- }
- // parse the URL params
- hash = window.location.hash;
- if (hash !== undefined && typeof hash === 'string' && hash.charAt(0) === '#') {
- hash = hash.substring(1);
- hash = decodeURIComponent(hash);
- params = hash.split('&');
- params.forEach(function (element) {
- var pair = element.split('=');
- var key = pair[0];
- var value = pair[1];
- switch (key) {
- case 'l':
- case 'language':
- this.options.language = value;
- this.options.force = true;
- break;
- case 't':
- case 'theme':
- this.options.theme = value;
- this.options.force = true;
- break;
- case 'm':
- case 'mode':
- this.options.mode = value;
- this.options.force = true;
- break;
- case 's':
- case 'status':
- this.options.status = value;
- this.options.force = true;
- break;
- }
- }.bind(this));
- }
- // end parse the URL params
- setupHTML.bind(this)();
- wireFunctionality.bind(this)();
- if (userTime !== undefined) {
- this.time(userTime);
- }
- };
- // private helper methods (not exported)
- var toggleConfigScreen = function toggleConfigScreen() {
- $('#uhr-controlpanel' + this.id).toggle('fast');
- };
- // set up
- var setupHTML = function setupHTML() {
- var e = this.element;
- // Base clock area
- e.addClass('uhr');
- e.empty();
- e.append('');
- e.append('');
- e.append('');
- e.append('');
- e.append('
');
- e.append('');
- setWidth.bind(this)(this.options.width);
-
- if (this.options.controls) {
- var controlpanel = $('');
- var content = $('');
- controlpanel.append(content);
- // on/off switch
- var toggleSwitch = $('');
- toggleSwitch.append('');
- toggleSwitch.append('');
- content.append(toggleSwitch);
-
- // time mode switch
- var modeSwitch = $('');
- modeSwitch.append('');
- modeSwitch.append('');
- content.append(modeSwitch);
- // language chooser
- if (uhrGlobals.languages.length > 1) {
- var languageChooser = $('');
- uhrGlobals.languages.forEach(function(item) {
- languageChooser.append('');
- });
- content.append(languageChooser);
- }
-
- // theme chooser
- if (uhrGlobals.themes.length > 1) {
- var themeChooser = $('');
- uhrGlobals.themes.forEach(function(item) {
- themeChooser.append('');
- });
- content.append(themeChooser);
- }
- var closebutton = $('');
- closebutton.on('click', function() {
- $('#uhr-controlpanel' + this.id).hide('fast');
- }.bind(this));
- content.append(closebutton);
- e.after(controlpanel);
- controlpanel.hide();
- var configlink = $('');
- configlink.on('click', function() {
- toggleConfigScreen.bind(this)();
- }.bind(this));
- e.after(configlink);
- }
- };
- var wireFunctionality = function wireFunctionality() {
- // on/off switch
- var toggleSwitch = $('#uhr-onoffswitch-checkbox' + this.id);
- toggleSwitch.on('click', function() {
- this.toggle();
- }.bind(this));
- var status = $.cookie('uhr-status' + this.id);
- if (status === undefined || this.options.force) {
- status = this.options.status;
- }
- toggleSwitch.prop('checked', status === 'on');
- if (status === 'on') {
- this.start();
- } else {
- this.stop();
- }
-
- // time mode switch
- var modeSwitch = $('#uhr-modeswitch-checkbox' + this.id);
- modeSwitch.on('click', function() {
- if (this.options.mode === 'seconds') {
- setMode.bind(this)('normal');
- } else {
- setMode.bind(this)('seconds');
- }
- }.bind(this));
-
- var mode = $.cookie('uhr-mode' + this.id);
- if (mode === undefined || this.options.force) {
- mode = this.options.mode;
- }
- modeSwitch.prop('checked', mode !== 'seconds');
- if (mode === 'seconds') {
- setMode.bind(this)('seconds');
- } else {
- setMode.bind(this)('normal');
- }
-
- // language chooser
- var languageChooser = $('#uhr-languagechooser' + this.id);
- languageChooser.on('change', function() {
- var languageKey = $('#uhr-languagechooser' + this.id).val();
- this.language(languageKey);
- }.bind(this));
- var selectedLanguage = $.cookie('uhr-language' + this.id);
- if (selectedLanguage === undefined || this.options.force) {
- selectedLanguage = this.options.language;
- }
- var found = uhrGlobals.languages.some(function(item) {
- return selectedLanguage === item.code;
- });
- if (!found) {
- var fallbackLanguage;
- if (uhrGlobals.languages.length > 0) {
- fallbackLanguage = uhrGlobals.languages[0].code;
- } else {
- fallbackLanguage = '';
- }
- console.warn("Language '" + selectedLanguage + "' not found! Using fallback '" + fallbackLanguage + "'");
- selectedLanguage = fallbackLanguage;
- }
- languageChooser.val(selectedLanguage);
- this.options.language = "";
- this.language(selectedLanguage);
-
- // theme chooser
- var themeChooser = $('#uhr-themechooser' + this.id);
- themeChooser.on('change', function() {
- var themeKey = $('#uhr-themechooser' + this.id).val();
- this.theme(themeKey);
- }.bind(this));
- var selectedTheme = $.cookie('uhr-theme' + this.id);
- if (selectedTheme === undefined || this.options.force) {
- selectedTheme = this.options.theme;
- }
- found = uhrGlobals.themes.some(function(item) {
- return selectedTheme === item.styleClass;
- });
- if (!found) {
- var fallbackTheme = uhrGlobals.themes[0].styleClass;
- console.warn("Theme '" + selectedTheme + "' not found! Using fallback '" + fallbackTheme + "'");
- selectedTheme = fallbackTheme;
- }
- themeChooser.val(selectedTheme);
- this.options.theme = "";
- this.theme(selectedTheme);
- if (this.options.autoresize) {
- $(window).on('resize', function() {
- var $e = this.element;
- var $parent = $e.parent();
- var $window = $(window);
- var parentWidth = $parent.width();
- var parentHeight = $parent.height();
- var windowWidth = $window.width();
- var windowHeight = $window.height();
- var size = Math.min(parentWidth, parentHeight, windowWidth, windowHeight) + 'px';
- setWidth.bind(this)(size);
- }.bind(this));
- }
- };
- var destroy = function destroy() {
- this.timer = null;
- $(this.element)
- .removeAttr('style')
- .removeAttr('class')
- .empty();
- $('#uhr-configlink' + this.id).remove();
- $('#uhr-controlpanel' + this.id).remove();
-
- };
- var setCookie = function setCookie(cookieName, cookieValue) {
- var options = {};
- if (this.options.cookiePath !== undefined) {
- options = {expires: 365, path: this.options.cookiePath};
- } else {
- options = {expires: 365};
- }
- $.cookie(cookieName + this.id, cookieValue, options);
- };
-
- // business logic
- var isOn = function isOn() {
- return this.timer !== null;
- };
- var update = function update() {
- if (isOn.bind(this)()) {
- var time = this.options.time;
- if (!language.bind(this)().hasOwnProperty('seconds') && this.options.mode !== 'seconds') {
- if (time.getMinutes() === this.currentMinute) {
- return;
- }
- this.currentMinute = time.getMinutes();
- }
- show.bind(this)(time);
- } else {
- clear.bind(this)();
- this.currentMinute = -1;
- }
- };
- var show = function show(time) {
- var second = getSecond.bind(this)(time);
- var dotMinute = getDotMinute.bind(this)(time);
- var hour = getHour.bind(this)(time);
- var coarseMinute = getCoarseMinute.bind(this)(time);
- clear.bind(this)();
- if (this.options.mode === 'seconds') {
- highlight.bind(this)('second' + second);
- } else {
- highlight.bind(this)('on');
- for (var i = 1; i <= dotMinute; i++) {
- highlight.bind(this)('dot' + i);
- }
- highlight.bind(this)('minute' + coarseMinute);
- highlight.bind(this)('hour' + hour);
- }
- };
- var highlight = function highlight(itemClass) {
- this.element.find('.item.' + itemClass).addClass('active');
- };
- var clear = function clear() {
- this.element.find('.item').removeClass('active');
- };
- var getSecond = function getSecond(date) {
- if (typeof language.bind(this)().getSeconds === 'function') {
- return language.bind(this)().getSeconds(date);
- }
- return date.getSeconds();
- };
- var getDotMinute = function getDotMinute(date) {
- if (typeof language.bind(this)().getDotMinute === 'function') {
- return language.bind(this)().getDotMinute(date);
- }
- var minutes = date.getMinutes();
- return minutes % 5;
- };
- var getCoarseMinute = function getCoarseMinute(date) {
- if (typeof language.bind(this)().getCoarseMinute === 'function') {
- return language.bind(this)().getCoarseMinute(date);
- }
- return date.getMinutes();
- };
- var getHour = function getHour(date) {
- if (typeof language.bind(this)().getHour === 'function') {
- return language.bind(this)().getHour(date);
- }
- var hour = date.getHours();
- if (date.getMinutes() >= 25) {
- return (hour + 1) % 24;
- }
- return hour;
- };
- var language = function language() {
- var matchingLanguages = uhrGlobals.languages.filter(function(element) {
- return (element.code === this.options.language);
- }, this);
- if (matchingLanguages.length > 0) {
- return matchingLanguages[0];
- }
- // fallback: return empty object
- return {};
- };
-
- $.widget("fritteli.uhr", {
- "options": {
- width: '100%',
- status: 'on',
- language: 'de_CH',
- theme: uhrGlobals.themes[0].styleClass,
- force: false,
- controls: true,
- cookiePath: undefined,
- autoresize: true,
- mode: 'normal'
- },
- "start": start,
- "stop": stop,
- "toggle": toggle,
- "language": setLanguage,
- "theme": setTheme,
- "time": setTime,
- "mode": setMode,
- "width": setWidth,
- // constructor method
- "_create": create,
- // destructor method
- "_destroy": destroy
- });
- $.fritteli.uhr.register = uhrGlobals.registerLanguage;
/**
- * Hilfsklasse zum Rendern der Uhr.
- * @param layout Layout-Objekt, das gerendert werden soll.
- * @param renderarea Das jQuery-gewrappte HTML-Element, auf dem gerendert werden soll.
+ * Ein Buchstabe. Hilfsklasse für den Renderer und Inhalt der Layout-Arrays.
+ * @param value Der Buchstabe, der Dargestellt werden soll.
+ * @param style Die CSS-Styleklassen des Buchstabens.
*/
- function UhrRenderer(layout, renderarea) {
- this.render = function render(beforeshow) {
- if (layout.parsed === undefined) {
- switch (layout.version) {
- case 2:
- var delegate = new UhrRendererV2Delegate(layout);
- var parsedLayout = delegate.parse();
- Object.defineProperty(layout, "parsed", {"value": parsedLayout, "writable": false, "configurable": false});
- break;
- default:
- console.warn("Unknown layout version: '" + layout.version + "'");
- return;
- }
+ function Letter(value, style) {
+ var myValue = value;
+ var myStyle = style || '';
+ this.addStyle = function (style) {
+ if (myStyle === '') {
+ myStyle = style;
+ } else {
+ myStyle += ' ' + style;
}
- var letters = layout.parsed;
- renderarea.fadeOut('fast', function() {
- renderarea.empty();
- letters.forEach(function(line, index, array) {
- line.forEach(function(letter) {
- renderarea.append(letter.toString());
- });
- if (index < array.length - 1) {
- renderarea.append('
');
- }
- });
- if (typeof beforeshow === 'function') {
- beforeshow();
- }
- renderarea.fadeIn('fast');
- });
+ };
+ this.toString = function () {
+ return '' + myValue + '';
};
}
@@ -644,7 +236,7 @@
8: [10],
9: [8, 9]
};
- var seconds= {
+ var seconds = {
"0": [vorne0, hinten0],
"1": [vorne0, hinten1],
"2": [vorne0, hinten2],
@@ -707,10 +299,21 @@
"59": [vorne5, hinten9]
};
+ function parseObject(letters, styleClass, object) {
+ if (typeof object !== 'undefined' && object !== null) {
+ Object.keys(object).forEach(function (y) {
+ var highlightLetters = object[y];
+ highlightLetters.forEach(function (x) {
+ letters[y - 1][x - 1].addStyle(styleClass);
+ });
+ });
+ }
+ }
+
function parseArrayOrObject(letters, styleClass, input) {
if (typeof input !== 'undefined' && input !== null) {
if (Array.isArray(input)) {
- input.forEach(function(item) {
+ input.forEach(function (item) {
parseObject(letters, styleClass, item);
});
} else {
@@ -719,23 +322,12 @@
}
}
- function parseObject(letters, styleClass, object) {
- if (typeof object !== 'undefined' && object !== null) {
- Object.keys(object).forEach(function(y) {
- var highlightLetters = object[y];
- highlightLetters.forEach(function(x) {
- letters[y - 1][x - 1].addStyle(styleClass);
- });
- });
- }
- }
-
function parseTimeDefinition(letters, styleClass, definition) {
if (typeof definition !== 'undefined' && definition !== null) {
- Object.keys(definition).forEach(function(listString) {
+ Object.keys(definition).forEach(function (listString) {
var array = listString.split(',');
var highlightLetters = definition[listString];
- array.forEach(function(item) {
+ array.forEach(function (item) {
parseArrayOrObject(letters, styleClass + item, highlightLetters);
});
});
@@ -744,7 +336,7 @@
this.parse = function parse() {
var letters = [];
- layout.letters.forEach(function(string) {
+ layout.letters.forEach(function (string) {
var line = [];
for (var c = 0; c < string.length; c++) {
var character = new Letter(string[c]);
@@ -765,24 +357,451 @@
}
/**
- * Ein Buchstabe. Hilfsklasse für den Renderer und Inhalt der Layout-Arrays.
- * @param value Der Buchstabe, der Dargestellt werden soll.
- * @param style Die CSS-Styleklassen des Buchstabens.
+ * Hilfsklasse zum Rendern der Uhr.
+ * @param layout Layout-Objekt, das gerendert werden soll.
+ * @param renderarea Das jQuery-gewrappte HTML-Element, auf dem gerendert werden soll.
*/
- function Letter(value, style) {
- var myValue = value;
- var myStyle = style || '';
- this.addStyle = function(style) {
- if (myStyle === '') {
- myStyle = style;
- } else {
- myStyle += ' ' + style;
+ function UhrRenderer(layout, renderarea) {
+ this.render = function render(beforeshow) {
+ if (layout.parsed === undefined) {
+ switch (layout.version) {
+ case 2:
+ var delegate = new UhrRendererV2Delegate(layout);
+ var parsedLayout = delegate.parse();
+ Object.defineProperty(layout, "parsed", {
+ "value": parsedLayout,
+ "writable": false,
+ "configurable": false
+ });
+ break;
+ default:
+ console.warn("Unknown layout version: '" + layout.version + "'");
+ return;
+ }
}
- };
- this.toString = function() {
- return '' + myValue + '';
+ var letters = layout.parsed;
+ renderarea.fadeOut('fast', function () {
+ renderarea.empty();
+ letters.forEach(function (line, index, array) {
+ line.forEach(function (letter) {
+ renderarea.append(letter.toString());
+ });
+ if (index < array.length - 1) {
+ renderarea.append('
');
+ }
+ });
+ if (typeof beforeshow === 'function') {
+ beforeshow();
+ }
+ renderarea.fadeIn('fast');
+ });
};
}
+
+ var setLanguage = function setLanguage(languageKey) {
+ if (languageKey !== this.options.language) {
+ this.options.language = languageKey;
+ var renderer = new UhrRenderer(language.bind(this)(), this.element.find('.letterarea'));
+ renderer.render.bind(this)(function () {
+ this.currentMinute = -1;
+ update.bind(this)();
+ }.bind(this));
+ setCookie.bind(this)('uhr-language', languageKey);
+ update.bind(this)();
+ }
+ };
+ var setTheme = function setTheme(theme) {
+ if (theme !== this.options.theme) {
+ this.element.removeClass(this.options.theme).addClass(theme);
+ $('#uhr-onoffswitch' + this.id).removeClass(this.options.theme).addClass(theme);
+ this.options.theme = theme;
+ setCookie.bind(this)('uhr-theme', theme);
+ }
+ };
+ var setTime = function setTime(time) {
+ this.currentMinute = -1;
+ if (time === null) {
+ this.options.time = new Date();
+ } else {
+ if (this.timer !== null) {
+ window.clearInterval(this.timer);
+ }
+ this.options.time = time;
+ }
+ update.bind(this)();
+ };
+ var setMode = function (mode) {
+ this.options.mode = mode;
+ this.currentMinute = -1;
+ update.bind(this)();
+ setCookie.bind(this)('uhr-mode', mode);
+ };
+ var setWidth = function setWidth(width) {
+ var e = this.element;
+ e.css('width', width);
+ var realWidth = e.width();
+ e.width(realWidth);
+ e.height(realWidth);
+ e.css('font-size', (realWidth / 40) + 'px');
+ };
+
+ // private interface methods
+ var setupHTML;
+ var wireFunctionality;
+ var create = function create() {
+ this.id = uhrGlobals.id++;
+ this.timer = null;
+ this.currentMinute = -1;
+ var userTime = this.options.time;
+ var hash, params;
+ if (this.options.time === undefined) {
+ this.options.time = new Date();
+ }
+ // parse the URL params
+ hash = window.location.hash;
+ if (hash !== undefined && typeof hash === 'string' && hash.charAt(0) === '#') {
+ hash = hash.substring(1);
+ hash = decodeURIComponent(hash);
+ params = hash.split('&');
+ params.forEach(function (element) {
+ var pair = element.split('=');
+ var key = pair[0];
+ var value = pair[1];
+ switch (key) {
+ case 'l':
+ case 'language':
+ this.options.language = value;
+ this.options.force = true;
+ break;
+ case 't':
+ case 'theme':
+ this.options.theme = value;
+ this.options.force = true;
+ break;
+ case 'm':
+ case 'mode':
+ this.options.mode = value;
+ this.options.force = true;
+ break;
+ case 's':
+ case 'status':
+ this.options.status = value;
+ this.options.force = true;
+ break;
+ }
+ }.bind(this));
+ }
+ // end parse the URL params
+ setupHTML.bind(this)();
+ wireFunctionality.bind(this)();
+ if (userTime !== undefined) {
+ this.time(userTime);
+ }
+ };
+ // private helper methods (not exported)
+ var toggleConfigScreen = function toggleConfigScreen() {
+ $('#uhr-controlpanel' + this.id).toggle('fast');
+ };
+ // set up
+ setupHTML = function setupHTML() {
+ var e = this.element;
+ // Base clock area
+ e.addClass('uhr');
+ e.empty();
+ e.append('');
+ e.append('');
+ e.append('');
+ e.append('');
+ e.append('');
+ e.append('');
+ setWidth.bind(this)(this.options.width);
+
+ if (this.options.controls) {
+ var controlpanel = $('');
+ var content = $('');
+ controlpanel.append(content);
+ // on/off switch
+ var toggleSwitch = $('');
+ toggleSwitch.append('');
+ toggleSwitch.append('');
+ content.append(toggleSwitch);
+
+ // time mode switch
+ var modeSwitch = $('');
+ modeSwitch.append('');
+ modeSwitch.append('');
+ content.append(modeSwitch);
+ // language chooser
+ if (uhrGlobals.languages.length > 1) {
+ var languageChooser = $('');
+ uhrGlobals.languages.forEach(function (item) {
+ languageChooser.append('');
+ });
+ content.append(languageChooser);
+ }
+
+ // theme chooser
+ if (uhrGlobals.themes.length > 1) {
+ var themeChooser = $('');
+ uhrGlobals.themes.forEach(function (item) {
+ themeChooser.append('');
+ });
+ content.append(themeChooser);
+ }
+ var closebutton = $('');
+ closebutton.on('click', function () {
+ $('#uhr-controlpanel' + this.id).hide('fast');
+ }.bind(this));
+ content.append(closebutton);
+ e.after(controlpanel);
+ controlpanel.hide();
+ var configlink = $('');
+ configlink.on('click', function () {
+ toggleConfigScreen.bind(this)();
+ }.bind(this));
+ e.after(configlink);
+ }
+ };
+ wireFunctionality = function wireFunctionality() {
+ // on/off switch
+ var toggleSwitch = $('#uhr-onoffswitch-checkbox' + this.id);
+ toggleSwitch.on('click', function () {
+ this.toggle();
+ }.bind(this));
+ var status = $.cookie('uhr-status' + this.id);
+ if (status === undefined || this.options.force) {
+ status = this.options.status;
+ }
+ toggleSwitch.prop('checked', status === 'on');
+ if (status === 'on') {
+ this.start();
+ } else {
+ this.stop();
+ }
+
+ // time mode switch
+ var modeSwitch = $('#uhr-modeswitch-checkbox' + this.id);
+ modeSwitch.on('click', function () {
+ if (this.options.mode === 'seconds') {
+ setMode.bind(this)('normal');
+ } else {
+ setMode.bind(this)('seconds');
+ }
+ }.bind(this));
+
+ var mode = $.cookie('uhr-mode' + this.id);
+ if (mode === undefined || this.options.force) {
+ mode = this.options.mode;
+ }
+ modeSwitch.prop('checked', mode !== 'seconds');
+ if (mode === 'seconds') {
+ setMode.bind(this)('seconds');
+ } else {
+ setMode.bind(this)('normal');
+ }
+
+ // language chooser
+ var languageChooser = $('#uhr-languagechooser' + this.id);
+ languageChooser.on('change', function () {
+ var languageKey = $('#uhr-languagechooser' + this.id).val();
+ this.language(languageKey);
+ }.bind(this));
+ var selectedLanguage = $.cookie('uhr-language' + this.id);
+ if (selectedLanguage === undefined || this.options.force) {
+ selectedLanguage = this.options.language;
+ }
+ var found = uhrGlobals.languages.some(function (item) {
+ return selectedLanguage === item.code;
+ });
+ if (!found) {
+ var fallbackLanguage;
+ if (uhrGlobals.languages.length > 0) {
+ fallbackLanguage = uhrGlobals.languages[0].code;
+ } else {
+ fallbackLanguage = '';
+ }
+ console.warn("Language '" + selectedLanguage + "' not found! Using fallback '" + fallbackLanguage + "'");
+ selectedLanguage = fallbackLanguage;
+ }
+ languageChooser.val(selectedLanguage);
+ this.options.language = "";
+ this.language(selectedLanguage);
+
+ // theme chooser
+ var themeChooser = $('#uhr-themechooser' + this.id);
+ themeChooser.on('change', function () {
+ var themeKey = $('#uhr-themechooser' + this.id).val();
+ this.theme(themeKey);
+ }.bind(this));
+ var selectedTheme = $.cookie('uhr-theme' + this.id);
+ if (selectedTheme === undefined || this.options.force) {
+ selectedTheme = this.options.theme;
+ }
+ found = uhrGlobals.themes.some(function (item) {
+ return selectedTheme === item.styleClass;
+ });
+ if (!found) {
+ var fallbackTheme = uhrGlobals.themes[0].styleClass;
+ console.warn("Theme '" + selectedTheme + "' not found! Using fallback '" + fallbackTheme + "'");
+ selectedTheme = fallbackTheme;
+ }
+ themeChooser.val(selectedTheme);
+ this.options.theme = "";
+ this.theme(selectedTheme);
+ if (this.options.autoresize) {
+ $(window).on('resize', function () {
+ var $e = this.element;
+ var $parent = $e.parent();
+ var $window = $(window);
+ var parentWidth = $parent.width();
+ var parentHeight = $parent.height();
+ var windowWidth = $window.width();
+ var windowHeight = $window.height();
+ var size = Math.min(parentWidth, parentHeight, windowWidth, windowHeight) + 'px';
+ setWidth.bind(this)(size);
+ }.bind(this));
+ }
+ };
+ var destroy = function destroy() {
+ this.timer = null;
+ $(this.element)
+ .removeAttr('style')
+ .removeAttr('class')
+ .empty();
+ $('#uhr-configlink' + this.id).remove();
+ $('#uhr-controlpanel' + this.id).remove();
+
+ };
+ setCookie = function setCookie(cookieName, cookieValue) {
+ var options = {};
+ if (this.options.cookiePath !== undefined) {
+ options = {expires: 365, path: this.options.cookiePath};
+ } else {
+ options = {expires: 365};
+ }
+ $.cookie(cookieName + this.id, cookieValue, options);
+ };
+
+ // business logic
+ isOn = function isOn() {
+ return this.timer !== null;
+ };
+ var show;
+ var clear;
+ update = function update() {
+ if (isOn.bind(this)()) {
+ var time = this.options.time;
+ if (!language.bind(this)().hasOwnProperty('seconds') && this.options.mode !== 'seconds') {
+ if (time.getMinutes() === this.currentMinute) {
+ return;
+ }
+ this.currentMinute = time.getMinutes();
+ }
+ show.bind(this)(time);
+ } else {
+ clear.bind(this)();
+ this.currentMinute = -1;
+ }
+ };
+ var highlight;
+ var getSecond;
+ var getDotMinute;
+ var getCoarseMinute;
+ var getHour;
+ show = function show(time) {
+ var second = getSecond.bind(this)(time);
+ var dotMinute = getDotMinute.bind(this)(time);
+ var hour = getHour.bind(this)(time);
+ var coarseMinute = getCoarseMinute.bind(this)(time);
+ clear.bind(this)();
+ if (this.options.mode === 'seconds') {
+ highlight.bind(this)('second' + second);
+ } else {
+ highlight.bind(this)('on');
+ for (var i = 1; i <= dotMinute; i++) {
+ highlight.bind(this)('dot' + i);
+ }
+ highlight.bind(this)('minute' + coarseMinute);
+ highlight.bind(this)('hour' + hour);
+ }
+ };
+ highlight = function highlight(itemClass) {
+ this.element.find('.item.' + itemClass).addClass('active');
+ };
+ clear = function clear() {
+ this.element.find('.item').removeClass('active');
+ };
+ getSecond = function getSecond(date) {
+ if (typeof language.bind(this)().getSeconds === 'function') {
+ return language.bind(this)().getSeconds(date);
+ }
+ return date.getSeconds();
+ };
+ getDotMinute = function getDotMinute(date) {
+ if (typeof language.bind(this)().getDotMinute === 'function') {
+ return language.bind(this)().getDotMinute(date);
+ }
+ var minutes = date.getMinutes();
+ return minutes % 5;
+ };
+ getCoarseMinute = function getCoarseMinute(date) {
+ if (typeof language.bind(this)().getCoarseMinute === 'function') {
+ return language.bind(this)().getCoarseMinute(date);
+ }
+ return date.getMinutes();
+ };
+ getHour = function getHour(date) {
+ if (typeof language.bind(this)().getHour === 'function') {
+ return language.bind(this)().getHour(date);
+ }
+ var hour = date.getHours();
+ if (date.getMinutes() >= 25) {
+ return (hour + 1) % 24;
+ }
+ return hour;
+ };
+ language = function language() {
+ var matchingLanguages = uhrGlobals.languages.filter(function (element) {
+ return (element.code === this.options.language);
+ }, this);
+ if (matchingLanguages.length > 0) {
+ return matchingLanguages[0];
+ }
+ // fallback: return empty object
+ return {};
+ };
+
+ $.widget("fritteli.uhr", {
+ "options": {
+ width: '100%',
+ status: 'on',
+ language: 'de_CH',
+ theme: uhrGlobals.themes[0].styleClass,
+ force: false,
+ controls: true,
+ cookiePath: undefined,
+ autoresize: true,
+ mode: 'normal'
+ },
+ "start": start,
+ "stop": stop,
+ "toggle": toggle,
+ "language": setLanguage,
+ "theme": setTheme,
+ "time": setTime,
+ "mode": setMode,
+ "width": setWidth,
+ // constructor method
+ "_create": create,
+ // destructor method
+ "_destroy": destroy
+ });
+ $.fritteli.uhr.register = uhrGlobals.registerLanguage;
})(jQuery);
(function($) {
diff --git a/dist/jquery.uhr.base.min.js b/dist/jquery.uhr.base.min.js
deleted file mode 100644
index 3d91901..0000000
--- a/dist/jquery.uhr.base.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! uhr - v8.0.4-dev.0 - 2016-06-27
-* http://bärneruhr.ch/
-* Copyright (c) 2016 Manuel Friedli; Licensed GPL-3.0 */
-!function(a){"use strict";function b(a,b){this.render=function(d){if(void 0===a.parsed)switch(a.version){case 2:var e=new c(a),f=e.parse();Object.defineProperty(a,"parsed",{value:f,writable:!1,configurable:!1});break;default:return void console.warn("Unknown layout version: '"+a.version+"'")}var g=a.parsed;b.fadeOut("fast",function(){b.empty(),g.forEach(function(a,c,d){a.forEach(function(a){b.append(a.toString())}),c")}),"function"==typeof d&&d(),b.fadeIn("fast")})}}function c(a){function b(a,b,d){"undefined"!=typeof d&&null!==d&&(Array.isArray(d)?d.forEach(function(d){c(a,b,d)}):c(a,b,d))}function c(a,b,c){"undefined"!=typeof c&&null!==c&&Object.keys(c).forEach(function(d){var e=c[d];e.forEach(function(c){a[d-1][c-1].addStyle(b)})})}function e(a,c,d){"undefined"!=typeof d&&null!==d&&Object.keys(d).forEach(function(e){var f=e.split(","),g=d[e];f.forEach(function(d){b(a,c+d,g)})})}var f={3:[2,3,4],4:[1,5],5:[1,4,5],6:[1,3,5],7:[1,2,5],8:[1,5],9:[2,3,4]},g={3:[8,9,10],4:[7,11],5:[7,10,11],6:[7,9,11],7:[7,8,11],8:[7,11],9:[8,9,10]},h={3:[3],4:[2,3],5:[3],6:[3],7:[3],8:[3],9:[2,3,4]},i={3:[9],4:[8,9],5:[9],6:[9],7:[9],8:[9],9:[8,9,10]},j={3:[2,3,4],4:[1,5],5:[5],6:[4],7:[3],8:[2],9:[1,2,3,4,5]},k={3:[8,9,10],4:[7,11],5:[11],6:[10],7:[9],8:[8],9:[7,8,9,10,11]},l={3:[1,2,3,4,5],4:[4],5:[3],6:[4],7:[5],8:[1,5],9:[2,3,4]},m={3:[7,8,9,10,11],4:[10],5:[9],6:[10],7:[11],8:[7,11],9:[8,9,10]},n={3:[4],4:[3,4],5:[2,4],6:[1,4],7:[1,2,3,4,5],8:[4],9:[4]},o={3:[10],4:[9,10],5:[8,10],6:[7,10],7:[7,8,9,10,11],8:[10],9:[10]},p={3:[1,2,3,4,5],4:[1],5:[1,2,3,4],6:[5],7:[5],8:[1,5],9:[2,3,4]},q={3:[7,8,9,10,11],4:[7],5:[7,8,9,10],6:[11],7:[11],8:[7,11],9:[8,9,10]},r={3:[9,10],4:[8],5:[7],6:[7,8,9,10],7:[7,11],8:[7,11],9:[8,9,10]},s={3:[7,8,9,10,11],4:[11],5:[10],6:[9],7:[8],8:[8],9:[8]},t={3:[8,9,10],4:[7,11],5:[7,11],6:[8,9,10],7:[7,11],8:[7,11],9:[8,9,10]},u={3:[8,9,10],4:[7,11],5:[7,11],6:[8,9,10,11],7:[11],8:[10],9:[8,9]},v={0:[f,g],1:[f,i],2:[f,k],3:[f,m],4:[f,o],5:[f,q],6:[f,r],7:[f,s],8:[f,t],9:[f,u],10:[h,g],11:[h,i],12:[h,k],13:[h,m],14:[h,o],15:[h,q],16:[h,r],17:[h,s],18:[h,t],19:[h,u],20:[j,g],21:[j,i],22:[j,k],23:[j,m],24:[j,o],25:[j,q],26:[j,r],27:[j,s],28:[j,t],29:[j,u],30:[l,g],31:[l,i],32:[l,k],33:[l,m],34:[l,o],35:[l,q],36:[l,r],37:[l,s],38:[l,t],39:[l,u],40:[n,g],41:[n,i],42:[n,k],43:[n,m],44:[n,o],45:[n,q],46:[n,r],47:[n,s],48:[n,t],49:[n,u],50:[p,g],51:[p,i],52:[p,k],53:[p,m],54:[p,o],55:[p,q],56:[p,r],57:[p,s],58:[p,t],59:[p,u]};this.parse=function(){var c=[];return a.letters.forEach(function(a){for(var b=[],e=0;e'+c+""}}var e={id:0,languages:[],themes:[],registerLanguage:function(a,b){var c=e.languages.some(function(c){return a===c.code&&(console.error("Error: Language code '"+a+"' cannot be registered for language '"+b.language+"' because it is already registered for language '"+c.language+"'!"),!0)});c||(b.code=a,e.languages.push(b))}};a("link[rel=stylesheet]").each(function(b,c){var d=a(c),f=d.attr("data-class");if(void 0!==f){var g=d.attr("data-name");void 0===g&&(g=f),e.themes.push({styleClass:f,name:g})}}),0===e.themes.length&&e.themes.push({});var f=function(){t.bind(this)()||(this.timer=window.setInterval(function(){this.options.time=new Date,u.bind(this)()}.bind(this),1e3),u.bind(this)(),s.bind(this)("uhr-status","on"))},g=function(){t.bind(this)()&&(window.clearInterval(this.timer),this.timer=null,u.bind(this)(),s.bind(this)("uhr-status","off"))},h=function(){t.bind(this)()?this.stop():this.start()},i=function(a){if(a!==this.options.language){this.options.language=a;var c=new b(C.bind(this)(),this.element.find(".letterarea"));c.render.bind(this)(function(){this.currentMinute=-1,u.bind(this)()}.bind(this)),s.bind(this)("uhr-language",a),u.bind(this)()}},j=function(b){b!==this.options.theme&&(this.element.removeClass(this.options.theme).addClass(b),a("#uhr-onoffswitch"+this.id).removeClass(this.options.theme).addClass(b),this.options.theme=b,s.bind(this)("uhr-theme",b))},k=function(a){this.currentMinute=-1,null===a?this.options.time=new Date:(null!==this.timer&&window.clearInterval(this.timer),this.options.time=a),u.bind(this)()},l=function(a){this.options.mode=a,this.currentMinute=-1,u.bind(this)(),s.bind(this)("uhr-mode",a)},m=function(a){var b=this.element;b.css("width",a);var c=b.width();b.width(c),b.height(c),b.css("font-size",c/40+"px")},n=function(){this.id=e.id++,this.timer=null,this.currentMinute=-1;var a,b,c=this.options.time;void 0===this.options.time&&(this.options.time=new Date),a=window.location.hash,void 0!==a&&"string"==typeof a&&"#"===a.charAt(0)&&(a=a.substring(1),a=decodeURIComponent(a),b=a.split("&"),b.forEach(function(a){var b=a.split("="),c=b[0],d=b[1];switch(c){case"l":case"language":this.options.language=d,this.options.force=!0;break;case"t":case"theme":this.options.theme=d,this.options.force=!0;break;case"m":case"mode":this.options.mode=d,this.options.force=!0;break;case"s":case"status":this.options.status=d,this.options.force=!0}}.bind(this))),p.bind(this)(),q.bind(this)(),void 0!==c&&this.time(c)},o=function(){a("#uhr-controlpanel"+this.id).toggle("fast")},p=function(){var b=this.element;if(b.addClass("uhr"),b.empty(),b.append(''),b.append(''),b.append(''),b.append(''),b.append(''),b.append(''),m.bind(this)(this.options.width),this.options.controls){var c=a(''),d=a('');c.append(d);var f=a('');f.append(''),f.append(''),d.append(f);var g=a('');if(g.append(''),g.append(''),d.append(g),e.languages.length>1){var h=a('');e.languages.forEach(function(a){h.append('")}),d.append(h)}if(e.themes.length>1){var i=a('');e.themes.forEach(function(a){i.append('")}),d.append(i)}var j=a('');j.on("click",function(){a("#uhr-controlpanel"+this.id).hide("fast")}.bind(this)),d.append(j),b.after(c),c.hide();var k=a('');k.on("click",function(){o.bind(this)()}.bind(this)),b.after(k)}},q=function(){var b=a("#uhr-onoffswitch-checkbox"+this.id);b.on("click",function(){this.toggle()}.bind(this));var c=a.cookie("uhr-status"+this.id);(void 0===c||this.options.force)&&(c=this.options.status),b.prop("checked","on"===c),"on"===c?this.start():this.stop();var d=a("#uhr-modeswitch-checkbox"+this.id);d.on("click",function(){"seconds"===this.options.mode?l.bind(this)("normal"):l.bind(this)("seconds")}.bind(this));var f=a.cookie("uhr-mode"+this.id);(void 0===f||this.options.force)&&(f=this.options.mode),d.prop("checked","seconds"!==f),"seconds"===f?l.bind(this)("seconds"):l.bind(this)("normal");var g=a("#uhr-languagechooser"+this.id);g.on("change",function(){var b=a("#uhr-languagechooser"+this.id).val();this.language(b)}.bind(this));var h=a.cookie("uhr-language"+this.id);(void 0===h||this.options.force)&&(h=this.options.language);var i=e.languages.some(function(a){return h===a.code});if(!i){var j;j=e.languages.length>0?e.languages[0].code:"",console.warn("Language '"+h+"' not found! Using fallback '"+j+"'"),h=j}g.val(h),this.options.language="",this.language(h);var k=a("#uhr-themechooser"+this.id);k.on("change",function(){var b=a("#uhr-themechooser"+this.id).val();this.theme(b)}.bind(this));var n=a.cookie("uhr-theme"+this.id);if((void 0===n||this.options.force)&&(n=this.options.theme),i=e.themes.some(function(a){return n===a.styleClass}),!i){var o=e.themes[0].styleClass;console.warn("Theme '"+n+"' not found! Using fallback '"+o+"'"),n=o}k.val(n),this.options.theme="",this.theme(n),this.options.autoresize&&a(window).on("resize",function(){var b=this.element,c=b.parent(),d=a(window),e=c.width(),f=c.height(),g=d.width(),h=d.height(),i=Math.min(e,f,g,h)+"px";m.bind(this)(i)}.bind(this))},r=function(){this.timer=null,a(this.element).removeAttr("style").removeAttr("class").empty(),a("#uhr-configlink"+this.id).remove(),a("#uhr-controlpanel"+this.id).remove()},s=function(b,c){var d={};d=void 0!==this.options.cookiePath?{expires:365,path:this.options.cookiePath}:{expires:365},a.cookie(b+this.id,c,d)},t=function(){return null!==this.timer},u=function(){if(t.bind(this)()){var a=this.options.time;if(!C.bind(this)().hasOwnProperty("seconds")&&"seconds"!==this.options.mode){if(a.getMinutes()===this.currentMinute)return;this.currentMinute=a.getMinutes()}v.bind(this)(a)}else x.bind(this)(),this.currentMinute=-1},v=function(a){var b=y.bind(this)(a),c=z.bind(this)(a),d=B.bind(this)(a),e=A.bind(this)(a);if(x.bind(this)(),"seconds"===this.options.mode)w.bind(this)("second"+b);else{w.bind(this)("on");for(var f=1;f<=c;f++)w.bind(this)("dot"+f);w.bind(this)("minute"+e),w.bind(this)("hour"+d)}},w=function(a){this.element.find(".item."+a).addClass("active")},x=function(){this.element.find(".item").removeClass("active")},y=function(a){return"function"==typeof C.bind(this)().getSeconds?C.bind(this)().getSeconds(a):a.getSeconds()},z=function(a){if("function"==typeof C.bind(this)().getDotMinute)return C.bind(this)().getDotMinute(a);var b=a.getMinutes();return b%5},A=function(a){return"function"==typeof C.bind(this)().getCoarseMinute?C.bind(this)().getCoarseMinute(a):a.getMinutes()},B=function(a){if("function"==typeof C.bind(this)().getHour)return C.bind(this)().getHour(a);var b=a.getHours();return a.getMinutes()>=25?(b+1)%24:b},C=function(){var a=e.languages.filter(function(a){return a.code===this.options.language},this);return a.length>0?a[0]:{}};a.widget("fritteli.uhr",{options:{width:"100%",status:"on",language:"de_CH",theme:e.themes[0].styleClass,force:!1,controls:!0,cookiePath:void 0,autoresize:!0,mode:"normal"},start:f,stop:g,toggle:h,language:i,theme:j,time:k,mode:l,width:m,_create:n,_destroy:r}),a.fritteli.uhr.register=e.registerLanguage}(jQuery),function(a){"use strict";var b={1:[1,2,4,5,6,7]},c={4:[1,2]},d={3:[9,10,11]},e={4:[4,5,6,7,8]},f={1:[9,10,11]},g={2:[9,10,11]},h={2:[1,2,3,4,5,6]},i={3:[1,2,3,4,5,6]},j={version:2,language:"Bärndütsch",letters:["ESKISCHAFÜF","VIERTUBFZÄÄ","ZWÄNZGSIVOR","ABOHAUBIEGE","EISZWÖISDRÜ","VIERIFÜFIQT","SÄCHSISIBNI","ACHTINÜNIEL","ZÄNIERBEUFI","ZWÖUFINAUHR"],permanent:b,minutes:{"5,6,7,8,9":[f,c],"10,11,12,13,14":[g,c],"15,16,17,18,19":[h,c],"20,21,22,23,24":[i,c],"25,26,27,28,29":[f,d,e],"30,31,32,33,34":e,"35,36,37,38,39":[f,c,e],"40,41,42,43,44":[i,d],"45,46,47,48,49":[h,d],"50,51,52,53,54":[g,d],"55,56,57,58,59":[f,d]},hours:{"0,12":{10:[1,2,3,4,5,6]},"1,13":{5:[1,2,3]},"2,14":{5:[4,5,6,7]},"3,15":{5:[9,10,11]},"4,16":{6:[1,2,3,4,5]},"5,17":{6:[6,7,8,9]},"6,18":{7:[1,2,3,4,5,6]},"7,19":{7:[7,8,9,10,11]},"8,20":{8:[1,2,3,4,5]},"9,21":{8:[6,7,8,9]},"10,22":{9:[1,2,3,4]},"11,23":{9:[8,9,10,11]}}};a.fritteli.uhr.register("de_CH",j)}(jQuery);
\ No newline at end of file
diff --git a/dist/jquery.uhr.baselangs.js b/dist/jquery.uhr.baselangs.js
index a8ab4c2..cd791da 100644
--- a/dist/jquery.uhr.baselangs.js
+++ b/dist/jquery.uhr.baselangs.js
@@ -1,65 +1,63 @@
-/*! uhr - v8.0.4-dev.0 - 2016-06-27
+/*! uhr - v8.0.4-dev.0 - 2019-05-03
* http://bärneruhr.ch/
-* Copyright (c) 2016 Manuel Friedli; Licensed GPL-3.0 */
+* Copyright (c) 2019 Manuel Friedli; Licensed GPL-3.0 */
(function($) {
'use strict';
- var es_ist = {1: [1, 2, 4, 5, 6]};
- var uhr = {10: [9, 10, 11]};
- var nach = {4: [8, 9, 10, 11]};
+ var es_isch = {1: [1, 2, 4, 5, 6, 7]};
+ var genau = {3: [7, 8, 9, 10, 11]};
+ var ab = {4: [4, 5]};
var vor = {4: [1, 2, 3]};
- var halb = {5: [1, 2, 3, 4]};
- var fuenf = {1: [8, 9, 10, 11]};
- var zehn = {2: [1, 2, 3, 4]};
- var viertel = {3: [5, 6, 7, 8, 9, 10, 11]};
- var zwanzig = {2: [5, 6, 7, 8, 9, 10, 11]};
- var dreiviertel = {3: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]};
-
+ var haubi = {4: [7, 8, 9, 10, 11]};
+ var fuef = {1: [9, 10, 11]};
+ var zae = {2: [9, 10, 11]};
+ var viertu = {2: [1, 2, 3, 4, 5, 6]};
+ var zwaenzg = {3: [1, 2, 3, 4, 5, 6]};
var layout = {
"version": 2,
- "language": 'Deutsch',
+ "language": 'Bärndütsch (genau)',
"letters": [
- 'ESKISTAFÜNF',
- 'ZEHNZWANZIG',
- 'DREIVIERTEL',
- 'VORFUNKNACH',
- 'HALBAELFÜNF',
- 'EINSXAMZWEI',
- 'DREIPMJVIER',
- 'SECHSNLACHT',
- 'SIEBENZWÖLF',
- 'ZEHNEUNKUHR'
+ 'ESKISCHAFÜF',
+ 'VIERTUBFZÄÄ',
+ 'ZWÄNZGGENAU',
+ 'VORABOHAUBI',
+ 'EISZWÖISDRÜ',
+ 'VIERIFÜFIQT',
+ 'SÄCHSISIBNI',
+ 'ACHTINÜNIEL',
+ 'ZÄNIERBEUFI',
+ 'ZWÖUFINAUHR'
],
- "permanent": es_ist,
+ "permanent": es_isch,
"minutes": {
- "0,1,2,3,4": uhr,
- "5,6,7,8,9": [fuenf, nach],
- "10,11,12,13,14": [zehn, nach],
- "15,16,17,18,19": [viertel, nach],
- "20,21,22,23,24": [zwanzig, nach],
- "25,26,27,28,29": [fuenf, vor, halb],
- "30,31,32,33,34": halb,
- "35,36,37,38,39": [fuenf, nach, halb],
- "40,41,42,43,44": [zwanzig, vor],
- "45,46,47,48,49": dreiviertel,
- "50,51,52,53,54": [zehn, vor],
- "55,56,57,58,59": [fuenf, vor]
+ "0": genau,
+ "5,6,7,8,9": [fuef, ab],
+ "10,11,12,13,14": [zae, ab],
+ "15,16,17,18,19": [viertu, ab],
+ "20,21,22,23,24": [zwaenzg, ab],
+ "25,26,27,28,29": [fuef, vor, haubi],
+ "30,31,32,33,34": haubi,
+ "35,36,37,38,39": [fuef, ab, haubi],
+ "40,41,42,43,44": [zwaenzg, vor],
+ "45,46,47,48,49": [viertu, vor],
+ "50,51,52,53,54": [zae, vor],
+ "55,56,57,58,59": [fuef, vor]
},
"hours": {
- "0,12": {9: [7, 8, 9, 10, 11]},
- "1,13": {6: [1, 2, 3, 4]},
- "2,14": {6: [8, 9, 10, 11]},
- "3,15": {7: [1, 2, 3, 4]},
- "4,16": {7: [8, 9, 10, 11]},
- "5,17": {5: [8, 9, 10, 11]},
- "6,18": {8: [1, 2, 3, 4, 5]},
- "7,19": {9: [1, 2, 3, 4, 5, 6]},
- "8,20": {8: [8, 9, 10, 11]},
- "9,21": {10: [4, 5, 6, 7]},
- "10,22": {10: [1, 2, 3, 4]},
- "11,23": {5: [6, 7, 8]}
+ "0,12": {10: [1, 2, 3, 4, 5, 6]},
+ "1,13": {5: [1, 2, 3]},
+ "2,14": {5: [4, 5, 6, 7]},
+ "3,15": {5: [9, 10, 11]},
+ "4,16": {6: [1, 2, 3, 4, 5]},
+ "5,17": {6: [6, 7, 8, 9]},
+ "6,18": {7: [1, 2, 3, 4, 5, 6]},
+ "7,19": {7: [7, 8, 9, 10, 11]},
+ "8,20": {8: [1, 2, 3, 4, 5]},
+ "9,21": {8: [6, 7, 8, 9]},
+ "10,22": {9: [1, 2, 3, 4]},
+ "11,23": {9: [8, 9, 10, 11]}
}
};
- $.fritteli.uhr.register('de', layout);
+ $.fritteli.uhr.register('de_CH_genau', layout);
}(jQuery));
(function($) {
'use strict';
@@ -146,61 +144,63 @@
}(jQuery));
(function($) {
'use strict';
- var es_isch = {1: [1, 2, 4, 5, 6, 7]};
- var genau = {3: [7, 8, 9, 10, 11]};
- var ab = {4: [4, 5]};
+ var es_ist = {1: [1, 2, 4, 5, 6]};
+ var uhr = {10: [9, 10, 11]};
+ var nach = {4: [8, 9, 10, 11]};
var vor = {4: [1, 2, 3]};
- var haubi = {4: [7, 8, 9, 10, 11]};
- var fuef = {1: [9, 10, 11]};
- var zae = {2: [9, 10, 11]};
- var viertu = {2: [1, 2, 3, 4, 5, 6]};
- var zwaenzg = {3: [1, 2, 3, 4, 5, 6]};
+ var halb = {5: [1, 2, 3, 4]};
+ var fuenf = {1: [8, 9, 10, 11]};
+ var zehn = {2: [1, 2, 3, 4]};
+ var viertel = {3: [5, 6, 7, 8, 9, 10, 11]};
+ var zwanzig = {2: [5, 6, 7, 8, 9, 10, 11]};
+ var dreiviertel = {3: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]};
+
var layout = {
"version": 2,
- "language": 'Bärndütsch (genau)',
+ "language": 'Deutsch',
"letters": [
- 'ESKISCHAFÜF',
- 'VIERTUBFZÄÄ',
- 'ZWÄNZGGENAU',
- 'VORABOHAUBI',
- 'EISZWÖISDRÜ',
- 'VIERIFÜFIQT',
- 'SÄCHSISIBNI',
- 'ACHTINÜNIEL',
- 'ZÄNIERBEUFI',
- 'ZWÖUFINAUHR'
+ 'ESKISTAFÜNF',
+ 'ZEHNZWANZIG',
+ 'DREIVIERTEL',
+ 'VORFUNKNACH',
+ 'HALBAELFÜNF',
+ 'EINSXAMZWEI',
+ 'DREIPMJVIER',
+ 'SECHSNLACHT',
+ 'SIEBENZWÖLF',
+ 'ZEHNEUNKUHR'
],
- "permanent": es_isch,
+ "permanent": es_ist,
"minutes": {
- "0": genau,
- "5,6,7,8,9": [fuef, ab],
- "10,11,12,13,14": [zae, ab],
- "15,16,17,18,19": [viertu, ab],
- "20,21,22,23,24": [zwaenzg, ab],
- "25,26,27,28,29": [fuef, vor, haubi],
- "30,31,32,33,34": haubi,
- "35,36,37,38,39": [fuef, ab, haubi],
- "40,41,42,43,44": [zwaenzg, vor],
- "45,46,47,48,49": [viertu, vor],
- "50,51,52,53,54": [zae, vor],
- "55,56,57,58,59": [fuef, vor]
+ "0,1,2,3,4": uhr,
+ "5,6,7,8,9": [fuenf, nach],
+ "10,11,12,13,14": [zehn, nach],
+ "15,16,17,18,19": [viertel, nach],
+ "20,21,22,23,24": [zwanzig, nach],
+ "25,26,27,28,29": [fuenf, vor, halb],
+ "30,31,32,33,34": halb,
+ "35,36,37,38,39": [fuenf, nach, halb],
+ "40,41,42,43,44": [zwanzig, vor],
+ "45,46,47,48,49": dreiviertel,
+ "50,51,52,53,54": [zehn, vor],
+ "55,56,57,58,59": [fuenf, vor]
},
"hours": {
- "0,12": {10: [1, 2, 3, 4, 5, 6]},
- "1,13": {5: [1, 2, 3]},
- "2,14": {5: [4, 5, 6, 7]},
- "3,15": {5: [9, 10, 11]},
- "4,16": {6: [1, 2, 3, 4, 5]},
- "5,17": {6: [6, 7, 8, 9]},
- "6,18": {7: [1, 2, 3, 4, 5, 6]},
- "7,19": {7: [7, 8, 9, 10, 11]},
- "8,20": {8: [1, 2, 3, 4, 5]},
- "9,21": {8: [6, 7, 8, 9]},
- "10,22": {9: [1, 2, 3, 4]},
- "11,23": {9: [8, 9, 10, 11]}
+ "0,12": {9: [7, 8, 9, 10, 11]},
+ "1,13": {6: [1, 2, 3, 4]},
+ "2,14": {6: [8, 9, 10, 11]},
+ "3,15": {7: [1, 2, 3, 4]},
+ "4,16": {7: [8, 9, 10, 11]},
+ "5,17": {5: [8, 9, 10, 11]},
+ "6,18": {8: [1, 2, 3, 4, 5]},
+ "7,19": {9: [1, 2, 3, 4, 5, 6]},
+ "8,20": {8: [8, 9, 10, 11]},
+ "9,21": {10: [4, 5, 6, 7]},
+ "10,22": {10: [1, 2, 3, 4]},
+ "11,23": {5: [6, 7, 8]}
}
};
- $.fritteli.uhr.register('de_CH_genau', layout);
+ $.fritteli.uhr.register('de', layout);
}(jQuery));
/*
This program is free software: you can redistribute it and/or modify
diff --git a/dist/jquery.uhr.baselangs.min.js b/dist/jquery.uhr.baselangs.min.js
deleted file mode 100644
index cad339c..0000000
--- a/dist/jquery.uhr.baselangs.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! uhr - v8.0.4-dev.0 - 2016-06-27
-* http://bärneruhr.ch/
-* Copyright (c) 2016 Manuel Friedli; Licensed GPL-3.0 */
-!function(a){"use strict";var b={1:[1,2,4,5,6]},c={10:[9,10,11]},d={4:[8,9,10,11]},e={4:[1,2,3]},f={5:[1,2,3,4]},g={1:[8,9,10,11]},h={2:[1,2,3,4]},i={3:[5,6,7,8,9,10,11]},j={2:[5,6,7,8,9,10,11]},k={3:[1,2,3,4,5,6,7,8,9,10,11]},l={version:2,language:"Deutsch",letters:["ESKISTAFÜNF","ZEHNZWANZIG","DREIVIERTEL","VORFUNKNACH","HALBAELFÜNF","EINSXAMZWEI","DREIPMJVIER","SECHSNLACHT","SIEBENZWÖLF","ZEHNEUNKUHR"],permanent:b,minutes:{"0,1,2,3,4":c,"5,6,7,8,9":[g,d],"10,11,12,13,14":[h,d],"15,16,17,18,19":[i,d],"20,21,22,23,24":[j,d],"25,26,27,28,29":[g,e,f],"30,31,32,33,34":f,"35,36,37,38,39":[g,d,f],"40,41,42,43,44":[j,e],"45,46,47,48,49":k,"50,51,52,53,54":[h,e],"55,56,57,58,59":[g,e]},hours:{"0,12":{9:[7,8,9,10,11]},"1,13":{6:[1,2,3,4]},"2,14":{6:[8,9,10,11]},"3,15":{7:[1,2,3,4]},"4,16":{7:[8,9,10,11]},"5,17":{5:[8,9,10,11]},"6,18":{8:[1,2,3,4,5]},"7,19":{9:[1,2,3,4,5,6]},"8,20":{8:[8,9,10,11]},"9,21":{10:[4,5,6,7]},"10,22":{10:[1,2,3,4]},"11,23":{5:[6,7,8]}}};a.fritteli.uhr.register("de",l)}(jQuery),function(a){"use strict";var b={1:[1,2,4,5,6,7]},c={4:[1,2]},d={3:[9,10,11]},e={4:[4,5,6,7,8]},f={1:[9,10,11]},g={2:[9,10,11]},h={2:[1,2,3,4,5,6]},i={3:[1,2,3,4,5,6]},j={version:2,language:"Bärndütsch",letters:["ESKISCHAFÜF","VIERTUBFZÄÄ","ZWÄNZGSIVOR","ABOHAUBIEGE","EISZWÖISDRÜ","VIERIFÜFIQT","SÄCHSISIBNI","ACHTINÜNIEL","ZÄNIERBEUFI","ZWÖUFINAUHR"],permanent:b,minutes:{"5,6,7,8,9":[f,c],"10,11,12,13,14":[g,c],"15,16,17,18,19":[h,c],"20,21,22,23,24":[i,c],"25,26,27,28,29":[f,d,e],"30,31,32,33,34":e,"35,36,37,38,39":[f,c,e],"40,41,42,43,44":[i,d],"45,46,47,48,49":[h,d],"50,51,52,53,54":[g,d],"55,56,57,58,59":[f,d]},hours:{"0,12":{10:[1,2,3,4,5,6]},"1,13":{5:[1,2,3]},"2,14":{5:[4,5,6,7]},"3,15":{5:[9,10,11]},"4,16":{6:[1,2,3,4,5]},"5,17":{6:[6,7,8,9]},"6,18":{7:[1,2,3,4,5,6]},"7,19":{7:[7,8,9,10,11]},"8,20":{8:[1,2,3,4,5]},"9,21":{8:[6,7,8,9]},"10,22":{9:[1,2,3,4]},"11,23":{9:[8,9,10,11]}}};a.fritteli.uhr.register("de_CH",j)}(jQuery),function(a){"use strict";var b={1:[1,2,4,5,6,7]},c={3:[7,8,9,10,11]},d={4:[4,5]},e={4:[1,2,3]},f={4:[7,8,9,10,11]},g={1:[9,10,11]},h={2:[9,10,11]},i={2:[1,2,3,4,5,6]},j={3:[1,2,3,4,5,6]},k={version:2,language:"Bärndütsch (genau)",letters:["ESKISCHAFÜF","VIERTUBFZÄÄ","ZWÄNZGGENAU","VORABOHAUBI","EISZWÖISDRÜ","VIERIFÜFIQT","SÄCHSISIBNI","ACHTINÜNIEL","ZÄNIERBEUFI","ZWÖUFINAUHR"],permanent:b,minutes:{0:c,"5,6,7,8,9":[g,d],"10,11,12,13,14":[h,d],"15,16,17,18,19":[i,d],"20,21,22,23,24":[j,d],"25,26,27,28,29":[g,e,f],"30,31,32,33,34":f,"35,36,37,38,39":[g,d,f],"40,41,42,43,44":[j,e],"45,46,47,48,49":[i,e],"50,51,52,53,54":[h,e],"55,56,57,58,59":[g,e]},hours:{"0,12":{10:[1,2,3,4,5,6]},"1,13":{5:[1,2,3]},"2,14":{5:[4,5,6,7]},"3,15":{5:[9,10,11]},"4,16":{6:[1,2,3,4,5]},"5,17":{6:[6,7,8,9]},"6,18":{7:[1,2,3,4,5,6]},"7,19":{7:[7,8,9,10,11]},"8,20":{8:[1,2,3,4,5]},"9,21":{8:[6,7,8,9]},"10,22":{9:[1,2,3,4]},"11,23":{9:[8,9,10,11]}}};a.fritteli.uhr.register("de_CH_genau",k)}(jQuery),function(a){"use strict";var b={1:[1,2,3,4,5,6,7,9,10]},c={4:[4,5,6,7,8,9,10,11]},d={5:[8]},e={5:[4,5,6,7]},f={2:[1,2,3]},g={4:[1,2]},h={3:[4,5,6,7,8]},i={2:[4,5,6,7]},j={6:[8,9,10,11]},k={version:2,language:"Dansk",letters:["KLOKKENVERO","FEMTYVESKLA","OJEKVARTVAT","TIAMINUTTER","VEMOVERILMF","MONALISHALV","ETTOTREFIRE","FEMSEKSRSYV","OTTERNIMETI","ELLEVEATOLV"],permanent:b,minutes:{"5,6,7,8,9":[f,c,e],"10,11,12,13,14":[g,c,e],"15,16,17,18,19":[h,e],"20,21,22,23,24":[i,c,e],"25,26,27,28,29":[f,c,d,j],"30,31,32,33,34":[j],"35,36,37,38,39":[f,c,e,j],"40,41,42,43,44":[i,c,d],"45,46,47,48,49":[h,d],"50,51,52,53,54":[g,c,d],"55,56,57,58,59":[f,c,d]},hours:{"0,12":{10:[8,9,10,11]},"1,13":{7:[1,2]},"2,14":{7:[3,4]},"3,15":{7:[5,6,7]},"4,16":{7:[8,9,10,11]},"5,17":{8:[1,2,3]},"6,18":{8:[4,5,6,7]},"7,19":{8:[9,10,11]},"8,20":{9:[1,2,3,4]},"9,21":{9:[6,7]},"10,22":{9:[10,11]},"11,23":{10:[1,2,3,4,5,6]}},getHour:function(a){var b=a.getHours();return a.getMinutes()>=25?(b+1)%24:b}};a.fritteli.uhr.register("dk",k)}(jQuery),function(a){"use strict";var b={1:[1,2,4,5]},c={4:[1,2,3,4]},d={4:[10,11]},e={5:[1,2,3,4]},f={10:[5,6,7,8,9,10,11]},g={3:[7,8,9,10]},h={4:[6,7,8]},i={2:[1,3,4,5,6,7,8,9]},j={3:[1,2,3,4,5,6]},k={3:[1,2,3,4,5,6,7,8,9,10]},l={version:2,language:"English",letters:["ITLISBFAMPM","ACQUARTERDC","TWENTYFIVEX","HALFBTENFTO","PASTERUNINE","ONESIXTHREE","FOURFIVETWO","EIGHTELEVEN","SEVENTWELVE","TENSO'CLOCK"],permanent:b,minutes:{"0,1,2,3,4":f,"5,6,7,8,9":[g,e],"10,11,12,13,14":[h,e],"15,16,17,18,19":[i,e],"20,21,22,23,24":[j,e],"25,26,27,28,29":[k,e],"30,31,32,33,34":[c,e],"35,36,37,38,39":[k,d],"40,41,42,43,44":[j,d],"45,46,47,48,49":[i,d],"50,51,52,53,54":[h,d],"55,56,57,58,59":[g,d]},hours:{"0,12":{9:[6,7,8,9,10,11]},"1,13":{6:[1,2,3]},"2,14":{7:[9,10,11]},"3,15":{6:[7,8,9,10,11]},"4,16":{7:[1,2,3,4]},"5,17":{7:[5,6,7,8]},"6,18":{6:[4,5,6]},"7,19":{9:[1,2,3,4,5]},"8,20":{8:[1,2,3,4,5]},"9,21":{5:[8,9,10,11]},"10,22":{10:[1,2,3]},"11,23":{8:[6,7,8,9,10,11]}},getHour:function(a){var b=a.getHours();return a.getMinutes()>=35?(b+1)%24:b}};a.fritteli.uhr.register("en",l)}(jQuery),function(a){"use strict";var b={1:[1,2,6,7]},c={1:[2,3,4,6,7,8]},d={7:[6]},e={7:[7,8,9,10,11]},f={10:[1,2,3,4,5]},g={9:[7,8,9,10,11]},h={8:[8,9,10,11]},i={10:[6,7,8,9,10,11]},j={8:[2,3,4,5,6,7]},k={9:[1,2,3,4,5,6,7,8,9,10,11]},l={version:2,language:"Español",letters:["ESONELASUNA","DOSITRESORE","CUATROCINCO","SEISASIETEN","OCHONUEVEYO","LADIEZSONCE","DOCELYMENOS","OVEINTEDIEZ","VEINTICINCO","MEDIACUARTO"],permanent:[],minutes:{"5,6,7,8,9":[d,g],"10,11,12,13,14":[d,h],"15,16,17,18,19":[d,i],"20,21,22,23,24":[d,j],"25,26,27,28,29":[d,k],"30,31,32,33,34":[d,f],"35,36,37,38,39":[e,k],"40,41,42,43,44":[e,j],"45,46,47,48,49":[e,i],"50,51,52,53,54":[e,h],"55,56,57,58,59":[e,g]},hours:{"0,12":[c,{7:[1,2,3,4]}],"1,13":[b,{1:[9,10,11]}],"2,14":[c,{2:[1,2,3]}],"3,15":[c,{2:[5,6,7,8]}],"4,16":[c,{3:[1,2,3,4,5,6]}],"5,17":[c,{3:[7,8,9,10,11]}],"6,18":[c,{4:[1,2,3,4]}],"7,19":[c,{4:[6,7,8,9,10]}],"8,20":[c,{5:[1,2,3,4]}],"9,21":[c,{5:[5,6,7,8,9]}],"10,22":[c,{6:[3,4,5,6]}],"11,23":[c,{6:[8,9,10,11]}]},getHour:function(a){var b=a.getHours();return a.getMinutes()>=35?(b+1)%24:b}};a.fritteli.uhr.register("es",l)}(jQuery),function(a){"use strict";var b={1:[1,2,4,5,6]},c={8:[1,2]},d={7:[1,2,3,4,5]},e={10:[4,5,6,7,8]},f={6:[6,7,8,9,10,11]},g={7:[7,8]},h={9:[7,8,9,10]},i={7:[9,10,11]},j={8:[4,5,6,7,8]},k={9:[1,2,3,4,5]},l={9:[1,2,3,4,5,6,7,8,9,10]},m={version:2,language:"Français",letters:["ILNESTODEUX","QUATRETROIS","NEUFUNESEPT","HUITSIXCINQ","MIDIXMINUIT","ONZERHEURES","MOINSOLEDIX","ETRQUARTPMD","VINGT-CINQU","ETSDEMIEPAM"],permanent:b,minutes:{"5,6,7,8,9":h,"10,11,12,13,14":i,"15,16,17,18,19":[c,j],"20,21,22,23,24":k,"25,26,27,28,29":l,"30,31,32,33,34":[c,e],"35,36,37,38,39":[d,l],"40,41,42,43,44":[d,k],"45,46,47,48,49":[d,g,j],"50,51,52,53,54":[d,i],"55,56,57,58,59":[d,h]},hours:{0:{5:[6,7,8,9,10,11]},"1,13":[{3:[5,6,7]},f],"2,14":[{1:[8,9,10,11]},f],"3,15":[{2:[7,8,9,10,11]},f],"4,16":[{2:[1,2,3,4,5,6]},f],"5,17":[{4:[8,9,10,11]},f],"6,18":[{4:[5,6,7]},f],"7,19":[{3:[8,9,10,11]},f],"8,20":[{4:[1,2,3,4]},f],"9,21":[{3:[1,2,3,4]},f],"10,22":[{5:[3,4,5]},f],"11,23":[{6:[1,2,3,4]},f],12:{5:[1,2,3,4]}},getHour:function(a){var b=a.getHours();return a.getMinutes()>=35?(b+1)%24:b}};a.fritteli.uhr.register("fr",m)}(jQuery),function(a){"use strict";var b={1:[1,2,3,4,6,7]},c={2:[1,3,4]},d={8:[1]},e={7:[8,9,10,11]},f={10:[7,8,9,10,11]},g={9:[6,7,8,9,10,11]},h={10:[1,2,3,4,5]},i={8:[3,4,6,7,8,9,10,11]},j={9:[1,2,3,4,5]},k={9:[1,2,3,4,5,6,7,8,9,10,11]},l={version:2,language:"Italiano",letters:["SONORLEBORE","ÈRL'UNASDUE","TREOTTONOVE","DIECIUNDICI","DODICISETTE","QUATTROCSEI","CINQUEAMENO","ECUNOQUARTO","VENTICINQUE","DIECIPMEZZA"],permanent:[],minutes:{"5,6,7,8,9":[d,g],"10,11,12,13,14":[d,h],"15,16,17,18,19":[d,i],"20,21,22,23,24":[d,j],"25,26,27,28,29":[d,k],"30,31,32,33,34":[d,f],"35,36,37,38,39":[e,k],"40,41,42,43,44":[e,j],"45,46,47,48,49":[e,i],"50,51,52,53,54":[e,h],"55,56,57,58,59":[e,g]},hours:{"0,12":[b,{5:[1,2,3,4,5,6]}],"1,13":[c,{2:[5,6,7]}],"2,14":[b,{2:[9,10,11]}],"3,15":[b,{3:[1,2,3]}],"4,16":[b,{6:[1,2,3,4,5,6,7]}],"5,17":[b,{7:[1,2,3,4,5,6]}],"6,18":[b,{6:[9,10,11]}],"7,19":[b,{5:[7,8,9,10,11]}],"8,20":[b,{3:[4,5,6,7]}],"9,21":[b,{3:[8,9,10,11]}],"10,22":[b,{4:[1,2,3,4,5]}],"11,23":[b,{4:[6,7,8,9,10,11]}]},getHour:function(a){var b=a.getHours();return a.getMinutes()>=35?(b+1)%24:b}};a.fritteli.uhr.register("it",l)}(jQuery),function(a){"use strict";var b={1:[1,2,3,5,6]},c={3:[1,2,3,4]},d={2:[8,9,10,11]},e={4:[8,9,10,11]},f={5:[1,2,3,4]},g={4:[1,2,3,4]},h={1:[8,9,10,11]},i={2:[1,2,3,4]},j={3:[7,8,9,10,11]},k={10:[9,10,11]},l={version:2,language:"Nederlands",letters:["HETKISAVIJF","TIENBTZVOOR","OVERMEKWART","HALFSPWOVER","VOORTHGEENS","TWEEPVCDRIE","VIERVIJFZES","ZEVENONEGEN","ACHTTIENELF","TWAALFBFUUR"],permanent:b,minutes:{"0,1,2,3,4":k,"5,6,7,8,9":[h,c],"10,11,12,13,14":[i,c],"15,16,17,18,19":[j,e],"20,21,22,23,24":[i,d,g],"25,26,27,28,29":[h,d,g],"30,31,32,33,34":g,"35,36,37,38,39":[h,c,g],"40,41,42,43,44":[i,c,g],"45,46,47,48,49":[j,f],"50,51,52,53,54":[i,d],"55,56,57,58,59":[h,d]},hours:{"0,12":{10:[1,2,3,4,5,6]},"1,13":{5:[8,9,10]},"2,14":{6:[1,2,3,4]},"3,15":{6:[8,9,10,11]},"4,16":{7:[1,2,3,4]},"5,17":{7:[5,6,7,8]},"6,18":{7:[9,10,11]},"7,19":{8:[1,2,3,4,5]},"8,20":{9:[1,2,3,4]},"9,21":{8:[7,8,9,10,11]},"10,22":{9:[5,6,7,8]},"11,23":{9:[9,10,11]}},getHour:function(a){var b=a.getHours();return a.getMinutes()>=20?(b+1)%24:b}};a.fritteli.uhr.register("nl",l)}(jQuery),function(a){"use strict";var b={1:[1]},c={1:[2,3,4]},d={7:[8]},e={10:[5]},f={7:[7,8,9,10,11]},g={8:[8,9,10,11]},h={10:[7,8,9,10,11]},i={10:[1,2,3]},j={9:[1,2,4,5,6,7,8,9]},k={8:[1,2,3,4,5]},l={version:2,language:"Português",letters:["ÉSÃOUMATRÊS","MEIOLDIADEZ","DUASEISETEY","QUATROHNOVE","CINCOITONZE","ZMEIALNOITE","HORASYMENOS","VINTECAMEIA","UMVQUARTOPM","DEZOEYCINCO"],minutes:{"5,6,7,8,9":[d,h],"10,11,12,13,14":[d,i],"15,16,17,18,19":[d,j],"20,21,22,23,24":[d,k],"25,26,27,28,29":[d,k,e,h],"30,31,32,33,34":[d,g],"35,36,37,38,39":[f,k,e,h],"40,41,42,43,44":[f,k],"45,46,47,48,49":[f,j],"50,51,52,53,54":[f,i],"55,56,57,58,59":[f,h]},hours:{0:[b,{6:[2,3,4,5,7,8,9,10,11]}],12:[b,{2:[1,2,3,4,6,7,8]}],"1,13":[b,{1:[5,6,7]}],"2,14":[c,{3:[1,2,3,4]}],"3,15":[c,{1:[8,9,10,11]}],"4,16":[c,{4:[1,2,3,4,5,6]}],"5,17":[c,{5:[1,2,3,4,5]}],"6,18":[c,{3:[4,5,6,7]}],"7,19":[c,{3:[7,8,9,10]}],"8,20":[c,{5:[5,6,7,8]}],"9,21":[c,{4:[8,9,10,11]}],"10,22":[c,{2:[9,10,11]}],"11,23":[c,{5:[8,9,10,11]}]},getHour:function(a){var b=a.getHours();return a.getMinutes()>=35?(b+1)%24:b}};a.fritteli.uhr.register("pt",l)}(jQuery);
\ No newline at end of file
diff --git a/dist/jquery.uhr.complete.js b/dist/jquery.uhr.complete.js
index a5796c3..ab43c0a 100644
--- a/dist/jquery.uhr.complete.js
+++ b/dist/jquery.uhr.complete.js
@@ -1,17 +1,17 @@
-/*! uhr - v8.0.4-dev.0 - 2016-06-27
+/*! uhr - v8.0.4-dev.0 - 2019-05-03
* http://bärneruhr.ch/
-* Copyright (c) 2016 Manuel Friedli; Licensed GPL-3.0 */
-(function($) {
+* Copyright (c) 2019 Manuel Friedli; Licensed GPL-3.0 */
+(function ($) {
'use strict';
var uhrGlobals = {
"id": 0,
"languages": [],
"themes": [],
registerLanguage: function registerLanguage(code, language) {
- var alreadyExists = uhrGlobals.languages.some(function(element) {
+ var alreadyExists = uhrGlobals.languages.some(function (element) {
if (code === element.code) {
console.error("Error: Language code '" + code + "' cannot be registered for language '" + language.language +
- "' because it is already registered for language '" + element.language + "'!");
+ "' because it is already registered for language '" + element.language + "'!");
return true;
}
return false;
@@ -24,7 +24,7 @@
};
// auto-detect themes
- $('link[rel=stylesheet]').each(function(index, item) {
+ $('link[rel=stylesheet]').each(function (index, item) {
var styleSheet = $(item);
var styleClass = styleSheet.attr('data-class');
if (styleClass !== undefined) {
@@ -41,9 +41,12 @@
}
// public interface methods (exported later)
+ var setCookie;
+ var isOn;
+ var update;
var start = function start() {
if (!isOn.bind(this)()) {
- this.timer = window.setInterval(function() {
+ this.timer = window.setInterval(function () {
this.options.time = new Date();
update.bind(this)();
}.bind(this), 1000);
@@ -66,436 +69,25 @@
this.start();
}
};
- var setLanguage = function setLanguage(languageKey) {
- if (languageKey !== this.options.language) {
- this.options.language = languageKey;
- var renderer = new UhrRenderer(language.bind(this)(), this.element.find('.letterarea'));
- renderer.render.bind(this)(function() {
- this.currentMinute = -1;
- update.bind(this)();
- }.bind(this));
- setCookie.bind(this)('uhr-language', languageKey);
- update.bind(this)();
- }
- };
- var setTheme = function setTheme(theme) {
- if (theme !== this.options.theme) {
- this.element.removeClass(this.options.theme).addClass(theme);
- $('#uhr-onoffswitch' + this.id).removeClass(this.options.theme).addClass(theme);
- this.options.theme = theme;
- setCookie.bind(this)('uhr-theme', theme);
- }
- };
- var setTime = function setTime(time) {
- this.currentMinute = -1;
- if (time === null) {
- this.options.time = new Date();
- } else {
- if (this.timer !== null) {
- window.clearInterval(this.timer);
- }
- this.options.time = time;
- }
- update.bind(this)();
- };
- var setMode = function(mode) {
- this.options.mode = mode;
- this.currentMinute = -1;
- update.bind(this)();
- setCookie.bind(this)('uhr-mode', mode);
- };
- var setWidth = function setWidth(width) {
- var e = this.element;
- e.css('width', width);
- var realWidth = e.width();
- e.width(realWidth);
- e.height(realWidth);
- e.css('font-size', (realWidth / 40) + 'px');
- };
+ var language;
- // private interface methods
- var create = function create() {
- this.id = uhrGlobals.id++;
- this.timer = null;
- this.currentMinute = -1;
- var userTime = this.options.time;
- var hash, params;
- if (this.options.time === undefined) {
- this.options.time = new Date();
- }
- // parse the URL params
- hash = window.location.hash;
- if (hash !== undefined && typeof hash === 'string' && hash.charAt(0) === '#') {
- hash = hash.substring(1);
- hash = decodeURIComponent(hash);
- params = hash.split('&');
- params.forEach(function (element) {
- var pair = element.split('=');
- var key = pair[0];
- var value = pair[1];
- switch (key) {
- case 'l':
- case 'language':
- this.options.language = value;
- this.options.force = true;
- break;
- case 't':
- case 'theme':
- this.options.theme = value;
- this.options.force = true;
- break;
- case 'm':
- case 'mode':
- this.options.mode = value;
- this.options.force = true;
- break;
- case 's':
- case 'status':
- this.options.status = value;
- this.options.force = true;
- break;
- }
- }.bind(this));
- }
- // end parse the URL params
- setupHTML.bind(this)();
- wireFunctionality.bind(this)();
- if (userTime !== undefined) {
- this.time(userTime);
- }
- };
- // private helper methods (not exported)
- var toggleConfigScreen = function toggleConfigScreen() {
- $('#uhr-controlpanel' + this.id).toggle('fast');
- };
- // set up
- var setupHTML = function setupHTML() {
- var e = this.element;
- // Base clock area
- e.addClass('uhr');
- e.empty();
- e.append('');
- e.append('');
- e.append('');
- e.append('');
- e.append('');
- e.append('');
- setWidth.bind(this)(this.options.width);
-
- if (this.options.controls) {
- var controlpanel = $('');
- var content = $('');
- controlpanel.append(content);
- // on/off switch
- var toggleSwitch = $('');
- toggleSwitch.append('');
- toggleSwitch.append('');
- content.append(toggleSwitch);
-
- // time mode switch
- var modeSwitch = $('');
- modeSwitch.append('');
- modeSwitch.append('');
- content.append(modeSwitch);
- // language chooser
- if (uhrGlobals.languages.length > 1) {
- var languageChooser = $('');
- uhrGlobals.languages.forEach(function(item) {
- languageChooser.append('');
- });
- content.append(languageChooser);
- }
-
- // theme chooser
- if (uhrGlobals.themes.length > 1) {
- var themeChooser = $('');
- uhrGlobals.themes.forEach(function(item) {
- themeChooser.append('');
- });
- content.append(themeChooser);
- }
- var closebutton = $('');
- closebutton.on('click', function() {
- $('#uhr-controlpanel' + this.id).hide('fast');
- }.bind(this));
- content.append(closebutton);
- e.after(controlpanel);
- controlpanel.hide();
- var configlink = $('');
- configlink.on('click', function() {
- toggleConfigScreen.bind(this)();
- }.bind(this));
- e.after(configlink);
- }
- };
- var wireFunctionality = function wireFunctionality() {
- // on/off switch
- var toggleSwitch = $('#uhr-onoffswitch-checkbox' + this.id);
- toggleSwitch.on('click', function() {
- this.toggle();
- }.bind(this));
- var status = $.cookie('uhr-status' + this.id);
- if (status === undefined || this.options.force) {
- status = this.options.status;
- }
- toggleSwitch.prop('checked', status === 'on');
- if (status === 'on') {
- this.start();
- } else {
- this.stop();
- }
-
- // time mode switch
- var modeSwitch = $('#uhr-modeswitch-checkbox' + this.id);
- modeSwitch.on('click', function() {
- if (this.options.mode === 'seconds') {
- setMode.bind(this)('normal');
- } else {
- setMode.bind(this)('seconds');
- }
- }.bind(this));
-
- var mode = $.cookie('uhr-mode' + this.id);
- if (mode === undefined || this.options.force) {
- mode = this.options.mode;
- }
- modeSwitch.prop('checked', mode !== 'seconds');
- if (mode === 'seconds') {
- setMode.bind(this)('seconds');
- } else {
- setMode.bind(this)('normal');
- }
-
- // language chooser
- var languageChooser = $('#uhr-languagechooser' + this.id);
- languageChooser.on('change', function() {
- var languageKey = $('#uhr-languagechooser' + this.id).val();
- this.language(languageKey);
- }.bind(this));
- var selectedLanguage = $.cookie('uhr-language' + this.id);
- if (selectedLanguage === undefined || this.options.force) {
- selectedLanguage = this.options.language;
- }
- var found = uhrGlobals.languages.some(function(item) {
- return selectedLanguage === item.code;
- });
- if (!found) {
- var fallbackLanguage;
- if (uhrGlobals.languages.length > 0) {
- fallbackLanguage = uhrGlobals.languages[0].code;
- } else {
- fallbackLanguage = '';
- }
- console.warn("Language '" + selectedLanguage + "' not found! Using fallback '" + fallbackLanguage + "'");
- selectedLanguage = fallbackLanguage;
- }
- languageChooser.val(selectedLanguage);
- this.options.language = "";
- this.language(selectedLanguage);
-
- // theme chooser
- var themeChooser = $('#uhr-themechooser' + this.id);
- themeChooser.on('change', function() {
- var themeKey = $('#uhr-themechooser' + this.id).val();
- this.theme(themeKey);
- }.bind(this));
- var selectedTheme = $.cookie('uhr-theme' + this.id);
- if (selectedTheme === undefined || this.options.force) {
- selectedTheme = this.options.theme;
- }
- found = uhrGlobals.themes.some(function(item) {
- return selectedTheme === item.styleClass;
- });
- if (!found) {
- var fallbackTheme = uhrGlobals.themes[0].styleClass;
- console.warn("Theme '" + selectedTheme + "' not found! Using fallback '" + fallbackTheme + "'");
- selectedTheme = fallbackTheme;
- }
- themeChooser.val(selectedTheme);
- this.options.theme = "";
- this.theme(selectedTheme);
- if (this.options.autoresize) {
- $(window).on('resize', function() {
- var $e = this.element;
- var $parent = $e.parent();
- var $window = $(window);
- var parentWidth = $parent.width();
- var parentHeight = $parent.height();
- var windowWidth = $window.width();
- var windowHeight = $window.height();
- var size = Math.min(parentWidth, parentHeight, windowWidth, windowHeight) + 'px';
- setWidth.bind(this)(size);
- }.bind(this));
- }
- };
- var destroy = function destroy() {
- this.timer = null;
- $(this.element)
- .removeAttr('style')
- .removeAttr('class')
- .empty();
- $('#uhr-configlink' + this.id).remove();
- $('#uhr-controlpanel' + this.id).remove();
-
- };
- var setCookie = function setCookie(cookieName, cookieValue) {
- var options = {};
- if (this.options.cookiePath !== undefined) {
- options = {expires: 365, path: this.options.cookiePath};
- } else {
- options = {expires: 365};
- }
- $.cookie(cookieName + this.id, cookieValue, options);
- };
-
- // business logic
- var isOn = function isOn() {
- return this.timer !== null;
- };
- var update = function update() {
- if (isOn.bind(this)()) {
- var time = this.options.time;
- if (!language.bind(this)().hasOwnProperty('seconds') && this.options.mode !== 'seconds') {
- if (time.getMinutes() === this.currentMinute) {
- return;
- }
- this.currentMinute = time.getMinutes();
- }
- show.bind(this)(time);
- } else {
- clear.bind(this)();
- this.currentMinute = -1;
- }
- };
- var show = function show(time) {
- var second = getSecond.bind(this)(time);
- var dotMinute = getDotMinute.bind(this)(time);
- var hour = getHour.bind(this)(time);
- var coarseMinute = getCoarseMinute.bind(this)(time);
- clear.bind(this)();
- if (this.options.mode === 'seconds') {
- highlight.bind(this)('second' + second);
- } else {
- highlight.bind(this)('on');
- for (var i = 1; i <= dotMinute; i++) {
- highlight.bind(this)('dot' + i);
- }
- highlight.bind(this)('minute' + coarseMinute);
- highlight.bind(this)('hour' + hour);
- }
- };
- var highlight = function highlight(itemClass) {
- this.element.find('.item.' + itemClass).addClass('active');
- };
- var clear = function clear() {
- this.element.find('.item').removeClass('active');
- };
- var getSecond = function getSecond(date) {
- if (typeof language.bind(this)().getSeconds === 'function') {
- return language.bind(this)().getSeconds(date);
- }
- return date.getSeconds();
- };
- var getDotMinute = function getDotMinute(date) {
- if (typeof language.bind(this)().getDotMinute === 'function') {
- return language.bind(this)().getDotMinute(date);
- }
- var minutes = date.getMinutes();
- return minutes % 5;
- };
- var getCoarseMinute = function getCoarseMinute(date) {
- if (typeof language.bind(this)().getCoarseMinute === 'function') {
- return language.bind(this)().getCoarseMinute(date);
- }
- return date.getMinutes();
- };
- var getHour = function getHour(date) {
- if (typeof language.bind(this)().getHour === 'function') {
- return language.bind(this)().getHour(date);
- }
- var hour = date.getHours();
- if (date.getMinutes() >= 25) {
- return (hour + 1) % 24;
- }
- return hour;
- };
- var language = function language() {
- var matchingLanguages = uhrGlobals.languages.filter(function(element) {
- return (element.code === this.options.language);
- }, this);
- if (matchingLanguages.length > 0) {
- return matchingLanguages[0];
- }
- // fallback: return empty object
- return {};
- };
-
- $.widget("fritteli.uhr", {
- "options": {
- width: '100%',
- status: 'on',
- language: 'de_CH',
- theme: uhrGlobals.themes[0].styleClass,
- force: false,
- controls: true,
- cookiePath: undefined,
- autoresize: true,
- mode: 'normal'
- },
- "start": start,
- "stop": stop,
- "toggle": toggle,
- "language": setLanguage,
- "theme": setTheme,
- "time": setTime,
- "mode": setMode,
- "width": setWidth,
- // constructor method
- "_create": create,
- // destructor method
- "_destroy": destroy
- });
- $.fritteli.uhr.register = uhrGlobals.registerLanguage;
/**
- * Hilfsklasse zum Rendern der Uhr.
- * @param layout Layout-Objekt, das gerendert werden soll.
- * @param renderarea Das jQuery-gewrappte HTML-Element, auf dem gerendert werden soll.
+ * Ein Buchstabe. Hilfsklasse für den Renderer und Inhalt der Layout-Arrays.
+ * @param value Der Buchstabe, der Dargestellt werden soll.
+ * @param style Die CSS-Styleklassen des Buchstabens.
*/
- function UhrRenderer(layout, renderarea) {
- this.render = function render(beforeshow) {
- if (layout.parsed === undefined) {
- switch (layout.version) {
- case 2:
- var delegate = new UhrRendererV2Delegate(layout);
- var parsedLayout = delegate.parse();
- Object.defineProperty(layout, "parsed", {"value": parsedLayout, "writable": false, "configurable": false});
- break;
- default:
- console.warn("Unknown layout version: '" + layout.version + "'");
- return;
- }
+ function Letter(value, style) {
+ var myValue = value;
+ var myStyle = style || '';
+ this.addStyle = function (style) {
+ if (myStyle === '') {
+ myStyle = style;
+ } else {
+ myStyle += ' ' + style;
}
- var letters = layout.parsed;
- renderarea.fadeOut('fast', function() {
- renderarea.empty();
- letters.forEach(function(line, index, array) {
- line.forEach(function(letter) {
- renderarea.append(letter.toString());
- });
- if (index < array.length - 1) {
- renderarea.append('
');
- }
- });
- if (typeof beforeshow === 'function') {
- beforeshow();
- }
- renderarea.fadeIn('fast');
- });
+ };
+ this.toString = function () {
+ return '' + myValue + '';
};
}
@@ -644,7 +236,7 @@
8: [10],
9: [8, 9]
};
- var seconds= {
+ var seconds = {
"0": [vorne0, hinten0],
"1": [vorne0, hinten1],
"2": [vorne0, hinten2],
@@ -707,10 +299,21 @@
"59": [vorne5, hinten9]
};
+ function parseObject(letters, styleClass, object) {
+ if (typeof object !== 'undefined' && object !== null) {
+ Object.keys(object).forEach(function (y) {
+ var highlightLetters = object[y];
+ highlightLetters.forEach(function (x) {
+ letters[y - 1][x - 1].addStyle(styleClass);
+ });
+ });
+ }
+ }
+
function parseArrayOrObject(letters, styleClass, input) {
if (typeof input !== 'undefined' && input !== null) {
if (Array.isArray(input)) {
- input.forEach(function(item) {
+ input.forEach(function (item) {
parseObject(letters, styleClass, item);
});
} else {
@@ -719,23 +322,12 @@
}
}
- function parseObject(letters, styleClass, object) {
- if (typeof object !== 'undefined' && object !== null) {
- Object.keys(object).forEach(function(y) {
- var highlightLetters = object[y];
- highlightLetters.forEach(function(x) {
- letters[y - 1][x - 1].addStyle(styleClass);
- });
- });
- }
- }
-
function parseTimeDefinition(letters, styleClass, definition) {
if (typeof definition !== 'undefined' && definition !== null) {
- Object.keys(definition).forEach(function(listString) {
+ Object.keys(definition).forEach(function (listString) {
var array = listString.split(',');
var highlightLetters = definition[listString];
- array.forEach(function(item) {
+ array.forEach(function (item) {
parseArrayOrObject(letters, styleClass + item, highlightLetters);
});
});
@@ -744,7 +336,7 @@
this.parse = function parse() {
var letters = [];
- layout.letters.forEach(function(string) {
+ layout.letters.forEach(function (string) {
var line = [];
for (var c = 0; c < string.length; c++) {
var character = new Letter(string[c]);
@@ -765,85 +357,510 @@
}
/**
- * Ein Buchstabe. Hilfsklasse für den Renderer und Inhalt der Layout-Arrays.
- * @param value Der Buchstabe, der Dargestellt werden soll.
- * @param style Die CSS-Styleklassen des Buchstabens.
+ * Hilfsklasse zum Rendern der Uhr.
+ * @param layout Layout-Objekt, das gerendert werden soll.
+ * @param renderarea Das jQuery-gewrappte HTML-Element, auf dem gerendert werden soll.
*/
- function Letter(value, style) {
- var myValue = value;
- var myStyle = style || '';
- this.addStyle = function(style) {
- if (myStyle === '') {
- myStyle = style;
- } else {
- myStyle += ' ' + style;
+ function UhrRenderer(layout, renderarea) {
+ this.render = function render(beforeshow) {
+ if (layout.parsed === undefined) {
+ switch (layout.version) {
+ case 2:
+ var delegate = new UhrRendererV2Delegate(layout);
+ var parsedLayout = delegate.parse();
+ Object.defineProperty(layout, "parsed", {
+ "value": parsedLayout,
+ "writable": false,
+ "configurable": false
+ });
+ break;
+ default:
+ console.warn("Unknown layout version: '" + layout.version + "'");
+ return;
+ }
}
- };
- this.toString = function() {
- return '' + myValue + '';
+ var letters = layout.parsed;
+ renderarea.fadeOut('fast', function () {
+ renderarea.empty();
+ letters.forEach(function (line, index, array) {
+ line.forEach(function (letter) {
+ renderarea.append(letter.toString());
+ });
+ if (index < array.length - 1) {
+ renderarea.append('
');
+ }
+ });
+ if (typeof beforeshow === 'function') {
+ beforeshow();
+ }
+ renderarea.fadeIn('fast');
+ });
};
}
+
+ var setLanguage = function setLanguage(languageKey) {
+ if (languageKey !== this.options.language) {
+ this.options.language = languageKey;
+ var renderer = new UhrRenderer(language.bind(this)(), this.element.find('.letterarea'));
+ renderer.render.bind(this)(function () {
+ this.currentMinute = -1;
+ update.bind(this)();
+ }.bind(this));
+ setCookie.bind(this)('uhr-language', languageKey);
+ update.bind(this)();
+ }
+ };
+ var setTheme = function setTheme(theme) {
+ if (theme !== this.options.theme) {
+ this.element.removeClass(this.options.theme).addClass(theme);
+ $('#uhr-onoffswitch' + this.id).removeClass(this.options.theme).addClass(theme);
+ this.options.theme = theme;
+ setCookie.bind(this)('uhr-theme', theme);
+ }
+ };
+ var setTime = function setTime(time) {
+ this.currentMinute = -1;
+ if (time === null) {
+ this.options.time = new Date();
+ } else {
+ if (this.timer !== null) {
+ window.clearInterval(this.timer);
+ }
+ this.options.time = time;
+ }
+ update.bind(this)();
+ };
+ var setMode = function (mode) {
+ this.options.mode = mode;
+ this.currentMinute = -1;
+ update.bind(this)();
+ setCookie.bind(this)('uhr-mode', mode);
+ };
+ var setWidth = function setWidth(width) {
+ var e = this.element;
+ e.css('width', width);
+ var realWidth = e.width();
+ e.width(realWidth);
+ e.height(realWidth);
+ e.css('font-size', (realWidth / 40) + 'px');
+ };
+
+ // private interface methods
+ var setupHTML;
+ var wireFunctionality;
+ var create = function create() {
+ this.id = uhrGlobals.id++;
+ this.timer = null;
+ this.currentMinute = -1;
+ var userTime = this.options.time;
+ var hash, params;
+ if (this.options.time === undefined) {
+ this.options.time = new Date();
+ }
+ // parse the URL params
+ hash = window.location.hash;
+ if (hash !== undefined && typeof hash === 'string' && hash.charAt(0) === '#') {
+ hash = hash.substring(1);
+ hash = decodeURIComponent(hash);
+ params = hash.split('&');
+ params.forEach(function (element) {
+ var pair = element.split('=');
+ var key = pair[0];
+ var value = pair[1];
+ switch (key) {
+ case 'l':
+ case 'language':
+ this.options.language = value;
+ this.options.force = true;
+ break;
+ case 't':
+ case 'theme':
+ this.options.theme = value;
+ this.options.force = true;
+ break;
+ case 'm':
+ case 'mode':
+ this.options.mode = value;
+ this.options.force = true;
+ break;
+ case 's':
+ case 'status':
+ this.options.status = value;
+ this.options.force = true;
+ break;
+ }
+ }.bind(this));
+ }
+ // end parse the URL params
+ setupHTML.bind(this)();
+ wireFunctionality.bind(this)();
+ if (userTime !== undefined) {
+ this.time(userTime);
+ }
+ };
+ // private helper methods (not exported)
+ var toggleConfigScreen = function toggleConfigScreen() {
+ $('#uhr-controlpanel' + this.id).toggle('fast');
+ };
+ // set up
+ setupHTML = function setupHTML() {
+ var e = this.element;
+ // Base clock area
+ e.addClass('uhr');
+ e.empty();
+ e.append('');
+ e.append('');
+ e.append('');
+ e.append('');
+ e.append('');
+ e.append('');
+ setWidth.bind(this)(this.options.width);
+
+ if (this.options.controls) {
+ var controlpanel = $('');
+ var content = $('');
+ controlpanel.append(content);
+ // on/off switch
+ var toggleSwitch = $('');
+ toggleSwitch.append('');
+ toggleSwitch.append('');
+ content.append(toggleSwitch);
+
+ // time mode switch
+ var modeSwitch = $('');
+ modeSwitch.append('');
+ modeSwitch.append('');
+ content.append(modeSwitch);
+ // language chooser
+ if (uhrGlobals.languages.length > 1) {
+ var languageChooser = $('');
+ uhrGlobals.languages.forEach(function (item) {
+ languageChooser.append('');
+ });
+ content.append(languageChooser);
+ }
+
+ // theme chooser
+ if (uhrGlobals.themes.length > 1) {
+ var themeChooser = $('');
+ uhrGlobals.themes.forEach(function (item) {
+ themeChooser.append('');
+ });
+ content.append(themeChooser);
+ }
+ var closebutton = $('');
+ closebutton.on('click', function () {
+ $('#uhr-controlpanel' + this.id).hide('fast');
+ }.bind(this));
+ content.append(closebutton);
+ e.after(controlpanel);
+ controlpanel.hide();
+ var configlink = $('');
+ configlink.on('click', function () {
+ toggleConfigScreen.bind(this)();
+ }.bind(this));
+ e.after(configlink);
+ }
+ };
+ wireFunctionality = function wireFunctionality() {
+ // on/off switch
+ var toggleSwitch = $('#uhr-onoffswitch-checkbox' + this.id);
+ toggleSwitch.on('click', function () {
+ this.toggle();
+ }.bind(this));
+ var status = $.cookie('uhr-status' + this.id);
+ if (status === undefined || this.options.force) {
+ status = this.options.status;
+ }
+ toggleSwitch.prop('checked', status === 'on');
+ if (status === 'on') {
+ this.start();
+ } else {
+ this.stop();
+ }
+
+ // time mode switch
+ var modeSwitch = $('#uhr-modeswitch-checkbox' + this.id);
+ modeSwitch.on('click', function () {
+ if (this.options.mode === 'seconds') {
+ setMode.bind(this)('normal');
+ } else {
+ setMode.bind(this)('seconds');
+ }
+ }.bind(this));
+
+ var mode = $.cookie('uhr-mode' + this.id);
+ if (mode === undefined || this.options.force) {
+ mode = this.options.mode;
+ }
+ modeSwitch.prop('checked', mode !== 'seconds');
+ if (mode === 'seconds') {
+ setMode.bind(this)('seconds');
+ } else {
+ setMode.bind(this)('normal');
+ }
+
+ // language chooser
+ var languageChooser = $('#uhr-languagechooser' + this.id);
+ languageChooser.on('change', function () {
+ var languageKey = $('#uhr-languagechooser' + this.id).val();
+ this.language(languageKey);
+ }.bind(this));
+ var selectedLanguage = $.cookie('uhr-language' + this.id);
+ if (selectedLanguage === undefined || this.options.force) {
+ selectedLanguage = this.options.language;
+ }
+ var found = uhrGlobals.languages.some(function (item) {
+ return selectedLanguage === item.code;
+ });
+ if (!found) {
+ var fallbackLanguage;
+ if (uhrGlobals.languages.length > 0) {
+ fallbackLanguage = uhrGlobals.languages[0].code;
+ } else {
+ fallbackLanguage = '';
+ }
+ console.warn("Language '" + selectedLanguage + "' not found! Using fallback '" + fallbackLanguage + "'");
+ selectedLanguage = fallbackLanguage;
+ }
+ languageChooser.val(selectedLanguage);
+ this.options.language = "";
+ this.language(selectedLanguage);
+
+ // theme chooser
+ var themeChooser = $('#uhr-themechooser' + this.id);
+ themeChooser.on('change', function () {
+ var themeKey = $('#uhr-themechooser' + this.id).val();
+ this.theme(themeKey);
+ }.bind(this));
+ var selectedTheme = $.cookie('uhr-theme' + this.id);
+ if (selectedTheme === undefined || this.options.force) {
+ selectedTheme = this.options.theme;
+ }
+ found = uhrGlobals.themes.some(function (item) {
+ return selectedTheme === item.styleClass;
+ });
+ if (!found) {
+ var fallbackTheme = uhrGlobals.themes[0].styleClass;
+ console.warn("Theme '" + selectedTheme + "' not found! Using fallback '" + fallbackTheme + "'");
+ selectedTheme = fallbackTheme;
+ }
+ themeChooser.val(selectedTheme);
+ this.options.theme = "";
+ this.theme(selectedTheme);
+ if (this.options.autoresize) {
+ $(window).on('resize', function () {
+ var $e = this.element;
+ var $parent = $e.parent();
+ var $window = $(window);
+ var parentWidth = $parent.width();
+ var parentHeight = $parent.height();
+ var windowWidth = $window.width();
+ var windowHeight = $window.height();
+ var size = Math.min(parentWidth, parentHeight, windowWidth, windowHeight) + 'px';
+ setWidth.bind(this)(size);
+ }.bind(this));
+ }
+ };
+ var destroy = function destroy() {
+ this.timer = null;
+ $(this.element)
+ .removeAttr('style')
+ .removeAttr('class')
+ .empty();
+ $('#uhr-configlink' + this.id).remove();
+ $('#uhr-controlpanel' + this.id).remove();
+
+ };
+ setCookie = function setCookie(cookieName, cookieValue) {
+ var options = {};
+ if (this.options.cookiePath !== undefined) {
+ options = {expires: 365, path: this.options.cookiePath};
+ } else {
+ options = {expires: 365};
+ }
+ $.cookie(cookieName + this.id, cookieValue, options);
+ };
+
+ // business logic
+ isOn = function isOn() {
+ return this.timer !== null;
+ };
+ var show;
+ var clear;
+ update = function update() {
+ if (isOn.bind(this)()) {
+ var time = this.options.time;
+ if (!language.bind(this)().hasOwnProperty('seconds') && this.options.mode !== 'seconds') {
+ if (time.getMinutes() === this.currentMinute) {
+ return;
+ }
+ this.currentMinute = time.getMinutes();
+ }
+ show.bind(this)(time);
+ } else {
+ clear.bind(this)();
+ this.currentMinute = -1;
+ }
+ };
+ var highlight;
+ var getSecond;
+ var getDotMinute;
+ var getCoarseMinute;
+ var getHour;
+ show = function show(time) {
+ var second = getSecond.bind(this)(time);
+ var dotMinute = getDotMinute.bind(this)(time);
+ var hour = getHour.bind(this)(time);
+ var coarseMinute = getCoarseMinute.bind(this)(time);
+ clear.bind(this)();
+ if (this.options.mode === 'seconds') {
+ highlight.bind(this)('second' + second);
+ } else {
+ highlight.bind(this)('on');
+ for (var i = 1; i <= dotMinute; i++) {
+ highlight.bind(this)('dot' + i);
+ }
+ highlight.bind(this)('minute' + coarseMinute);
+ highlight.bind(this)('hour' + hour);
+ }
+ };
+ highlight = function highlight(itemClass) {
+ this.element.find('.item.' + itemClass).addClass('active');
+ };
+ clear = function clear() {
+ this.element.find('.item').removeClass('active');
+ };
+ getSecond = function getSecond(date) {
+ if (typeof language.bind(this)().getSeconds === 'function') {
+ return language.bind(this)().getSeconds(date);
+ }
+ return date.getSeconds();
+ };
+ getDotMinute = function getDotMinute(date) {
+ if (typeof language.bind(this)().getDotMinute === 'function') {
+ return language.bind(this)().getDotMinute(date);
+ }
+ var minutes = date.getMinutes();
+ return minutes % 5;
+ };
+ getCoarseMinute = function getCoarseMinute(date) {
+ if (typeof language.bind(this)().getCoarseMinute === 'function') {
+ return language.bind(this)().getCoarseMinute(date);
+ }
+ return date.getMinutes();
+ };
+ getHour = function getHour(date) {
+ if (typeof language.bind(this)().getHour === 'function') {
+ return language.bind(this)().getHour(date);
+ }
+ var hour = date.getHours();
+ if (date.getMinutes() >= 25) {
+ return (hour + 1) % 24;
+ }
+ return hour;
+ };
+ language = function language() {
+ var matchingLanguages = uhrGlobals.languages.filter(function (element) {
+ return (element.code === this.options.language);
+ }, this);
+ if (matchingLanguages.length > 0) {
+ return matchingLanguages[0];
+ }
+ // fallback: return empty object
+ return {};
+ };
+
+ $.widget("fritteli.uhr", {
+ "options": {
+ width: '100%',
+ status: 'on',
+ language: 'de_CH',
+ theme: uhrGlobals.themes[0].styleClass,
+ force: false,
+ controls: true,
+ cookiePath: undefined,
+ autoresize: true,
+ mode: 'normal'
+ },
+ "start": start,
+ "stop": stop,
+ "toggle": toggle,
+ "language": setLanguage,
+ "theme": setTheme,
+ "time": setTime,
+ "mode": setMode,
+ "width": setWidth,
+ // constructor method
+ "_create": create,
+ // destructor method
+ "_destroy": destroy
+ });
+ $.fritteli.uhr.register = uhrGlobals.registerLanguage;
})(jQuery);
(function($) {
'use strict';
- var es_ist = {1: [1, 2, 4, 5, 6]};
- var uhr = {10: [9, 10, 11]};
- var nach = {4: [8, 9, 10, 11]};
+ var es_isch = {1: [1, 2, 4, 5, 6, 7]};
+ var genau = {3: [7, 8, 9, 10, 11]};
+ var ab = {4: [4, 5]};
var vor = {4: [1, 2, 3]};
- var halb = {5: [1, 2, 3, 4]};
- var fuenf = {1: [8, 9, 10, 11]};
- var zehn = {2: [1, 2, 3, 4]};
- var viertel = {3: [5, 6, 7, 8, 9, 10, 11]};
- var zwanzig = {2: [5, 6, 7, 8, 9, 10, 11]};
- var dreiviertel = {3: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]};
-
+ var haubi = {4: [7, 8, 9, 10, 11]};
+ var fuef = {1: [9, 10, 11]};
+ var zae = {2: [9, 10, 11]};
+ var viertu = {2: [1, 2, 3, 4, 5, 6]};
+ var zwaenzg = {3: [1, 2, 3, 4, 5, 6]};
var layout = {
"version": 2,
- "language": 'Deutsch',
+ "language": 'Bärndütsch (genau)',
"letters": [
- 'ESKISTAFÜNF',
- 'ZEHNZWANZIG',
- 'DREIVIERTEL',
- 'VORFUNKNACH',
- 'HALBAELFÜNF',
- 'EINSXAMZWEI',
- 'DREIPMJVIER',
- 'SECHSNLACHT',
- 'SIEBENZWÖLF',
- 'ZEHNEUNKUHR'
+ 'ESKISCHAFÜF',
+ 'VIERTUBFZÄÄ',
+ 'ZWÄNZGGENAU',
+ 'VORABOHAUBI',
+ 'EISZWÖISDRÜ',
+ 'VIERIFÜFIQT',
+ 'SÄCHSISIBNI',
+ 'ACHTINÜNIEL',
+ 'ZÄNIERBEUFI',
+ 'ZWÖUFINAUHR'
],
- "permanent": es_ist,
+ "permanent": es_isch,
"minutes": {
- "0,1,2,3,4": uhr,
- "5,6,7,8,9": [fuenf, nach],
- "10,11,12,13,14": [zehn, nach],
- "15,16,17,18,19": [viertel, nach],
- "20,21,22,23,24": [zwanzig, nach],
- "25,26,27,28,29": [fuenf, vor, halb],
- "30,31,32,33,34": halb,
- "35,36,37,38,39": [fuenf, nach, halb],
- "40,41,42,43,44": [zwanzig, vor],
- "45,46,47,48,49": dreiviertel,
- "50,51,52,53,54": [zehn, vor],
- "55,56,57,58,59": [fuenf, vor]
+ "0": genau,
+ "5,6,7,8,9": [fuef, ab],
+ "10,11,12,13,14": [zae, ab],
+ "15,16,17,18,19": [viertu, ab],
+ "20,21,22,23,24": [zwaenzg, ab],
+ "25,26,27,28,29": [fuef, vor, haubi],
+ "30,31,32,33,34": haubi,
+ "35,36,37,38,39": [fuef, ab, haubi],
+ "40,41,42,43,44": [zwaenzg, vor],
+ "45,46,47,48,49": [viertu, vor],
+ "50,51,52,53,54": [zae, vor],
+ "55,56,57,58,59": [fuef, vor]
},
"hours": {
- "0,12": {9: [7, 8, 9, 10, 11]},
- "1,13": {6: [1, 2, 3, 4]},
- "2,14": {6: [8, 9, 10, 11]},
- "3,15": {7: [1, 2, 3, 4]},
- "4,16": {7: [8, 9, 10, 11]},
- "5,17": {5: [8, 9, 10, 11]},
- "6,18": {8: [1, 2, 3, 4, 5]},
- "7,19": {9: [1, 2, 3, 4, 5, 6]},
- "8,20": {8: [8, 9, 10, 11]},
- "9,21": {10: [4, 5, 6, 7]},
- "10,22": {10: [1, 2, 3, 4]},
- "11,23": {5: [6, 7, 8]}
+ "0,12": {10: [1, 2, 3, 4, 5, 6]},
+ "1,13": {5: [1, 2, 3]},
+ "2,14": {5: [4, 5, 6, 7]},
+ "3,15": {5: [9, 10, 11]},
+ "4,16": {6: [1, 2, 3, 4, 5]},
+ "5,17": {6: [6, 7, 8, 9]},
+ "6,18": {7: [1, 2, 3, 4, 5, 6]},
+ "7,19": {7: [7, 8, 9, 10, 11]},
+ "8,20": {8: [1, 2, 3, 4, 5]},
+ "9,21": {8: [6, 7, 8, 9]},
+ "10,22": {9: [1, 2, 3, 4]},
+ "11,23": {9: [8, 9, 10, 11]}
}
};
- $.fritteli.uhr.register('de', layout);
+ $.fritteli.uhr.register('de_CH_genau', layout);
}(jQuery));
(function($) {
'use strict';
@@ -930,61 +947,63 @@
}(jQuery));
(function($) {
'use strict';
- var es_isch = {1: [1, 2, 4, 5, 6, 7]};
- var genau = {3: [7, 8, 9, 10, 11]};
- var ab = {4: [4, 5]};
+ var es_ist = {1: [1, 2, 4, 5, 6]};
+ var uhr = {10: [9, 10, 11]};
+ var nach = {4: [8, 9, 10, 11]};
var vor = {4: [1, 2, 3]};
- var haubi = {4: [7, 8, 9, 10, 11]};
- var fuef = {1: [9, 10, 11]};
- var zae = {2: [9, 10, 11]};
- var viertu = {2: [1, 2, 3, 4, 5, 6]};
- var zwaenzg = {3: [1, 2, 3, 4, 5, 6]};
+ var halb = {5: [1, 2, 3, 4]};
+ var fuenf = {1: [8, 9, 10, 11]};
+ var zehn = {2: [1, 2, 3, 4]};
+ var viertel = {3: [5, 6, 7, 8, 9, 10, 11]};
+ var zwanzig = {2: [5, 6, 7, 8, 9, 10, 11]};
+ var dreiviertel = {3: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]};
+
var layout = {
"version": 2,
- "language": 'Bärndütsch (genau)',
+ "language": 'Deutsch',
"letters": [
- 'ESKISCHAFÜF',
- 'VIERTUBFZÄÄ',
- 'ZWÄNZGGENAU',
- 'VORABOHAUBI',
- 'EISZWÖISDRÜ',
- 'VIERIFÜFIQT',
- 'SÄCHSISIBNI',
- 'ACHTINÜNIEL',
- 'ZÄNIERBEUFI',
- 'ZWÖUFINAUHR'
+ 'ESKISTAFÜNF',
+ 'ZEHNZWANZIG',
+ 'DREIVIERTEL',
+ 'VORFUNKNACH',
+ 'HALBAELFÜNF',
+ 'EINSXAMZWEI',
+ 'DREIPMJVIER',
+ 'SECHSNLACHT',
+ 'SIEBENZWÖLF',
+ 'ZEHNEUNKUHR'
],
- "permanent": es_isch,
+ "permanent": es_ist,
"minutes": {
- "0": genau,
- "5,6,7,8,9": [fuef, ab],
- "10,11,12,13,14": [zae, ab],
- "15,16,17,18,19": [viertu, ab],
- "20,21,22,23,24": [zwaenzg, ab],
- "25,26,27,28,29": [fuef, vor, haubi],
- "30,31,32,33,34": haubi,
- "35,36,37,38,39": [fuef, ab, haubi],
- "40,41,42,43,44": [zwaenzg, vor],
- "45,46,47,48,49": [viertu, vor],
- "50,51,52,53,54": [zae, vor],
- "55,56,57,58,59": [fuef, vor]
+ "0,1,2,3,4": uhr,
+ "5,6,7,8,9": [fuenf, nach],
+ "10,11,12,13,14": [zehn, nach],
+ "15,16,17,18,19": [viertel, nach],
+ "20,21,22,23,24": [zwanzig, nach],
+ "25,26,27,28,29": [fuenf, vor, halb],
+ "30,31,32,33,34": halb,
+ "35,36,37,38,39": [fuenf, nach, halb],
+ "40,41,42,43,44": [zwanzig, vor],
+ "45,46,47,48,49": dreiviertel,
+ "50,51,52,53,54": [zehn, vor],
+ "55,56,57,58,59": [fuenf, vor]
},
"hours": {
- "0,12": {10: [1, 2, 3, 4, 5, 6]},
- "1,13": {5: [1, 2, 3]},
- "2,14": {5: [4, 5, 6, 7]},
- "3,15": {5: [9, 10, 11]},
- "4,16": {6: [1, 2, 3, 4, 5]},
- "5,17": {6: [6, 7, 8, 9]},
- "6,18": {7: [1, 2, 3, 4, 5, 6]},
- "7,19": {7: [7, 8, 9, 10, 11]},
- "8,20": {8: [1, 2, 3, 4, 5]},
- "9,21": {8: [6, 7, 8, 9]},
- "10,22": {9: [1, 2, 3, 4]},
- "11,23": {9: [8, 9, 10, 11]}
+ "0,12": {9: [7, 8, 9, 10, 11]},
+ "1,13": {6: [1, 2, 3, 4]},
+ "2,14": {6: [8, 9, 10, 11]},
+ "3,15": {7: [1, 2, 3, 4]},
+ "4,16": {7: [8, 9, 10, 11]},
+ "5,17": {5: [8, 9, 10, 11]},
+ "6,18": {8: [1, 2, 3, 4, 5]},
+ "7,19": {9: [1, 2, 3, 4, 5, 6]},
+ "8,20": {8: [8, 9, 10, 11]},
+ "9,21": {10: [4, 5, 6, 7]},
+ "10,22": {10: [1, 2, 3, 4]},
+ "11,23": {5: [6, 7, 8]}
}
};
- $.fritteli.uhr.register('de_CH_genau', layout);
+ $.fritteli.uhr.register('de', layout);
}(jQuery));
/*
This program is free software: you can redistribute it and/or modify
diff --git a/dist/jquery.uhr.complete.min.js b/dist/jquery.uhr.complete.min.js
deleted file mode 100644
index e8b059f..0000000
--- a/dist/jquery.uhr.complete.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! uhr - v8.0.4-dev.0 - 2016-06-27
-* http://bärneruhr.ch/
-* Copyright (c) 2016 Manuel Friedli; Licensed GPL-3.0 */
-!function(a){"use strict";function b(a,b){this.render=function(d){if(void 0===a.parsed)switch(a.version){case 2:var e=new c(a),f=e.parse();Object.defineProperty(a,"parsed",{value:f,writable:!1,configurable:!1});break;default:return void console.warn("Unknown layout version: '"+a.version+"'")}var g=a.parsed;b.fadeOut("fast",function(){b.empty(),g.forEach(function(a,c,d){a.forEach(function(a){b.append(a.toString())}),c")}),"function"==typeof d&&d(),b.fadeIn("fast")})}}function c(a){function b(a,b,d){"undefined"!=typeof d&&null!==d&&(Array.isArray(d)?d.forEach(function(d){c(a,b,d)}):c(a,b,d))}function c(a,b,c){"undefined"!=typeof c&&null!==c&&Object.keys(c).forEach(function(d){var e=c[d];e.forEach(function(c){a[d-1][c-1].addStyle(b)})})}function e(a,c,d){"undefined"!=typeof d&&null!==d&&Object.keys(d).forEach(function(e){var f=e.split(","),g=d[e];f.forEach(function(d){b(a,c+d,g)})})}var f={3:[2,3,4],4:[1,5],5:[1,4,5],6:[1,3,5],7:[1,2,5],8:[1,5],9:[2,3,4]},g={3:[8,9,10],4:[7,11],5:[7,10,11],6:[7,9,11],7:[7,8,11],8:[7,11],9:[8,9,10]},h={3:[3],4:[2,3],5:[3],6:[3],7:[3],8:[3],9:[2,3,4]},i={3:[9],4:[8,9],5:[9],6:[9],7:[9],8:[9],9:[8,9,10]},j={3:[2,3,4],4:[1,5],5:[5],6:[4],7:[3],8:[2],9:[1,2,3,4,5]},k={3:[8,9,10],4:[7,11],5:[11],6:[10],7:[9],8:[8],9:[7,8,9,10,11]},l={3:[1,2,3,4,5],4:[4],5:[3],6:[4],7:[5],8:[1,5],9:[2,3,4]},m={3:[7,8,9,10,11],4:[10],5:[9],6:[10],7:[11],8:[7,11],9:[8,9,10]},n={3:[4],4:[3,4],5:[2,4],6:[1,4],7:[1,2,3,4,5],8:[4],9:[4]},o={3:[10],4:[9,10],5:[8,10],6:[7,10],7:[7,8,9,10,11],8:[10],9:[10]},p={3:[1,2,3,4,5],4:[1],5:[1,2,3,4],6:[5],7:[5],8:[1,5],9:[2,3,4]},q={3:[7,8,9,10,11],4:[7],5:[7,8,9,10],6:[11],7:[11],8:[7,11],9:[8,9,10]},r={3:[9,10],4:[8],5:[7],6:[7,8,9,10],7:[7,11],8:[7,11],9:[8,9,10]},s={3:[7,8,9,10,11],4:[11],5:[10],6:[9],7:[8],8:[8],9:[8]},t={3:[8,9,10],4:[7,11],5:[7,11],6:[8,9,10],7:[7,11],8:[7,11],9:[8,9,10]},u={3:[8,9,10],4:[7,11],5:[7,11],6:[8,9,10,11],7:[11],8:[10],9:[8,9]},v={0:[f,g],1:[f,i],2:[f,k],3:[f,m],4:[f,o],5:[f,q],6:[f,r],7:[f,s],8:[f,t],9:[f,u],10:[h,g],11:[h,i],12:[h,k],13:[h,m],14:[h,o],15:[h,q],16:[h,r],17:[h,s],18:[h,t],19:[h,u],20:[j,g],21:[j,i],22:[j,k],23:[j,m],24:[j,o],25:[j,q],26:[j,r],27:[j,s],28:[j,t],29:[j,u],30:[l,g],31:[l,i],32:[l,k],33:[l,m],34:[l,o],35:[l,q],36:[l,r],37:[l,s],38:[l,t],39:[l,u],40:[n,g],41:[n,i],42:[n,k],43:[n,m],44:[n,o],45:[n,q],46:[n,r],47:[n,s],48:[n,t],49:[n,u],50:[p,g],51:[p,i],52:[p,k],53:[p,m],54:[p,o],55:[p,q],56:[p,r],57:[p,s],58:[p,t],59:[p,u]};this.parse=function(){var c=[];return a.letters.forEach(function(a){for(var b=[],e=0;e'+c+""}}var e={id:0,languages:[],themes:[],registerLanguage:function(a,b){var c=e.languages.some(function(c){return a===c.code&&(console.error("Error: Language code '"+a+"' cannot be registered for language '"+b.language+"' because it is already registered for language '"+c.language+"'!"),!0)});c||(b.code=a,e.languages.push(b))}};a("link[rel=stylesheet]").each(function(b,c){var d=a(c),f=d.attr("data-class");if(void 0!==f){var g=d.attr("data-name");void 0===g&&(g=f),e.themes.push({styleClass:f,name:g})}}),0===e.themes.length&&e.themes.push({});var f=function(){t.bind(this)()||(this.timer=window.setInterval(function(){this.options.time=new Date,u.bind(this)()}.bind(this),1e3),u.bind(this)(),s.bind(this)("uhr-status","on"))},g=function(){t.bind(this)()&&(window.clearInterval(this.timer),this.timer=null,u.bind(this)(),s.bind(this)("uhr-status","off"))},h=function(){t.bind(this)()?this.stop():this.start()},i=function(a){if(a!==this.options.language){this.options.language=a;var c=new b(C.bind(this)(),this.element.find(".letterarea"));c.render.bind(this)(function(){this.currentMinute=-1,u.bind(this)()}.bind(this)),s.bind(this)("uhr-language",a),u.bind(this)()}},j=function(b){b!==this.options.theme&&(this.element.removeClass(this.options.theme).addClass(b),a("#uhr-onoffswitch"+this.id).removeClass(this.options.theme).addClass(b),this.options.theme=b,s.bind(this)("uhr-theme",b))},k=function(a){this.currentMinute=-1,null===a?this.options.time=new Date:(null!==this.timer&&window.clearInterval(this.timer),this.options.time=a),u.bind(this)()},l=function(a){this.options.mode=a,this.currentMinute=-1,u.bind(this)(),s.bind(this)("uhr-mode",a)},m=function(a){var b=this.element;b.css("width",a);var c=b.width();b.width(c),b.height(c),b.css("font-size",c/40+"px")},n=function(){this.id=e.id++,this.timer=null,this.currentMinute=-1;var a,b,c=this.options.time;void 0===this.options.time&&(this.options.time=new Date),a=window.location.hash,void 0!==a&&"string"==typeof a&&"#"===a.charAt(0)&&(a=a.substring(1),a=decodeURIComponent(a),b=a.split("&"),b.forEach(function(a){var b=a.split("="),c=b[0],d=b[1];switch(c){case"l":case"language":this.options.language=d,this.options.force=!0;break;case"t":case"theme":this.options.theme=d,this.options.force=!0;break;case"m":case"mode":this.options.mode=d,this.options.force=!0;break;case"s":case"status":this.options.status=d,this.options.force=!0}}.bind(this))),p.bind(this)(),q.bind(this)(),void 0!==c&&this.time(c)},o=function(){a("#uhr-controlpanel"+this.id).toggle("fast")},p=function(){var b=this.element;if(b.addClass("uhr"),b.empty(),b.append(''),b.append(''),b.append(''),b.append(''),b.append(''),b.append(''),m.bind(this)(this.options.width),this.options.controls){var c=a(''),d=a('');c.append(d);var f=a('');f.append(''),f.append(''),d.append(f);var g=a('');if(g.append(''),g.append(''),d.append(g),e.languages.length>1){var h=a('');e.languages.forEach(function(a){h.append('")}),d.append(h)}if(e.themes.length>1){var i=a('');e.themes.forEach(function(a){i.append('")}),d.append(i)}var j=a('');j.on("click",function(){a("#uhr-controlpanel"+this.id).hide("fast")}.bind(this)),d.append(j),b.after(c),c.hide();var k=a('');k.on("click",function(){o.bind(this)()}.bind(this)),b.after(k)}},q=function(){var b=a("#uhr-onoffswitch-checkbox"+this.id);b.on("click",function(){this.toggle()}.bind(this));var c=a.cookie("uhr-status"+this.id);(void 0===c||this.options.force)&&(c=this.options.status),b.prop("checked","on"===c),"on"===c?this.start():this.stop();var d=a("#uhr-modeswitch-checkbox"+this.id);d.on("click",function(){"seconds"===this.options.mode?l.bind(this)("normal"):l.bind(this)("seconds")}.bind(this));var f=a.cookie("uhr-mode"+this.id);(void 0===f||this.options.force)&&(f=this.options.mode),d.prop("checked","seconds"!==f),"seconds"===f?l.bind(this)("seconds"):l.bind(this)("normal");var g=a("#uhr-languagechooser"+this.id);g.on("change",function(){var b=a("#uhr-languagechooser"+this.id).val();this.language(b)}.bind(this));var h=a.cookie("uhr-language"+this.id);(void 0===h||this.options.force)&&(h=this.options.language);var i=e.languages.some(function(a){return h===a.code});if(!i){var j;j=e.languages.length>0?e.languages[0].code:"",console.warn("Language '"+h+"' not found! Using fallback '"+j+"'"),h=j}g.val(h),this.options.language="",this.language(h);var k=a("#uhr-themechooser"+this.id);k.on("change",function(){var b=a("#uhr-themechooser"+this.id).val();this.theme(b)}.bind(this));var n=a.cookie("uhr-theme"+this.id);if((void 0===n||this.options.force)&&(n=this.options.theme),i=e.themes.some(function(a){return n===a.styleClass}),!i){var o=e.themes[0].styleClass;console.warn("Theme '"+n+"' not found! Using fallback '"+o+"'"),n=o}k.val(n),this.options.theme="",this.theme(n),this.options.autoresize&&a(window).on("resize",function(){var b=this.element,c=b.parent(),d=a(window),e=c.width(),f=c.height(),g=d.width(),h=d.height(),i=Math.min(e,f,g,h)+"px";m.bind(this)(i)}.bind(this))},r=function(){this.timer=null,a(this.element).removeAttr("style").removeAttr("class").empty(),a("#uhr-configlink"+this.id).remove(),a("#uhr-controlpanel"+this.id).remove()},s=function(b,c){var d={};d=void 0!==this.options.cookiePath?{expires:365,path:this.options.cookiePath}:{expires:365},a.cookie(b+this.id,c,d)},t=function(){return null!==this.timer},u=function(){if(t.bind(this)()){var a=this.options.time;if(!C.bind(this)().hasOwnProperty("seconds")&&"seconds"!==this.options.mode){if(a.getMinutes()===this.currentMinute)return;this.currentMinute=a.getMinutes()}v.bind(this)(a)}else x.bind(this)(),this.currentMinute=-1},v=function(a){var b=y.bind(this)(a),c=z.bind(this)(a),d=B.bind(this)(a),e=A.bind(this)(a);if(x.bind(this)(),"seconds"===this.options.mode)w.bind(this)("second"+b);else{w.bind(this)("on");for(var f=1;f<=c;f++)w.bind(this)("dot"+f);w.bind(this)("minute"+e),w.bind(this)("hour"+d)}},w=function(a){this.element.find(".item."+a).addClass("active")},x=function(){this.element.find(".item").removeClass("active")},y=function(a){return"function"==typeof C.bind(this)().getSeconds?C.bind(this)().getSeconds(a):a.getSeconds()},z=function(a){if("function"==typeof C.bind(this)().getDotMinute)return C.bind(this)().getDotMinute(a);var b=a.getMinutes();return b%5},A=function(a){return"function"==typeof C.bind(this)().getCoarseMinute?C.bind(this)().getCoarseMinute(a):a.getMinutes()},B=function(a){if("function"==typeof C.bind(this)().getHour)return C.bind(this)().getHour(a);var b=a.getHours();return a.getMinutes()>=25?(b+1)%24:b},C=function(){var a=e.languages.filter(function(a){return a.code===this.options.language},this);return a.length>0?a[0]:{}};a.widget("fritteli.uhr",{options:{width:"100%",status:"on",language:"de_CH",theme:e.themes[0].styleClass,force:!1,controls:!0,cookiePath:void 0,autoresize:!0,mode:"normal"},start:f,stop:g,toggle:h,language:i,theme:j,time:k,mode:l,width:m,_create:n,_destroy:r}),a.fritteli.uhr.register=e.registerLanguage}(jQuery),function(a){"use strict";var b={1:[1,2,4,5,6]},c={10:[9,10,11]},d={4:[8,9,10,11]},e={4:[1,2,3]},f={5:[1,2,3,4]},g={1:[8,9,10,11]},h={2:[1,2,3,4]},i={3:[5,6,7,8,9,10,11]},j={2:[5,6,7,8,9,10,11]},k={3:[1,2,3,4,5,6,7,8,9,10,11]},l={version:2,language:"Deutsch",letters:["ESKISTAFÜNF","ZEHNZWANZIG","DREIVIERTEL","VORFUNKNACH","HALBAELFÜNF","EINSXAMZWEI","DREIPMJVIER","SECHSNLACHT","SIEBENZWÖLF","ZEHNEUNKUHR"],permanent:b,minutes:{"0,1,2,3,4":c,"5,6,7,8,9":[g,d],"10,11,12,13,14":[h,d],"15,16,17,18,19":[i,d],"20,21,22,23,24":[j,d],"25,26,27,28,29":[g,e,f],"30,31,32,33,34":f,"35,36,37,38,39":[g,d,f],"40,41,42,43,44":[j,e],"45,46,47,48,49":k,"50,51,52,53,54":[h,e],"55,56,57,58,59":[g,e]},hours:{"0,12":{9:[7,8,9,10,11]},"1,13":{6:[1,2,3,4]},"2,14":{6:[8,9,10,11]},"3,15":{7:[1,2,3,4]},"4,16":{7:[8,9,10,11]},"5,17":{5:[8,9,10,11]},"6,18":{8:[1,2,3,4,5]},"7,19":{9:[1,2,3,4,5,6]},"8,20":{8:[8,9,10,11]},"9,21":{10:[4,5,6,7]},"10,22":{10:[1,2,3,4]},"11,23":{5:[6,7,8]}}};a.fritteli.uhr.register("de",l)}(jQuery),function(a){"use strict";var b={1:[1,2,4,5,6,7]},c={4:[1,2]},d={3:[9,10,11]},e={4:[4,5,6,7,8]},f={1:[9,10,11]},g={2:[9,10,11]},h={2:[1,2,3,4,5,6]},i={3:[1,2,3,4,5,6]},j={version:2,language:"Bärndütsch",letters:["ESKISCHAFÜF","VIERTUBFZÄÄ","ZWÄNZGSIVOR","ABOHAUBIEGE","EISZWÖISDRÜ","VIERIFÜFIQT","SÄCHSISIBNI","ACHTINÜNIEL","ZÄNIERBEUFI","ZWÖUFINAUHR"],permanent:b,minutes:{"5,6,7,8,9":[f,c],"10,11,12,13,14":[g,c],"15,16,17,18,19":[h,c],"20,21,22,23,24":[i,c],"25,26,27,28,29":[f,d,e],"30,31,32,33,34":e,"35,36,37,38,39":[f,c,e],"40,41,42,43,44":[i,d],"45,46,47,48,49":[h,d],"50,51,52,53,54":[g,d],"55,56,57,58,59":[f,d]},hours:{"0,12":{10:[1,2,3,4,5,6]},"1,13":{5:[1,2,3]},"2,14":{5:[4,5,6,7]},"3,15":{5:[9,10,11]},"4,16":{6:[1,2,3,4,5]},"5,17":{6:[6,7,8,9]},"6,18":{7:[1,2,3,4,5,6]},"7,19":{7:[7,8,9,10,11]},"8,20":{8:[1,2,3,4,5]},"9,21":{8:[6,7,8,9]},"10,22":{9:[1,2,3,4]},"11,23":{9:[8,9,10,11]}}};a.fritteli.uhr.register("de_CH",j)}(jQuery),function(a){"use strict";var b={1:[1,2,4,5,6,7]},c={3:[7,8,9,10,11]},d={4:[4,5]},e={4:[1,2,3]},f={4:[7,8,9,10,11]},g={1:[9,10,11]},h={2:[9,10,11]},i={2:[1,2,3,4,5,6]},j={3:[1,2,3,4,5,6]},k={version:2,language:"Bärndütsch (genau)",letters:["ESKISCHAFÜF","VIERTUBFZÄÄ","ZWÄNZGGENAU","VORABOHAUBI","EISZWÖISDRÜ","VIERIFÜFIQT","SÄCHSISIBNI","ACHTINÜNIEL","ZÄNIERBEUFI","ZWÖUFINAUHR"],permanent:b,minutes:{0:c,"5,6,7,8,9":[g,d],"10,11,12,13,14":[h,d],"15,16,17,18,19":[i,d],"20,21,22,23,24":[j,d],"25,26,27,28,29":[g,e,f],"30,31,32,33,34":f,"35,36,37,38,39":[g,d,f],"40,41,42,43,44":[j,e],"45,46,47,48,49":[i,e],"50,51,52,53,54":[h,e],"55,56,57,58,59":[g,e]},hours:{"0,12":{10:[1,2,3,4,5,6]},"1,13":{5:[1,2,3]},"2,14":{5:[4,5,6,7]},"3,15":{5:[9,10,11]},"4,16":{6:[1,2,3,4,5]},"5,17":{6:[6,7,8,9]},"6,18":{7:[1,2,3,4,5,6]},"7,19":{7:[7,8,9,10,11]},"8,20":{8:[1,2,3,4,5]},"9,21":{8:[6,7,8,9]},"10,22":{9:[1,2,3,4]},"11,23":{9:[8,9,10,11]}}};a.fritteli.uhr.register("de_CH_genau",k)}(jQuery),function(a){"use strict";var b={1:[1,2,3,4,5,6,7,9,10]},c={4:[4,5,6,7,8,9,10,11]},d={5:[8]},e={5:[4,5,6,7]},f={2:[1,2,3]},g={4:[1,2]},h={3:[4,5,6,7,8]},i={2:[4,5,6,7]},j={6:[8,9,10,11]},k={version:2,language:"Dansk",letters:["KLOKKENVERO","FEMTYVESKLA","OJEKVARTVAT","TIAMINUTTER","VEMOVERILMF","MONALISHALV","ETTOTREFIRE","FEMSEKSRSYV","OTTERNIMETI","ELLEVEATOLV"],permanent:b,minutes:{"5,6,7,8,9":[f,c,e],"10,11,12,13,14":[g,c,e],"15,16,17,18,19":[h,e],"20,21,22,23,24":[i,c,e],"25,26,27,28,29":[f,c,d,j],"30,31,32,33,34":[j],"35,36,37,38,39":[f,c,e,j],"40,41,42,43,44":[i,c,d],"45,46,47,48,49":[h,d],"50,51,52,53,54":[g,c,d],"55,56,57,58,59":[f,c,d]},hours:{"0,12":{10:[8,9,10,11]},"1,13":{7:[1,2]},"2,14":{7:[3,4]},"3,15":{7:[5,6,7]},"4,16":{7:[8,9,10,11]},"5,17":{8:[1,2,3]},"6,18":{8:[4,5,6,7]},"7,19":{8:[9,10,11]},"8,20":{9:[1,2,3,4]},"9,21":{9:[6,7]},"10,22":{9:[10,11]},"11,23":{10:[1,2,3,4,5,6]}},getHour:function(a){var b=a.getHours();return a.getMinutes()>=25?(b+1)%24:b}};a.fritteli.uhr.register("dk",k)}(jQuery),function(a){"use strict";var b={1:[1,2,4,5]},c={4:[1,2,3,4]},d={4:[10,11]},e={5:[1,2,3,4]},f={10:[5,6,7,8,9,10,11]},g={3:[7,8,9,10]},h={4:[6,7,8]},i={2:[1,3,4,5,6,7,8,9]},j={3:[1,2,3,4,5,6]},k={3:[1,2,3,4,5,6,7,8,9,10]},l={version:2,language:"English",letters:["ITLISBFAMPM","ACQUARTERDC","TWENTYFIVEX","HALFBTENFTO","PASTERUNINE","ONESIXTHREE","FOURFIVETWO","EIGHTELEVEN","SEVENTWELVE","TENSO'CLOCK"],permanent:b,minutes:{"0,1,2,3,4":f,"5,6,7,8,9":[g,e],"10,11,12,13,14":[h,e],"15,16,17,18,19":[i,e],"20,21,22,23,24":[j,e],"25,26,27,28,29":[k,e],"30,31,32,33,34":[c,e],"35,36,37,38,39":[k,d],"40,41,42,43,44":[j,d],"45,46,47,48,49":[i,d],"50,51,52,53,54":[h,d],"55,56,57,58,59":[g,d]},hours:{"0,12":{9:[6,7,8,9,10,11]},"1,13":{6:[1,2,3]},"2,14":{7:[9,10,11]},"3,15":{6:[7,8,9,10,11]},"4,16":{7:[1,2,3,4]},"5,17":{7:[5,6,7,8]},"6,18":{6:[4,5,6]},"7,19":{9:[1,2,3,4,5]},"8,20":{8:[1,2,3,4,5]},"9,21":{5:[8,9,10,11]},"10,22":{10:[1,2,3]},"11,23":{8:[6,7,8,9,10,11]}},getHour:function(a){var b=a.getHours();return a.getMinutes()>=35?(b+1)%24:b}};a.fritteli.uhr.register("en",l)}(jQuery),function(a){"use strict";var b={1:[1,2,6,7]},c={1:[2,3,4,6,7,8]},d={7:[6]},e={7:[7,8,9,10,11]},f={10:[1,2,3,4,5]},g={9:[7,8,9,10,11]},h={8:[8,9,10,11]},i={10:[6,7,8,9,10,11]},j={8:[2,3,4,5,6,7]},k={9:[1,2,3,4,5,6,7,8,9,10,11]},l={version:2,language:"Español",letters:["ESONELASUNA","DOSITRESORE","CUATROCINCO","SEISASIETEN","OCHONUEVEYO","LADIEZSONCE","DOCELYMENOS","OVEINTEDIEZ","VEINTICINCO","MEDIACUARTO"],permanent:[],minutes:{"5,6,7,8,9":[d,g],"10,11,12,13,14":[d,h],"15,16,17,18,19":[d,i],"20,21,22,23,24":[d,j],"25,26,27,28,29":[d,k],"30,31,32,33,34":[d,f],"35,36,37,38,39":[e,k],"40,41,42,43,44":[e,j],"45,46,47,48,49":[e,i],"50,51,52,53,54":[e,h],"55,56,57,58,59":[e,g]},hours:{"0,12":[c,{7:[1,2,3,4]}],"1,13":[b,{1:[9,10,11]}],"2,14":[c,{2:[1,2,3]}],"3,15":[c,{2:[5,6,7,8]}],"4,16":[c,{3:[1,2,3,4,5,6]}],"5,17":[c,{3:[7,8,9,10,11]}],"6,18":[c,{4:[1,2,3,4]}],"7,19":[c,{4:[6,7,8,9,10]}],"8,20":[c,{5:[1,2,3,4]}],"9,21":[c,{5:[5,6,7,8,9]}],"10,22":[c,{6:[3,4,5,6]}],"11,23":[c,{6:[8,9,10,11]}]},getHour:function(a){var b=a.getHours();return a.getMinutes()>=35?(b+1)%24:b}};a.fritteli.uhr.register("es",l)}(jQuery),function(a){"use strict";var b={1:[1,2,4,5,6]},c={8:[1,2]},d={7:[1,2,3,4,5]},e={10:[4,5,6,7,8]},f={6:[6,7,8,9,10,11]},g={7:[7,8]},h={9:[7,8,9,10]},i={7:[9,10,11]},j={8:[4,5,6,7,8]},k={9:[1,2,3,4,5]},l={9:[1,2,3,4,5,6,7,8,9,10]},m={version:2,language:"Français",letters:["ILNESTODEUX","QUATRETROIS","NEUFUNESEPT","HUITSIXCINQ","MIDIXMINUIT","ONZERHEURES","MOINSOLEDIX","ETRQUARTPMD","VINGT-CINQU","ETSDEMIEPAM"],permanent:b,minutes:{"5,6,7,8,9":h,"10,11,12,13,14":i,"15,16,17,18,19":[c,j],"20,21,22,23,24":k,"25,26,27,28,29":l,"30,31,32,33,34":[c,e],"35,36,37,38,39":[d,l],"40,41,42,43,44":[d,k],"45,46,47,48,49":[d,g,j],"50,51,52,53,54":[d,i],"55,56,57,58,59":[d,h]},hours:{0:{5:[6,7,8,9,10,11]},"1,13":[{3:[5,6,7]},f],"2,14":[{1:[8,9,10,11]},f],"3,15":[{2:[7,8,9,10,11]},f],"4,16":[{2:[1,2,3,4,5,6]},f],"5,17":[{4:[8,9,10,11]},f],"6,18":[{4:[5,6,7]},f],"7,19":[{3:[8,9,10,11]},f],"8,20":[{4:[1,2,3,4]},f],"9,21":[{3:[1,2,3,4]},f],"10,22":[{5:[3,4,5]},f],"11,23":[{6:[1,2,3,4]},f],12:{5:[1,2,3,4]}},getHour:function(a){var b=a.getHours();return a.getMinutes()>=35?(b+1)%24:b}};a.fritteli.uhr.register("fr",m)}(jQuery),function(a){"use strict";var b={1:[1,2,3,4,6,7]},c={2:[1,3,4]},d={8:[1]},e={7:[8,9,10,11]},f={10:[7,8,9,10,11]},g={9:[6,7,8,9,10,11]},h={10:[1,2,3,4,5]},i={8:[3,4,6,7,8,9,10,11]},j={9:[1,2,3,4,5]},k={9:[1,2,3,4,5,6,7,8,9,10,11]},l={version:2,language:"Italiano",letters:["SONORLEBORE","ÈRL'UNASDUE","TREOTTONOVE","DIECIUNDICI","DODICISETTE","QUATTROCSEI","CINQUEAMENO","ECUNOQUARTO","VENTICINQUE","DIECIPMEZZA"],permanent:[],minutes:{"5,6,7,8,9":[d,g],"10,11,12,13,14":[d,h],"15,16,17,18,19":[d,i],"20,21,22,23,24":[d,j],"25,26,27,28,29":[d,k],"30,31,32,33,34":[d,f],"35,36,37,38,39":[e,k],"40,41,42,43,44":[e,j],"45,46,47,48,49":[e,i],"50,51,52,53,54":[e,h],"55,56,57,58,59":[e,g]},hours:{"0,12":[b,{5:[1,2,3,4,5,6]}],"1,13":[c,{2:[5,6,7]}],"2,14":[b,{2:[9,10,11]}],"3,15":[b,{3:[1,2,3]}],"4,16":[b,{6:[1,2,3,4,5,6,7]}],"5,17":[b,{7:[1,2,3,4,5,6]}],"6,18":[b,{6:[9,10,11]}],"7,19":[b,{5:[7,8,9,10,11]}],"8,20":[b,{3:[4,5,6,7]}],"9,21":[b,{3:[8,9,10,11]}],"10,22":[b,{4:[1,2,3,4,5]}],"11,23":[b,{4:[6,7,8,9,10,11]}]},getHour:function(a){var b=a.getHours();return a.getMinutes()>=35?(b+1)%24:b}};a.fritteli.uhr.register("it",l)}(jQuery),function(a){"use strict";var b={1:[1,2,3,5,6]},c={3:[1,2,3,4]},d={2:[8,9,10,11]},e={4:[8,9,10,11]},f={5:[1,2,3,4]},g={4:[1,2,3,4]},h={1:[8,9,10,11]},i={2:[1,2,3,4]},j={3:[7,8,9,10,11]},k={10:[9,10,11]},l={version:2,language:"Nederlands",letters:["HETKISAVIJF","TIENBTZVOOR","OVERMEKWART","HALFSPWOVER","VOORTHGEENS","TWEEPVCDRIE","VIERVIJFZES","ZEVENONEGEN","ACHTTIENELF","TWAALFBFUUR"],permanent:b,minutes:{"0,1,2,3,4":k,"5,6,7,8,9":[h,c],"10,11,12,13,14":[i,c],"15,16,17,18,19":[j,e],"20,21,22,23,24":[i,d,g],"25,26,27,28,29":[h,d,g],"30,31,32,33,34":g,"35,36,37,38,39":[h,c,g],"40,41,42,43,44":[i,c,g],"45,46,47,48,49":[j,f],"50,51,52,53,54":[i,d],"55,56,57,58,59":[h,d]},hours:{"0,12":{10:[1,2,3,4,5,6]},"1,13":{5:[8,9,10]},"2,14":{6:[1,2,3,4]},"3,15":{6:[8,9,10,11]},"4,16":{7:[1,2,3,4]},"5,17":{7:[5,6,7,8]},"6,18":{7:[9,10,11]},"7,19":{8:[1,2,3,4,5]},"8,20":{9:[1,2,3,4]},"9,21":{8:[7,8,9,10,11]},"10,22":{9:[5,6,7,8]},"11,23":{9:[9,10,11]}},getHour:function(a){var b=a.getHours();return a.getMinutes()>=20?(b+1)%24:b}};a.fritteli.uhr.register("nl",l)}(jQuery),function(a){"use strict";var b={1:[1]},c={1:[2,3,4]},d={7:[8]},e={10:[5]},f={7:[7,8,9,10,11]},g={8:[8,9,10,11]},h={10:[7,8,9,10,11]},i={10:[1,2,3]},j={9:[1,2,4,5,6,7,8,9]},k={8:[1,2,3,4,5]},l={version:2,language:"Português",letters:["ÉSÃOUMATRÊS","MEIOLDIADEZ","DUASEISETEY","QUATROHNOVE","CINCOITONZE","ZMEIALNOITE","HORASYMENOS","VINTECAMEIA","UMVQUARTOPM","DEZOEYCINCO"],minutes:{"5,6,7,8,9":[d,h],"10,11,12,13,14":[d,i],"15,16,17,18,19":[d,j],"20,21,22,23,24":[d,k],"25,26,27,28,29":[d,k,e,h],"30,31,32,33,34":[d,g],"35,36,37,38,39":[f,k,e,h],"40,41,42,43,44":[f,k],"45,46,47,48,49":[f,j],"50,51,52,53,54":[f,i],"55,56,57,58,59":[f,h]},hours:{0:[b,{6:[2,3,4,5,7,8,9,10,11]}],12:[b,{2:[1,2,3,4,6,7,8]}],"1,13":[b,{1:[5,6,7]}],"2,14":[c,{3:[1,2,3,4]}],"3,15":[c,{1:[8,9,10,11]}],"4,16":[c,{4:[1,2,3,4,5,6]}],"5,17":[c,{5:[1,2,3,4,5]}],"6,18":[c,{3:[4,5,6,7]}],"7,19":[c,{3:[7,8,9,10]}],"8,20":[c,{5:[5,6,7,8]}],"9,21":[c,{4:[8,9,10,11]}],"10,22":[c,{2:[9,10,11]}],"11,23":[c,{5:[8,9,10,11]}]},getHour:function(a){var b=a.getHours();return a.getMinutes()>=35?(b+1)%24:b}};a.fritteli.uhr.register("pt",l)}(jQuery);
\ No newline at end of file
diff --git a/dist/jquery.uhr.langs.js b/dist/jquery.uhr.langs.js
index a8ab4c2..cd791da 100644
--- a/dist/jquery.uhr.langs.js
+++ b/dist/jquery.uhr.langs.js
@@ -1,65 +1,63 @@
-/*! uhr - v8.0.4-dev.0 - 2016-06-27
+/*! uhr - v8.0.4-dev.0 - 2019-05-03
* http://bärneruhr.ch/
-* Copyright (c) 2016 Manuel Friedli; Licensed GPL-3.0 */
+* Copyright (c) 2019 Manuel Friedli; Licensed GPL-3.0 */
(function($) {
'use strict';
- var es_ist = {1: [1, 2, 4, 5, 6]};
- var uhr = {10: [9, 10, 11]};
- var nach = {4: [8, 9, 10, 11]};
+ var es_isch = {1: [1, 2, 4, 5, 6, 7]};
+ var genau = {3: [7, 8, 9, 10, 11]};
+ var ab = {4: [4, 5]};
var vor = {4: [1, 2, 3]};
- var halb = {5: [1, 2, 3, 4]};
- var fuenf = {1: [8, 9, 10, 11]};
- var zehn = {2: [1, 2, 3, 4]};
- var viertel = {3: [5, 6, 7, 8, 9, 10, 11]};
- var zwanzig = {2: [5, 6, 7, 8, 9, 10, 11]};
- var dreiviertel = {3: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]};
-
+ var haubi = {4: [7, 8, 9, 10, 11]};
+ var fuef = {1: [9, 10, 11]};
+ var zae = {2: [9, 10, 11]};
+ var viertu = {2: [1, 2, 3, 4, 5, 6]};
+ var zwaenzg = {3: [1, 2, 3, 4, 5, 6]};
var layout = {
"version": 2,
- "language": 'Deutsch',
+ "language": 'Bärndütsch (genau)',
"letters": [
- 'ESKISTAFÜNF',
- 'ZEHNZWANZIG',
- 'DREIVIERTEL',
- 'VORFUNKNACH',
- 'HALBAELFÜNF',
- 'EINSXAMZWEI',
- 'DREIPMJVIER',
- 'SECHSNLACHT',
- 'SIEBENZWÖLF',
- 'ZEHNEUNKUHR'
+ 'ESKISCHAFÜF',
+ 'VIERTUBFZÄÄ',
+ 'ZWÄNZGGENAU',
+ 'VORABOHAUBI',
+ 'EISZWÖISDRÜ',
+ 'VIERIFÜFIQT',
+ 'SÄCHSISIBNI',
+ 'ACHTINÜNIEL',
+ 'ZÄNIERBEUFI',
+ 'ZWÖUFINAUHR'
],
- "permanent": es_ist,
+ "permanent": es_isch,
"minutes": {
- "0,1,2,3,4": uhr,
- "5,6,7,8,9": [fuenf, nach],
- "10,11,12,13,14": [zehn, nach],
- "15,16,17,18,19": [viertel, nach],
- "20,21,22,23,24": [zwanzig, nach],
- "25,26,27,28,29": [fuenf, vor, halb],
- "30,31,32,33,34": halb,
- "35,36,37,38,39": [fuenf, nach, halb],
- "40,41,42,43,44": [zwanzig, vor],
- "45,46,47,48,49": dreiviertel,
- "50,51,52,53,54": [zehn, vor],
- "55,56,57,58,59": [fuenf, vor]
+ "0": genau,
+ "5,6,7,8,9": [fuef, ab],
+ "10,11,12,13,14": [zae, ab],
+ "15,16,17,18,19": [viertu, ab],
+ "20,21,22,23,24": [zwaenzg, ab],
+ "25,26,27,28,29": [fuef, vor, haubi],
+ "30,31,32,33,34": haubi,
+ "35,36,37,38,39": [fuef, ab, haubi],
+ "40,41,42,43,44": [zwaenzg, vor],
+ "45,46,47,48,49": [viertu, vor],
+ "50,51,52,53,54": [zae, vor],
+ "55,56,57,58,59": [fuef, vor]
},
"hours": {
- "0,12": {9: [7, 8, 9, 10, 11]},
- "1,13": {6: [1, 2, 3, 4]},
- "2,14": {6: [8, 9, 10, 11]},
- "3,15": {7: [1, 2, 3, 4]},
- "4,16": {7: [8, 9, 10, 11]},
- "5,17": {5: [8, 9, 10, 11]},
- "6,18": {8: [1, 2, 3, 4, 5]},
- "7,19": {9: [1, 2, 3, 4, 5, 6]},
- "8,20": {8: [8, 9, 10, 11]},
- "9,21": {10: [4, 5, 6, 7]},
- "10,22": {10: [1, 2, 3, 4]},
- "11,23": {5: [6, 7, 8]}
+ "0,12": {10: [1, 2, 3, 4, 5, 6]},
+ "1,13": {5: [1, 2, 3]},
+ "2,14": {5: [4, 5, 6, 7]},
+ "3,15": {5: [9, 10, 11]},
+ "4,16": {6: [1, 2, 3, 4, 5]},
+ "5,17": {6: [6, 7, 8, 9]},
+ "6,18": {7: [1, 2, 3, 4, 5, 6]},
+ "7,19": {7: [7, 8, 9, 10, 11]},
+ "8,20": {8: [1, 2, 3, 4, 5]},
+ "9,21": {8: [6, 7, 8, 9]},
+ "10,22": {9: [1, 2, 3, 4]},
+ "11,23": {9: [8, 9, 10, 11]}
}
};
- $.fritteli.uhr.register('de', layout);
+ $.fritteli.uhr.register('de_CH_genau', layout);
}(jQuery));
(function($) {
'use strict';
@@ -146,61 +144,63 @@
}(jQuery));
(function($) {
'use strict';
- var es_isch = {1: [1, 2, 4, 5, 6, 7]};
- var genau = {3: [7, 8, 9, 10, 11]};
- var ab = {4: [4, 5]};
+ var es_ist = {1: [1, 2, 4, 5, 6]};
+ var uhr = {10: [9, 10, 11]};
+ var nach = {4: [8, 9, 10, 11]};
var vor = {4: [1, 2, 3]};
- var haubi = {4: [7, 8, 9, 10, 11]};
- var fuef = {1: [9, 10, 11]};
- var zae = {2: [9, 10, 11]};
- var viertu = {2: [1, 2, 3, 4, 5, 6]};
- var zwaenzg = {3: [1, 2, 3, 4, 5, 6]};
+ var halb = {5: [1, 2, 3, 4]};
+ var fuenf = {1: [8, 9, 10, 11]};
+ var zehn = {2: [1, 2, 3, 4]};
+ var viertel = {3: [5, 6, 7, 8, 9, 10, 11]};
+ var zwanzig = {2: [5, 6, 7, 8, 9, 10, 11]};
+ var dreiviertel = {3: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]};
+
var layout = {
"version": 2,
- "language": 'Bärndütsch (genau)',
+ "language": 'Deutsch',
"letters": [
- 'ESKISCHAFÜF',
- 'VIERTUBFZÄÄ',
- 'ZWÄNZGGENAU',
- 'VORABOHAUBI',
- 'EISZWÖISDRÜ',
- 'VIERIFÜFIQT',
- 'SÄCHSISIBNI',
- 'ACHTINÜNIEL',
- 'ZÄNIERBEUFI',
- 'ZWÖUFINAUHR'
+ 'ESKISTAFÜNF',
+ 'ZEHNZWANZIG',
+ 'DREIVIERTEL',
+ 'VORFUNKNACH',
+ 'HALBAELFÜNF',
+ 'EINSXAMZWEI',
+ 'DREIPMJVIER',
+ 'SECHSNLACHT',
+ 'SIEBENZWÖLF',
+ 'ZEHNEUNKUHR'
],
- "permanent": es_isch,
+ "permanent": es_ist,
"minutes": {
- "0": genau,
- "5,6,7,8,9": [fuef, ab],
- "10,11,12,13,14": [zae, ab],
- "15,16,17,18,19": [viertu, ab],
- "20,21,22,23,24": [zwaenzg, ab],
- "25,26,27,28,29": [fuef, vor, haubi],
- "30,31,32,33,34": haubi,
- "35,36,37,38,39": [fuef, ab, haubi],
- "40,41,42,43,44": [zwaenzg, vor],
- "45,46,47,48,49": [viertu, vor],
- "50,51,52,53,54": [zae, vor],
- "55,56,57,58,59": [fuef, vor]
+ "0,1,2,3,4": uhr,
+ "5,6,7,8,9": [fuenf, nach],
+ "10,11,12,13,14": [zehn, nach],
+ "15,16,17,18,19": [viertel, nach],
+ "20,21,22,23,24": [zwanzig, nach],
+ "25,26,27,28,29": [fuenf, vor, halb],
+ "30,31,32,33,34": halb,
+ "35,36,37,38,39": [fuenf, nach, halb],
+ "40,41,42,43,44": [zwanzig, vor],
+ "45,46,47,48,49": dreiviertel,
+ "50,51,52,53,54": [zehn, vor],
+ "55,56,57,58,59": [fuenf, vor]
},
"hours": {
- "0,12": {10: [1, 2, 3, 4, 5, 6]},
- "1,13": {5: [1, 2, 3]},
- "2,14": {5: [4, 5, 6, 7]},
- "3,15": {5: [9, 10, 11]},
- "4,16": {6: [1, 2, 3, 4, 5]},
- "5,17": {6: [6, 7, 8, 9]},
- "6,18": {7: [1, 2, 3, 4, 5, 6]},
- "7,19": {7: [7, 8, 9, 10, 11]},
- "8,20": {8: [1, 2, 3, 4, 5]},
- "9,21": {8: [6, 7, 8, 9]},
- "10,22": {9: [1, 2, 3, 4]},
- "11,23": {9: [8, 9, 10, 11]}
+ "0,12": {9: [7, 8, 9, 10, 11]},
+ "1,13": {6: [1, 2, 3, 4]},
+ "2,14": {6: [8, 9, 10, 11]},
+ "3,15": {7: [1, 2, 3, 4]},
+ "4,16": {7: [8, 9, 10, 11]},
+ "5,17": {5: [8, 9, 10, 11]},
+ "6,18": {8: [1, 2, 3, 4, 5]},
+ "7,19": {9: [1, 2, 3, 4, 5, 6]},
+ "8,20": {8: [8, 9, 10, 11]},
+ "9,21": {10: [4, 5, 6, 7]},
+ "10,22": {10: [1, 2, 3, 4]},
+ "11,23": {5: [6, 7, 8]}
}
};
- $.fritteli.uhr.register('de_CH_genau', layout);
+ $.fritteli.uhr.register('de', layout);
}(jQuery));
/*
This program is free software: you can redistribute it and/or modify
diff --git a/dist/jquery.uhr.langs.min.js b/dist/jquery.uhr.langs.min.js
deleted file mode 100644
index cad339c..0000000
--- a/dist/jquery.uhr.langs.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! uhr - v8.0.4-dev.0 - 2016-06-27
-* http://bärneruhr.ch/
-* Copyright (c) 2016 Manuel Friedli; Licensed GPL-3.0 */
-!function(a){"use strict";var b={1:[1,2,4,5,6]},c={10:[9,10,11]},d={4:[8,9,10,11]},e={4:[1,2,3]},f={5:[1,2,3,4]},g={1:[8,9,10,11]},h={2:[1,2,3,4]},i={3:[5,6,7,8,9,10,11]},j={2:[5,6,7,8,9,10,11]},k={3:[1,2,3,4,5,6,7,8,9,10,11]},l={version:2,language:"Deutsch",letters:["ESKISTAFÜNF","ZEHNZWANZIG","DREIVIERTEL","VORFUNKNACH","HALBAELFÜNF","EINSXAMZWEI","DREIPMJVIER","SECHSNLACHT","SIEBENZWÖLF","ZEHNEUNKUHR"],permanent:b,minutes:{"0,1,2,3,4":c,"5,6,7,8,9":[g,d],"10,11,12,13,14":[h,d],"15,16,17,18,19":[i,d],"20,21,22,23,24":[j,d],"25,26,27,28,29":[g,e,f],"30,31,32,33,34":f,"35,36,37,38,39":[g,d,f],"40,41,42,43,44":[j,e],"45,46,47,48,49":k,"50,51,52,53,54":[h,e],"55,56,57,58,59":[g,e]},hours:{"0,12":{9:[7,8,9,10,11]},"1,13":{6:[1,2,3,4]},"2,14":{6:[8,9,10,11]},"3,15":{7:[1,2,3,4]},"4,16":{7:[8,9,10,11]},"5,17":{5:[8,9,10,11]},"6,18":{8:[1,2,3,4,5]},"7,19":{9:[1,2,3,4,5,6]},"8,20":{8:[8,9,10,11]},"9,21":{10:[4,5,6,7]},"10,22":{10:[1,2,3,4]},"11,23":{5:[6,7,8]}}};a.fritteli.uhr.register("de",l)}(jQuery),function(a){"use strict";var b={1:[1,2,4,5,6,7]},c={4:[1,2]},d={3:[9,10,11]},e={4:[4,5,6,7,8]},f={1:[9,10,11]},g={2:[9,10,11]},h={2:[1,2,3,4,5,6]},i={3:[1,2,3,4,5,6]},j={version:2,language:"Bärndütsch",letters:["ESKISCHAFÜF","VIERTUBFZÄÄ","ZWÄNZGSIVOR","ABOHAUBIEGE","EISZWÖISDRÜ","VIERIFÜFIQT","SÄCHSISIBNI","ACHTINÜNIEL","ZÄNIERBEUFI","ZWÖUFINAUHR"],permanent:b,minutes:{"5,6,7,8,9":[f,c],"10,11,12,13,14":[g,c],"15,16,17,18,19":[h,c],"20,21,22,23,24":[i,c],"25,26,27,28,29":[f,d,e],"30,31,32,33,34":e,"35,36,37,38,39":[f,c,e],"40,41,42,43,44":[i,d],"45,46,47,48,49":[h,d],"50,51,52,53,54":[g,d],"55,56,57,58,59":[f,d]},hours:{"0,12":{10:[1,2,3,4,5,6]},"1,13":{5:[1,2,3]},"2,14":{5:[4,5,6,7]},"3,15":{5:[9,10,11]},"4,16":{6:[1,2,3,4,5]},"5,17":{6:[6,7,8,9]},"6,18":{7:[1,2,3,4,5,6]},"7,19":{7:[7,8,9,10,11]},"8,20":{8:[1,2,3,4,5]},"9,21":{8:[6,7,8,9]},"10,22":{9:[1,2,3,4]},"11,23":{9:[8,9,10,11]}}};a.fritteli.uhr.register("de_CH",j)}(jQuery),function(a){"use strict";var b={1:[1,2,4,5,6,7]},c={3:[7,8,9,10,11]},d={4:[4,5]},e={4:[1,2,3]},f={4:[7,8,9,10,11]},g={1:[9,10,11]},h={2:[9,10,11]},i={2:[1,2,3,4,5,6]},j={3:[1,2,3,4,5,6]},k={version:2,language:"Bärndütsch (genau)",letters:["ESKISCHAFÜF","VIERTUBFZÄÄ","ZWÄNZGGENAU","VORABOHAUBI","EISZWÖISDRÜ","VIERIFÜFIQT","SÄCHSISIBNI","ACHTINÜNIEL","ZÄNIERBEUFI","ZWÖUFINAUHR"],permanent:b,minutes:{0:c,"5,6,7,8,9":[g,d],"10,11,12,13,14":[h,d],"15,16,17,18,19":[i,d],"20,21,22,23,24":[j,d],"25,26,27,28,29":[g,e,f],"30,31,32,33,34":f,"35,36,37,38,39":[g,d,f],"40,41,42,43,44":[j,e],"45,46,47,48,49":[i,e],"50,51,52,53,54":[h,e],"55,56,57,58,59":[g,e]},hours:{"0,12":{10:[1,2,3,4,5,6]},"1,13":{5:[1,2,3]},"2,14":{5:[4,5,6,7]},"3,15":{5:[9,10,11]},"4,16":{6:[1,2,3,4,5]},"5,17":{6:[6,7,8,9]},"6,18":{7:[1,2,3,4,5,6]},"7,19":{7:[7,8,9,10,11]},"8,20":{8:[1,2,3,4,5]},"9,21":{8:[6,7,8,9]},"10,22":{9:[1,2,3,4]},"11,23":{9:[8,9,10,11]}}};a.fritteli.uhr.register("de_CH_genau",k)}(jQuery),function(a){"use strict";var b={1:[1,2,3,4,5,6,7,9,10]},c={4:[4,5,6,7,8,9,10,11]},d={5:[8]},e={5:[4,5,6,7]},f={2:[1,2,3]},g={4:[1,2]},h={3:[4,5,6,7,8]},i={2:[4,5,6,7]},j={6:[8,9,10,11]},k={version:2,language:"Dansk",letters:["KLOKKENVERO","FEMTYVESKLA","OJEKVARTVAT","TIAMINUTTER","VEMOVERILMF","MONALISHALV","ETTOTREFIRE","FEMSEKSRSYV","OTTERNIMETI","ELLEVEATOLV"],permanent:b,minutes:{"5,6,7,8,9":[f,c,e],"10,11,12,13,14":[g,c,e],"15,16,17,18,19":[h,e],"20,21,22,23,24":[i,c,e],"25,26,27,28,29":[f,c,d,j],"30,31,32,33,34":[j],"35,36,37,38,39":[f,c,e,j],"40,41,42,43,44":[i,c,d],"45,46,47,48,49":[h,d],"50,51,52,53,54":[g,c,d],"55,56,57,58,59":[f,c,d]},hours:{"0,12":{10:[8,9,10,11]},"1,13":{7:[1,2]},"2,14":{7:[3,4]},"3,15":{7:[5,6,7]},"4,16":{7:[8,9,10,11]},"5,17":{8:[1,2,3]},"6,18":{8:[4,5,6,7]},"7,19":{8:[9,10,11]},"8,20":{9:[1,2,3,4]},"9,21":{9:[6,7]},"10,22":{9:[10,11]},"11,23":{10:[1,2,3,4,5,6]}},getHour:function(a){var b=a.getHours();return a.getMinutes()>=25?(b+1)%24:b}};a.fritteli.uhr.register("dk",k)}(jQuery),function(a){"use strict";var b={1:[1,2,4,5]},c={4:[1,2,3,4]},d={4:[10,11]},e={5:[1,2,3,4]},f={10:[5,6,7,8,9,10,11]},g={3:[7,8,9,10]},h={4:[6,7,8]},i={2:[1,3,4,5,6,7,8,9]},j={3:[1,2,3,4,5,6]},k={3:[1,2,3,4,5,6,7,8,9,10]},l={version:2,language:"English",letters:["ITLISBFAMPM","ACQUARTERDC","TWENTYFIVEX","HALFBTENFTO","PASTERUNINE","ONESIXTHREE","FOURFIVETWO","EIGHTELEVEN","SEVENTWELVE","TENSO'CLOCK"],permanent:b,minutes:{"0,1,2,3,4":f,"5,6,7,8,9":[g,e],"10,11,12,13,14":[h,e],"15,16,17,18,19":[i,e],"20,21,22,23,24":[j,e],"25,26,27,28,29":[k,e],"30,31,32,33,34":[c,e],"35,36,37,38,39":[k,d],"40,41,42,43,44":[j,d],"45,46,47,48,49":[i,d],"50,51,52,53,54":[h,d],"55,56,57,58,59":[g,d]},hours:{"0,12":{9:[6,7,8,9,10,11]},"1,13":{6:[1,2,3]},"2,14":{7:[9,10,11]},"3,15":{6:[7,8,9,10,11]},"4,16":{7:[1,2,3,4]},"5,17":{7:[5,6,7,8]},"6,18":{6:[4,5,6]},"7,19":{9:[1,2,3,4,5]},"8,20":{8:[1,2,3,4,5]},"9,21":{5:[8,9,10,11]},"10,22":{10:[1,2,3]},"11,23":{8:[6,7,8,9,10,11]}},getHour:function(a){var b=a.getHours();return a.getMinutes()>=35?(b+1)%24:b}};a.fritteli.uhr.register("en",l)}(jQuery),function(a){"use strict";var b={1:[1,2,6,7]},c={1:[2,3,4,6,7,8]},d={7:[6]},e={7:[7,8,9,10,11]},f={10:[1,2,3,4,5]},g={9:[7,8,9,10,11]},h={8:[8,9,10,11]},i={10:[6,7,8,9,10,11]},j={8:[2,3,4,5,6,7]},k={9:[1,2,3,4,5,6,7,8,9,10,11]},l={version:2,language:"Español",letters:["ESONELASUNA","DOSITRESORE","CUATROCINCO","SEISASIETEN","OCHONUEVEYO","LADIEZSONCE","DOCELYMENOS","OVEINTEDIEZ","VEINTICINCO","MEDIACUARTO"],permanent:[],minutes:{"5,6,7,8,9":[d,g],"10,11,12,13,14":[d,h],"15,16,17,18,19":[d,i],"20,21,22,23,24":[d,j],"25,26,27,28,29":[d,k],"30,31,32,33,34":[d,f],"35,36,37,38,39":[e,k],"40,41,42,43,44":[e,j],"45,46,47,48,49":[e,i],"50,51,52,53,54":[e,h],"55,56,57,58,59":[e,g]},hours:{"0,12":[c,{7:[1,2,3,4]}],"1,13":[b,{1:[9,10,11]}],"2,14":[c,{2:[1,2,3]}],"3,15":[c,{2:[5,6,7,8]}],"4,16":[c,{3:[1,2,3,4,5,6]}],"5,17":[c,{3:[7,8,9,10,11]}],"6,18":[c,{4:[1,2,3,4]}],"7,19":[c,{4:[6,7,8,9,10]}],"8,20":[c,{5:[1,2,3,4]}],"9,21":[c,{5:[5,6,7,8,9]}],"10,22":[c,{6:[3,4,5,6]}],"11,23":[c,{6:[8,9,10,11]}]},getHour:function(a){var b=a.getHours();return a.getMinutes()>=35?(b+1)%24:b}};a.fritteli.uhr.register("es",l)}(jQuery),function(a){"use strict";var b={1:[1,2,4,5,6]},c={8:[1,2]},d={7:[1,2,3,4,5]},e={10:[4,5,6,7,8]},f={6:[6,7,8,9,10,11]},g={7:[7,8]},h={9:[7,8,9,10]},i={7:[9,10,11]},j={8:[4,5,6,7,8]},k={9:[1,2,3,4,5]},l={9:[1,2,3,4,5,6,7,8,9,10]},m={version:2,language:"Français",letters:["ILNESTODEUX","QUATRETROIS","NEUFUNESEPT","HUITSIXCINQ","MIDIXMINUIT","ONZERHEURES","MOINSOLEDIX","ETRQUARTPMD","VINGT-CINQU","ETSDEMIEPAM"],permanent:b,minutes:{"5,6,7,8,9":h,"10,11,12,13,14":i,"15,16,17,18,19":[c,j],"20,21,22,23,24":k,"25,26,27,28,29":l,"30,31,32,33,34":[c,e],"35,36,37,38,39":[d,l],"40,41,42,43,44":[d,k],"45,46,47,48,49":[d,g,j],"50,51,52,53,54":[d,i],"55,56,57,58,59":[d,h]},hours:{0:{5:[6,7,8,9,10,11]},"1,13":[{3:[5,6,7]},f],"2,14":[{1:[8,9,10,11]},f],"3,15":[{2:[7,8,9,10,11]},f],"4,16":[{2:[1,2,3,4,5,6]},f],"5,17":[{4:[8,9,10,11]},f],"6,18":[{4:[5,6,7]},f],"7,19":[{3:[8,9,10,11]},f],"8,20":[{4:[1,2,3,4]},f],"9,21":[{3:[1,2,3,4]},f],"10,22":[{5:[3,4,5]},f],"11,23":[{6:[1,2,3,4]},f],12:{5:[1,2,3,4]}},getHour:function(a){var b=a.getHours();return a.getMinutes()>=35?(b+1)%24:b}};a.fritteli.uhr.register("fr",m)}(jQuery),function(a){"use strict";var b={1:[1,2,3,4,6,7]},c={2:[1,3,4]},d={8:[1]},e={7:[8,9,10,11]},f={10:[7,8,9,10,11]},g={9:[6,7,8,9,10,11]},h={10:[1,2,3,4,5]},i={8:[3,4,6,7,8,9,10,11]},j={9:[1,2,3,4,5]},k={9:[1,2,3,4,5,6,7,8,9,10,11]},l={version:2,language:"Italiano",letters:["SONORLEBORE","ÈRL'UNASDUE","TREOTTONOVE","DIECIUNDICI","DODICISETTE","QUATTROCSEI","CINQUEAMENO","ECUNOQUARTO","VENTICINQUE","DIECIPMEZZA"],permanent:[],minutes:{"5,6,7,8,9":[d,g],"10,11,12,13,14":[d,h],"15,16,17,18,19":[d,i],"20,21,22,23,24":[d,j],"25,26,27,28,29":[d,k],"30,31,32,33,34":[d,f],"35,36,37,38,39":[e,k],"40,41,42,43,44":[e,j],"45,46,47,48,49":[e,i],"50,51,52,53,54":[e,h],"55,56,57,58,59":[e,g]},hours:{"0,12":[b,{5:[1,2,3,4,5,6]}],"1,13":[c,{2:[5,6,7]}],"2,14":[b,{2:[9,10,11]}],"3,15":[b,{3:[1,2,3]}],"4,16":[b,{6:[1,2,3,4,5,6,7]}],"5,17":[b,{7:[1,2,3,4,5,6]}],"6,18":[b,{6:[9,10,11]}],"7,19":[b,{5:[7,8,9,10,11]}],"8,20":[b,{3:[4,5,6,7]}],"9,21":[b,{3:[8,9,10,11]}],"10,22":[b,{4:[1,2,3,4,5]}],"11,23":[b,{4:[6,7,8,9,10,11]}]},getHour:function(a){var b=a.getHours();return a.getMinutes()>=35?(b+1)%24:b}};a.fritteli.uhr.register("it",l)}(jQuery),function(a){"use strict";var b={1:[1,2,3,5,6]},c={3:[1,2,3,4]},d={2:[8,9,10,11]},e={4:[8,9,10,11]},f={5:[1,2,3,4]},g={4:[1,2,3,4]},h={1:[8,9,10,11]},i={2:[1,2,3,4]},j={3:[7,8,9,10,11]},k={10:[9,10,11]},l={version:2,language:"Nederlands",letters:["HETKISAVIJF","TIENBTZVOOR","OVERMEKWART","HALFSPWOVER","VOORTHGEENS","TWEEPVCDRIE","VIERVIJFZES","ZEVENONEGEN","ACHTTIENELF","TWAALFBFUUR"],permanent:b,minutes:{"0,1,2,3,4":k,"5,6,7,8,9":[h,c],"10,11,12,13,14":[i,c],"15,16,17,18,19":[j,e],"20,21,22,23,24":[i,d,g],"25,26,27,28,29":[h,d,g],"30,31,32,33,34":g,"35,36,37,38,39":[h,c,g],"40,41,42,43,44":[i,c,g],"45,46,47,48,49":[j,f],"50,51,52,53,54":[i,d],"55,56,57,58,59":[h,d]},hours:{"0,12":{10:[1,2,3,4,5,6]},"1,13":{5:[8,9,10]},"2,14":{6:[1,2,3,4]},"3,15":{6:[8,9,10,11]},"4,16":{7:[1,2,3,4]},"5,17":{7:[5,6,7,8]},"6,18":{7:[9,10,11]},"7,19":{8:[1,2,3,4,5]},"8,20":{9:[1,2,3,4]},"9,21":{8:[7,8,9,10,11]},"10,22":{9:[5,6,7,8]},"11,23":{9:[9,10,11]}},getHour:function(a){var b=a.getHours();return a.getMinutes()>=20?(b+1)%24:b}};a.fritteli.uhr.register("nl",l)}(jQuery),function(a){"use strict";var b={1:[1]},c={1:[2,3,4]},d={7:[8]},e={10:[5]},f={7:[7,8,9,10,11]},g={8:[8,9,10,11]},h={10:[7,8,9,10,11]},i={10:[1,2,3]},j={9:[1,2,4,5,6,7,8,9]},k={8:[1,2,3,4,5]},l={version:2,language:"Português",letters:["ÉSÃOUMATRÊS","MEIOLDIADEZ","DUASEISETEY","QUATROHNOVE","CINCOITONZE","ZMEIALNOITE","HORASYMENOS","VINTECAMEIA","UMVQUARTOPM","DEZOEYCINCO"],minutes:{"5,6,7,8,9":[d,h],"10,11,12,13,14":[d,i],"15,16,17,18,19":[d,j],"20,21,22,23,24":[d,k],"25,26,27,28,29":[d,k,e,h],"30,31,32,33,34":[d,g],"35,36,37,38,39":[f,k,e,h],"40,41,42,43,44":[f,k],"45,46,47,48,49":[f,j],"50,51,52,53,54":[f,i],"55,56,57,58,59":[f,h]},hours:{0:[b,{6:[2,3,4,5,7,8,9,10,11]}],12:[b,{2:[1,2,3,4,6,7,8]}],"1,13":[b,{1:[5,6,7]}],"2,14":[c,{3:[1,2,3,4]}],"3,15":[c,{1:[8,9,10,11]}],"4,16":[c,{4:[1,2,3,4,5,6]}],"5,17":[c,{5:[1,2,3,4,5]}],"6,18":[c,{3:[4,5,6,7]}],"7,19":[c,{3:[7,8,9,10]}],"8,20":[c,{5:[5,6,7,8]}],"9,21":[c,{4:[8,9,10,11]}],"10,22":[c,{2:[9,10,11]}],"11,23":[c,{5:[8,9,10,11]}]},getHour:function(a){var b=a.getHours();return a.getMinutes()>=35?(b+1)%24:b}};a.fritteli.uhr.register("pt",l)}(jQuery);
\ No newline at end of file
diff --git a/dist/jquery.uhr.main.js b/dist/jquery.uhr.main.js
index 5b3bb5a..fd94574 100644
--- a/dist/jquery.uhr.main.js
+++ b/dist/jquery.uhr.main.js
@@ -1,17 +1,17 @@
-/*! uhr - v8.0.4-dev.0 - 2016-06-27
+/*! uhr - v8.0.4-dev.0 - 2019-05-03
* http://bärneruhr.ch/
-* Copyright (c) 2016 Manuel Friedli; Licensed GPL-3.0 */
-(function($) {
+* Copyright (c) 2019 Manuel Friedli; Licensed GPL-3.0 */
+(function ($) {
'use strict';
var uhrGlobals = {
"id": 0,
"languages": [],
"themes": [],
registerLanguage: function registerLanguage(code, language) {
- var alreadyExists = uhrGlobals.languages.some(function(element) {
+ var alreadyExists = uhrGlobals.languages.some(function (element) {
if (code === element.code) {
console.error("Error: Language code '" + code + "' cannot be registered for language '" + language.language +
- "' because it is already registered for language '" + element.language + "'!");
+ "' because it is already registered for language '" + element.language + "'!");
return true;
}
return false;
@@ -24,7 +24,7 @@
};
// auto-detect themes
- $('link[rel=stylesheet]').each(function(index, item) {
+ $('link[rel=stylesheet]').each(function (index, item) {
var styleSheet = $(item);
var styleClass = styleSheet.attr('data-class');
if (styleClass !== undefined) {
@@ -41,9 +41,12 @@
}
// public interface methods (exported later)
+ var setCookie;
+ var isOn;
+ var update;
var start = function start() {
if (!isOn.bind(this)()) {
- this.timer = window.setInterval(function() {
+ this.timer = window.setInterval(function () {
this.options.time = new Date();
update.bind(this)();
}.bind(this), 1000);
@@ -66,436 +69,25 @@
this.start();
}
};
- var setLanguage = function setLanguage(languageKey) {
- if (languageKey !== this.options.language) {
- this.options.language = languageKey;
- var renderer = new UhrRenderer(language.bind(this)(), this.element.find('.letterarea'));
- renderer.render.bind(this)(function() {
- this.currentMinute = -1;
- update.bind(this)();
- }.bind(this));
- setCookie.bind(this)('uhr-language', languageKey);
- update.bind(this)();
- }
- };
- var setTheme = function setTheme(theme) {
- if (theme !== this.options.theme) {
- this.element.removeClass(this.options.theme).addClass(theme);
- $('#uhr-onoffswitch' + this.id).removeClass(this.options.theme).addClass(theme);
- this.options.theme = theme;
- setCookie.bind(this)('uhr-theme', theme);
- }
- };
- var setTime = function setTime(time) {
- this.currentMinute = -1;
- if (time === null) {
- this.options.time = new Date();
- } else {
- if (this.timer !== null) {
- window.clearInterval(this.timer);
- }
- this.options.time = time;
- }
- update.bind(this)();
- };
- var setMode = function(mode) {
- this.options.mode = mode;
- this.currentMinute = -1;
- update.bind(this)();
- setCookie.bind(this)('uhr-mode', mode);
- };
- var setWidth = function setWidth(width) {
- var e = this.element;
- e.css('width', width);
- var realWidth = e.width();
- e.width(realWidth);
- e.height(realWidth);
- e.css('font-size', (realWidth / 40) + 'px');
- };
+ var language;
- // private interface methods
- var create = function create() {
- this.id = uhrGlobals.id++;
- this.timer = null;
- this.currentMinute = -1;
- var userTime = this.options.time;
- var hash, params;
- if (this.options.time === undefined) {
- this.options.time = new Date();
- }
- // parse the URL params
- hash = window.location.hash;
- if (hash !== undefined && typeof hash === 'string' && hash.charAt(0) === '#') {
- hash = hash.substring(1);
- hash = decodeURIComponent(hash);
- params = hash.split('&');
- params.forEach(function (element) {
- var pair = element.split('=');
- var key = pair[0];
- var value = pair[1];
- switch (key) {
- case 'l':
- case 'language':
- this.options.language = value;
- this.options.force = true;
- break;
- case 't':
- case 'theme':
- this.options.theme = value;
- this.options.force = true;
- break;
- case 'm':
- case 'mode':
- this.options.mode = value;
- this.options.force = true;
- break;
- case 's':
- case 'status':
- this.options.status = value;
- this.options.force = true;
- break;
- }
- }.bind(this));
- }
- // end parse the URL params
- setupHTML.bind(this)();
- wireFunctionality.bind(this)();
- if (userTime !== undefined) {
- this.time(userTime);
- }
- };
- // private helper methods (not exported)
- var toggleConfigScreen = function toggleConfigScreen() {
- $('#uhr-controlpanel' + this.id).toggle('fast');
- };
- // set up
- var setupHTML = function setupHTML() {
- var e = this.element;
- // Base clock area
- e.addClass('uhr');
- e.empty();
- e.append('');
- e.append('');
- e.append('');
- e.append('');
- e.append('');
- e.append('');
- setWidth.bind(this)(this.options.width);
-
- if (this.options.controls) {
- var controlpanel = $('');
- var content = $('');
- controlpanel.append(content);
- // on/off switch
- var toggleSwitch = $('');
- toggleSwitch.append('');
- toggleSwitch.append('');
- content.append(toggleSwitch);
-
- // time mode switch
- var modeSwitch = $('');
- modeSwitch.append('');
- modeSwitch.append('');
- content.append(modeSwitch);
- // language chooser
- if (uhrGlobals.languages.length > 1) {
- var languageChooser = $('');
- uhrGlobals.languages.forEach(function(item) {
- languageChooser.append('');
- });
- content.append(languageChooser);
- }
-
- // theme chooser
- if (uhrGlobals.themes.length > 1) {
- var themeChooser = $('');
- uhrGlobals.themes.forEach(function(item) {
- themeChooser.append('');
- });
- content.append(themeChooser);
- }
- var closebutton = $('');
- closebutton.on('click', function() {
- $('#uhr-controlpanel' + this.id).hide('fast');
- }.bind(this));
- content.append(closebutton);
- e.after(controlpanel);
- controlpanel.hide();
- var configlink = $('');
- configlink.on('click', function() {
- toggleConfigScreen.bind(this)();
- }.bind(this));
- e.after(configlink);
- }
- };
- var wireFunctionality = function wireFunctionality() {
- // on/off switch
- var toggleSwitch = $('#uhr-onoffswitch-checkbox' + this.id);
- toggleSwitch.on('click', function() {
- this.toggle();
- }.bind(this));
- var status = $.cookie('uhr-status' + this.id);
- if (status === undefined || this.options.force) {
- status = this.options.status;
- }
- toggleSwitch.prop('checked', status === 'on');
- if (status === 'on') {
- this.start();
- } else {
- this.stop();
- }
-
- // time mode switch
- var modeSwitch = $('#uhr-modeswitch-checkbox' + this.id);
- modeSwitch.on('click', function() {
- if (this.options.mode === 'seconds') {
- setMode.bind(this)('normal');
- } else {
- setMode.bind(this)('seconds');
- }
- }.bind(this));
-
- var mode = $.cookie('uhr-mode' + this.id);
- if (mode === undefined || this.options.force) {
- mode = this.options.mode;
- }
- modeSwitch.prop('checked', mode !== 'seconds');
- if (mode === 'seconds') {
- setMode.bind(this)('seconds');
- } else {
- setMode.bind(this)('normal');
- }
-
- // language chooser
- var languageChooser = $('#uhr-languagechooser' + this.id);
- languageChooser.on('change', function() {
- var languageKey = $('#uhr-languagechooser' + this.id).val();
- this.language(languageKey);
- }.bind(this));
- var selectedLanguage = $.cookie('uhr-language' + this.id);
- if (selectedLanguage === undefined || this.options.force) {
- selectedLanguage = this.options.language;
- }
- var found = uhrGlobals.languages.some(function(item) {
- return selectedLanguage === item.code;
- });
- if (!found) {
- var fallbackLanguage;
- if (uhrGlobals.languages.length > 0) {
- fallbackLanguage = uhrGlobals.languages[0].code;
- } else {
- fallbackLanguage = '';
- }
- console.warn("Language '" + selectedLanguage + "' not found! Using fallback '" + fallbackLanguage + "'");
- selectedLanguage = fallbackLanguage;
- }
- languageChooser.val(selectedLanguage);
- this.options.language = "";
- this.language(selectedLanguage);
-
- // theme chooser
- var themeChooser = $('#uhr-themechooser' + this.id);
- themeChooser.on('change', function() {
- var themeKey = $('#uhr-themechooser' + this.id).val();
- this.theme(themeKey);
- }.bind(this));
- var selectedTheme = $.cookie('uhr-theme' + this.id);
- if (selectedTheme === undefined || this.options.force) {
- selectedTheme = this.options.theme;
- }
- found = uhrGlobals.themes.some(function(item) {
- return selectedTheme === item.styleClass;
- });
- if (!found) {
- var fallbackTheme = uhrGlobals.themes[0].styleClass;
- console.warn("Theme '" + selectedTheme + "' not found! Using fallback '" + fallbackTheme + "'");
- selectedTheme = fallbackTheme;
- }
- themeChooser.val(selectedTheme);
- this.options.theme = "";
- this.theme(selectedTheme);
- if (this.options.autoresize) {
- $(window).on('resize', function() {
- var $e = this.element;
- var $parent = $e.parent();
- var $window = $(window);
- var parentWidth = $parent.width();
- var parentHeight = $parent.height();
- var windowWidth = $window.width();
- var windowHeight = $window.height();
- var size = Math.min(parentWidth, parentHeight, windowWidth, windowHeight) + 'px';
- setWidth.bind(this)(size);
- }.bind(this));
- }
- };
- var destroy = function destroy() {
- this.timer = null;
- $(this.element)
- .removeAttr('style')
- .removeAttr('class')
- .empty();
- $('#uhr-configlink' + this.id).remove();
- $('#uhr-controlpanel' + this.id).remove();
-
- };
- var setCookie = function setCookie(cookieName, cookieValue) {
- var options = {};
- if (this.options.cookiePath !== undefined) {
- options = {expires: 365, path: this.options.cookiePath};
- } else {
- options = {expires: 365};
- }
- $.cookie(cookieName + this.id, cookieValue, options);
- };
-
- // business logic
- var isOn = function isOn() {
- return this.timer !== null;
- };
- var update = function update() {
- if (isOn.bind(this)()) {
- var time = this.options.time;
- if (!language.bind(this)().hasOwnProperty('seconds') && this.options.mode !== 'seconds') {
- if (time.getMinutes() === this.currentMinute) {
- return;
- }
- this.currentMinute = time.getMinutes();
- }
- show.bind(this)(time);
- } else {
- clear.bind(this)();
- this.currentMinute = -1;
- }
- };
- var show = function show(time) {
- var second = getSecond.bind(this)(time);
- var dotMinute = getDotMinute.bind(this)(time);
- var hour = getHour.bind(this)(time);
- var coarseMinute = getCoarseMinute.bind(this)(time);
- clear.bind(this)();
- if (this.options.mode === 'seconds') {
- highlight.bind(this)('second' + second);
- } else {
- highlight.bind(this)('on');
- for (var i = 1; i <= dotMinute; i++) {
- highlight.bind(this)('dot' + i);
- }
- highlight.bind(this)('minute' + coarseMinute);
- highlight.bind(this)('hour' + hour);
- }
- };
- var highlight = function highlight(itemClass) {
- this.element.find('.item.' + itemClass).addClass('active');
- };
- var clear = function clear() {
- this.element.find('.item').removeClass('active');
- };
- var getSecond = function getSecond(date) {
- if (typeof language.bind(this)().getSeconds === 'function') {
- return language.bind(this)().getSeconds(date);
- }
- return date.getSeconds();
- };
- var getDotMinute = function getDotMinute(date) {
- if (typeof language.bind(this)().getDotMinute === 'function') {
- return language.bind(this)().getDotMinute(date);
- }
- var minutes = date.getMinutes();
- return minutes % 5;
- };
- var getCoarseMinute = function getCoarseMinute(date) {
- if (typeof language.bind(this)().getCoarseMinute === 'function') {
- return language.bind(this)().getCoarseMinute(date);
- }
- return date.getMinutes();
- };
- var getHour = function getHour(date) {
- if (typeof language.bind(this)().getHour === 'function') {
- return language.bind(this)().getHour(date);
- }
- var hour = date.getHours();
- if (date.getMinutes() >= 25) {
- return (hour + 1) % 24;
- }
- return hour;
- };
- var language = function language() {
- var matchingLanguages = uhrGlobals.languages.filter(function(element) {
- return (element.code === this.options.language);
- }, this);
- if (matchingLanguages.length > 0) {
- return matchingLanguages[0];
- }
- // fallback: return empty object
- return {};
- };
-
- $.widget("fritteli.uhr", {
- "options": {
- width: '100%',
- status: 'on',
- language: 'de_CH',
- theme: uhrGlobals.themes[0].styleClass,
- force: false,
- controls: true,
- cookiePath: undefined,
- autoresize: true,
- mode: 'normal'
- },
- "start": start,
- "stop": stop,
- "toggle": toggle,
- "language": setLanguage,
- "theme": setTheme,
- "time": setTime,
- "mode": setMode,
- "width": setWidth,
- // constructor method
- "_create": create,
- // destructor method
- "_destroy": destroy
- });
- $.fritteli.uhr.register = uhrGlobals.registerLanguage;
/**
- * Hilfsklasse zum Rendern der Uhr.
- * @param layout Layout-Objekt, das gerendert werden soll.
- * @param renderarea Das jQuery-gewrappte HTML-Element, auf dem gerendert werden soll.
+ * Ein Buchstabe. Hilfsklasse für den Renderer und Inhalt der Layout-Arrays.
+ * @param value Der Buchstabe, der Dargestellt werden soll.
+ * @param style Die CSS-Styleklassen des Buchstabens.
*/
- function UhrRenderer(layout, renderarea) {
- this.render = function render(beforeshow) {
- if (layout.parsed === undefined) {
- switch (layout.version) {
- case 2:
- var delegate = new UhrRendererV2Delegate(layout);
- var parsedLayout = delegate.parse();
- Object.defineProperty(layout, "parsed", {"value": parsedLayout, "writable": false, "configurable": false});
- break;
- default:
- console.warn("Unknown layout version: '" + layout.version + "'");
- return;
- }
+ function Letter(value, style) {
+ var myValue = value;
+ var myStyle = style || '';
+ this.addStyle = function (style) {
+ if (myStyle === '') {
+ myStyle = style;
+ } else {
+ myStyle += ' ' + style;
}
- var letters = layout.parsed;
- renderarea.fadeOut('fast', function() {
- renderarea.empty();
- letters.forEach(function(line, index, array) {
- line.forEach(function(letter) {
- renderarea.append(letter.toString());
- });
- if (index < array.length - 1) {
- renderarea.append('
');
- }
- });
- if (typeof beforeshow === 'function') {
- beforeshow();
- }
- renderarea.fadeIn('fast');
- });
+ };
+ this.toString = function () {
+ return '' + myValue + '';
};
}
@@ -644,7 +236,7 @@
8: [10],
9: [8, 9]
};
- var seconds= {
+ var seconds = {
"0": [vorne0, hinten0],
"1": [vorne0, hinten1],
"2": [vorne0, hinten2],
@@ -707,10 +299,21 @@
"59": [vorne5, hinten9]
};
+ function parseObject(letters, styleClass, object) {
+ if (typeof object !== 'undefined' && object !== null) {
+ Object.keys(object).forEach(function (y) {
+ var highlightLetters = object[y];
+ highlightLetters.forEach(function (x) {
+ letters[y - 1][x - 1].addStyle(styleClass);
+ });
+ });
+ }
+ }
+
function parseArrayOrObject(letters, styleClass, input) {
if (typeof input !== 'undefined' && input !== null) {
if (Array.isArray(input)) {
- input.forEach(function(item) {
+ input.forEach(function (item) {
parseObject(letters, styleClass, item);
});
} else {
@@ -719,23 +322,12 @@
}
}
- function parseObject(letters, styleClass, object) {
- if (typeof object !== 'undefined' && object !== null) {
- Object.keys(object).forEach(function(y) {
- var highlightLetters = object[y];
- highlightLetters.forEach(function(x) {
- letters[y - 1][x - 1].addStyle(styleClass);
- });
- });
- }
- }
-
function parseTimeDefinition(letters, styleClass, definition) {
if (typeof definition !== 'undefined' && definition !== null) {
- Object.keys(definition).forEach(function(listString) {
+ Object.keys(definition).forEach(function (listString) {
var array = listString.split(',');
var highlightLetters = definition[listString];
- array.forEach(function(item) {
+ array.forEach(function (item) {
parseArrayOrObject(letters, styleClass + item, highlightLetters);
});
});
@@ -744,7 +336,7 @@
this.parse = function parse() {
var letters = [];
- layout.letters.forEach(function(string) {
+ layout.letters.forEach(function (string) {
var line = [];
for (var c = 0; c < string.length; c++) {
var character = new Letter(string[c]);
@@ -765,22 +357,449 @@
}
/**
- * Ein Buchstabe. Hilfsklasse für den Renderer und Inhalt der Layout-Arrays.
- * @param value Der Buchstabe, der Dargestellt werden soll.
- * @param style Die CSS-Styleklassen des Buchstabens.
+ * Hilfsklasse zum Rendern der Uhr.
+ * @param layout Layout-Objekt, das gerendert werden soll.
+ * @param renderarea Das jQuery-gewrappte HTML-Element, auf dem gerendert werden soll.
*/
- function Letter(value, style) {
- var myValue = value;
- var myStyle = style || '';
- this.addStyle = function(style) {
- if (myStyle === '') {
- myStyle = style;
- } else {
- myStyle += ' ' + style;
+ function UhrRenderer(layout, renderarea) {
+ this.render = function render(beforeshow) {
+ if (layout.parsed === undefined) {
+ switch (layout.version) {
+ case 2:
+ var delegate = new UhrRendererV2Delegate(layout);
+ var parsedLayout = delegate.parse();
+ Object.defineProperty(layout, "parsed", {
+ "value": parsedLayout,
+ "writable": false,
+ "configurable": false
+ });
+ break;
+ default:
+ console.warn("Unknown layout version: '" + layout.version + "'");
+ return;
+ }
}
- };
- this.toString = function() {
- return '' + myValue + '';
+ var letters = layout.parsed;
+ renderarea.fadeOut('fast', function () {
+ renderarea.empty();
+ letters.forEach(function (line, index, array) {
+ line.forEach(function (letter) {
+ renderarea.append(letter.toString());
+ });
+ if (index < array.length - 1) {
+ renderarea.append('
');
+ }
+ });
+ if (typeof beforeshow === 'function') {
+ beforeshow();
+ }
+ renderarea.fadeIn('fast');
+ });
};
}
+
+ var setLanguage = function setLanguage(languageKey) {
+ if (languageKey !== this.options.language) {
+ this.options.language = languageKey;
+ var renderer = new UhrRenderer(language.bind(this)(), this.element.find('.letterarea'));
+ renderer.render.bind(this)(function () {
+ this.currentMinute = -1;
+ update.bind(this)();
+ }.bind(this));
+ setCookie.bind(this)('uhr-language', languageKey);
+ update.bind(this)();
+ }
+ };
+ var setTheme = function setTheme(theme) {
+ if (theme !== this.options.theme) {
+ this.element.removeClass(this.options.theme).addClass(theme);
+ $('#uhr-onoffswitch' + this.id).removeClass(this.options.theme).addClass(theme);
+ this.options.theme = theme;
+ setCookie.bind(this)('uhr-theme', theme);
+ }
+ };
+ var setTime = function setTime(time) {
+ this.currentMinute = -1;
+ if (time === null) {
+ this.options.time = new Date();
+ } else {
+ if (this.timer !== null) {
+ window.clearInterval(this.timer);
+ }
+ this.options.time = time;
+ }
+ update.bind(this)();
+ };
+ var setMode = function (mode) {
+ this.options.mode = mode;
+ this.currentMinute = -1;
+ update.bind(this)();
+ setCookie.bind(this)('uhr-mode', mode);
+ };
+ var setWidth = function setWidth(width) {
+ var e = this.element;
+ e.css('width', width);
+ var realWidth = e.width();
+ e.width(realWidth);
+ e.height(realWidth);
+ e.css('font-size', (realWidth / 40) + 'px');
+ };
+
+ // private interface methods
+ var setupHTML;
+ var wireFunctionality;
+ var create = function create() {
+ this.id = uhrGlobals.id++;
+ this.timer = null;
+ this.currentMinute = -1;
+ var userTime = this.options.time;
+ var hash, params;
+ if (this.options.time === undefined) {
+ this.options.time = new Date();
+ }
+ // parse the URL params
+ hash = window.location.hash;
+ if (hash !== undefined && typeof hash === 'string' && hash.charAt(0) === '#') {
+ hash = hash.substring(1);
+ hash = decodeURIComponent(hash);
+ params = hash.split('&');
+ params.forEach(function (element) {
+ var pair = element.split('=');
+ var key = pair[0];
+ var value = pair[1];
+ switch (key) {
+ case 'l':
+ case 'language':
+ this.options.language = value;
+ this.options.force = true;
+ break;
+ case 't':
+ case 'theme':
+ this.options.theme = value;
+ this.options.force = true;
+ break;
+ case 'm':
+ case 'mode':
+ this.options.mode = value;
+ this.options.force = true;
+ break;
+ case 's':
+ case 'status':
+ this.options.status = value;
+ this.options.force = true;
+ break;
+ }
+ }.bind(this));
+ }
+ // end parse the URL params
+ setupHTML.bind(this)();
+ wireFunctionality.bind(this)();
+ if (userTime !== undefined) {
+ this.time(userTime);
+ }
+ };
+ // private helper methods (not exported)
+ var toggleConfigScreen = function toggleConfigScreen() {
+ $('#uhr-controlpanel' + this.id).toggle('fast');
+ };
+ // set up
+ setupHTML = function setupHTML() {
+ var e = this.element;
+ // Base clock area
+ e.addClass('uhr');
+ e.empty();
+ e.append('');
+ e.append('');
+ e.append('');
+ e.append('');
+ e.append('');
+ e.append('');
+ setWidth.bind(this)(this.options.width);
+
+ if (this.options.controls) {
+ var controlpanel = $('');
+ var content = $('');
+ controlpanel.append(content);
+ // on/off switch
+ var toggleSwitch = $('');
+ toggleSwitch.append('');
+ toggleSwitch.append('');
+ content.append(toggleSwitch);
+
+ // time mode switch
+ var modeSwitch = $('');
+ modeSwitch.append('');
+ modeSwitch.append('');
+ content.append(modeSwitch);
+ // language chooser
+ if (uhrGlobals.languages.length > 1) {
+ var languageChooser = $('');
+ uhrGlobals.languages.forEach(function (item) {
+ languageChooser.append('');
+ });
+ content.append(languageChooser);
+ }
+
+ // theme chooser
+ if (uhrGlobals.themes.length > 1) {
+ var themeChooser = $('');
+ uhrGlobals.themes.forEach(function (item) {
+ themeChooser.append('');
+ });
+ content.append(themeChooser);
+ }
+ var closebutton = $('');
+ closebutton.on('click', function () {
+ $('#uhr-controlpanel' + this.id).hide('fast');
+ }.bind(this));
+ content.append(closebutton);
+ e.after(controlpanel);
+ controlpanel.hide();
+ var configlink = $('');
+ configlink.on('click', function () {
+ toggleConfigScreen.bind(this)();
+ }.bind(this));
+ e.after(configlink);
+ }
+ };
+ wireFunctionality = function wireFunctionality() {
+ // on/off switch
+ var toggleSwitch = $('#uhr-onoffswitch-checkbox' + this.id);
+ toggleSwitch.on('click', function () {
+ this.toggle();
+ }.bind(this));
+ var status = $.cookie('uhr-status' + this.id);
+ if (status === undefined || this.options.force) {
+ status = this.options.status;
+ }
+ toggleSwitch.prop('checked', status === 'on');
+ if (status === 'on') {
+ this.start();
+ } else {
+ this.stop();
+ }
+
+ // time mode switch
+ var modeSwitch = $('#uhr-modeswitch-checkbox' + this.id);
+ modeSwitch.on('click', function () {
+ if (this.options.mode === 'seconds') {
+ setMode.bind(this)('normal');
+ } else {
+ setMode.bind(this)('seconds');
+ }
+ }.bind(this));
+
+ var mode = $.cookie('uhr-mode' + this.id);
+ if (mode === undefined || this.options.force) {
+ mode = this.options.mode;
+ }
+ modeSwitch.prop('checked', mode !== 'seconds');
+ if (mode === 'seconds') {
+ setMode.bind(this)('seconds');
+ } else {
+ setMode.bind(this)('normal');
+ }
+
+ // language chooser
+ var languageChooser = $('#uhr-languagechooser' + this.id);
+ languageChooser.on('change', function () {
+ var languageKey = $('#uhr-languagechooser' + this.id).val();
+ this.language(languageKey);
+ }.bind(this));
+ var selectedLanguage = $.cookie('uhr-language' + this.id);
+ if (selectedLanguage === undefined || this.options.force) {
+ selectedLanguage = this.options.language;
+ }
+ var found = uhrGlobals.languages.some(function (item) {
+ return selectedLanguage === item.code;
+ });
+ if (!found) {
+ var fallbackLanguage;
+ if (uhrGlobals.languages.length > 0) {
+ fallbackLanguage = uhrGlobals.languages[0].code;
+ } else {
+ fallbackLanguage = '';
+ }
+ console.warn("Language '" + selectedLanguage + "' not found! Using fallback '" + fallbackLanguage + "'");
+ selectedLanguage = fallbackLanguage;
+ }
+ languageChooser.val(selectedLanguage);
+ this.options.language = "";
+ this.language(selectedLanguage);
+
+ // theme chooser
+ var themeChooser = $('#uhr-themechooser' + this.id);
+ themeChooser.on('change', function () {
+ var themeKey = $('#uhr-themechooser' + this.id).val();
+ this.theme(themeKey);
+ }.bind(this));
+ var selectedTheme = $.cookie('uhr-theme' + this.id);
+ if (selectedTheme === undefined || this.options.force) {
+ selectedTheme = this.options.theme;
+ }
+ found = uhrGlobals.themes.some(function (item) {
+ return selectedTheme === item.styleClass;
+ });
+ if (!found) {
+ var fallbackTheme = uhrGlobals.themes[0].styleClass;
+ console.warn("Theme '" + selectedTheme + "' not found! Using fallback '" + fallbackTheme + "'");
+ selectedTheme = fallbackTheme;
+ }
+ themeChooser.val(selectedTheme);
+ this.options.theme = "";
+ this.theme(selectedTheme);
+ if (this.options.autoresize) {
+ $(window).on('resize', function () {
+ var $e = this.element;
+ var $parent = $e.parent();
+ var $window = $(window);
+ var parentWidth = $parent.width();
+ var parentHeight = $parent.height();
+ var windowWidth = $window.width();
+ var windowHeight = $window.height();
+ var size = Math.min(parentWidth, parentHeight, windowWidth, windowHeight) + 'px';
+ setWidth.bind(this)(size);
+ }.bind(this));
+ }
+ };
+ var destroy = function destroy() {
+ this.timer = null;
+ $(this.element)
+ .removeAttr('style')
+ .removeAttr('class')
+ .empty();
+ $('#uhr-configlink' + this.id).remove();
+ $('#uhr-controlpanel' + this.id).remove();
+
+ };
+ setCookie = function setCookie(cookieName, cookieValue) {
+ var options = {};
+ if (this.options.cookiePath !== undefined) {
+ options = {expires: 365, path: this.options.cookiePath};
+ } else {
+ options = {expires: 365};
+ }
+ $.cookie(cookieName + this.id, cookieValue, options);
+ };
+
+ // business logic
+ isOn = function isOn() {
+ return this.timer !== null;
+ };
+ var show;
+ var clear;
+ update = function update() {
+ if (isOn.bind(this)()) {
+ var time = this.options.time;
+ if (!language.bind(this)().hasOwnProperty('seconds') && this.options.mode !== 'seconds') {
+ if (time.getMinutes() === this.currentMinute) {
+ return;
+ }
+ this.currentMinute = time.getMinutes();
+ }
+ show.bind(this)(time);
+ } else {
+ clear.bind(this)();
+ this.currentMinute = -1;
+ }
+ };
+ var highlight;
+ var getSecond;
+ var getDotMinute;
+ var getCoarseMinute;
+ var getHour;
+ show = function show(time) {
+ var second = getSecond.bind(this)(time);
+ var dotMinute = getDotMinute.bind(this)(time);
+ var hour = getHour.bind(this)(time);
+ var coarseMinute = getCoarseMinute.bind(this)(time);
+ clear.bind(this)();
+ if (this.options.mode === 'seconds') {
+ highlight.bind(this)('second' + second);
+ } else {
+ highlight.bind(this)('on');
+ for (var i = 1; i <= dotMinute; i++) {
+ highlight.bind(this)('dot' + i);
+ }
+ highlight.bind(this)('minute' + coarseMinute);
+ highlight.bind(this)('hour' + hour);
+ }
+ };
+ highlight = function highlight(itemClass) {
+ this.element.find('.item.' + itemClass).addClass('active');
+ };
+ clear = function clear() {
+ this.element.find('.item').removeClass('active');
+ };
+ getSecond = function getSecond(date) {
+ if (typeof language.bind(this)().getSeconds === 'function') {
+ return language.bind(this)().getSeconds(date);
+ }
+ return date.getSeconds();
+ };
+ getDotMinute = function getDotMinute(date) {
+ if (typeof language.bind(this)().getDotMinute === 'function') {
+ return language.bind(this)().getDotMinute(date);
+ }
+ var minutes = date.getMinutes();
+ return minutes % 5;
+ };
+ getCoarseMinute = function getCoarseMinute(date) {
+ if (typeof language.bind(this)().getCoarseMinute === 'function') {
+ return language.bind(this)().getCoarseMinute(date);
+ }
+ return date.getMinutes();
+ };
+ getHour = function getHour(date) {
+ if (typeof language.bind(this)().getHour === 'function') {
+ return language.bind(this)().getHour(date);
+ }
+ var hour = date.getHours();
+ if (date.getMinutes() >= 25) {
+ return (hour + 1) % 24;
+ }
+ return hour;
+ };
+ language = function language() {
+ var matchingLanguages = uhrGlobals.languages.filter(function (element) {
+ return (element.code === this.options.language);
+ }, this);
+ if (matchingLanguages.length > 0) {
+ return matchingLanguages[0];
+ }
+ // fallback: return empty object
+ return {};
+ };
+
+ $.widget("fritteli.uhr", {
+ "options": {
+ width: '100%',
+ status: 'on',
+ language: 'de_CH',
+ theme: uhrGlobals.themes[0].styleClass,
+ force: false,
+ controls: true,
+ cookiePath: undefined,
+ autoresize: true,
+ mode: 'normal'
+ },
+ "start": start,
+ "stop": stop,
+ "toggle": toggle,
+ "language": setLanguage,
+ "theme": setTheme,
+ "time": setTime,
+ "mode": setMode,
+ "width": setWidth,
+ // constructor method
+ "_create": create,
+ // destructor method
+ "_destroy": destroy
+ });
+ $.fritteli.uhr.register = uhrGlobals.registerLanguage;
})(jQuery);
diff --git a/dist/jquery.uhr.main.min.js b/dist/jquery.uhr.main.min.js
deleted file mode 100644
index 0ac22a6..0000000
--- a/dist/jquery.uhr.main.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! uhr - v8.0.4-dev.0 - 2016-06-27
-* http://bärneruhr.ch/
-* Copyright (c) 2016 Manuel Friedli; Licensed GPL-3.0 */
-!function(a){"use strict";function b(a,b){this.render=function(d){if(void 0===a.parsed)switch(a.version){case 2:var e=new c(a),f=e.parse();Object.defineProperty(a,"parsed",{value:f,writable:!1,configurable:!1});break;default:return void console.warn("Unknown layout version: '"+a.version+"'")}var g=a.parsed;b.fadeOut("fast",function(){b.empty(),g.forEach(function(a,c,d){a.forEach(function(a){b.append(a.toString())}),c")}),"function"==typeof d&&d(),b.fadeIn("fast")})}}function c(a){function b(a,b,d){"undefined"!=typeof d&&null!==d&&(Array.isArray(d)?d.forEach(function(d){c(a,b,d)}):c(a,b,d))}function c(a,b,c){"undefined"!=typeof c&&null!==c&&Object.keys(c).forEach(function(d){var e=c[d];e.forEach(function(c){a[d-1][c-1].addStyle(b)})})}function e(a,c,d){"undefined"!=typeof d&&null!==d&&Object.keys(d).forEach(function(e){var f=e.split(","),g=d[e];f.forEach(function(d){b(a,c+d,g)})})}var f={3:[2,3,4],4:[1,5],5:[1,4,5],6:[1,3,5],7:[1,2,5],8:[1,5],9:[2,3,4]},g={3:[8,9,10],4:[7,11],5:[7,10,11],6:[7,9,11],7:[7,8,11],8:[7,11],9:[8,9,10]},h={3:[3],4:[2,3],5:[3],6:[3],7:[3],8:[3],9:[2,3,4]},i={3:[9],4:[8,9],5:[9],6:[9],7:[9],8:[9],9:[8,9,10]},j={3:[2,3,4],4:[1,5],5:[5],6:[4],7:[3],8:[2],9:[1,2,3,4,5]},k={3:[8,9,10],4:[7,11],5:[11],6:[10],7:[9],8:[8],9:[7,8,9,10,11]},l={3:[1,2,3,4,5],4:[4],5:[3],6:[4],7:[5],8:[1,5],9:[2,3,4]},m={3:[7,8,9,10,11],4:[10],5:[9],6:[10],7:[11],8:[7,11],9:[8,9,10]},n={3:[4],4:[3,4],5:[2,4],6:[1,4],7:[1,2,3,4,5],8:[4],9:[4]},o={3:[10],4:[9,10],5:[8,10],6:[7,10],7:[7,8,9,10,11],8:[10],9:[10]},p={3:[1,2,3,4,5],4:[1],5:[1,2,3,4],6:[5],7:[5],8:[1,5],9:[2,3,4]},q={3:[7,8,9,10,11],4:[7],5:[7,8,9,10],6:[11],7:[11],8:[7,11],9:[8,9,10]},r={3:[9,10],4:[8],5:[7],6:[7,8,9,10],7:[7,11],8:[7,11],9:[8,9,10]},s={3:[7,8,9,10,11],4:[11],5:[10],6:[9],7:[8],8:[8],9:[8]},t={3:[8,9,10],4:[7,11],5:[7,11],6:[8,9,10],7:[7,11],8:[7,11],9:[8,9,10]},u={3:[8,9,10],4:[7,11],5:[7,11],6:[8,9,10,11],7:[11],8:[10],9:[8,9]},v={0:[f,g],1:[f,i],2:[f,k],3:[f,m],4:[f,o],5:[f,q],6:[f,r],7:[f,s],8:[f,t],9:[f,u],10:[h,g],11:[h,i],12:[h,k],13:[h,m],14:[h,o],15:[h,q],16:[h,r],17:[h,s],18:[h,t],19:[h,u],20:[j,g],21:[j,i],22:[j,k],23:[j,m],24:[j,o],25:[j,q],26:[j,r],27:[j,s],28:[j,t],29:[j,u],30:[l,g],31:[l,i],32:[l,k],33:[l,m],34:[l,o],35:[l,q],36:[l,r],37:[l,s],38:[l,t],39:[l,u],40:[n,g],41:[n,i],42:[n,k],43:[n,m],44:[n,o],45:[n,q],46:[n,r],47:[n,s],48:[n,t],49:[n,u],50:[p,g],51:[p,i],52:[p,k],53:[p,m],54:[p,o],55:[p,q],56:[p,r],57:[p,s],58:[p,t],59:[p,u]};this.parse=function(){var c=[];return a.letters.forEach(function(a){for(var b=[],e=0;e'+c+""}}var e={id:0,languages:[],themes:[],registerLanguage:function(a,b){var c=e.languages.some(function(c){return a===c.code&&(console.error("Error: Language code '"+a+"' cannot be registered for language '"+b.language+"' because it is already registered for language '"+c.language+"'!"),!0)});c||(b.code=a,e.languages.push(b))}};a("link[rel=stylesheet]").each(function(b,c){var d=a(c),f=d.attr("data-class");if(void 0!==f){var g=d.attr("data-name");void 0===g&&(g=f),e.themes.push({styleClass:f,name:g})}}),0===e.themes.length&&e.themes.push({});var f=function(){t.bind(this)()||(this.timer=window.setInterval(function(){this.options.time=new Date,u.bind(this)()}.bind(this),1e3),u.bind(this)(),s.bind(this)("uhr-status","on"))},g=function(){t.bind(this)()&&(window.clearInterval(this.timer),this.timer=null,u.bind(this)(),s.bind(this)("uhr-status","off"))},h=function(){t.bind(this)()?this.stop():this.start()},i=function(a){if(a!==this.options.language){this.options.language=a;var c=new b(C.bind(this)(),this.element.find(".letterarea"));c.render.bind(this)(function(){this.currentMinute=-1,u.bind(this)()}.bind(this)),s.bind(this)("uhr-language",a),u.bind(this)()}},j=function(b){b!==this.options.theme&&(this.element.removeClass(this.options.theme).addClass(b),a("#uhr-onoffswitch"+this.id).removeClass(this.options.theme).addClass(b),this.options.theme=b,s.bind(this)("uhr-theme",b))},k=function(a){this.currentMinute=-1,null===a?this.options.time=new Date:(null!==this.timer&&window.clearInterval(this.timer),this.options.time=a),u.bind(this)()},l=function(a){this.options.mode=a,this.currentMinute=-1,u.bind(this)(),s.bind(this)("uhr-mode",a)},m=function(a){var b=this.element;b.css("width",a);var c=b.width();b.width(c),b.height(c),b.css("font-size",c/40+"px")},n=function(){this.id=e.id++,this.timer=null,this.currentMinute=-1;var a,b,c=this.options.time;void 0===this.options.time&&(this.options.time=new Date),a=window.location.hash,void 0!==a&&"string"==typeof a&&"#"===a.charAt(0)&&(a=a.substring(1),a=decodeURIComponent(a),b=a.split("&"),b.forEach(function(a){var b=a.split("="),c=b[0],d=b[1];switch(c){case"l":case"language":this.options.language=d,this.options.force=!0;break;case"t":case"theme":this.options.theme=d,this.options.force=!0;break;case"m":case"mode":this.options.mode=d,this.options.force=!0;break;case"s":case"status":this.options.status=d,this.options.force=!0}}.bind(this))),p.bind(this)(),q.bind(this)(),void 0!==c&&this.time(c)},o=function(){a("#uhr-controlpanel"+this.id).toggle("fast")},p=function(){var b=this.element;if(b.addClass("uhr"),b.empty(),b.append(''),b.append(''),b.append(''),b.append(''),b.append(''),b.append(''),m.bind(this)(this.options.width),this.options.controls){var c=a(''),d=a('');c.append(d);var f=a('');f.append(''),f.append(''),d.append(f);var g=a('');if(g.append(''),g.append(''),d.append(g),e.languages.length>1){var h=a('');e.languages.forEach(function(a){h.append('")}),d.append(h)}if(e.themes.length>1){var i=a('');e.themes.forEach(function(a){i.append('")}),d.append(i)}var j=a('');j.on("click",function(){a("#uhr-controlpanel"+this.id).hide("fast")}.bind(this)),d.append(j),b.after(c),c.hide();var k=a('');k.on("click",function(){o.bind(this)()}.bind(this)),b.after(k)}},q=function(){var b=a("#uhr-onoffswitch-checkbox"+this.id);b.on("click",function(){this.toggle()}.bind(this));var c=a.cookie("uhr-status"+this.id);(void 0===c||this.options.force)&&(c=this.options.status),b.prop("checked","on"===c),"on"===c?this.start():this.stop();var d=a("#uhr-modeswitch-checkbox"+this.id);d.on("click",function(){"seconds"===this.options.mode?l.bind(this)("normal"):l.bind(this)("seconds")}.bind(this));var f=a.cookie("uhr-mode"+this.id);(void 0===f||this.options.force)&&(f=this.options.mode),d.prop("checked","seconds"!==f),"seconds"===f?l.bind(this)("seconds"):l.bind(this)("normal");var g=a("#uhr-languagechooser"+this.id);g.on("change",function(){var b=a("#uhr-languagechooser"+this.id).val();this.language(b)}.bind(this));var h=a.cookie("uhr-language"+this.id);(void 0===h||this.options.force)&&(h=this.options.language);var i=e.languages.some(function(a){return h===a.code});if(!i){var j;j=e.languages.length>0?e.languages[0].code:"",console.warn("Language '"+h+"' not found! Using fallback '"+j+"'"),h=j}g.val(h),this.options.language="",this.language(h);var k=a("#uhr-themechooser"+this.id);k.on("change",function(){var b=a("#uhr-themechooser"+this.id).val();this.theme(b)}.bind(this));var n=a.cookie("uhr-theme"+this.id);if((void 0===n||this.options.force)&&(n=this.options.theme),i=e.themes.some(function(a){return n===a.styleClass}),!i){var o=e.themes[0].styleClass;console.warn("Theme '"+n+"' not found! Using fallback '"+o+"'"),n=o}k.val(n),this.options.theme="",this.theme(n),this.options.autoresize&&a(window).on("resize",function(){var b=this.element,c=b.parent(),d=a(window),e=c.width(),f=c.height(),g=d.width(),h=d.height(),i=Math.min(e,f,g,h)+"px";m.bind(this)(i)}.bind(this))},r=function(){this.timer=null,a(this.element).removeAttr("style").removeAttr("class").empty(),a("#uhr-configlink"+this.id).remove(),a("#uhr-controlpanel"+this.id).remove()},s=function(b,c){var d={};d=void 0!==this.options.cookiePath?{expires:365,path:this.options.cookiePath}:{expires:365},a.cookie(b+this.id,c,d)},t=function(){return null!==this.timer},u=function(){if(t.bind(this)()){var a=this.options.time;if(!C.bind(this)().hasOwnProperty("seconds")&&"seconds"!==this.options.mode){if(a.getMinutes()===this.currentMinute)return;this.currentMinute=a.getMinutes()}v.bind(this)(a)}else x.bind(this)(),this.currentMinute=-1},v=function(a){var b=y.bind(this)(a),c=z.bind(this)(a),d=B.bind(this)(a),e=A.bind(this)(a);if(x.bind(this)(),"seconds"===this.options.mode)w.bind(this)("second"+b);else{w.bind(this)("on");for(var f=1;f<=c;f++)w.bind(this)("dot"+f);w.bind(this)("minute"+e),w.bind(this)("hour"+d)}},w=function(a){this.element.find(".item."+a).addClass("active")},x=function(){this.element.find(".item").removeClass("active")},y=function(a){return"function"==typeof C.bind(this)().getSeconds?C.bind(this)().getSeconds(a):a.getSeconds()},z=function(a){if("function"==typeof C.bind(this)().getDotMinute)return C.bind(this)().getDotMinute(a);var b=a.getMinutes();return b%5},A=function(a){return"function"==typeof C.bind(this)().getCoarseMinute?C.bind(this)().getCoarseMinute(a):a.getMinutes()},B=function(a){if("function"==typeof C.bind(this)().getHour)return C.bind(this)().getHour(a);var b=a.getHours();return a.getMinutes()>=25?(b+1)%24:b},C=function(){var a=e.languages.filter(function(a){return a.code===this.options.language},this);return a.length>0?a[0]:{}};a.widget("fritteli.uhr",{options:{width:"100%",status:"on",language:"de_CH",theme:e.themes[0].styleClass,force:!1,controls:!0,cookiePath:void 0,autoresize:!0,mode:"normal"},start:f,stop:g,toggle:h,language:i,theme:j,time:k,mode:l,width:m,_create:n,_destroy:r}),a.fritteli.uhr.register=e.registerLanguage}(jQuery);
\ No newline at end of file
diff --git a/dist/libs.js b/dist/libs.js
index eb28d8c..95f0d05 100644
--- a/dist/libs.js
+++ b/dist/libs.js
@@ -1,23 +1,25 @@
-/*! uhr - v8.0.4-dev.0 - 2016-06-27
+/*! uhr - v8.0.4-dev.0 - 2019-05-03
* http://bärneruhr.ch/
-* Copyright (c) 2016 Manuel Friedli; Licensed GPL-3.0 */
+* Copyright (c) 2019 Manuel Friedli; Licensed GPL-3.0 */
/*!
- * jQuery JavaScript Library v2.1.4
- * http://jquery.com/
+ * jQuery JavaScript Library v3.4.1
+ * https://jquery.com/
*
* Includes Sizzle.js
- * http://sizzlejs.com/
+ * https://sizzlejs.com/
*
- * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
+ * Copyright JS Foundation and other contributors
* Released under the MIT license
- * http://jquery.org/license
+ * https://jquery.org/license
*
- * Date: 2015-04-28T16:01Z
+ * Date: 2019-05-01T21:04Z
*/
+( function( global, factory ) {
-(function( global, factory ) {
+ "use strict";
if ( typeof module === "object" && typeof module.exports === "object" ) {
+
// For CommonJS and CommonJS-like environments where a proper `window`
// is present, execute the factory and get jQuery.
// For environments that do not have a `window` with a `document`
@@ -38,16 +40,20 @@
}
// Pass this if window is not defined yet
-}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
+} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
-// Support: Firefox 18+
-// Can't be in strict mode, several libs including ASP.NET trace
-// the stack via arguments.caller.callee and Firefox dies if
-// you try to trace through "use strict" call chains. (#13335)
-//
+// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
+// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
+// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
+// enough that all such attempts are guarded in a try block.
+"use strict";
var arr = [];
+var document = window.document;
+
+var getProto = Object.getPrototypeOf;
+
var slice = arr.slice;
var concat = arr.concat;
@@ -62,45 +68,104 @@ var toString = class2type.toString;
var hasOwn = class2type.hasOwnProperty;
+var fnToString = hasOwn.toString;
+
+var ObjectFunctionString = fnToString.call( Object );
+
var support = {};
+var isFunction = function isFunction( obj ) {
+
+ // Support: Chrome <=57, Firefox <=52
+ // In some browsers, typeof returns "function" for HTML