diff --git a/.drone.yml b/.drone.yml
new file mode 100644
index 0000000..e3b8ad5
--- /dev/null
+++ b/.drone.yml
@@ -0,0 +1,14 @@
+kind: pipeline
+name: default
+
+steps:
+ - name: prepare
+ image: node:12
+ commands:
+ - npm install
+ - name: build
+ image: node:12
+ environment:
+ NPMPATH: "node_modules/.bin"
+ commands:
+ - $NPMPATH/grunt
diff --git a/.editorconfig b/.editorconfig
index c308ed0..87a3009 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -9,5 +9,7 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
+[*.yml]
+indent_size = 2
[*.md]
trim_trailing_whitespace = false
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
deleted file mode 100644
index 549dc2e..0000000
--- a/.gitlab-ci.yml
+++ /dev/null
@@ -1,75 +0,0 @@
-variables:
- NPMPATH: "node_modules/.bin"
-
-stages:
- - build
- - cleanup_build
- - deploy
- - cleanup
-
-.run_deploy: &run_deploy
- script:
- - chmod +x ./deploy.sh
- - ./deploy.sh
-
-build_job:
- stage: build
- script:
- - npm install
- - $NPMPATH/grunt
- tags:
- - javascript
- except:
- - tags
- artifacts:
- paths:
- - dist/*.min.*
- - info/
- - resources/
- - index.html
- - manifest.appcache
-
-cleanup_build_job:
- stage: cleanup_build
- script:
- - rm -rf node_modules
- - rm -rf dist
- when: on_failure
-
-develop:
- stage: deploy
- <<: *run_deploy
- environment: develop
- except:
- - tags
- - master
- - develop
- variables:
- ENVIRON: develop
- TARGET: $WWW_DEPLOY_ROOT_DEVELOP
-
-staging:
- stage: deploy
- <<: *run_deploy
- environment: staging
- only:
- - develop
- variables:
- ENVIRON: staging
- TARGET: $WWW_DEPLOY_ROOT_STAGING
-
-production:
- stage: deploy
- <<: *run_deploy
- environment: production
- only:
- - master
- variables:
- ENVIRON: production
- TARGET: $WWW_DEPLOY_ROOT_PRODUCTION
-
-cleanup_job:
- stage: cleanup
- script:
- - rm -rf node_modules
- when: always
diff --git a/Gruntfile.js b/Gruntfile.js
index f210bc3..ae194d4 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -26,7 +26,6 @@ module.exports = function (grunt) {
libs: {
src: [
'node_modules/jquery/dist/jquery.js',
- 'node_modules/jquery-ui/ui/core.js',
'node_modules/jquery-ui/ui/widget.js',
'node_modules/jquery.cookie/jquery.cookie.js'
],
diff --git a/README.md b/README.md
index 9772066..22eb1a9 100644
--- a/README.md
+++ b/README.md
@@ -22,10 +22,10 @@ Beim Einbinden muss das attribut `data-class` angegeben werden, welches die CSS-
* Binde nach den CSS-Dateien (wichtig!) folgende Javascript-Dateien im HTML-Dokument ein:
* dist/libs.min.js: Dies enthält die minifizierten Versionen von jQuery, jQuery-UI (mit den Komponenten `code` und `widget`) und jQuery-Cookie.
Alternativ kannst Du auch direkt die benötigten Bibliotheken einbinden:
- * jquery (getestet mit Version 2.1.0)
- * jquery-ui (getestet mit Version 1.10.4)
- * Von jquery-ui werden die Komponenten 'core' und 'widget' benötigt.
- * jquery-cookie (getestet mit Version 1.4.0)
+ * jquery (getestet mit Version 3.4.1)
+ * jquery-ui (getestet mit Version 1.12.1)
+ * Von jquery-ui wird die Komponente 'widget' benötigt.
+ * jquery-cookie (getestet mit Version 1.4.1)
Je nach dem, in welchen Sprachen du die Uhr verwenden willst, noch eine der folgenden Dateien:
* dist/jquery.uhr.complete.min.js: Enthält die Hauptdatei sowie alle unterstützten Sprachdateien
* dist/jquery.uhr.base.min.js: Enthält die Hauptdatei sowie Bärndütsch (de_CH)
@@ -149,7 +149,7 @@ Es ist möglich, die Uhr durch den Aufruf mit URL-Parameters zu konfigurieren. D
* on: Die Uhr ist eingeschaltet
* off: Die Uhr ist ausgeschaltet
-Eine URL kann also beispielweise so aussehen:
+Eine URL kann also beispielsweise so aussehen:
http://example.com/uhr.html#l=fr&t=red&m=seconds&s=on
diff --git a/VERSION b/VERSION
index d3ae6cf..2b1a7b3 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-8.0.4-dev.0
+9.0.0-dev.0
diff --git a/deploy.sh b/deploy.sh
deleted file mode 100644
index b5515ed..0000000
--- a/deploy.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-declare destination
-case "${TARGET}" in
- "${WWW_DEPLOY_ROOT_DEVELOP}")
- destination="${TARGET}/${CI_BUILD_REF_NAME}"
- ;;
- "${WWW_DEPLOY_ROOT_STAGING}"|"${WWW_DEPLOY_ROOT_PRODUCTION}")
- destination="${TARGET}"
- ;;
- *)
- echo "Invalid TARGET specified. Aborting deployment."
- exit 1
- ;;
-esac
-
-rm -rf "${destination}/*"
-rm -rf "${destination}/.??*"
-mkdir -p "${destination}/dist"
-cp -a index.html manifest.appcache info resources "${destination}"
-cp -a dist/*.min.* "${destination}/dist"
-
-echo "Deployment successful."
diff --git a/dist/jquery.uhr.base.js b/dist/jquery.uhr.base.js
index bbd5b72..12cba0e 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 - v9.0.0-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($) {
@@ -867,4 +886,4 @@
};
// Das Layout bei der Uhr unter dem Code "de_CH" registrieren.
$.fritteli.uhr.register('de_CH', layout);
-}(jQuery));
\ No newline at end of file
+}(jQuery));
diff --git a/dist/jquery.uhr.base.min.js b/dist/jquery.uhr.base.min.js
index 3d91901..1515a36 100644
--- a/dist/jquery.uhr.base.min.js
+++ b/dist/jquery.uhr.base.min.js
@@ -1,4 +1,5 @@
-/*! uhr - v8.0.4-dev.0 - 2016-06-27
+/*! uhr - v9.0.0-dev.0 - 2019-05-03
* 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
+* Copyright (c) 2019 Manuel Friedli; Licensed GPL-3.0 */
+
+!function(u){"use strict";var i,e,n,l={id:0,languages:[],themes:[],registerLanguage:function(i,e){l.languages.some(function(t){return i===t.code&&(console.error("Error: Language code '"+i+"' cannot be registered for language '"+e.language+"' because it is already registered for language '"+t.language+"'!"),!0)})||(e.code=i,l.languages.push(e))}};u("link[rel=stylesheet]").each(function(t,i){var e=u(i),n=e.attr("data-class");if(void 0!==n){var s=e.attr("data-name");void 0===s&&(s=n),l.themes.push({styleClass:n,name:s})}}),0===l.themes.length&&l.themes.push({});var s;function y(t,i){var e=t,n=i||"";this.addStyle=function(t){""===n?n=t:n+=" "+t},this.toString=function(){return''+e+""}}function o(t){var i={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]},e={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]},n={3:[3],4:[2,3],5:[3],6:[3],7:[3],8:[3],9:[2,3,4]},s={3:[9],4:[8,9],5:[9],6:[9],7:[9],8:[9],9:[8,9,10]},o={3:[2,3,4],4:[1,5],5:[5],6:[4],7:[3],8:[2],9:[1,2,3,4,5]},h={3:[8,9,10],4:[7,11],5:[11],6:[10],7:[9],8:[8],9:[7,8,9,10,11]},a={3:[1,2,3,4,5],4:[4],5:[3],6:[4],7:[5],8:[1,5],9:[2,3,4]},r={3:[7,8,9,10,11],4:[10],5:[9],6:[10],7:[11],8:[7,11],9:[8,9,10]},c={3:[4],4:[3,4],5:[2,4],6:[1,4],7:[1,2,3,4,5],8:[4],9:[4]},d={3:[10],4:[9,10],5:[8,10],6:[7,10],7:[7,8,9,10,11],8:[10],9:[10]},u={3:[1,2,3,4,5],4:[1],5:[1,2,3,4],6:[5],7:[5],8:[1,5],9:[2,3,4]},l={3:[7,8,9,10,11],4:[7],5:[7,8,9,10],6:[11],7:[11],8:[7,11],9:[8,9,10]},f={3:[9,10],4:[8],5:[7],6:[7,8,9,10],7:[7,11],8:[7,11],9:[8,9,10]},p={3:[7,8,9,10,11],4:[11],5:[10],6:[9],7:[8],8:[8],9:[8]},g={3:[8,9,10],4:[7,11],5:[7,11],6:[8,9,10],7:[7,11],8:[7,11],9:[8,9,10]},m={3:[8,9,10],4:[7,11],5:[7,11],6:[8,9,10,11],7:[11],8:[10],9:[8,9]},v={0:[i,e],1:[i,s],2:[i,h],3:[i,r],4:[i,d],5:[i,l],6:[i,f],7:[i,p],8:[i,g],9:[i,m],10:[n,e],11:[n,s],12:[n,h],13:[n,r],14:[n,d],15:[n,l],16:[n,f],17:[n,p],18:[n,g],19:[n,m],20:[o,e],21:[o,s],22:[o,h],23:[o,r],24:[o,d],25:[o,l],26:[o,f],27:[o,p],28:[o,g],29:[o,m],30:[a,e],31:[a,s],32:[a,h],33:[a,r],34:[a,d],35:[a,l],36:[a,f],37:[a,p],38:[a,g],39:[a,m],40:[c,e],41:[c,s],42:[c,h],43:[c,r],44:[c,d],45:[c,l],46:[c,f],47:[c,p],48:[c,g],49:[c,m],50:[u,e],51:[u,s],52:[u,h],53:[u,r],54:[u,d],55:[u,l],56:[u,f],57:[u,p],58:[u,g],59:[u,m]};function b(e,n,t){null!=t&&Object.keys(t).forEach(function(i){t[i].forEach(function(t){e[i-1][t-1].addStyle(n)})})}function w(i,e,t){null!=t&&(Array.isArray(t)?t.forEach(function(t){b(i,e,t)}):b(i,e,t))}function k(n,s,o){null!=o&&Object.keys(o).forEach(function(t){var i=t.split(","),e=o[t];i.forEach(function(t){w(n,s+t,e)})})}this.parse=function(){var s=[];return t.letters.forEach(function(t){for(var i=[],e=0;e")}),"function"==typeof t&&t(),s.fadeIn("fast")})}}function f(t){this.options.mode=t,this.currentMinute=-1,n.bind(this)(),i.bind(this)("uhr-mode",t)}function p(t){var i=this.element;i.css("width",t);var e=i.width();i.width(e),i.height(e),i.css("font-size",e/40+"px")}var a,r;a=function(){var t=this.element;if(t.addClass("uhr"),t.empty(),t.append(''),t.append(''),t.append(''),t.append(''),t.append(''),t.append(''),p.bind(this)(this.options.width),this.options.controls){var i=u(''),e=u('');i.append(e);var n=u('');n.append(''),n.append(''),e.append(n);var s=u('');if(s.append(''),s.append(''),e.append(s),1');l.languages.forEach(function(t){o.append('")}),e.append(o)}if(1');l.themes.forEach(function(t){h.append('")}),e.append(h)}var a=u('');a.on("click",function(){u("#uhr-controlpanel"+this.id).hide("fast")}.bind(this)),e.append(a),t.after(i),i.hide();var r=u('');r.on("click",function(){(function(){u("#uhr-controlpanel"+this.id).toggle("fast")}).bind(this)()}.bind(this)),t.after(r)}},r=function(){var t=u("#uhr-onoffswitch-checkbox"+this.id);t.on("click",function(){this.toggle()}.bind(this));var i=u.cookie("uhr-status"+this.id);void 0!==i&&!this.options.force||(i=this.options.status),t.prop("checked","on"===i),"on"===i?this.start():this.stop();var e=u("#uhr-modeswitch-checkbox"+this.id);e.on("click",function(){"seconds"===this.options.mode?f.bind(this)("normal"):f.bind(this)("seconds")}.bind(this));var n=u.cookie("uhr-mode"+this.id);void 0!==n&&!this.options.force||(n=this.options.mode),e.prop("checked","seconds"!==n),"seconds"===n?f.bind(this)("seconds"):f.bind(this)("normal");var s=u("#uhr-languagechooser"+this.id);s.on("change",function(){var t=u("#uhr-languagechooser"+this.id).val();this.language(t)}.bind(this));var o=u.cookie("uhr-language"+this.id);void 0!==o&&!this.options.force||(o=this.options.language);var h,a=l.languages.some(function(t){return o===t.code});a||(h=0=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
+* Copyright (c) 2019 Manuel Friedli; Licensed GPL-3.0 */
+
+!function(e){"use strict";var E={4:[8,9,10,11]},r={4:[1,2,3]},t={5:[1,2,3,4]},I={1:[8,9,10,11]},u={2:[1,2,3,4]},n={2:[5,6,7,8,9,10,11]},s={version:2,language:"Deutsch",letters:["ESKISTAFÜNF","ZEHNZWANZIG","DREIVIERTEL","VORFUNKNACH","HALBAELFÜNF","EINSXAMZWEI","DREIPMJVIER","SECHSNLACHT","SIEBENZWÖLF","ZEHNEUNKUHR"],permanent:{1:[1,2,4,5,6]},minutes:{"0,1,2,3,4":{10:[9,10,11]},"5,6,7,8,9":[I,E],"10,11,12,13,14":[u,E],"15,16,17,18,19":[{3:[5,6,7,8,9,10,11]},E],"20,21,22,23,24":[n,E],"25,26,27,28,29":[I,r,t],"30,31,32,33,34":t,"35,36,37,38,39":[I,E,t],"40,41,42,43,44":[n,r],"45,46,47,48,49":{3:[1,2,3,4,5,6,7,8,9,10,11]},"50,51,52,53,54":[u,r],"55,56,57,58,59":[I,r]},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]}}};jQuery.fritteli.uhr.register("de",s)}(),function(e){"use strict";var E={4:[1,2]},r={3:[9,10,11]},t={4:[4,5,6,7,8]},I={1:[9,10,11]},u={2:[9,10,11]},n={2:[1,2,3,4,5,6]},s={3:[1,2,3,4,5,6]},i={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:{1:[1,2,4,5,6,7]},minutes:{"5,6,7,8,9":[I,E],"10,11,12,13,14":[u,E],"15,16,17,18,19":[n,E],"20,21,22,23,24":[s,E],"25,26,27,28,29":[I,r,t],"30,31,32,33,34":t,"35,36,37,38,39":[I,E,t],"40,41,42,43,44":[s,r],"45,46,47,48,49":[n,r],"50,51,52,53,54":[u,r],"55,56,57,58,59":[I,r]},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]}}};jQuery.fritteli.uhr.register("de_CH",i)}(),function(e){"use strict";var E={4:[4,5]},r={4:[1,2,3]},t={4:[7,8,9,10,11]},I={1:[9,10,11]},u={2:[9,10,11]},n={2:[1,2,3,4,5,6]},s={3:[1,2,3,4,5,6]},i={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:{1:[1,2,4,5,6,7]},minutes:{0:{3:[7,8,9,10,11]},"5,6,7,8,9":[I,E],"10,11,12,13,14":[u,E],"15,16,17,18,19":[n,E],"20,21,22,23,24":[s,E],"25,26,27,28,29":[I,r,t],"30,31,32,33,34":t,"35,36,37,38,39":[I,E,t],"40,41,42,43,44":[s,r],"45,46,47,48,49":[n,r],"50,51,52,53,54":[u,r],"55,56,57,58,59":[I,r]},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]}}};jQuery.fritteli.uhr.register("de_CH_genau",i)}(),function(e){"use strict";var E={4:[4,5,6,7,8,9,10,11]},r={5:[8]},t={5:[4,5,6,7]},I={2:[1,2,3]},u={4:[1,2]},n={3:[4,5,6,7,8]},s={2:[4,5,6,7]},i={6:[8,9,10,11]},N={version:2,language:"Dansk",letters:["KLOKKENVERO","FEMTYVESKLA","OJEKVARTVAT","TIAMINUTTER","VEMOVERILMF","MONALISHALV","ETTOTREFIRE","FEMSEKSRSYV","OTTERNIMETI","ELLEVEATOLV"],permanent:{1:[1,2,3,4,5,6,7,9,10]},minutes:{"5,6,7,8,9":[I,E,t],"10,11,12,13,14":[u,E,t],"15,16,17,18,19":[n,t],"20,21,22,23,24":[s,E,t],"25,26,27,28,29":[I,E,r,i],"30,31,32,33,34":[i],"35,36,37,38,39":[I,E,t,i],"40,41,42,43,44":[s,E,r],"45,46,47,48,49":[n,r],"50,51,52,53,54":[u,E,r],"55,56,57,58,59":[I,E,r]},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(e){var E=e.getHours();return 25<=e.getMinutes()?(E+1)%24:E}};jQuery.fritteli.uhr.register("dk",N)}(),function(e){"use strict";var E={4:[10,11]},r={5:[1,2,3,4]},t={3:[7,8,9,10]},I={4:[6,7,8]},u={2:[1,3,4,5,6,7,8,9]},n={3:[1,2,3,4,5,6]},s={3:[1,2,3,4,5,6,7,8,9,10]},i={version:2,language:"English",letters:["ITLISBFAMPM","ACQUARTERDC","TWENTYFIVEX","HALFBTENFTO","PASTERUNINE","ONESIXTHREE","FOURFIVETWO","EIGHTELEVEN","SEVENTWELVE","TENSO'CLOCK"],permanent:{1:[1,2,4,5]},minutes:{"0,1,2,3,4":{10:[5,6,7,8,9,10,11]},"5,6,7,8,9":[t,r],"10,11,12,13,14":[I,r],"15,16,17,18,19":[u,r],"20,21,22,23,24":[n,r],"25,26,27,28,29":[s,r],"30,31,32,33,34":[{4:[1,2,3,4]},r],"35,36,37,38,39":[s,E],"40,41,42,43,44":[n,E],"45,46,47,48,49":[u,E],"50,51,52,53,54":[I,E],"55,56,57,58,59":[t,E]},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(e){var E=e.getHours();return 35<=e.getMinutes()?(E+1)%24:E}};jQuery.fritteli.uhr.register("en",i)}(),function(e){"use strict";var E={1:[2,3,4,6,7,8]},r={7:[6]},t={7:[7,8,9,10,11]},I={9:[7,8,9,10,11]},u={8:[8,9,10,11]},n={10:[6,7,8,9,10,11]},s={8:[2,3,4,5,6,7]},i={9:[1,2,3,4,5,6,7,8,9,10,11]},N={version:2,language:"Español",letters:["ESONELASUNA","DOSITRESORE","CUATROCINCO","SEISASIETEN","OCHONUEVEYO","LADIEZSONCE","DOCELYMENOS","OVEINTEDIEZ","VEINTICINCO","MEDIACUARTO"],permanent:[],minutes:{"5,6,7,8,9":[r,I],"10,11,12,13,14":[r,u],"15,16,17,18,19":[r,n],"20,21,22,23,24":[r,s],"25,26,27,28,29":[r,i],"30,31,32,33,34":[r,{10:[1,2,3,4,5]}],"35,36,37,38,39":[t,i],"40,41,42,43,44":[t,s],"45,46,47,48,49":[t,n],"50,51,52,53,54":[t,u],"55,56,57,58,59":[t,I]},hours:{"0,12":[E,{7:[1,2,3,4]}],"1,13":[{1:[1,2,6,7]},{1:[9,10,11]}],"2,14":[E,{2:[1,2,3]}],"3,15":[E,{2:[5,6,7,8]}],"4,16":[E,{3:[1,2,3,4,5,6]}],"5,17":[E,{3:[7,8,9,10,11]}],"6,18":[E,{4:[1,2,3,4]}],"7,19":[E,{4:[6,7,8,9,10]}],"8,20":[E,{5:[1,2,3,4]}],"9,21":[E,{5:[5,6,7,8,9]}],"10,22":[E,{6:[3,4,5,6]}],"11,23":[E,{6:[8,9,10,11]}]},getHour:function(e){var E=e.getHours();return 35<=e.getMinutes()?(E+1)%24:E}};jQuery.fritteli.uhr.register("es",N)}(),function(e){"use strict";var E={8:[1,2]},r={7:[1,2,3,4,5]},t={6:[6,7,8,9,10,11]},I={9:[7,8,9,10]},u={7:[9,10,11]},n={8:[4,5,6,7,8]},s={9:[1,2,3,4,5]},i={9:[1,2,3,4,5,6,7,8,9,10]},N={version:2,language:"Français",letters:["ILNESTODEUX","QUATRETROIS","NEUFUNESEPT","HUITSIXCINQ","MIDIXMINUIT","ONZERHEURES","MOINSOLEDIX","ETRQUARTPMD","VINGT-CINQU","ETSDEMIEPAM"],permanent:{1:[1,2,4,5,6]},minutes:{"5,6,7,8,9":I,"10,11,12,13,14":u,"15,16,17,18,19":[E,n],"20,21,22,23,24":s,"25,26,27,28,29":i,"30,31,32,33,34":[E,{10:[4,5,6,7,8]}],"35,36,37,38,39":[r,i],"40,41,42,43,44":[r,s],"45,46,47,48,49":[r,{7:[7,8]},n],"50,51,52,53,54":[r,u],"55,56,57,58,59":[r,I]},hours:{0:{5:[6,7,8,9,10,11]},"1,13":[{3:[5,6,7]},t],"2,14":[{1:[8,9,10,11]},t],"3,15":[{2:[7,8,9,10,11]},t],"4,16":[{2:[1,2,3,4,5,6]},t],"5,17":[{4:[8,9,10,11]},t],"6,18":[{4:[5,6,7]},t],"7,19":[{3:[8,9,10,11]},t],"8,20":[{4:[1,2,3,4]},t],"9,21":[{3:[1,2,3,4]},t],"10,22":[{5:[3,4,5]},t],"11,23":[{6:[1,2,3,4]},t],12:{5:[1,2,3,4]}},getHour:function(e){var E=e.getHours();return 35<=e.getMinutes()?(E+1)%24:E}};jQuery.fritteli.uhr.register("fr",N)}(),function(e){"use strict";var E={1:[1,2,3,4,6,7]},r={8:[1]},t={7:[8,9,10,11]},I={9:[6,7,8,9,10,11]},u={10:[1,2,3,4,5]},n={8:[3,4,6,7,8,9,10,11]},s={9:[1,2,3,4,5]},i={9:[1,2,3,4,5,6,7,8,9,10,11]},N={version:2,language:"Italiano",letters:["SONORLEBORE","ÈRL'UNASDUE","TREOTTONOVE","DIECIUNDICI","DODICISETTE","QUATTROCSEI","CINQUEAMENO","ECUNOQUARTO","VENTICINQUE","DIECIPMEZZA"],permanent:[],minutes:{"5,6,7,8,9":[r,I],"10,11,12,13,14":[r,u],"15,16,17,18,19":[r,n],"20,21,22,23,24":[r,s],"25,26,27,28,29":[r,i],"30,31,32,33,34":[r,{10:[7,8,9,10,11]}],"35,36,37,38,39":[t,i],"40,41,42,43,44":[t,s],"45,46,47,48,49":[t,n],"50,51,52,53,54":[t,u],"55,56,57,58,59":[t,I]},hours:{"0,12":[E,{5:[1,2,3,4,5,6]}],"1,13":[{2:[1,3,4]},{2:[5,6,7]}],"2,14":[E,{2:[9,10,11]}],"3,15":[E,{3:[1,2,3]}],"4,16":[E,{6:[1,2,3,4,5,6,7]}],"5,17":[E,{7:[1,2,3,4,5,6]}],"6,18":[E,{6:[9,10,11]}],"7,19":[E,{5:[7,8,9,10,11]}],"8,20":[E,{3:[4,5,6,7]}],"9,21":[E,{3:[8,9,10,11]}],"10,22":[E,{4:[1,2,3,4,5]}],"11,23":[E,{4:[6,7,8,9,10,11]}]},getHour:function(e){var E=e.getHours();return 35<=e.getMinutes()?(E+1)%24:E}};jQuery.fritteli.uhr.register("it",N)}(),function(e){"use strict";var E={3:[1,2,3,4]},r={2:[8,9,10,11]},t={4:[1,2,3,4]},I={1:[8,9,10,11]},u={2:[1,2,3,4]},n={3:[7,8,9,10,11]},s={version:2,language:"Nederlands",letters:["HETKISAVIJF","TIENBTZVOOR","OVERMEKWART","HALFSPWOVER","VOORTHGEENS","TWEEPVCDRIE","VIERVIJFZES","ZEVENONEGEN","ACHTTIENELF","TWAALFBFUUR"],permanent:{1:[1,2,3,5,6]},minutes:{"0,1,2,3,4":{10:[9,10,11]},"5,6,7,8,9":[I,E],"10,11,12,13,14":[u,E],"15,16,17,18,19":[n,{4:[8,9,10,11]}],"20,21,22,23,24":[u,r,t],"25,26,27,28,29":[I,r,t],"30,31,32,33,34":t,"35,36,37,38,39":[I,E,t],"40,41,42,43,44":[u,E,t],"45,46,47,48,49":[n,{5:[1,2,3,4]}],"50,51,52,53,54":[u,r],"55,56,57,58,59":[I,r]},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(e){var E=e.getHours();return 20<=e.getMinutes()?(E+1)%24:E}};jQuery.fritteli.uhr.register("nl",s)}(),function(e){"use strict";var E={1:[1]},r={1:[2,3,4]},t={7:[8]},I={10:[5]},u={7:[7,8,9,10,11]},n={10:[7,8,9,10,11]},s={10:[1,2,3]},i={9:[1,2,4,5,6,7,8,9]},N={8:[1,2,3,4,5]},T={version:2,language:"Português",letters:["ÉSÃOUMATRÊS","MEIOLDIADEZ","DUASEISETEY","QUATROHNOVE","CINCOITONZE","ZMEIALNOITE","HORASYMENOS","VINTECAMEIA","UMVQUARTOPM","DEZOEYCINCO"],minutes:{"5,6,7,8,9":[t,n],"10,11,12,13,14":[t,s],"15,16,17,18,19":[t,i],"20,21,22,23,24":[t,N],"25,26,27,28,29":[t,N,I,n],"30,31,32,33,34":[t,{8:[8,9,10,11]}],"35,36,37,38,39":[u,N,I,n],"40,41,42,43,44":[u,N],"45,46,47,48,49":[u,i],"50,51,52,53,54":[u,s],"55,56,57,58,59":[u,n]},hours:{0:[E,{6:[2,3,4,5,7,8,9,10,11]}],12:[E,{2:[1,2,3,4,6,7,8]}],"1,13":[E,{1:[5,6,7]}],"2,14":[r,{3:[1,2,3,4]}],"3,15":[r,{1:[8,9,10,11]}],"4,16":[r,{4:[1,2,3,4,5,6]}],"5,17":[r,{5:[1,2,3,4,5]}],"6,18":[r,{3:[4,5,6,7]}],"7,19":[r,{3:[7,8,9,10]}],"8,20":[r,{5:[5,6,7,8]}],"9,21":[r,{4:[8,9,10,11]}],"10,22":[r,{2:[9,10,11]}],"11,23":[r,{5:[8,9,10,11]}]},getHour:function(e){var E=e.getHours();return 35<=e.getMinutes()?(E+1)%24:E}};jQuery.fritteli.uhr.register("pt",T)}();
diff --git a/dist/jquery.uhr.complete.js b/dist/jquery.uhr.complete.js
index a5796c3..138d05d 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 - v9.0.0-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.complete.min.js b/dist/jquery.uhr.complete.min.js
index e8b059f..6789c61 100644
--- a/dist/jquery.uhr.complete.min.js
+++ b/dist/jquery.uhr.complete.min.js
@@ -1,4 +1,5 @@
-/*! uhr - v8.0.4-dev.0 - 2016-06-27
+/*! uhr - v9.0.0-dev.0 - 2019-05-03
* 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
+* Copyright (c) 2019 Manuel Friedli; Licensed GPL-3.0 */
+
+!function(d){"use strict";var e,i,n,l={id:0,languages:[],themes:[],registerLanguage:function(e,i){l.languages.some(function(t){return e===t.code&&(console.error("Error: Language code '"+e+"' cannot be registered for language '"+i.language+"' because it is already registered for language '"+t.language+"'!"),!0)})||(i.code=e,l.languages.push(i))}};d("link[rel=stylesheet]").each(function(t,e){var i=d(e),n=i.attr("data-class");if(void 0!==n){var s=i.attr("data-name");void 0===s&&(s=n),l.themes.push({styleClass:n,name:s})}}),0===l.themes.length&&l.themes.push({});var s;function N(t,e){var i=t,n=e||"";this.addStyle=function(t){""===n?n=t:n+=" "+t},this.toString=function(){return''+i+""}}function o(t){var e={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]},i={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]},n={3:[3],4:[2,3],5:[3],6:[3],7:[3],8:[3],9:[2,3,4]},s={3:[9],4:[8,9],5:[9],6:[9],7:[9],8:[9],9:[8,9,10]},o={3:[2,3,4],4:[1,5],5:[5],6:[4],7:[3],8:[2],9:[1,2,3,4,5]},r={3:[8,9,10],4:[7,11],5:[11],6:[10],7:[9],8:[8],9:[7,8,9,10,11]},a={3:[1,2,3,4,5],4:[4],5:[3],6:[4],7:[5],8:[1,5],9:[2,3,4]},h={3:[7,8,9,10,11],4:[10],5:[9],6:[10],7:[11],8:[7,11],9:[8,9,10]},u={3:[4],4:[3,4],5:[2,4],6:[1,4],7:[1,2,3,4,5],8:[4],9:[4]},c={3:[10],4:[9,10],5:[8,10],6:[7,10],7:[7,8,9,10,11],8:[10],9:[10]},d={3:[1,2,3,4,5],4:[1],5:[1,2,3,4],6:[5],7:[5],8:[1,5],9:[2,3,4]},l={3:[7,8,9,10,11],4:[7],5:[7,8,9,10],6:[11],7:[11],8:[7,11],9:[8,9,10]},f={3:[9,10],4:[8],5:[7],6:[7,8,9,10],7:[7,11],8:[7,11],9:[8,9,10]},g={3:[7,8,9,10,11],4:[11],5:[10],6:[9],7:[8],8:[8],9:[8]},E={3:[8,9,10],4:[7,11],5:[7,11],6:[8,9,10],7:[7,11],8:[7,11],9:[8,9,10]},p={3:[8,9,10],4:[7,11],5:[7,11],6:[8,9,10,11],7:[11],8:[10],9:[8,9]},v={0:[e,i],1:[e,s],2:[e,r],3:[e,h],4:[e,c],5:[e,l],6:[e,f],7:[e,g],8:[e,E],9:[e,p],10:[n,i],11:[n,s],12:[n,r],13:[n,h],14:[n,c],15:[n,l],16:[n,f],17:[n,g],18:[n,E],19:[n,p],20:[o,i],21:[o,s],22:[o,r],23:[o,h],24:[o,c],25:[o,l],26:[o,f],27:[o,g],28:[o,E],29:[o,p],30:[a,i],31:[a,s],32:[a,r],33:[a,h],34:[a,c],35:[a,l],36:[a,f],37:[a,g],38:[a,E],39:[a,p],40:[u,i],41:[u,s],42:[u,r],43:[u,h],44:[u,c],45:[u,l],46:[u,f],47:[u,g],48:[u,E],49:[u,p],50:[d,i],51:[d,s],52:[d,r],53:[d,h],54:[d,c],55:[d,l],56:[d,f],57:[d,g],58:[d,E],59:[d,p]};function m(i,n,t){null!=t&&Object.keys(t).forEach(function(e){t[e].forEach(function(t){i[e-1][t-1].addStyle(n)})})}function I(e,i,t){null!=t&&(Array.isArray(t)?t.forEach(function(t){m(e,i,t)}):m(e,i,t))}function b(n,s,o){null!=o&&Object.keys(o).forEach(function(t){var e=t.split(","),i=o[t];e.forEach(function(t){I(n,s+t,i)})})}this.parse=function(){var s=[];return t.letters.forEach(function(t){for(var e=[],i=0;i")}),"function"==typeof t&&t(),s.fadeIn("fast")})}}function f(t){this.options.mode=t,this.currentMinute=-1,n.bind(this)(),e.bind(this)("uhr-mode",t)}function g(t){var e=this.element;e.css("width",t);var i=e.width();e.width(i),e.height(i),e.css("font-size",i/40+"px")}var a,h;a=function(){var t=this.element;if(t.addClass("uhr"),t.empty(),t.append(''),t.append(''),t.append(''),t.append(''),t.append(''),t.append(''),g.bind(this)(this.options.width),this.options.controls){var e=d(''),i=d('');e.append(i);var n=d('');n.append(''),n.append(''),i.append(n);var s=d('');if(s.append(''),s.append(''),i.append(s),1');l.languages.forEach(function(t){o.append('")}),i.append(o)}if(1');l.themes.forEach(function(t){r.append('")}),i.append(r)}var a=d('');a.on("click",function(){d("#uhr-controlpanel"+this.id).hide("fast")}.bind(this)),i.append(a),t.after(e),e.hide();var h=d('');h.on("click",function(){(function(){d("#uhr-controlpanel"+this.id).toggle("fast")}).bind(this)()}.bind(this)),t.after(h)}},h=function(){var t=d("#uhr-onoffswitch-checkbox"+this.id);t.on("click",function(){this.toggle()}.bind(this));var e=d.cookie("uhr-status"+this.id);void 0!==e&&!this.options.force||(e=this.options.status),t.prop("checked","on"===e),"on"===e?this.start():this.stop();var i=d("#uhr-modeswitch-checkbox"+this.id);i.on("click",function(){"seconds"===this.options.mode?f.bind(this)("normal"):f.bind(this)("seconds")}.bind(this));var n=d.cookie("uhr-mode"+this.id);void 0!==n&&!this.options.force||(n=this.options.mode),i.prop("checked","seconds"!==n),"seconds"===n?f.bind(this)("seconds"):f.bind(this)("normal");var s=d("#uhr-languagechooser"+this.id);s.on("change",function(){var t=d("#uhr-languagechooser"+this.id).val();this.language(t)}.bind(this));var o=d.cookie("uhr-language"+this.id);void 0!==o&&!this.options.force||(o=this.options.language);var r,a=l.languages.some(function(t){return o===t.code});a||(r=0=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
+* Copyright (c) 2019 Manuel Friedli; Licensed GPL-3.0 */
+
+!function(e){"use strict";var E={4:[8,9,10,11]},r={4:[1,2,3]},t={5:[1,2,3,4]},I={1:[8,9,10,11]},u={2:[1,2,3,4]},n={2:[5,6,7,8,9,10,11]},s={version:2,language:"Deutsch",letters:["ESKISTAFÜNF","ZEHNZWANZIG","DREIVIERTEL","VORFUNKNACH","HALBAELFÜNF","EINSXAMZWEI","DREIPMJVIER","SECHSNLACHT","SIEBENZWÖLF","ZEHNEUNKUHR"],permanent:{1:[1,2,4,5,6]},minutes:{"0,1,2,3,4":{10:[9,10,11]},"5,6,7,8,9":[I,E],"10,11,12,13,14":[u,E],"15,16,17,18,19":[{3:[5,6,7,8,9,10,11]},E],"20,21,22,23,24":[n,E],"25,26,27,28,29":[I,r,t],"30,31,32,33,34":t,"35,36,37,38,39":[I,E,t],"40,41,42,43,44":[n,r],"45,46,47,48,49":{3:[1,2,3,4,5,6,7,8,9,10,11]},"50,51,52,53,54":[u,r],"55,56,57,58,59":[I,r]},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]}}};jQuery.fritteli.uhr.register("de",s)}(),function(e){"use strict";var E={4:[1,2]},r={3:[9,10,11]},t={4:[4,5,6,7,8]},I={1:[9,10,11]},u={2:[9,10,11]},n={2:[1,2,3,4,5,6]},s={3:[1,2,3,4,5,6]},i={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:{1:[1,2,4,5,6,7]},minutes:{"5,6,7,8,9":[I,E],"10,11,12,13,14":[u,E],"15,16,17,18,19":[n,E],"20,21,22,23,24":[s,E],"25,26,27,28,29":[I,r,t],"30,31,32,33,34":t,"35,36,37,38,39":[I,E,t],"40,41,42,43,44":[s,r],"45,46,47,48,49":[n,r],"50,51,52,53,54":[u,r],"55,56,57,58,59":[I,r]},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]}}};jQuery.fritteli.uhr.register("de_CH",i)}(),function(e){"use strict";var E={4:[4,5]},r={4:[1,2,3]},t={4:[7,8,9,10,11]},I={1:[9,10,11]},u={2:[9,10,11]},n={2:[1,2,3,4,5,6]},s={3:[1,2,3,4,5,6]},i={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:{1:[1,2,4,5,6,7]},minutes:{0:{3:[7,8,9,10,11]},"5,6,7,8,9":[I,E],"10,11,12,13,14":[u,E],"15,16,17,18,19":[n,E],"20,21,22,23,24":[s,E],"25,26,27,28,29":[I,r,t],"30,31,32,33,34":t,"35,36,37,38,39":[I,E,t],"40,41,42,43,44":[s,r],"45,46,47,48,49":[n,r],"50,51,52,53,54":[u,r],"55,56,57,58,59":[I,r]},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]}}};jQuery.fritteli.uhr.register("de_CH_genau",i)}(),function(e){"use strict";var E={4:[4,5,6,7,8,9,10,11]},r={5:[8]},t={5:[4,5,6,7]},I={2:[1,2,3]},u={4:[1,2]},n={3:[4,5,6,7,8]},s={2:[4,5,6,7]},i={6:[8,9,10,11]},N={version:2,language:"Dansk",letters:["KLOKKENVERO","FEMTYVESKLA","OJEKVARTVAT","TIAMINUTTER","VEMOVERILMF","MONALISHALV","ETTOTREFIRE","FEMSEKSRSYV","OTTERNIMETI","ELLEVEATOLV"],permanent:{1:[1,2,3,4,5,6,7,9,10]},minutes:{"5,6,7,8,9":[I,E,t],"10,11,12,13,14":[u,E,t],"15,16,17,18,19":[n,t],"20,21,22,23,24":[s,E,t],"25,26,27,28,29":[I,E,r,i],"30,31,32,33,34":[i],"35,36,37,38,39":[I,E,t,i],"40,41,42,43,44":[s,E,r],"45,46,47,48,49":[n,r],"50,51,52,53,54":[u,E,r],"55,56,57,58,59":[I,E,r]},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(e){var E=e.getHours();return 25<=e.getMinutes()?(E+1)%24:E}};jQuery.fritteli.uhr.register("dk",N)}(),function(e){"use strict";var E={4:[10,11]},r={5:[1,2,3,4]},t={3:[7,8,9,10]},I={4:[6,7,8]},u={2:[1,3,4,5,6,7,8,9]},n={3:[1,2,3,4,5,6]},s={3:[1,2,3,4,5,6,7,8,9,10]},i={version:2,language:"English",letters:["ITLISBFAMPM","ACQUARTERDC","TWENTYFIVEX","HALFBTENFTO","PASTERUNINE","ONESIXTHREE","FOURFIVETWO","EIGHTELEVEN","SEVENTWELVE","TENSO'CLOCK"],permanent:{1:[1,2,4,5]},minutes:{"0,1,2,3,4":{10:[5,6,7,8,9,10,11]},"5,6,7,8,9":[t,r],"10,11,12,13,14":[I,r],"15,16,17,18,19":[u,r],"20,21,22,23,24":[n,r],"25,26,27,28,29":[s,r],"30,31,32,33,34":[{4:[1,2,3,4]},r],"35,36,37,38,39":[s,E],"40,41,42,43,44":[n,E],"45,46,47,48,49":[u,E],"50,51,52,53,54":[I,E],"55,56,57,58,59":[t,E]},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(e){var E=e.getHours();return 35<=e.getMinutes()?(E+1)%24:E}};jQuery.fritteli.uhr.register("en",i)}(),function(e){"use strict";var E={1:[2,3,4,6,7,8]},r={7:[6]},t={7:[7,8,9,10,11]},I={9:[7,8,9,10,11]},u={8:[8,9,10,11]},n={10:[6,7,8,9,10,11]},s={8:[2,3,4,5,6,7]},i={9:[1,2,3,4,5,6,7,8,9,10,11]},N={version:2,language:"Español",letters:["ESONELASUNA","DOSITRESORE","CUATROCINCO","SEISASIETEN","OCHONUEVEYO","LADIEZSONCE","DOCELYMENOS","OVEINTEDIEZ","VEINTICINCO","MEDIACUARTO"],permanent:[],minutes:{"5,6,7,8,9":[r,I],"10,11,12,13,14":[r,u],"15,16,17,18,19":[r,n],"20,21,22,23,24":[r,s],"25,26,27,28,29":[r,i],"30,31,32,33,34":[r,{10:[1,2,3,4,5]}],"35,36,37,38,39":[t,i],"40,41,42,43,44":[t,s],"45,46,47,48,49":[t,n],"50,51,52,53,54":[t,u],"55,56,57,58,59":[t,I]},hours:{"0,12":[E,{7:[1,2,3,4]}],"1,13":[{1:[1,2,6,7]},{1:[9,10,11]}],"2,14":[E,{2:[1,2,3]}],"3,15":[E,{2:[5,6,7,8]}],"4,16":[E,{3:[1,2,3,4,5,6]}],"5,17":[E,{3:[7,8,9,10,11]}],"6,18":[E,{4:[1,2,3,4]}],"7,19":[E,{4:[6,7,8,9,10]}],"8,20":[E,{5:[1,2,3,4]}],"9,21":[E,{5:[5,6,7,8,9]}],"10,22":[E,{6:[3,4,5,6]}],"11,23":[E,{6:[8,9,10,11]}]},getHour:function(e){var E=e.getHours();return 35<=e.getMinutes()?(E+1)%24:E}};jQuery.fritteli.uhr.register("es",N)}(),function(e){"use strict";var E={8:[1,2]},r={7:[1,2,3,4,5]},t={6:[6,7,8,9,10,11]},I={9:[7,8,9,10]},u={7:[9,10,11]},n={8:[4,5,6,7,8]},s={9:[1,2,3,4,5]},i={9:[1,2,3,4,5,6,7,8,9,10]},N={version:2,language:"Français",letters:["ILNESTODEUX","QUATRETROIS","NEUFUNESEPT","HUITSIXCINQ","MIDIXMINUIT","ONZERHEURES","MOINSOLEDIX","ETRQUARTPMD","VINGT-CINQU","ETSDEMIEPAM"],permanent:{1:[1,2,4,5,6]},minutes:{"5,6,7,8,9":I,"10,11,12,13,14":u,"15,16,17,18,19":[E,n],"20,21,22,23,24":s,"25,26,27,28,29":i,"30,31,32,33,34":[E,{10:[4,5,6,7,8]}],"35,36,37,38,39":[r,i],"40,41,42,43,44":[r,s],"45,46,47,48,49":[r,{7:[7,8]},n],"50,51,52,53,54":[r,u],"55,56,57,58,59":[r,I]},hours:{0:{5:[6,7,8,9,10,11]},"1,13":[{3:[5,6,7]},t],"2,14":[{1:[8,9,10,11]},t],"3,15":[{2:[7,8,9,10,11]},t],"4,16":[{2:[1,2,3,4,5,6]},t],"5,17":[{4:[8,9,10,11]},t],"6,18":[{4:[5,6,7]},t],"7,19":[{3:[8,9,10,11]},t],"8,20":[{4:[1,2,3,4]},t],"9,21":[{3:[1,2,3,4]},t],"10,22":[{5:[3,4,5]},t],"11,23":[{6:[1,2,3,4]},t],12:{5:[1,2,3,4]}},getHour:function(e){var E=e.getHours();return 35<=e.getMinutes()?(E+1)%24:E}};jQuery.fritteli.uhr.register("fr",N)}(),function(e){"use strict";var E={1:[1,2,3,4,6,7]},r={8:[1]},t={7:[8,9,10,11]},I={9:[6,7,8,9,10,11]},u={10:[1,2,3,4,5]},n={8:[3,4,6,7,8,9,10,11]},s={9:[1,2,3,4,5]},i={9:[1,2,3,4,5,6,7,8,9,10,11]},N={version:2,language:"Italiano",letters:["SONORLEBORE","ÈRL'UNASDUE","TREOTTONOVE","DIECIUNDICI","DODICISETTE","QUATTROCSEI","CINQUEAMENO","ECUNOQUARTO","VENTICINQUE","DIECIPMEZZA"],permanent:[],minutes:{"5,6,7,8,9":[r,I],"10,11,12,13,14":[r,u],"15,16,17,18,19":[r,n],"20,21,22,23,24":[r,s],"25,26,27,28,29":[r,i],"30,31,32,33,34":[r,{10:[7,8,9,10,11]}],"35,36,37,38,39":[t,i],"40,41,42,43,44":[t,s],"45,46,47,48,49":[t,n],"50,51,52,53,54":[t,u],"55,56,57,58,59":[t,I]},hours:{"0,12":[E,{5:[1,2,3,4,5,6]}],"1,13":[{2:[1,3,4]},{2:[5,6,7]}],"2,14":[E,{2:[9,10,11]}],"3,15":[E,{3:[1,2,3]}],"4,16":[E,{6:[1,2,3,4,5,6,7]}],"5,17":[E,{7:[1,2,3,4,5,6]}],"6,18":[E,{6:[9,10,11]}],"7,19":[E,{5:[7,8,9,10,11]}],"8,20":[E,{3:[4,5,6,7]}],"9,21":[E,{3:[8,9,10,11]}],"10,22":[E,{4:[1,2,3,4,5]}],"11,23":[E,{4:[6,7,8,9,10,11]}]},getHour:function(e){var E=e.getHours();return 35<=e.getMinutes()?(E+1)%24:E}};jQuery.fritteli.uhr.register("it",N)}(),function(e){"use strict";var E={3:[1,2,3,4]},r={2:[8,9,10,11]},t={4:[1,2,3,4]},I={1:[8,9,10,11]},u={2:[1,2,3,4]},n={3:[7,8,9,10,11]},s={version:2,language:"Nederlands",letters:["HETKISAVIJF","TIENBTZVOOR","OVERMEKWART","HALFSPWOVER","VOORTHGEENS","TWEEPVCDRIE","VIERVIJFZES","ZEVENONEGEN","ACHTTIENELF","TWAALFBFUUR"],permanent:{1:[1,2,3,5,6]},minutes:{"0,1,2,3,4":{10:[9,10,11]},"5,6,7,8,9":[I,E],"10,11,12,13,14":[u,E],"15,16,17,18,19":[n,{4:[8,9,10,11]}],"20,21,22,23,24":[u,r,t],"25,26,27,28,29":[I,r,t],"30,31,32,33,34":t,"35,36,37,38,39":[I,E,t],"40,41,42,43,44":[u,E,t],"45,46,47,48,49":[n,{5:[1,2,3,4]}],"50,51,52,53,54":[u,r],"55,56,57,58,59":[I,r]},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(e){var E=e.getHours();return 20<=e.getMinutes()?(E+1)%24:E}};jQuery.fritteli.uhr.register("nl",s)}(),function(e){"use strict";var E={1:[1]},r={1:[2,3,4]},t={7:[8]},I={10:[5]},u={7:[7,8,9,10,11]},n={10:[7,8,9,10,11]},s={10:[1,2,3]},i={9:[1,2,4,5,6,7,8,9]},N={8:[1,2,3,4,5]},T={version:2,language:"Português",letters:["ÉSÃOUMATRÊS","MEIOLDIADEZ","DUASEISETEY","QUATROHNOVE","CINCOITONZE","ZMEIALNOITE","HORASYMENOS","VINTECAMEIA","UMVQUARTOPM","DEZOEYCINCO"],minutes:{"5,6,7,8,9":[t,n],"10,11,12,13,14":[t,s],"15,16,17,18,19":[t,i],"20,21,22,23,24":[t,N],"25,26,27,28,29":[t,N,I,n],"30,31,32,33,34":[t,{8:[8,9,10,11]}],"35,36,37,38,39":[u,N,I,n],"40,41,42,43,44":[u,N],"45,46,47,48,49":[u,i],"50,51,52,53,54":[u,s],"55,56,57,58,59":[u,n]},hours:{0:[E,{6:[2,3,4,5,7,8,9,10,11]}],12:[E,{2:[1,2,3,4,6,7,8]}],"1,13":[E,{1:[5,6,7]}],"2,14":[r,{3:[1,2,3,4]}],"3,15":[r,{1:[8,9,10,11]}],"4,16":[r,{4:[1,2,3,4,5,6]}],"5,17":[r,{5:[1,2,3,4,5]}],"6,18":[r,{3:[4,5,6,7]}],"7,19":[r,{3:[7,8,9,10]}],"8,20":[r,{5:[5,6,7,8]}],"9,21":[r,{4:[8,9,10,11]}],"10,22":[r,{2:[9,10,11]}],"11,23":[r,{5:[8,9,10,11]}]},getHour:function(e){var E=e.getHours();return 35<=e.getMinutes()?(E+1)%24:E}};jQuery.fritteli.uhr.register("pt",T)}();
diff --git a/dist/jquery.uhr.main.js b/dist/jquery.uhr.main.js
index 5b3bb5a..5fc0502 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 - v9.0.0-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
index 0ac22a6..e15c1b2 100644
--- a/dist/jquery.uhr.main.min.js
+++ b/dist/jquery.uhr.main.min.js
@@ -1,4 +1,5 @@
-/*! uhr - v8.0.4-dev.0 - 2016-06-27
+/*! uhr - v9.0.0-dev.0 - 2019-05-03
* 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
+* Copyright (c) 2019 Manuel Friedli; Licensed GPL-3.0 */
+
+!function(u){"use strict";var i,e,n,l={id:0,languages:[],themes:[],registerLanguage:function(i,e){l.languages.some(function(t){return i===t.code&&(console.error("Error: Language code '"+i+"' cannot be registered for language '"+e.language+"' because it is already registered for language '"+t.language+"'!"),!0)})||(e.code=i,l.languages.push(e))}};u("link[rel=stylesheet]").each(function(t,i){var e=u(i),n=e.attr("data-class");if(void 0!==n){var s=e.attr("data-name");void 0===s&&(s=n),l.themes.push({styleClass:n,name:s})}}),0===l.themes.length&&l.themes.push({});var s;function y(t,i){var e=t,n=i||"";this.addStyle=function(t){""===n?n=t:n+=" "+t},this.toString=function(){return''+e+""}}function o(t){var i={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]},e={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]},n={3:[3],4:[2,3],5:[3],6:[3],7:[3],8:[3],9:[2,3,4]},s={3:[9],4:[8,9],5:[9],6:[9],7:[9],8:[9],9:[8,9,10]},o={3:[2,3,4],4:[1,5],5:[5],6:[4],7:[3],8:[2],9:[1,2,3,4,5]},h={3:[8,9,10],4:[7,11],5:[11],6:[10],7:[9],8:[8],9:[7,8,9,10,11]},a={3:[1,2,3,4,5],4:[4],5:[3],6:[4],7:[5],8:[1,5],9:[2,3,4]},r={3:[7,8,9,10,11],4:[10],5:[9],6:[10],7:[11],8:[7,11],9:[8,9,10]},c={3:[4],4:[3,4],5:[2,4],6:[1,4],7:[1,2,3,4,5],8:[4],9:[4]},d={3:[10],4:[9,10],5:[8,10],6:[7,10],7:[7,8,9,10,11],8:[10],9:[10]},u={3:[1,2,3,4,5],4:[1],5:[1,2,3,4],6:[5],7:[5],8:[1,5],9:[2,3,4]},l={3:[7,8,9,10,11],4:[7],5:[7,8,9,10],6:[11],7:[11],8:[7,11],9:[8,9,10]},f={3:[9,10],4:[8],5:[7],6:[7,8,9,10],7:[7,11],8:[7,11],9:[8,9,10]},p={3:[7,8,9,10,11],4:[11],5:[10],6:[9],7:[8],8:[8],9:[8]},g={3:[8,9,10],4:[7,11],5:[7,11],6:[8,9,10],7:[7,11],8:[7,11],9:[8,9,10]},m={3:[8,9,10],4:[7,11],5:[7,11],6:[8,9,10,11],7:[11],8:[10],9:[8,9]},v={0:[i,e],1:[i,s],2:[i,h],3:[i,r],4:[i,d],5:[i,l],6:[i,f],7:[i,p],8:[i,g],9:[i,m],10:[n,e],11:[n,s],12:[n,h],13:[n,r],14:[n,d],15:[n,l],16:[n,f],17:[n,p],18:[n,g],19:[n,m],20:[o,e],21:[o,s],22:[o,h],23:[o,r],24:[o,d],25:[o,l],26:[o,f],27:[o,p],28:[o,g],29:[o,m],30:[a,e],31:[a,s],32:[a,h],33:[a,r],34:[a,d],35:[a,l],36:[a,f],37:[a,p],38:[a,g],39:[a,m],40:[c,e],41:[c,s],42:[c,h],43:[c,r],44:[c,d],45:[c,l],46:[c,f],47:[c,p],48:[c,g],49:[c,m],50:[u,e],51:[u,s],52:[u,h],53:[u,r],54:[u,d],55:[u,l],56:[u,f],57:[u,p],58:[u,g],59:[u,m]};function b(e,n,t){null!=t&&Object.keys(t).forEach(function(i){t[i].forEach(function(t){e[i-1][t-1].addStyle(n)})})}function w(i,e,t){null!=t&&(Array.isArray(t)?t.forEach(function(t){b(i,e,t)}):b(i,e,t))}function k(n,s,o){null!=o&&Object.keys(o).forEach(function(t){var i=t.split(","),e=o[t];i.forEach(function(t){w(n,s+t,e)})})}this.parse=function(){var s=[];return t.letters.forEach(function(t){for(var i=[],e=0;e")}),"function"==typeof t&&t(),s.fadeIn("fast")})}}function f(t){this.options.mode=t,this.currentMinute=-1,n.bind(this)(),i.bind(this)("uhr-mode",t)}function p(t){var i=this.element;i.css("width",t);var e=i.width();i.width(e),i.height(e),i.css("font-size",e/40+"px")}var a,r;a=function(){var t=this.element;if(t.addClass("uhr"),t.empty(),t.append(''),t.append(''),t.append(''),t.append(''),t.append(''),t.append(''),p.bind(this)(this.options.width),this.options.controls){var i=u(''),e=u('');i.append(e);var n=u('');n.append(''),n.append(''),e.append(n);var s=u('');if(s.append(''),s.append(''),e.append(s),1');l.languages.forEach(function(t){o.append('")}),e.append(o)}if(1');l.themes.forEach(function(t){h.append('")}),e.append(h)}var a=u('');a.on("click",function(){u("#uhr-controlpanel"+this.id).hide("fast")}.bind(this)),e.append(a),t.after(i),i.hide();var r=u('');r.on("click",function(){(function(){u("#uhr-controlpanel"+this.id).toggle("fast")}).bind(this)()}.bind(this)),t.after(r)}},r=function(){var t=u("#uhr-onoffswitch-checkbox"+this.id);t.on("click",function(){this.toggle()}.bind(this));var i=u.cookie("uhr-status"+this.id);void 0!==i&&!this.options.force||(i=this.options.status),t.prop("checked","on"===i),"on"===i?this.start():this.stop();var e=u("#uhr-modeswitch-checkbox"+this.id);e.on("click",function(){"seconds"===this.options.mode?f.bind(this)("normal"):f.bind(this)("seconds")}.bind(this));var n=u.cookie("uhr-mode"+this.id);void 0!==n&&!this.options.force||(n=this.options.mode),e.prop("checked","seconds"!==n),"seconds"===n?f.bind(this)("seconds"):f.bind(this)("normal");var s=u("#uhr-languagechooser"+this.id);s.on("change",function(){var t=u("#uhr-languagechooser"+this.id).val();this.language(t)}.bind(this));var o=u.cookie("uhr-language"+this.id);void 0!==o&&!this.options.force||(o=this.options.language);var h,a=l.languages.some(function(t){return o===t.code});a||(h=0 elements
+ // (i.e., `typeof document.createElement( "object" ) === "function"`).
+ // We don't want to classify *any* DOM node as a function.
+ return typeof obj === "function" && typeof obj.nodeType !== "number";
+ };
+
+
+var isWindow = function isWindow( obj ) {
+ return obj != null && obj === obj.window;
+ };
+
+
+
+
+ var preservedScriptAttributes = {
+ type: true,
+ src: true,
+ nonce: true,
+ noModule: true
+ };
+
+ function DOMEval( code, node, doc ) {
+ doc = doc || document;
+
+ var i, val,
+ script = doc.createElement( "script" );
+
+ script.text = code;
+ if ( node ) {
+ for ( i in preservedScriptAttributes ) {
+
+ // Support: Firefox 64+, Edge 18+
+ // Some browsers don't support the "nonce" property on scripts.
+ // On the other hand, just using `getAttribute` is not enough as
+ // the `nonce` attribute is reset to an empty string whenever it
+ // becomes browsing-context connected.
+ // See https://github.com/whatwg/html/issues/2369
+ // See https://html.spec.whatwg.org/#nonce-attributes
+ // The `node.getAttribute` check was added for the sake of
+ // `jQuery.globalEval` so that it can fake a nonce-containing node
+ // via an object.
+ val = node[ i ] || node.getAttribute && node.getAttribute( i );
+ if ( val ) {
+ script.setAttribute( i, val );
+ }
+ }
+ }
+ doc.head.appendChild( script ).parentNode.removeChild( script );
+ }
+
+
+function toType( obj ) {
+ if ( obj == null ) {
+ return obj + "";
+ }
+
+ // Support: Android <=2.3 only (functionish RegExp)
+ return typeof obj === "object" || typeof obj === "function" ?
+ class2type[ toString.call( obj ) ] || "object" :
+ typeof obj;
+}
+/* global Symbol */
+// Defining this global in .eslintrc.json would create a danger of using the global
+// unguarded in another place, it seems safer to define global only for this module
+
var
- // Use the correct document accordingly with window argument (sandbox)
- document = window.document,
-
- version = "2.1.4",
+ version = "3.4.1",
// Define a local copy of jQuery
jQuery = function( selector, context ) {
+
// The jQuery object is actually just the init constructor 'enhanced'
// Need init if jQuery is called (just allow error to be thrown if not included)
return new jQuery.fn.init( selector, context );
},
- // Support: Android<4.1
+ // Support: Android <=4.0 only
// Make sure we trim BOM and NBSP
- rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
-
- // Matches dashed string for camelizing
- rmsPrefix = /^-ms-/,
- rdashAlpha = /-([\da-z])/gi,
-
- // Used by jQuery.camelCase as callback to replace()
- fcamelCase = function( all, letter ) {
- return letter.toUpperCase();
- };
+ rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
jQuery.fn = jQuery.prototype = {
+
// The current version of jQuery being used
jquery: version,
constructor: jQuery,
- // Start with an empty selector
- selector: "",
-
// The default length of a jQuery object is 0
length: 0,
@@ -111,13 +176,14 @@ jQuery.fn = jQuery.prototype = {
// Get the Nth element in the matched element set OR
// Get the whole matched element set as a clean array
get: function( num ) {
- return num != null ?
- // Return just the one element from the set
- ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
+ // Return all the elements in a clean array
+ if ( num == null ) {
+ return slice.call( this );
+ }
- // Return all the elements in a clean array
- slice.call( this );
+ // Return just the one element from the set
+ return num < 0 ? this[ num + this.length ] : this[ num ];
},
// Take an array of elements and push it onto the stack
@@ -129,23 +195,20 @@ jQuery.fn = jQuery.prototype = {
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
- ret.context = this.context;
// Return the newly-formed element set
return ret;
},
// Execute a callback for every element in the matched set.
- // (You can seed the arguments with an array of args, but this is
- // only used internally.)
- each: function( callback, args ) {
- return jQuery.each( this, callback, args );
+ each: function( callback ) {
+ return jQuery.each( this, callback );
},
map: function( callback ) {
- return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return this.pushStack( jQuery.map( this, function( elem, i ) {
return callback.call( elem, i, elem );
- }));
+ } ) );
},
slice: function() {
@@ -163,11 +226,11 @@ jQuery.fn = jQuery.prototype = {
eq: function( i ) {
var len = this.length,
j = +i + ( i < 0 ? len : 0 );
- return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
+ return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
},
end: function() {
- return this.prevObject || this.constructor(null);
+ return this.prevObject || this.constructor();
},
// For internal use only.
@@ -179,7 +242,7 @@ jQuery.fn = jQuery.prototype = {
jQuery.extend = jQuery.fn.extend = function() {
var options, name, src, copy, copyIsArray, clone,
- target = arguments[0] || {},
+ target = arguments[ 0 ] || {},
i = 1,
length = arguments.length,
deep = false;
@@ -194,7 +257,7 @@ jQuery.extend = jQuery.fn.extend = function() {
}
// Handle case when target is a string or something (possible in deep copy)
- if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ if ( typeof target !== "object" && !isFunction( target ) ) {
target = {};
}
@@ -205,27 +268,34 @@ jQuery.extend = jQuery.fn.extend = function() {
}
for ( ; i < length; i++ ) {
+
// Only deal with non-null/undefined values
- if ( (options = arguments[ i ]) != null ) {
+ if ( ( options = arguments[ i ] ) != null ) {
+
// Extend the base object
for ( name in options ) {
- src = target[ name ];
copy = options[ name ];
+ // Prevent Object.prototype pollution
// Prevent never-ending loop
- if ( target === copy ) {
+ if ( name === "__proto__" || target === copy ) {
continue;
}
// Recurse if we're merging plain objects or arrays
- if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
- if ( copyIsArray ) {
- copyIsArray = false;
- clone = src && jQuery.isArray(src) ? src : [];
+ if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
+ ( copyIsArray = Array.isArray( copy ) ) ) ) {
+ src = target[ name ];
+ // Ensure proper type for the source value
+ if ( copyIsArray && !Array.isArray( src ) ) {
+ clone = [];
+ } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
+ clone = {};
} else {
- clone = src && jQuery.isPlainObject(src) ? src : {};
+ clone = src;
}
+ copyIsArray = false;
// Never move original objects, clone them
target[ name ] = jQuery.extend( deep, clone, copy );
@@ -242,7 +312,8 @@ jQuery.extend = jQuery.fn.extend = function() {
return target;
};
-jQuery.extend({
+jQuery.extend( {
+
// Unique for each copy of jQuery on the page
expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
@@ -255,138 +326,55 @@ jQuery.extend({
noop: function() {},
- isFunction: function( obj ) {
- return jQuery.type(obj) === "function";
- },
-
- isArray: Array.isArray,
-
- isWindow: function( obj ) {
- return obj != null && obj === obj.window;
- },
-
- isNumeric: function( obj ) {
- // parseFloat NaNs numeric-cast false positives (null|true|false|"")
- // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
- // subtraction forces infinities to NaN
- // adding 1 corrects loss of precision from parseFloat (#15100)
- return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0;
- },
-
isPlainObject: function( obj ) {
- // Not plain objects:
- // - Any object or value whose internal [[Class]] property is not "[object Object]"
- // - DOM nodes
- // - window
- if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ var proto, Ctor;
+
+ // Detect obvious negatives
+ // Use toString instead of jQuery.type to catch host objects
+ if ( !obj || toString.call( obj ) !== "[object Object]" ) {
return false;
}
- if ( obj.constructor &&
- !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
- return false;
+ proto = getProto( obj );
+
+ // Objects with no prototype (e.g., `Object.create( null )`) are plain
+ if ( !proto ) {
+ return true;
}
- // If the function hasn't returned already, we're confident that
- // |obj| is a plain object, created by {} or constructed with new Object
- return true;
+ // Objects with prototype are plain iff they were constructed by a global Object function
+ Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
+ return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
},
isEmptyObject: function( obj ) {
var name;
+
for ( name in obj ) {
return false;
}
return true;
},
- type: function( obj ) {
- if ( obj == null ) {
- return obj + "";
- }
- // Support: Android<4.0, iOS<6 (functionish RegExp)
- return typeof obj === "object" || typeof obj === "function" ?
- class2type[ toString.call(obj) ] || "object" :
- typeof obj;
- },
-
// Evaluates a script in a global context
- globalEval: function( code ) {
- var script,
- indirect = eval;
-
- code = jQuery.trim( code );
-
- if ( code ) {
- // If the code includes a valid, prologue position
- // strict mode pragma, execute code by injecting a
- // script tag into the document.
- if ( code.indexOf("use strict") === 1 ) {
- script = document.createElement("script");
- script.text = code;
- document.head.appendChild( script ).parentNode.removeChild( script );
- } else {
- // Otherwise, avoid the DOM node creation, insertion
- // and removal by using an indirect global eval
- indirect( code );
- }
- }
+ globalEval: function( code, options ) {
+ DOMEval( code, { nonce: options && options.nonce } );
},
- // Convert dashed to camelCase; used by the css and data modules
- // Support: IE9-11+
- // Microsoft forgot to hump their vendor prefix (#9572)
- camelCase: function( string ) {
- return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
- },
+ each: function( obj, callback ) {
+ var length, i = 0;
- nodeName: function( elem, name ) {
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
- },
-
- // args is for internal usage only
- each: function( obj, callback, args ) {
- var value,
- i = 0,
- length = obj.length,
- isArray = isArraylike( obj );
-
- if ( args ) {
- if ( isArray ) {
- for ( ; i < length; i++ ) {
- value = callback.apply( obj[ i ], args );
-
- if ( value === false ) {
- break;
- }
- }
- } else {
- for ( i in obj ) {
- value = callback.apply( obj[ i ], args );
-
- if ( value === false ) {
- break;
- }
+ if ( isArrayLike( obj ) ) {
+ length = obj.length;
+ for ( ; i < length; i++ ) {
+ if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
+ break;
}
}
-
- // A special, fast, case for the most common use of each
} else {
- if ( isArray ) {
- for ( ; i < length; i++ ) {
- value = callback.call( obj[ i ], i, obj[ i ] );
-
- if ( value === false ) {
- break;
- }
- }
- } else {
- for ( i in obj ) {
- value = callback.call( obj[ i ], i, obj[ i ] );
-
- if ( value === false ) {
- break;
- }
+ for ( i in obj ) {
+ if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
+ break;
}
}
}
@@ -394,7 +382,7 @@ jQuery.extend({
return obj;
},
- // Support: Android<4.1
+ // Support: Android <=4.0 only
trim: function( text ) {
return text == null ?
"" :
@@ -406,7 +394,7 @@ jQuery.extend({
var ret = results || [];
if ( arr != null ) {
- if ( isArraylike( Object(arr) ) ) {
+ if ( isArrayLike( Object( arr ) ) ) {
jQuery.merge( ret,
typeof arr === "string" ?
[ arr ] : arr
@@ -423,6 +411,8 @@ jQuery.extend({
return arr == null ? -1 : indexOf.call( arr, elem, i );
},
+ // Support: Android <=4.0 only, PhantomJS 1 only
+ // push.apply(_, arraylike) throws on ancient WebKit
merge: function( first, second ) {
var len = +second.length,
j = 0,
@@ -458,14 +448,13 @@ jQuery.extend({
// arg is for internal usage only
map: function( elems, callback, arg ) {
- var value,
+ var length, value,
i = 0,
- length = elems.length,
- isArray = isArraylike( elems ),
ret = [];
// Go through the array, translating each of the items to their new values
- if ( isArray ) {
+ if ( isArrayLike( elems ) ) {
+ length = elems.length;
for ( ; i < length; i++ ) {
value = callback( elems[ i ], i, arg );
@@ -492,77 +481,47 @@ jQuery.extend({
// A global GUID counter for objects
guid: 1,
- // Bind a function to a context, optionally partially applying any
- // arguments.
- proxy: function( fn, context ) {
- var tmp, args, proxy;
-
- if ( typeof context === "string" ) {
- tmp = fn[ context ];
- context = fn;
- fn = tmp;
- }
-
- // Quick check to determine if target is callable, in the spec
- // this throws a TypeError, but we will just return undefined.
- if ( !jQuery.isFunction( fn ) ) {
- return undefined;
- }
-
- // Simulated bind
- args = slice.call( arguments, 2 );
- proxy = function() {
- return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
- };
-
- // Set the guid of unique handler to the same of original handler, so it can be removed
- proxy.guid = fn.guid = fn.guid || jQuery.guid++;
-
- return proxy;
- },
-
- now: Date.now,
-
// jQuery.support is not used in Core but other projects attach their
// properties to it so it needs to exist.
support: support
-});
+} );
+
+if ( typeof Symbol === "function" ) {
+ jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
+}
// Populate the class2type map
-jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
+jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
+function( i, name ) {
class2type[ "[object " + name + "]" ] = name.toLowerCase();
-});
+} );
-function isArraylike( obj ) {
+function isArrayLike( obj ) {
- // Support: iOS 8.2 (not reproducible in simulator)
+ // Support: real iOS 8.2 only (not reproducible in simulator)
// `in` check used to prevent JIT error (gh-2145)
// hasOwn isn't used here due to false negatives
// regarding Nodelist length in IE
- var length = "length" in obj && obj.length,
- type = jQuery.type( obj );
+ var length = !!obj && "length" in obj && obj.length,
+ type = toType( obj );
- if ( type === "function" || jQuery.isWindow( obj ) ) {
+ if ( isFunction( obj ) || isWindow( obj ) ) {
return false;
}
- if ( obj.nodeType === 1 && length ) {
- return true;
- }
-
return type === "array" || length === 0 ||
typeof length === "number" && length > 0 && ( length - 1 ) in obj;
}
var Sizzle =
/*!
- * Sizzle CSS Selector Engine v2.2.0-pre
- * http://sizzlejs.com/
+ * Sizzle CSS Selector Engine v2.3.4
+ * https://sizzlejs.com/
*
- * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
+ * Copyright JS Foundation and other contributors
* Released under the MIT license
- * http://jquery.org/license
+ * https://js.foundation/
*
- * Date: 2014-12-16
+ * Date: 2019-04-08
*/
(function( window ) {
@@ -596,6 +555,7 @@ var i,
classCache = createCache(),
tokenCache = createCache(),
compilerCache = createCache(),
+ nonnativeSelectorCache = createCache(),
sortOrder = function( a, b ) {
if ( a === b ) {
hasDuplicate = true;
@@ -603,9 +563,6 @@ var i,
return 0;
},
- // General-purpose constants
- MAX_NEGATIVE = 1 << 31,
-
// Instance methods
hasOwn = ({}).hasOwnProperty,
arr = [],
@@ -614,7 +571,7 @@ var i,
push = arr.push,
slice = arr.slice,
// Use a stripped-down indexOf as it's faster than native
- // http://jsperf.com/thor-indexof-vs-for/5
+ // https://jsperf.com/thor-indexof-vs-for/5
indexOf = function( list, elem ) {
var i = 0,
len = list.length;
@@ -630,25 +587,21 @@ var i,
// Regular expressions
- // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
+ // http://www.w3.org/TR/css3-selectors/#whitespace
whitespace = "[\\x20\\t\\r\\n\\f]",
- // http://www.w3.org/TR/css3-syntax/#characters
- characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
- // Loosely modeled on CSS identifier characters
- // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
- // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
- identifier = characterEncoding.replace( "w", "w#" ),
+ // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
+ identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
- attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
+ attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
// Operator (capture 2)
"*([*^$|!~]?=)" + whitespace +
// "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
"*\\]",
- pseudos = ":(" + characterEncoding + ")(?:\\((" +
+ pseudos = ":(" + identifier + ")(?:\\((" +
// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
// 1. quoted (capture 3; capture 4 or capture 5)
"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
@@ -664,16 +617,15 @@ var i,
rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
-
- rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
+ rdescend = new RegExp( whitespace + "|>" ),
rpseudo = new RegExp( pseudos ),
ridentifier = new RegExp( "^" + identifier + "$" ),
matchExpr = {
- "ID": new RegExp( "^#(" + characterEncoding + ")" ),
- "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
- "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
+ "ID": new RegExp( "^#(" + identifier + ")" ),
+ "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
+ "TAG": new RegExp( "^(" + identifier + "|[*])" ),
"ATTR": new RegExp( "^" + attributes ),
"PSEUDO": new RegExp( "^" + pseudos ),
"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
@@ -686,6 +638,7 @@ var i,
whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
},
+ rhtml = /HTML$/i,
rinputs = /^(?:input|select|textarea|button)$/i,
rheader = /^h\d$/i,
@@ -695,9 +648,9 @@ var i,
rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
rsibling = /[+~]/,
- rescape = /'|\\/g,
- // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+ // CSS escapes
+ // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
funescape = function( _, escaped, escapedWhitespace ) {
var high = "0x" + escaped - 0x10000;
@@ -713,13 +666,39 @@ var i,
String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
},
+ // CSS string/identifier serialization
+ // https://drafts.csswg.org/cssom/#common-serializing-idioms
+ rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
+ fcssescape = function( ch, asCodePoint ) {
+ if ( asCodePoint ) {
+
+ // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
+ if ( ch === "\0" ) {
+ return "\uFFFD";
+ }
+
+ // Control characters and (dependent upon position) numbers get escaped as code points
+ return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
+ }
+
+ // Other potentially-special ASCII characters get backslash-escaped
+ return "\\" + ch;
+ },
+
// Used for iframes
// See setDocument()
// Removing the function wrapper causes a "Permission Denied"
// error in IE
unloadHandler = function() {
setDocument();
- };
+ },
+
+ inDisabledFieldset = addCombinator(
+ function( elem ) {
+ return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
+ },
+ { dir: "parentNode", next: "legend" }
+ );
// Optimize for push.apply( _, NodeList )
try {
@@ -751,103 +730,131 @@ try {
}
function Sizzle( selector, context, results, seed ) {
- var match, elem, m, nodeType,
- // QSA vars
- i, groups, old, nid, newContext, newSelector;
+ var m, i, elem, nid, match, groups, newSelector,
+ newContext = context && context.ownerDocument,
- if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
- setDocument( context );
- }
+ // nodeType defaults to 9, since context defaults to document
+ nodeType = context ? context.nodeType : 9;
- context = context || document;
results = results || [];
- nodeType = context.nodeType;
+ // Return early from calls with invalid selector or context
if ( typeof selector !== "string" || !selector ||
nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
return results;
}
- if ( !seed && documentIsHTML ) {
+ // Try to shortcut find operations (as opposed to filters) in HTML documents
+ if ( !seed ) {
+
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
+ setDocument( context );
+ }
+ context = context || document;
+
+ if ( documentIsHTML ) {
+
+ // If the selector is sufficiently simple, try using a "get*By*" DOM method
+ // (excepting DocumentFragment context, where the methods don't exist)
+ if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
+
+ // ID selector
+ if ( (m = match[1]) ) {
+
+ // Document context
+ if ( nodeType === 9 ) {
+ if ( (elem = context.getElementById( m )) ) {
+
+ // Support: IE, Opera, Webkit
+ // TODO: identify versions
+ // getElementById can match elements by name instead of ID
+ if ( elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ } else {
+ return results;
+ }
+
+ // Element context
+ } else {
+
+ // Support: IE, Opera, Webkit
+ // TODO: identify versions
+ // getElementById can match elements by name instead of ID
+ if ( newContext && (elem = newContext.getElementById( m )) &&
+ contains( context, elem ) &&
+ elem.id === m ) {
- // Try to shortcut find operations when possible (e.g., not under DocumentFragment)
- if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
- // Speed-up: Sizzle("#ID")
- if ( (m = match[1]) ) {
- if ( nodeType === 9 ) {
- elem = context.getElementById( m );
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document (jQuery #6963)
- if ( elem && elem.parentNode ) {
- // Handle the case where IE, Opera, and Webkit return items
- // by name instead of ID
- if ( elem.id === m ) {
results.push( elem );
return results;
}
+ }
+
+ // Type selector
+ } else if ( match[2] ) {
+ push.apply( results, context.getElementsByTagName( selector ) );
+ return results;
+
+ // Class selector
+ } else if ( (m = match[3]) && support.getElementsByClassName &&
+ context.getElementsByClassName ) {
+
+ push.apply( results, context.getElementsByClassName( m ) );
+ return results;
+ }
+ }
+
+ // Take advantage of querySelectorAll
+ if ( support.qsa &&
+ !nonnativeSelectorCache[ selector + " " ] &&
+ (!rbuggyQSA || !rbuggyQSA.test( selector )) &&
+
+ // Support: IE 8 only
+ // Exclude object elements
+ (nodeType !== 1 || context.nodeName.toLowerCase() !== "object") ) {
+
+ newSelector = selector;
+ newContext = context;
+
+ // qSA considers elements outside a scoping root when evaluating child or
+ // descendant combinators, which is not what we want.
+ // In such cases, we work around the behavior by prefixing every selector in the
+ // list with an ID selector referencing the scope context.
+ // Thanks to Andrew Dupont for this technique.
+ if ( nodeType === 1 && rdescend.test( selector ) ) {
+
+ // Capture the context ID, setting it first if necessary
+ if ( (nid = context.getAttribute( "id" )) ) {
+ nid = nid.replace( rcssescape, fcssescape );
} else {
- return results;
+ context.setAttribute( "id", (nid = expando) );
}
- } else {
- // Context is not a document
- if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
- contains( context, elem ) && elem.id === m ) {
- results.push( elem );
- return results;
+
+ // Prefix every selector in the list
+ groups = tokenize( selector );
+ i = groups.length;
+ while ( i-- ) {
+ groups[i] = "#" + nid + " " + toSelector( groups[i] );
}
+ newSelector = groups.join( "," );
+
+ // Expand context for sibling selectors
+ newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
+ context;
}
- // Speed-up: Sizzle("TAG")
- } else if ( match[2] ) {
- push.apply( results, context.getElementsByTagName( selector ) );
- return results;
-
- // Speed-up: Sizzle(".CLASS")
- } else if ( (m = match[3]) && support.getElementsByClassName ) {
- push.apply( results, context.getElementsByClassName( m ) );
- return results;
- }
- }
-
- // QSA path
- if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
- nid = old = expando;
- newContext = context;
- newSelector = nodeType !== 1 && selector;
-
- // qSA works strangely on Element-rooted queries
- // We can work around this by specifying an extra ID on the root
- // and working up from there (Thanks to Andrew Dupont for the technique)
- // IE 8 doesn't work on object elements
- if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
- groups = tokenize( selector );
-
- if ( (old = context.getAttribute("id")) ) {
- nid = old.replace( rescape, "\\$&" );
- } else {
- context.setAttribute( "id", nid );
- }
- nid = "[id='" + nid + "'] ";
-
- i = groups.length;
- while ( i-- ) {
- groups[i] = nid + toSelector( groups[i] );
- }
- newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
- newSelector = groups.join(",");
- }
-
- if ( newSelector ) {
try {
push.apply( results,
newContext.querySelectorAll( newSelector )
);
return results;
- } catch(qsaError) {
+ } catch ( qsaError ) {
+ nonnativeSelectorCache( selector, true );
} finally {
- if ( !old ) {
- context.removeAttribute("id");
+ if ( nid === expando ) {
+ context.removeAttribute( "id" );
}
}
}
@@ -860,7 +867,7 @@ function Sizzle( selector, context, results, seed ) {
/**
* Create key-value caches of limited size
- * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
+ * @returns {function(string, object)} Returns the Object data after storing it on itself with
* property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
* deleting the oldest entry
*/
@@ -889,22 +896,22 @@ function markFunction( fn ) {
/**
* Support testing using an element
- * @param {Function} fn Passed the created div and expects a boolean result
+ * @param {Function} fn Passed the created element and returns a boolean result
*/
function assert( fn ) {
- var div = document.createElement("div");
+ var el = document.createElement("fieldset");
try {
- return !!fn( div );
+ return !!fn( el );
} catch (e) {
return false;
} finally {
// Remove from its parent by default
- if ( div.parentNode ) {
- div.parentNode.removeChild( div );
+ if ( el.parentNode ) {
+ el.parentNode.removeChild( el );
}
// release memory in IE
- div = null;
+ el = null;
}
}
@@ -915,7 +922,7 @@ function assert( fn ) {
*/
function addHandle( attrs, handler ) {
var arr = attrs.split("|"),
- i = attrs.length;
+ i = arr.length;
while ( i-- ) {
Expr.attrHandle[ arr[i] ] = handler;
@@ -931,8 +938,7 @@ function addHandle( attrs, handler ) {
function siblingCheck( a, b ) {
var cur = b && a,
diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
- ( ~b.sourceIndex || MAX_NEGATIVE ) -
- ( ~a.sourceIndex || MAX_NEGATIVE );
+ a.sourceIndex - b.sourceIndex;
// Use IE sourceIndex if available on both nodes
if ( diff ) {
@@ -973,6 +979,62 @@ function createButtonPseudo( type ) {
};
}
+/**
+ * Returns a function to use in pseudos for :enabled/:disabled
+ * @param {Boolean} disabled true for :disabled; false for :enabled
+ */
+function createDisabledPseudo( disabled ) {
+
+ // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
+ return function( elem ) {
+
+ // Only certain elements can match :enabled or :disabled
+ // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
+ // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
+ if ( "form" in elem ) {
+
+ // Check for inherited disabledness on relevant non-disabled elements:
+ // * listed form-associated elements in a disabled fieldset
+ // https://html.spec.whatwg.org/multipage/forms.html#category-listed
+ // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
+ // * option elements in a disabled optgroup
+ // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
+ // All such elements have a "form" property.
+ if ( elem.parentNode && elem.disabled === false ) {
+
+ // Option elements defer to a parent optgroup if present
+ if ( "label" in elem ) {
+ if ( "label" in elem.parentNode ) {
+ return elem.parentNode.disabled === disabled;
+ } else {
+ return elem.disabled === disabled;
+ }
+ }
+
+ // Support: IE 6 - 11
+ // Use the isDisabled shortcut property to check for disabled fieldset ancestors
+ return elem.isDisabled === disabled ||
+
+ // Where there is no isDisabled, check manually
+ /* jshint -W018 */
+ elem.isDisabled !== !disabled &&
+ inDisabledFieldset( elem ) === disabled;
+ }
+
+ return elem.disabled === disabled;
+
+ // Try to winnow out elements that can't be disabled before trusting the disabled property.
+ // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
+ // even exist on them, let alone have a boolean value.
+ } else if ( "label" in elem ) {
+ return elem.disabled === disabled;
+ }
+
+ // Remaining elements are neither :enabled nor :disabled
+ return false;
+ };
+}
+
/**
* Returns a function to use in pseudos for positionals
* @param {Function} fn
@@ -1013,10 +1075,13 @@ support = Sizzle.support = {};
* @returns {Boolean} True iff elem is a non-HTML XML node
*/
isXML = Sizzle.isXML = function( elem ) {
- // documentElement is verified for cases where it doesn't yet exist
- // (such as loading iframes in IE - #4833)
- var documentElement = elem && (elem.ownerDocument || elem).documentElement;
- return documentElement ? documentElement.nodeName !== "HTML" : false;
+ var namespace = elem.namespaceURI,
+ docElem = (elem.ownerDocument || elem).documentElement;
+
+ // Support: IE <=8
+ // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
+ // https://bugs.jquery.com/ticket/4833
+ return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
};
/**
@@ -1025,96 +1090,119 @@ isXML = Sizzle.isXML = function( elem ) {
* @returns {Object} Returns the current document
*/
setDocument = Sizzle.setDocument = function( node ) {
- var hasCompare, parent,
+ var hasCompare, subWindow,
doc = node ? node.ownerDocument || node : preferredDoc;
- // If no document and documentElement is available, return
+ // Return early if doc is invalid or already selected
if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
return document;
}
- // Set our document
+ // Update global variables
document = doc;
- docElem = doc.documentElement;
- parent = doc.defaultView;
+ docElem = document.documentElement;
+ documentIsHTML = !isXML( document );
- // Support: IE>8
- // If iframe document is assigned to "document" variable and if iframe has been reloaded,
- // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
- // IE6-8 do not support the defaultView property so parent will be undefined
- if ( parent && parent !== parent.top ) {
- // IE11 does not have attachEvent, so all must suffer
- if ( parent.addEventListener ) {
- parent.addEventListener( "unload", unloadHandler, false );
- } else if ( parent.attachEvent ) {
- parent.attachEvent( "onunload", unloadHandler );
+ // Support: IE 9-11, Edge
+ // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
+ if ( preferredDoc !== document &&
+ (subWindow = document.defaultView) && subWindow.top !== subWindow ) {
+
+ // Support: IE 11, Edge
+ if ( subWindow.addEventListener ) {
+ subWindow.addEventListener( "unload", unloadHandler, false );
+
+ // Support: IE 9 - 10 only
+ } else if ( subWindow.attachEvent ) {
+ subWindow.attachEvent( "onunload", unloadHandler );
}
}
- /* Support tests
- ---------------------------------------------------------------------- */
- documentIsHTML = !isXML( doc );
-
/* Attributes
---------------------------------------------------------------------- */
// Support: IE<8
// Verify that getAttribute really returns attributes and not properties
// (excepting IE8 booleans)
- support.attributes = assert(function( div ) {
- div.className = "i";
- return !div.getAttribute("className");
+ support.attributes = assert(function( el ) {
+ el.className = "i";
+ return !el.getAttribute("className");
});
/* getElement(s)By*
---------------------------------------------------------------------- */
// Check if getElementsByTagName("*") returns only elements
- support.getElementsByTagName = assert(function( div ) {
- div.appendChild( doc.createComment("") );
- return !div.getElementsByTagName("*").length;
+ support.getElementsByTagName = assert(function( el ) {
+ el.appendChild( document.createComment("") );
+ return !el.getElementsByTagName("*").length;
});
// Support: IE<9
- support.getElementsByClassName = rnative.test( doc.getElementsByClassName );
+ support.getElementsByClassName = rnative.test( document.getElementsByClassName );
// Support: IE<10
// Check if getElementById returns elements by name
- // The broken getElementById methods don't pick up programatically-set names,
+ // The broken getElementById methods don't pick up programmatically-set names,
// so use a roundabout getElementsByName test
- support.getById = assert(function( div ) {
- docElem.appendChild( div ).id = expando;
- return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
+ support.getById = assert(function( el ) {
+ docElem.appendChild( el ).id = expando;
+ return !document.getElementsByName || !document.getElementsByName( expando ).length;
});
- // ID find and filter
+ // ID filter and find
if ( support.getById ) {
- Expr.find["ID"] = function( id, context ) {
- if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
- var m = context.getElementById( id );
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document #6963
- return m && m.parentNode ? [ m ] : [];
- }
- };
Expr.filter["ID"] = function( id ) {
var attrId = id.replace( runescape, funescape );
return function( elem ) {
return elem.getAttribute("id") === attrId;
};
};
+ Expr.find["ID"] = function( id, context ) {
+ if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
+ var elem = context.getElementById( id );
+ return elem ? [ elem ] : [];
+ }
+ };
} else {
- // Support: IE6/7
- // getElementById is not reliable as a find shortcut
- delete Expr.find["ID"];
-
Expr.filter["ID"] = function( id ) {
var attrId = id.replace( runescape, funescape );
return function( elem ) {
- var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+ var node = typeof elem.getAttributeNode !== "undefined" &&
+ elem.getAttributeNode("id");
return node && node.value === attrId;
};
};
+
+ // Support: IE 6 - 7 only
+ // getElementById is not reliable as a find shortcut
+ Expr.find["ID"] = function( id, context ) {
+ if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
+ var node, i, elems,
+ elem = context.getElementById( id );
+
+ if ( elem ) {
+
+ // Verify the id attribute
+ node = elem.getAttributeNode("id");
+ if ( node && node.value === id ) {
+ return [ elem ];
+ }
+
+ // Fall back on getElementsByName
+ elems = context.getElementsByName( id );
+ i = 0;
+ while ( (elem = elems[i++]) ) {
+ node = elem.getAttributeNode("id");
+ if ( node && node.value === id ) {
+ return [ elem ];
+ }
+ }
+ }
+
+ return [];
+ }
+ };
}
// Tag
@@ -1151,7 +1239,7 @@ setDocument = Sizzle.setDocument = function( node ) {
// Class
Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
- if ( documentIsHTML ) {
+ if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
return context.getElementsByClassName( className );
}
};
@@ -1168,77 +1256,87 @@ setDocument = Sizzle.setDocument = function( node ) {
// We allow this because of a bug in IE8/9 that throws an error
// whenever `document.activeElement` is accessed on an iframe
// So, we allow :focus to pass through QSA all the time to avoid the IE error
- // See http://bugs.jquery.com/ticket/13378
+ // See https://bugs.jquery.com/ticket/13378
rbuggyQSA = [];
- if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
+ if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
// Build QSA regex
// Regex strategy adopted from Diego Perini
- assert(function( div ) {
+ assert(function( el ) {
// Select is set to empty string on purpose
// This is to test IE's treatment of not explicitly
// setting a boolean content attribute,
// since its presence should be enough
- // http://bugs.jquery.com/ticket/12359
- docElem.appendChild( div ).innerHTML = "" +
- "