From 018367f1ceaeadb50806dc9d2ba7981b55cc3648 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Mon, 12 Jan 2015 18:49:30 +0100 Subject: [PATCH 01/24] first step of gruntifying/nodifying/bowerifying the whole thing --- .bowerrc | 3 + .editorconfig | 13 ++++ .gitignore | 4 +- .jshintrc | 8 ++- Gruntfile.js | 119 +++++++++++++++++++++++++++++++++ bower.json | 12 ++++ index.html | 11 +-- info/index.html | 4 +- package.json | 39 +++++++++++ {js => src}/uhr-de.js | 0 {js => src}/uhr-de_CH.js | 0 {js => src}/uhr-de_CH_genau.js | 0 {js => src}/uhr-dk.js | 0 {js => src}/uhr-en.js | 0 {js => src}/uhr-es.js | 0 {js => src}/uhr-fr.js | 0 {js => src}/uhr-it.js | 0 {js => src}/uhr-nl.js | 0 {js => src}/uhr.js | 2 +- test/test.html | 6 +- 20 files changed, 201 insertions(+), 20 deletions(-) create mode 100644 .bowerrc create mode 100644 .editorconfig create mode 100644 Gruntfile.js create mode 100644 bower.json create mode 100644 package.json rename {js => src}/uhr-de.js (100%) rename {js => src}/uhr-de_CH.js (100%) rename {js => src}/uhr-de_CH_genau.js (100%) rename {js => src}/uhr-dk.js (100%) rename {js => src}/uhr-en.js (100%) rename {js => src}/uhr-es.js (100%) rename {js => src}/uhr-fr.js (100%) rename {js => src}/uhr-it.js (100%) rename {js => src}/uhr-nl.js (100%) rename {js => src}/uhr.js (99%) diff --git a/.bowerrc b/.bowerrc new file mode 100644 index 0000000..44491d3 --- /dev/null +++ b/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "bower_components" +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e717f5e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# http://editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore index 07be4ff..98820ff 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ .idea *.iml atlassian-ide-plugin.xml - +/node_modules/ +/bower_components/ +/dist/ diff --git a/.jshintrc b/.jshintrc index 9a3a0c1..736c921 100644 --- a/.jshintrc +++ b/.jshintrc @@ -6,12 +6,14 @@ // Predefined globals whom JSHint will ignore. "browser" : true, // Standard browser globals e.g. `window`, `document`. - + "node" : true, "jquery" : true, "predef" : [ "suite", - "test" + "test", + "define", + "require" ], @@ -55,4 +57,4 @@ "trailing" : true, // Prohibit trailing whitespaces. "white" : false, // Check against strict whitespace and indentation rules. "indent" : 0 // Specify indentation spacing -} \ No newline at end of file +} diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..42589f3 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,119 @@ +module.exports = function (grunt) { + 'use strict'; + // Load all grunt tasks + require('load-grunt-tasks')(grunt); + // Show elapsed time at the end + require('time-grunt')(grunt); + + // Project configuration. + grunt.initConfig({ + // Metadata. + pkg: grunt.file.readJSON('package.json'), + banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' + + '<%= grunt.template.today("yyyy-mm-dd") %>\n' + + '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' + + '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' + + ' Licensed MIT */\n', + // Task configuration. + clean: { + files: ['dist'] + }, + concat: { + options: { + banner: '<%= banner %>', + stripBanners: true + }, + dist: { + src: ['src/uhr.js', 'src/uhr-*.js'], + dest: 'dist/jquery.<%= pkg.name %>.complete.js' + }, + mainonly: { + src: ['src/uhr.js'], + dest: ['dist/jquery.<%= pkg.name %>.js'] + }, + langonly: { + src: ['src/uhr-%.js'], + dest: ['dist/jquery.<%= pkg.name %>.langs.js'] + } + }, + uglify: { + options: { + banner: '<%= banner %>' + }, + dist: { + src: '<%= concat.dist.dest %>', + dest: 'dist/jquery.<%= pkg.name %>.complete.min.js' + }, + mainonly: { + src: '<%= concat.mainonly.dest %>', + dest: 'dist/jquery.<%= pkg.name %>.min.js' + }, + langonly: { + src: '<%= concat.langonly.dest %>', + dest: 'dist/jquery.<%= pkg.name %>.langs.min.js' + } + }, + qunit: { + all: { + options: { + urls: ['http://localhost:9000/test/<%= pkg.name %>.html'] + } + } + }, + jshint: { + options: { + reporter: require('jshint-stylish') + }, + gruntfile: { + options: { + jshintrc: '.jshintrc' + }, + src: 'Gruntfile.js' + }, + src: { + options: { + jshintrc: '.jshintrc' + }, + src: ['src/**/*.js'] +// }, +// test: { +// options: { +// jshintrc: 'test/.jshintrc' +// }, +// src: ['test/**/*.js'] + } + }, + watch: { + gruntfile: { + files: '<%= jshint.gruntfile.src %>', + tasks: ['jshint:gruntfile'] + }, + src: { + files: '<%= jshint.src.src %>', + tasks: ['jshint:src', 'qunit'] + }, + test: { + files: '<%= jshint.test.src %>', + tasks: ['jshint:test', 'qunit'] + } + }, + connect: { + server: { + options: { + hostname: '*', + port: 9000 + } + } + } + }); + + // Default task. + grunt.registerTask('default', ['jshint', 'connect', 'qunit', 'clean', 'concat', 'uglify']); + grunt.registerTask('buildonly', ['clean', 'concat', 'uglify']); + grunt.registerTask('server', function () { + grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.'); + grunt.task.run(['serve']); + }); + grunt.registerTask('serve', ['connect', 'watch']); + grunt.registerTask('test', ['jshint', 'connect', 'qunit']); +}; diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..5e85227 --- /dev/null +++ b/bower.json @@ -0,0 +1,12 @@ +{ + "name": "uhr", + "version": "0.0.1", + "dependencies": { + "jquery-ui": "~1.11.2", + "jquery-cookie": "~1.4.1" + }, + "devDependencies": { + "qunit": "~1.12.0", + "jquery": "latest" + } +} diff --git a/index.html b/index.html index 83abc1f..c03e6ee 100644 --- a/index.html +++ b/index.html @@ -34,16 +34,7 @@ along with this program. If not, see . - - - - - - - - - - + - - + + - - + +
- \ No newline at end of file + From c990752abc966513f636d4eb168b4f909be61228 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Tue, 13 Jan 2015 19:50:48 +0100 Subject: [PATCH 02/24] corrected absolutely silly syntax error in Gruntfile.js and added /dist directory --- .gitignore | 1 - Gruntfile.js | 6 +- dist/jquery.uhr.complete.js | 1424 +++++++++++++++++++++++++++++++ dist/jquery.uhr.complete.min.js | 4 + dist/jquery.uhr.langs.js | 652 ++++++++++++++ dist/jquery.uhr.langs.min.js | 4 + dist/jquery.uhr.main.js | 774 +++++++++++++++++ dist/jquery.uhr.min.js | 4 + 8 files changed, 2865 insertions(+), 4 deletions(-) create mode 100644 dist/jquery.uhr.complete.js create mode 100644 dist/jquery.uhr.complete.min.js create mode 100644 dist/jquery.uhr.langs.js create mode 100644 dist/jquery.uhr.langs.min.js create mode 100644 dist/jquery.uhr.main.js create mode 100644 dist/jquery.uhr.min.js diff --git a/.gitignore b/.gitignore index 98820ff..35aab8b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,3 @@ atlassian-ide-plugin.xml /node_modules/ /bower_components/ -/dist/ diff --git a/Gruntfile.js b/Gruntfile.js index 42589f3..a5ebe11 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -29,11 +29,11 @@ module.exports = function (grunt) { }, mainonly: { src: ['src/uhr.js'], - dest: ['dist/jquery.<%= pkg.name %>.js'] + dest: 'dist/jquery.<%= pkg.name %>.main.js' }, langonly: { - src: ['src/uhr-%.js'], - dest: ['dist/jquery.<%= pkg.name %>.langs.js'] + src: ['src/uhr-*.js'], + dest: 'dist/jquery.<%= pkg.name %>.langs.js' } }, uglify: { diff --git a/dist/jquery.uhr.complete.js b/dist/jquery.uhr.complete.js new file mode 100644 index 0000000..3569c02 --- /dev/null +++ b/dist/jquery.uhr.complete.js @@ -0,0 +1,1424 @@ +/*! uhr - v0.0.1 - 2015-01-13 +* http://bärneruhr.ch/ +* Copyright (c) 2015 Manuel Friedli; Licensed MIT */ +(function($) { + 'use strict'; + var uhrGlobals = { + "id": 0, + "languages": [], + "themes": [], + registerLanguage: function registerLanguage(code, language) { + 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 + "'!"); + return true; + } + return false; + }); + if (!alreadyExists) { + language.code = code; + uhrGlobals.languages.push(language); + } + } + }; + + // auto-detect themes + $('link[rel=stylesheet]').each(function(index, item) { + var styleSheet = $(item); + var styleClass = styleSheet.attr('data-class'); + if (styleClass !== undefined) { + var name = styleSheet.attr('data-name'); + if (name === undefined) { + name = styleClass; + } + uhrGlobals.themes.push({'styleClass': styleClass, 'name': name}); + } + }); + // fall-back if no theme was included + if (uhrGlobals.themes.length === 0) { + uhrGlobals.themes.push({}); + } + + // public interface methods (exported later) + var start = function start() { + if (!isOn.bind(this)()) { + this.timer = window.setInterval(function() { + this.options.time = new Date(); + update.bind(this)(); + }.bind(this), 1000); + update.bind(this)(); + setCookie.bind(this)('uhr-status', 'on'); + } + }; + var stop = function stop() { + if (isOn.bind(this)()) { + window.clearInterval(this.timer); + this.timer = null; + update.bind(this)(); + setCookie.bind(this)('uhr-status', 'off'); + } + }; + var toggle = function toggle() { + if (isOn.bind(this)()) { + this.stop(); + } else { + 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'); + }; + + // 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 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 + }); + $.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. + */ + 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; + } + } + 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'); + }); + }; + } + + function UhrRendererV2Delegate(layout) { + var vorne0 = { + 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] + }; + var hinten0 = { + 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] + }; + var vorne1 = { + 3: [3], + 4: [2, 3], + 5: [3], + 6: [3], + 7: [3], + 8: [3], + 9: [2, 3, 4] + }; + var hinten1 = { + 3: [9], + 4: [8, 9], + 5: [9], + 6: [9], + 7: [9], + 8: [9], + 9: [8, 9, 10] + }; + var vorne2 = { + 3: [2, 3, 4], + 4: [1, 5], + 5: [5], + 6: [4], + 7: [3], + 8: [2], + 9: [1, 2, 3, 4, 5] + }; + var hinten2 = { + 3: [8, 9, 10], + 4: [7, 11], + 5: [11], + 6: [10], + 7: [9], + 8: [8], + 9: [7, 8, 9, 10, 11] + }; + var vorne3 = { + 3: [1, 2, 3, 4, 5], + 4: [4], + 5: [3], + 6: [4], + 7: [5], + 8: [1, 5], + 9: [2, 3, 4] + }; + var hinten3 = { + 3: [7, 8, 9, 10, 11], + 4: [10], + 5: [9], + 6: [10], + 7: [11], + 8: [7, 11], + 9: [8, 9, 10] + }; + var vorne4 = { + 3: [4], + 4: [3, 4], + 5: [2, 4], + 6: [1, 4], + 7: [1, 2, 3, 4, 5], + 8: [4], + 9: [4] + }; + var hinten4 = { + 3: [10], + 4: [9, 10], + 5: [8, 10], + 6: [7, 10], + 7: [7, 8, 9, 10, 11], + 8: [10], + 9: [10] + }; + var vorne5 = { + 3: [1, 2, 3, 4, 5], + 4: [1], + 5: [1, 2, 3, 4], + 6: [5], + 7: [5], + 8: [1, 5], + 9: [2, 3, 4] + }; + var hinten5 = { + 3: [7, 8, 9, 10, 11], + 4: [7], + 5: [7, 8, 9, 10], + 6: [11], + 7: [11], + 8: [7, 11], + 9: [8, 9, 10] + }; + var hinten6 = { + 3: [9, 10], + 4: [8], + 5: [7], + 6: [7, 8, 9, 10], + 7: [7, 11], + 8: [7, 11], + 9: [8, 9, 10] + }; + var hinten7 = { + 3: [7, 8, 9, 10, 11], + 4: [11], + 5: [10], + 6: [9], + 7: [8], + 8: [8], + 9: [8] + }; + var hinten8 = { + 3: [8, 9, 10], + 4: [7, 11], + 5: [7, 11], + 6: [8, 9, 10], + 7: [7, 11], + 8: [7, 11], + 9: [8, 9, 10] + }; + var hinten9 = { + 3: [8, 9, 10], + 4: [7, 11], + 5: [7, 11], + 6: [8, 9, 10, 11], + 7: [11], + 8: [10], + 9: [8, 9] + }; + var seconds= { + "0": [vorne0, hinten0], + "1": [vorne0, hinten1], + "2": [vorne0, hinten2], + "3": [vorne0, hinten3], + "4": [vorne0, hinten4], + "5": [vorne0, hinten5], + "6": [vorne0, hinten6], + "7": [vorne0, hinten7], + "8": [vorne0, hinten8], + "9": [vorne0, hinten9], + "10": [vorne1, hinten0], + "11": [vorne1, hinten1], + "12": [vorne1, hinten2], + "13": [vorne1, hinten3], + "14": [vorne1, hinten4], + "15": [vorne1, hinten5], + "16": [vorne1, hinten6], + "17": [vorne1, hinten7], + "18": [vorne1, hinten8], + "19": [vorne1, hinten9], + "20": [vorne2, hinten0], + "21": [vorne2, hinten1], + "22": [vorne2, hinten2], + "23": [vorne2, hinten3], + "24": [vorne2, hinten4], + "25": [vorne2, hinten5], + "26": [vorne2, hinten6], + "27": [vorne2, hinten7], + "28": [vorne2, hinten8], + "29": [vorne2, hinten9], + "30": [vorne3, hinten0], + "31": [vorne3, hinten1], + "32": [vorne3, hinten2], + "33": [vorne3, hinten3], + "34": [vorne3, hinten4], + "35": [vorne3, hinten5], + "36": [vorne3, hinten6], + "37": [vorne3, hinten7], + "38": [vorne3, hinten8], + "39": [vorne3, hinten9], + "40": [vorne4, hinten0], + "41": [vorne4, hinten1], + "42": [vorne4, hinten2], + "43": [vorne4, hinten3], + "44": [vorne4, hinten4], + "45": [vorne4, hinten5], + "46": [vorne4, hinten6], + "47": [vorne4, hinten7], + "48": [vorne4, hinten8], + "49": [vorne4, hinten9], + "50": [vorne5, hinten0], + "51": [vorne5, hinten1], + "52": [vorne5, hinten2], + "53": [vorne5, hinten3], + "54": [vorne5, hinten4], + "55": [vorne5, hinten5], + "56": [vorne5, hinten6], + "57": [vorne5, hinten7], + "58": [vorne5, hinten8], + "59": [vorne5, hinten9] + }; + + function parseArrayOrObject(letters, styleClass, input) { + if (typeof input !== 'undefined' && input !== null) { + if (Array.isArray(input)) { + input.forEach(function(item) { + parseObject(letters, styleClass, item); + }); + } else { + parseObject(letters, styleClass, input); + } + } + } + + 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) { + var array = listString.split(','); + var highlightLetters = definition[listString]; + array.forEach(function(item) { + parseArrayOrObject(letters, styleClass + item, highlightLetters); + }); + }); + } + } + + this.parse = function parse() { + var letters = []; + layout.letters.forEach(function(string) { + var line = []; + for (var c = 0; c < string.length; c++) { + var character = new Letter(string[c]); + line.push(character); + } + letters.push(line); + }); + parseArrayOrObject(letters, 'on', layout.permanent); + if (typeof layout.seconds !== 'undefined' && layout.seconds !== null) { + parseTimeDefinition(letters, 'second', layout.seconds); + } else { + parseTimeDefinition(letters, 'second', seconds); + } + parseTimeDefinition(letters, 'minute', layout.minutes); + parseTimeDefinition(letters, 'hour', layout.hours); + return letters; + }; + } + + /** + * 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 Letter(value, style) { + var myValue = value; + var myStyle = style || ''; + this.addStyle = function(style) { + if (myStyle === '') { + myStyle = style; + } else { + myStyle += ' ' + style; + } + }; + this.toString = function() { + return '' + myValue + ''; + }; + } +})(jQuery); + +(function($) { + 'use strict'; + var es_ist = {1: [1, 2, 4, 5, 6]}; + var uhr = {10: [9, 10, 11]}; + var nach = {4: [8, 9, 10, 11]}; + var vor = {4: [1, 2, 3]}; + var halb = {5: [1, 2, 3, 4]}; + var fuenf = {1: [8, 9, 10, 11]}; + var zehn = {2: [1, 2, 3, 4]}; + var viertel = {3: [5, 6, 7, 8, 9, 10, 11]}; + var zwanzig = {2: [5, 6, 7, 8, 9, 10, 11]}; + var dreiviertel = {3: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]}; + + var layout = { + "version": 2, + "language": 'Deutsch', + "letters": [ + 'ESKISTAFÜNF', + 'ZEHNZWANZIG', + 'DREIVIERTEL', + 'VORFUNKNACH', + 'HALBAELFÜNF', + 'EINSXAMZWEI', + 'DREIPMJVIER', + 'SECHSNLACHT', + 'SIEBENZWÖLF', + 'ZEHNEUNKUHR' + ], + "permanent": es_ist, + "minutes": { + "0,1,2,3,4": uhr, + "5,6,7,8,9": [fuenf, nach], + "10,11,12,13,14": [zehn, nach], + "15,16,17,18,19": [viertel, nach], + "20,21,22,23,24": [zwanzig, nach], + "25,26,27,28,29": [fuenf, vor, halb], + "30,31,32,33,34": halb, + "35,36,37,38,39": [fuenf, nach, halb], + "40,41,42,43,44": [zwanzig, vor], + "45,46,47,48,49": dreiviertel, + "50,51,52,53,54": [zehn, vor], + "55,56,57,58,59": [fuenf, vor] + }, + "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]} + } + }; + $.fritteli.uhr.register('de', layout); +}(jQuery)); +(function($) { + 'use strict'; +// hilfsvariablen + var es_isch = {1: [1, 2, 4, 5, 6, 7]}; + var ab = {4: [1, 2]}; + var vor = {3: [9, 10, 11]}; + var haubi = {4: [4, 5, 6, 7, 8]}; + var fuef = {1: [9, 10, 11]}; + var zae = {2: [9, 10, 11]}; + var viertu = {2: [1, 2, 3, 4, 5, 6]}; + var zwaenzg = {3: [1, 2, 3, 4, 5, 6]}; + var layout = { + // version: zur Zeit immer 2 (Pflichtattribut) + "version": 2, + // Sprechender Name der Sprache + "language": 'Bärndütsch', + // Buchstabenfeld als Array von Strings. + "letters": [ + 'ESKISCHAFÜF', + 'VIERTUBFZÄÄ', + 'ZWÄNZGSIVOR', + 'ABOHAUBIEGE', + 'EISZWÖISDRÜ', + 'VIERIFÜFIQT', + 'SÄCHSISIBNI', + 'ACHTINÜNIEL', + 'ZÄNIERBEUFI', + 'ZWÖUFINAUHR' + ], + // Permanent aktive Buchstaben. , vgl. ausführliche Beschreibung bei "minutes". + "permanent": es_isch, + /* + * Minuten: Objekt im folgenden Format: + * { + * : , + * ... + * } + * : String von Komma-separierten Minutenwerten, zu welchem die in angegebenen Buchstaben aktiv sein sollen + * : [ , ...] | + * : { : [ , ... ] } + * : Die Zeile, in welcher die Buchstaben liegen; von oben gezählt, oben ist 1. + * : Die Spalte, in der ein einzelner Buchstabe liegt; von links gezählt, links ist 1. + * Beispiel: + * "minutes": { + * "0,1": {1: [6, 7, 9]}, + * "5": [ {3: [1, 2]}, {4: [10, 11]} ] + * } + * Erklärung: + * Bei Minuten 0 und 1 sind die Buchstaben 6, 7 und 9 der ersten Zeile aktiv. + * Bei Minute 5 sind die Buchstaben 1 und 2 der Zeile 3 sowie die Buchstaben 10 und 11 der Zeile 4 aktiv. + */ + "minutes": { + "5,6,7,8,9": [fuef, ab], + "10,11,12,13,14": [zae, ab], + "15,16,17,18,19": [viertu, ab], + "20,21,22,23,24": [zwaenzg, ab], + "25,26,27,28,29": [fuef, vor, haubi], + "30,31,32,33,34": haubi, + "35,36,37,38,39": [fuef, ab, haubi], + "40,41,42,43,44": [zwaenzg, vor], + "45,46,47,48,49": [viertu, vor], + "50,51,52,53,54": [zae, vor], + "55,56,57,58,59": [fuef, vor] + }, + // Die Stunden; gleiches Format wie bei den Minuten + "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]} + } + }; +// Das Layout bei der Uhr unter dem Code "de_CH" registrieren. + $.fritteli.uhr.register('de_CH', layout); +}(jQuery)); +(function($) { + 'use strict'; + var es_isch = {1: [1, 2, 4, 5, 6, 7]}; + var genau = {3: [7, 8, 9, 10, 11]}; + var ab = {4: [4, 5]}; + var vor = {4: [1, 2, 3]}; + var haubi = {4: [7, 8, 9, 10, 11]}; + var fuef = {1: [9, 10, 11]}; + var zae = {2: [9, 10, 11]}; + var viertu = {2: [1, 2, 3, 4, 5, 6]}; + var zwaenzg = {3: [1, 2, 3, 4, 5, 6]}; + var layout = { + "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": es_isch, + "minutes": { + "0": genau, + "5,6,7,8,9": [fuef, ab], + "10,11,12,13,14": [zae, ab], + "15,16,17,18,19": [viertu, ab], + "20,21,22,23,24": [zwaenzg, ab], + "25,26,27,28,29": [fuef, vor, haubi], + "30,31,32,33,34": haubi, + "35,36,37,38,39": [fuef, ab, haubi], + "40,41,42,43,44": [zwaenzg, vor], + "45,46,47,48,49": [viertu, vor], + "50,51,52,53,54": [zae, vor], + "55,56,57,58,59": [fuef, vor] + }, + "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]} + } + }; + $.fritteli.uhr.register('de_CH_genau', layout); +}(jQuery)); +/* + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ +(function($) { + 'use strict'; + + var klokken_er = {1: [1, 2, 3, 4, 5, 6, 7, 9, 10]}; + var minutter = {4: [4, 5, 6, 7, 8, 9, 10, 11]}; + var i = {5: [8]}; + var over = {5: [4, 5, 6, 7]}; + var fem = {2: [1, 2, 3]}; + var ti = {4: [1, 2]}; + var kvart = {3: [4, 5, 6, 7, 8]}; + var tyve = {2: [4, 5, 6, 7]}; + var halv = {6: [8, 9, 10, 11]}; + + var layout = { + "version": 2, + "language": 'Dansk', + "letters": [ + 'KLOKKENVERO', + 'FEMTYVESKLA', + 'OJEKVARTVAT', + 'TIAMINUTTER', + 'VEMOVERILMF', + 'MONALISHALV', + 'ETTOTREFIRE', + 'FEMSEKSRSYV', + 'OTTERNIMETI', + 'ELLEVEATOLV' + ], + "permanent": klokken_er, + "minutes": { + "5,6,7,8,9": [fem, minutter, over], + "10,11,12,13,14": [ti, minutter, over], + "15,16,17,18,19": [kvart, over], + "20,21,22,23,24": [tyve, minutter, over], + "25,26,27,28,29": [fem, minutter, i, halv], + "30,31,32,33,34": [halv], + "35,36,37,38,39": [fem, minutter, over, halv], + "40,41,42,43,44": [tyve, minutter, i], + "45,46,47,48,49": [kvart, i], + "50,51,52,53,54": [ti, minutter, i], + "55,56,57,58,59": [fem, minutter, i] + }, + "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 (date) { + var hour = date.getHours(); + if (date.getMinutes() >= 25) { + return (hour + 1) % 24; + } + return hour; + } + }; + $.fritteli.uhr.register('dk', layout); +}(jQuery)); +(function($) { + 'use strict'; + var it_is = {1: [1, 2, 4, 5]}; + var half = {4: [1, 2, 3, 4]}; + var to = {4: [10, 11]}; + var past = {5: [1, 2, 3, 4]}; + var o_clock = {10: [5, 6, 7, 8, 9, 10, 11]}; + var five = {3: [7, 8, 9, 10]}; + var ten = {4: [6, 7, 8]}; + var a_quarter = {2: [1, 3, 4, 5, 6, 7, 8, 9]}; + var twenty = {3: [1, 2, 3, 4, 5, 6]}; + var twentyfive = {3: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}; + + var layout = { + "version": 2, + "language": 'English', + "letters": [ + 'ITLISBFAMPM', + 'ACQUARTERDC', + 'TWENTYFIVEX', + 'HALFBTENFTO', + 'PASTERUNINE', + 'ONESIXTHREE', + 'FOURFIVETWO', + 'EIGHTELEVEN', + 'SEVENTWELVE', + 'TENSO\'CLOCK' + ], + "permanent": it_is, + "minutes": { + "0,1,2,3,4": o_clock, + "5,6,7,8,9": [five, past], + "10,11,12,13,14": [ten, past], + "15,16,17,18,19": [a_quarter, past], + "20,21,22,23,24": [twenty, past], + "25,26,27,28,29": [twentyfive, past], + "30,31,32,33,34": [half, past], + "35,36,37,38,39": [twentyfive, to], + "40,41,42,43,44": [twenty, to], + "45,46,47,48,49": [a_quarter, to], + "50,51,52,53,54": [ten, to], + "55,56,57,58,59": [five, to] + }, + "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(date) { + var hour = date.getHours(); + if (date.getMinutes() >= 35) { + return (hour + 1) % 24; + } + return hour; + } + }; + $.fritteli.uhr.register('en', layout); +}(jQuery)); +(function($) { + 'use strict'; + var es_la = {1: [1, 2, 6, 7]}; + var son_las = {1: [2, 3, 4, 6, 7, 8]}; + var y = {7: [6]}; + var menos = {7: [7, 8, 9, 10, 11]}; + var media = {10: [1, 2, 3, 4, 5]}; + var cinco = {9: [7, 8, 9, 10, 11]}; + var diez = {8: [8, 9, 10, 11]}; + var cuarto = {10: [6, 7, 8, 9, 10, 11]}; + var veinte = {8: [2, 3, 4, 5, 6, 7]}; + var veinticinco = {9: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]}; + + var layout = { + "version": 2, + "language": 'Español', + "letters": [ + 'ESONELASUNA', + 'DOSITRESORE', + 'CUATROCINCO', + 'SEISASIETEN', + 'OCHONUEVEYO', + 'LADIEZSONCE', + 'DOCELYMENOS', + 'OVEINTEDIEZ', + 'VEINTICINCO', + 'MEDIACUARTO' + ], + "permanent": [], + "minutes": { + "5,6,7,8,9": [y, cinco], + "10,11,12,13,14": [y, diez], + "15,16,17,18,19": [y, cuarto], + "20,21,22,23,24": [y, veinte], + "25,26,27,28,29": [y, veinticinco], + "30,31,32,33,34": [y, media], + "35,36,37,38,39": [menos, veinticinco], + "40,41,42,43,44": [menos, veinte], + "45,46,47,48,49": [menos, cuarto], + "50,51,52,53,54": [menos, diez], + "55,56,57,58,59": [menos, cinco] + }, + "hours": { + "0,12": [son_las, {7: [1, 2, 3, 4]}], + "1,13": [es_la, {1: [9, 10, 11]}], + "2,14": [son_las, {2: [1, 2, 3]}], + "3,15": [son_las, {2: [5, 6, 7, 8]}], + "4,16": [son_las, {3: [1, 2, 3, 4, 5, 6]}], + "5,17": [son_las, {3: [7, 8, 9, 10, 11]}], + "6,18": [son_las, {4: [1, 2, 3, 4]}], + "7,19": [son_las, {4: [6, 7, 8, 9, 10]}], + "8,20": [son_las, {5: [1, 2, 3, 4]}], + "9,21": [son_las, {5: [5, 6, 7, 8, 9]}], + "10,22": [son_las, {6: [3, 4, 5, 6]}], + "11,23": [son_las, {6: [8, 9, 10, 11]}] + }, + "getHour": function(date) { + var hour = date.getHours(); + if (date.getMinutes() >= 35) { + return (hour + 1) % 24; + } + return hour; + } + }; + $.fritteli.uhr.register('es', layout); +}(jQuery)); + +(function($) { + 'use strict'; + var il_est = {1: [1, 2, 4, 5, 6]}; + var et = {8: [1, 2]}; + var moins = {7: [1, 2, 3, 4, 5]}; + var demie = {10: [4, 5, 6, 7, 8]}; + var heures = {6: [6, 7, 8, 9, 10, 11]}; + var le = {7: [7, 8]}; + var cinq = {9: [7, 8, 9, 10]}; + var dix = {7: [9, 10, 11]}; + var quart = {8: [4, 5, 6, 7, 8]}; + var vingt = {9: [1, 2, 3, 4, 5]}; + var vingtcinq = {9: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}; + + var layout = { + "version": 2, + "language": 'Français', + "letters": [ + 'ILNESTODEUX', + 'QUATRETROIS', + 'NEUFUNESEPT', + 'HUITSIXCINQ', + 'MIDIXMINUIT', + 'ONZERHEURES', + 'MOINSOLEDIX', + 'ETRQUARTPMD', + 'VINGT-CINQU', + 'ETSDEMIEPAM' + ], + "permanent": il_est, + "minutes": { + "5,6,7,8,9": cinq, + "10,11,12,13,14": dix, + "15,16,17,18,19": [et, quart], + "20,21,22,23,24": vingt, + "25,26,27,28,29": vingtcinq, + "30,31,32,33,34": [et, demie], + "35,36,37,38,39": [moins, vingtcinq], + "40,41,42,43,44": [moins, vingt], + "45,46,47,48,49": [moins, le, quart], + "50,51,52,53,54": [moins, dix], + "55,56,57,58,59": [moins, cinq] + }, + "hours": { + "0": {5: [6, 7, 8, 9, 10, 11]}, + "1,13": [ + {3: [5, 6, 7]}, + heures + ], + "2,14": [ + {1: [8, 9, 10, 11]}, + heures + ], + "3,15": [ + {2: [7, 8, 9, 10, 11]}, + heures + ], + "4,16": [ + {2: [1, 2, 3, 4, 5, 6]}, + heures + ], + "5,17": [ + {4: [8, 9, 10, 11]}, + heures + ], + "6,18": [ + {4: [5, 6, 7]}, + heures + ], + "7,19": [ + {3: [8, 9, 10, 11]}, + heures + ], + "8,20": [ + {4: [1, 2, 3, 4]}, + heures + ], + "9,21": [ + {3: [1, 2, 3, 4]}, + heures + ], + "10,22": [ + {5: [3, 4, 5]}, + heures + ], + "11,23": [ + {6: [1, 2, 3, 4]}, + heures + ], + "12": {5: [1, 2, 3, 4]} + }, + "getHour": function(date) { + var hour = date.getHours(); + if (date.getMinutes() >= 35) { + return (hour + 1) % 24; + } + return hour; + } + }; + $.fritteli.uhr.register('fr', layout); +}(jQuery)); +(function($) { + 'use strict'; + var sono_le = {1: [1, 2, 3, 4, 6, 7]}; + var e_l = {2: [1, 3, 4]}; + var e = {8: [1]}; + var meno = {7: [8, 9, 10, 11]}; + var mezza = {10: [7, 8, 9, 10, 11]}; + var cinque = {9: [6, 7, 8, 9, 10, 11]}; + var dieci = {10: [1, 2, 3, 4, 5]}; + var un_quarto = {8: [3, 4, 6, 7, 8, 9, 10, 11]}; + var venti = {9: [1, 2, 3, 4, 5]}; + var venticinque = {9: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]}; + + var layout = { + "version": 2, + "language": 'Italiano', + "letters": [ + 'SONORLEBORE', + 'ÈRL\'UNASDUE', + 'TREOTTONOVE', + 'DIECIUNDICI', + 'DODICISETTE', + 'QUATTROCSEI', + 'CINQUEAMENO', + 'ECUNOQUARTO', + 'VENTICINQUE', + 'DIECIPMEZZA' + ], + "permanent": [], + "minutes": { + "5,6,7,8,9": [e, cinque], + "10,11,12,13,14": [e, dieci], + "15,16,17,18,19": [e, un_quarto], + "20,21,22,23,24": [e, venti], + "25,26,27,28,29": [e, venticinque], + "30,31,32,33,34": [e, mezza], + "35,36,37,38,39": [meno, venticinque], + "40,41,42,43,44": [meno, venti], + "45,46,47,48,49": [meno, un_quarto], + "50,51,52,53,54": [meno, dieci], + "55,56,57,58,59": [meno, cinque] + }, + "hours": { + "0,12": [sono_le, {5: [1, 2, 3, 4, 5, 6]}], + "1,13": [e_l, {2: [5, 6, 7]}], + "2,14": [sono_le, {2: [9, 10, 11]}], + "3,15": [sono_le, {3: [1, 2, 3]}], + "4,16": [sono_le, {6: [1, 2, 3, 4, 5, 6, 7]}], + "5,17": [sono_le, {7: [1, 2, 3, 4, 5, 6]}], + "6,18": [sono_le, {6: [9, 10, 11]}], + "7,19": [sono_le, {5: [7, 8, 9, 10, 11]}], + "8,20": [sono_le, {3: [4, 5, 6, 7]}], + "9,21": [sono_le, {3: [8, 9, 10, 11]}], + "10,22": [sono_le, {4: [1, 2, 3, 4, 5]}], + "11,23": [sono_le, {4: [6, 7, 8, 9, 10, 11]}] + }, + "getHour": function(date) { + var hour = date.getHours(); + if (date.getMinutes() >= 35) { + return (hour + 1) % 24; + } + return hour; + } + }; + $.fritteli.uhr.register('it', layout); +}(jQuery)); +(function($) { + 'use strict'; + var het_is = {1: [1, 2, 3, 5, 6]}; + var over1 = {3: [1, 2, 3, 4]}; + var voor1 = {2: [8, 9, 10, 11]}; + var over2 = {4: [8, 9, 10, 11]}; + var voor2 = {5: [1, 2, 3, 4]}; + var half = {4: [1, 2, 3, 4]}; + var vijf = {1: [8, 9, 10, 11]}; + var tien = {2: [1, 2, 3, 4]}; + var kwart = {3: [7, 8, 9, 10, 11]}; + var uur = {10: [9, 10, 11]}; + + var layout = { + "version": 2, + "language": 'Nederlands', + "letters": [ + 'HETKISAVIJF', + 'TIENBTZVOOR', + 'OVERMEKWART', + 'HALFSPWOVER', + 'VOORTHGEENS', + 'TWEEPVCDRIE', + 'VIERVIJFZES', + 'ZEVENONEGEN', + 'ACHTTIENELF', + 'TWAALFBFUUR' + ], + "permanent": het_is, + "minutes": { + "0,1,2,3,4": uur, + "5,6,7,8,9": [vijf, over1], + "10,11,12,13,14": [tien, over1], + "15,16,17,18,19": [kwart, over2], + "20,21,22,23,24": [tien, voor1, half], + "25,26,27,28,29": [vijf, voor1, half], + "30,31,32,33,34": half, + "35,36,37,38,39": [vijf, over1, half], + "40,41,42,43,44": [tien, over1, half], + "45,46,47,48,49": [kwart, voor2], + "50,51,52,53,54": [tien, voor1], + "55,56,57,58,59": [vijf, voor1] + }, + "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(date) { + var hour = date.getHours(); + if (date.getMinutes() >= 20) { + return (hour + 1) % 24; + } + return hour; + } + }; + $.fritteli.uhr.register('nl', layout); +}(jQuery)); \ No newline at end of file diff --git a/dist/jquery.uhr.complete.min.js b/dist/jquery.uhr.complete.min.js new file mode 100644 index 0000000..3b96cd7 --- /dev/null +++ b/dist/jquery.uhr.complete.min.js @@ -0,0 +1,4 @@ +/*! uhr - v0.0.1 - 2015-01-13 +* http://bärneruhr.ch/ +* Copyright (c) 2015 Manuel Friedli; Licensed MIT */ +!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):!1});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(){s.bind(this)()||(this.timer=window.setInterval(function(){this.options.time=new Date,t.bind(this)()}.bind(this),1e3),t.bind(this)(),r.bind(this)("uhr-status","on"))},g=function(){s.bind(this)()&&(window.clearInterval(this.timer),this.timer=null,t.bind(this)(),r.bind(this)("uhr-status","off"))},h=function(){s.bind(this)()?this.stop():this.start()},i=function(a){if(a!==this.options.language){this.options.language=a;var c=new b(B.bind(this)(),this.element.find(".letterarea"));c.render.bind(this)(function(){this.currentMinute=-1,t.bind(this)()}.bind(this)),r.bind(this)("uhr-language",a),t.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,r.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),t.bind(this)()},l=function(a){this.options.mode=a,this.currentMinute=-1,t.bind(this)(),r.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(){l.bind(this)("seconds"===this.options.mode?"normal":"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),l.bind(this)("seconds"===f?"seconds":"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(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)},s=function(){return null!==this.timer},t=function(){if(s.bind(this)()){var a=this.options.time;if(!B.bind(this)().hasOwnProperty("seconds")&&"seconds"!==this.options.mode){if(a.getMinutes()===this.currentMinute)return;this.currentMinute=a.getMinutes()}u.bind(this)(a)}else w.bind(this)(),this.currentMinute=-1},u=function(a){var b=x.bind(this)(a),c=y.bind(this)(a),d=A.bind(this)(a),e=z.bind(this)(a);if(w.bind(this)(),"seconds"===this.options.mode)v.bind(this)("second"+b);else{v.bind(this)("on");for(var f=1;c>=f;f++)v.bind(this)("dot"+f);v.bind(this)("minute"+e),v.bind(this)("hour"+d)}},v=function(a){this.element.find(".item."+a).addClass("active")},w=function(){this.element.find(".item").removeClass("active")},x=function(a){return"function"==typeof B.bind(this)().getSeconds?B.bind(this)().getSeconds(a):a.getSeconds()},y=function(a){if("function"==typeof B.bind(this)().getDotMinute)return B.bind(this)().getDotMinute(a);var b=a.getMinutes();return b%5},z=function(a){return"function"==typeof B.bind(this)().getCoarseMinute?B.bind(this)().getCoarseMinute(a):a.getMinutes()},A=function(a){if("function"==typeof B.bind(this)().getHour)return B.bind(this)().getHour(a);var b=a.getHours();return a.getMinutes()>=25?(b+1)%24:b},B=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}),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); \ No newline at end of file diff --git a/dist/jquery.uhr.langs.js b/dist/jquery.uhr.langs.js new file mode 100644 index 0000000..f84f428 --- /dev/null +++ b/dist/jquery.uhr.langs.js @@ -0,0 +1,652 @@ +/*! uhr - v0.0.1 - 2015-01-13 +* http://bärneruhr.ch/ +* Copyright (c) 2015 Manuel Friedli; Licensed MIT */ +(function($) { + 'use strict'; + var es_ist = {1: [1, 2, 4, 5, 6]}; + var uhr = {10: [9, 10, 11]}; + var nach = {4: [8, 9, 10, 11]}; + var vor = {4: [1, 2, 3]}; + var halb = {5: [1, 2, 3, 4]}; + var fuenf = {1: [8, 9, 10, 11]}; + var zehn = {2: [1, 2, 3, 4]}; + var viertel = {3: [5, 6, 7, 8, 9, 10, 11]}; + var zwanzig = {2: [5, 6, 7, 8, 9, 10, 11]}; + var dreiviertel = {3: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]}; + + var layout = { + "version": 2, + "language": 'Deutsch', + "letters": [ + 'ESKISTAFÜNF', + 'ZEHNZWANZIG', + 'DREIVIERTEL', + 'VORFUNKNACH', + 'HALBAELFÜNF', + 'EINSXAMZWEI', + 'DREIPMJVIER', + 'SECHSNLACHT', + 'SIEBENZWÖLF', + 'ZEHNEUNKUHR' + ], + "permanent": es_ist, + "minutes": { + "0,1,2,3,4": uhr, + "5,6,7,8,9": [fuenf, nach], + "10,11,12,13,14": [zehn, nach], + "15,16,17,18,19": [viertel, nach], + "20,21,22,23,24": [zwanzig, nach], + "25,26,27,28,29": [fuenf, vor, halb], + "30,31,32,33,34": halb, + "35,36,37,38,39": [fuenf, nach, halb], + "40,41,42,43,44": [zwanzig, vor], + "45,46,47,48,49": dreiviertel, + "50,51,52,53,54": [zehn, vor], + "55,56,57,58,59": [fuenf, vor] + }, + "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]} + } + }; + $.fritteli.uhr.register('de', layout); +}(jQuery)); +(function($) { + 'use strict'; +// hilfsvariablen + var es_isch = {1: [1, 2, 4, 5, 6, 7]}; + var ab = {4: [1, 2]}; + var vor = {3: [9, 10, 11]}; + var haubi = {4: [4, 5, 6, 7, 8]}; + var fuef = {1: [9, 10, 11]}; + var zae = {2: [9, 10, 11]}; + var viertu = {2: [1, 2, 3, 4, 5, 6]}; + var zwaenzg = {3: [1, 2, 3, 4, 5, 6]}; + var layout = { + // version: zur Zeit immer 2 (Pflichtattribut) + "version": 2, + // Sprechender Name der Sprache + "language": 'Bärndütsch', + // Buchstabenfeld als Array von Strings. + "letters": [ + 'ESKISCHAFÜF', + 'VIERTUBFZÄÄ', + 'ZWÄNZGSIVOR', + 'ABOHAUBIEGE', + 'EISZWÖISDRÜ', + 'VIERIFÜFIQT', + 'SÄCHSISIBNI', + 'ACHTINÜNIEL', + 'ZÄNIERBEUFI', + 'ZWÖUFINAUHR' + ], + // Permanent aktive Buchstaben. , vgl. ausführliche Beschreibung bei "minutes". + "permanent": es_isch, + /* + * Minuten: Objekt im folgenden Format: + * { + * : , + * ... + * } + * : String von Komma-separierten Minutenwerten, zu welchem die in angegebenen Buchstaben aktiv sein sollen + * : [ , ...] | + * : { : [ , ... ] } + * : Die Zeile, in welcher die Buchstaben liegen; von oben gezählt, oben ist 1. + * : Die Spalte, in der ein einzelner Buchstabe liegt; von links gezählt, links ist 1. + * Beispiel: + * "minutes": { + * "0,1": {1: [6, 7, 9]}, + * "5": [ {3: [1, 2]}, {4: [10, 11]} ] + * } + * Erklärung: + * Bei Minuten 0 und 1 sind die Buchstaben 6, 7 und 9 der ersten Zeile aktiv. + * Bei Minute 5 sind die Buchstaben 1 und 2 der Zeile 3 sowie die Buchstaben 10 und 11 der Zeile 4 aktiv. + */ + "minutes": { + "5,6,7,8,9": [fuef, ab], + "10,11,12,13,14": [zae, ab], + "15,16,17,18,19": [viertu, ab], + "20,21,22,23,24": [zwaenzg, ab], + "25,26,27,28,29": [fuef, vor, haubi], + "30,31,32,33,34": haubi, + "35,36,37,38,39": [fuef, ab, haubi], + "40,41,42,43,44": [zwaenzg, vor], + "45,46,47,48,49": [viertu, vor], + "50,51,52,53,54": [zae, vor], + "55,56,57,58,59": [fuef, vor] + }, + // Die Stunden; gleiches Format wie bei den Minuten + "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]} + } + }; +// Das Layout bei der Uhr unter dem Code "de_CH" registrieren. + $.fritteli.uhr.register('de_CH', layout); +}(jQuery)); +(function($) { + 'use strict'; + var es_isch = {1: [1, 2, 4, 5, 6, 7]}; + var genau = {3: [7, 8, 9, 10, 11]}; + var ab = {4: [4, 5]}; + var vor = {4: [1, 2, 3]}; + var haubi = {4: [7, 8, 9, 10, 11]}; + var fuef = {1: [9, 10, 11]}; + var zae = {2: [9, 10, 11]}; + var viertu = {2: [1, 2, 3, 4, 5, 6]}; + var zwaenzg = {3: [1, 2, 3, 4, 5, 6]}; + var layout = { + "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": es_isch, + "minutes": { + "0": genau, + "5,6,7,8,9": [fuef, ab], + "10,11,12,13,14": [zae, ab], + "15,16,17,18,19": [viertu, ab], + "20,21,22,23,24": [zwaenzg, ab], + "25,26,27,28,29": [fuef, vor, haubi], + "30,31,32,33,34": haubi, + "35,36,37,38,39": [fuef, ab, haubi], + "40,41,42,43,44": [zwaenzg, vor], + "45,46,47,48,49": [viertu, vor], + "50,51,52,53,54": [zae, vor], + "55,56,57,58,59": [fuef, vor] + }, + "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]} + } + }; + $.fritteli.uhr.register('de_CH_genau', layout); +}(jQuery)); +/* + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ +(function($) { + 'use strict'; + + var klokken_er = {1: [1, 2, 3, 4, 5, 6, 7, 9, 10]}; + var minutter = {4: [4, 5, 6, 7, 8, 9, 10, 11]}; + var i = {5: [8]}; + var over = {5: [4, 5, 6, 7]}; + var fem = {2: [1, 2, 3]}; + var ti = {4: [1, 2]}; + var kvart = {3: [4, 5, 6, 7, 8]}; + var tyve = {2: [4, 5, 6, 7]}; + var halv = {6: [8, 9, 10, 11]}; + + var layout = { + "version": 2, + "language": 'Dansk', + "letters": [ + 'KLOKKENVERO', + 'FEMTYVESKLA', + 'OJEKVARTVAT', + 'TIAMINUTTER', + 'VEMOVERILMF', + 'MONALISHALV', + 'ETTOTREFIRE', + 'FEMSEKSRSYV', + 'OTTERNIMETI', + 'ELLEVEATOLV' + ], + "permanent": klokken_er, + "minutes": { + "5,6,7,8,9": [fem, minutter, over], + "10,11,12,13,14": [ti, minutter, over], + "15,16,17,18,19": [kvart, over], + "20,21,22,23,24": [tyve, minutter, over], + "25,26,27,28,29": [fem, minutter, i, halv], + "30,31,32,33,34": [halv], + "35,36,37,38,39": [fem, minutter, over, halv], + "40,41,42,43,44": [tyve, minutter, i], + "45,46,47,48,49": [kvart, i], + "50,51,52,53,54": [ti, minutter, i], + "55,56,57,58,59": [fem, minutter, i] + }, + "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 (date) { + var hour = date.getHours(); + if (date.getMinutes() >= 25) { + return (hour + 1) % 24; + } + return hour; + } + }; + $.fritteli.uhr.register('dk', layout); +}(jQuery)); +(function($) { + 'use strict'; + var it_is = {1: [1, 2, 4, 5]}; + var half = {4: [1, 2, 3, 4]}; + var to = {4: [10, 11]}; + var past = {5: [1, 2, 3, 4]}; + var o_clock = {10: [5, 6, 7, 8, 9, 10, 11]}; + var five = {3: [7, 8, 9, 10]}; + var ten = {4: [6, 7, 8]}; + var a_quarter = {2: [1, 3, 4, 5, 6, 7, 8, 9]}; + var twenty = {3: [1, 2, 3, 4, 5, 6]}; + var twentyfive = {3: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}; + + var layout = { + "version": 2, + "language": 'English', + "letters": [ + 'ITLISBFAMPM', + 'ACQUARTERDC', + 'TWENTYFIVEX', + 'HALFBTENFTO', + 'PASTERUNINE', + 'ONESIXTHREE', + 'FOURFIVETWO', + 'EIGHTELEVEN', + 'SEVENTWELVE', + 'TENSO\'CLOCK' + ], + "permanent": it_is, + "minutes": { + "0,1,2,3,4": o_clock, + "5,6,7,8,9": [five, past], + "10,11,12,13,14": [ten, past], + "15,16,17,18,19": [a_quarter, past], + "20,21,22,23,24": [twenty, past], + "25,26,27,28,29": [twentyfive, past], + "30,31,32,33,34": [half, past], + "35,36,37,38,39": [twentyfive, to], + "40,41,42,43,44": [twenty, to], + "45,46,47,48,49": [a_quarter, to], + "50,51,52,53,54": [ten, to], + "55,56,57,58,59": [five, to] + }, + "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(date) { + var hour = date.getHours(); + if (date.getMinutes() >= 35) { + return (hour + 1) % 24; + } + return hour; + } + }; + $.fritteli.uhr.register('en', layout); +}(jQuery)); +(function($) { + 'use strict'; + var es_la = {1: [1, 2, 6, 7]}; + var son_las = {1: [2, 3, 4, 6, 7, 8]}; + var y = {7: [6]}; + var menos = {7: [7, 8, 9, 10, 11]}; + var media = {10: [1, 2, 3, 4, 5]}; + var cinco = {9: [7, 8, 9, 10, 11]}; + var diez = {8: [8, 9, 10, 11]}; + var cuarto = {10: [6, 7, 8, 9, 10, 11]}; + var veinte = {8: [2, 3, 4, 5, 6, 7]}; + var veinticinco = {9: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]}; + + var layout = { + "version": 2, + "language": 'Español', + "letters": [ + 'ESONELASUNA', + 'DOSITRESORE', + 'CUATROCINCO', + 'SEISASIETEN', + 'OCHONUEVEYO', + 'LADIEZSONCE', + 'DOCELYMENOS', + 'OVEINTEDIEZ', + 'VEINTICINCO', + 'MEDIACUARTO' + ], + "permanent": [], + "minutes": { + "5,6,7,8,9": [y, cinco], + "10,11,12,13,14": [y, diez], + "15,16,17,18,19": [y, cuarto], + "20,21,22,23,24": [y, veinte], + "25,26,27,28,29": [y, veinticinco], + "30,31,32,33,34": [y, media], + "35,36,37,38,39": [menos, veinticinco], + "40,41,42,43,44": [menos, veinte], + "45,46,47,48,49": [menos, cuarto], + "50,51,52,53,54": [menos, diez], + "55,56,57,58,59": [menos, cinco] + }, + "hours": { + "0,12": [son_las, {7: [1, 2, 3, 4]}], + "1,13": [es_la, {1: [9, 10, 11]}], + "2,14": [son_las, {2: [1, 2, 3]}], + "3,15": [son_las, {2: [5, 6, 7, 8]}], + "4,16": [son_las, {3: [1, 2, 3, 4, 5, 6]}], + "5,17": [son_las, {3: [7, 8, 9, 10, 11]}], + "6,18": [son_las, {4: [1, 2, 3, 4]}], + "7,19": [son_las, {4: [6, 7, 8, 9, 10]}], + "8,20": [son_las, {5: [1, 2, 3, 4]}], + "9,21": [son_las, {5: [5, 6, 7, 8, 9]}], + "10,22": [son_las, {6: [3, 4, 5, 6]}], + "11,23": [son_las, {6: [8, 9, 10, 11]}] + }, + "getHour": function(date) { + var hour = date.getHours(); + if (date.getMinutes() >= 35) { + return (hour + 1) % 24; + } + return hour; + } + }; + $.fritteli.uhr.register('es', layout); +}(jQuery)); + +(function($) { + 'use strict'; + var il_est = {1: [1, 2, 4, 5, 6]}; + var et = {8: [1, 2]}; + var moins = {7: [1, 2, 3, 4, 5]}; + var demie = {10: [4, 5, 6, 7, 8]}; + var heures = {6: [6, 7, 8, 9, 10, 11]}; + var le = {7: [7, 8]}; + var cinq = {9: [7, 8, 9, 10]}; + var dix = {7: [9, 10, 11]}; + var quart = {8: [4, 5, 6, 7, 8]}; + var vingt = {9: [1, 2, 3, 4, 5]}; + var vingtcinq = {9: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}; + + var layout = { + "version": 2, + "language": 'Français', + "letters": [ + 'ILNESTODEUX', + 'QUATRETROIS', + 'NEUFUNESEPT', + 'HUITSIXCINQ', + 'MIDIXMINUIT', + 'ONZERHEURES', + 'MOINSOLEDIX', + 'ETRQUARTPMD', + 'VINGT-CINQU', + 'ETSDEMIEPAM' + ], + "permanent": il_est, + "minutes": { + "5,6,7,8,9": cinq, + "10,11,12,13,14": dix, + "15,16,17,18,19": [et, quart], + "20,21,22,23,24": vingt, + "25,26,27,28,29": vingtcinq, + "30,31,32,33,34": [et, demie], + "35,36,37,38,39": [moins, vingtcinq], + "40,41,42,43,44": [moins, vingt], + "45,46,47,48,49": [moins, le, quart], + "50,51,52,53,54": [moins, dix], + "55,56,57,58,59": [moins, cinq] + }, + "hours": { + "0": {5: [6, 7, 8, 9, 10, 11]}, + "1,13": [ + {3: [5, 6, 7]}, + heures + ], + "2,14": [ + {1: [8, 9, 10, 11]}, + heures + ], + "3,15": [ + {2: [7, 8, 9, 10, 11]}, + heures + ], + "4,16": [ + {2: [1, 2, 3, 4, 5, 6]}, + heures + ], + "5,17": [ + {4: [8, 9, 10, 11]}, + heures + ], + "6,18": [ + {4: [5, 6, 7]}, + heures + ], + "7,19": [ + {3: [8, 9, 10, 11]}, + heures + ], + "8,20": [ + {4: [1, 2, 3, 4]}, + heures + ], + "9,21": [ + {3: [1, 2, 3, 4]}, + heures + ], + "10,22": [ + {5: [3, 4, 5]}, + heures + ], + "11,23": [ + {6: [1, 2, 3, 4]}, + heures + ], + "12": {5: [1, 2, 3, 4]} + }, + "getHour": function(date) { + var hour = date.getHours(); + if (date.getMinutes() >= 35) { + return (hour + 1) % 24; + } + return hour; + } + }; + $.fritteli.uhr.register('fr', layout); +}(jQuery)); +(function($) { + 'use strict'; + var sono_le = {1: [1, 2, 3, 4, 6, 7]}; + var e_l = {2: [1, 3, 4]}; + var e = {8: [1]}; + var meno = {7: [8, 9, 10, 11]}; + var mezza = {10: [7, 8, 9, 10, 11]}; + var cinque = {9: [6, 7, 8, 9, 10, 11]}; + var dieci = {10: [1, 2, 3, 4, 5]}; + var un_quarto = {8: [3, 4, 6, 7, 8, 9, 10, 11]}; + var venti = {9: [1, 2, 3, 4, 5]}; + var venticinque = {9: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]}; + + var layout = { + "version": 2, + "language": 'Italiano', + "letters": [ + 'SONORLEBORE', + 'ÈRL\'UNASDUE', + 'TREOTTONOVE', + 'DIECIUNDICI', + 'DODICISETTE', + 'QUATTROCSEI', + 'CINQUEAMENO', + 'ECUNOQUARTO', + 'VENTICINQUE', + 'DIECIPMEZZA' + ], + "permanent": [], + "minutes": { + "5,6,7,8,9": [e, cinque], + "10,11,12,13,14": [e, dieci], + "15,16,17,18,19": [e, un_quarto], + "20,21,22,23,24": [e, venti], + "25,26,27,28,29": [e, venticinque], + "30,31,32,33,34": [e, mezza], + "35,36,37,38,39": [meno, venticinque], + "40,41,42,43,44": [meno, venti], + "45,46,47,48,49": [meno, un_quarto], + "50,51,52,53,54": [meno, dieci], + "55,56,57,58,59": [meno, cinque] + }, + "hours": { + "0,12": [sono_le, {5: [1, 2, 3, 4, 5, 6]}], + "1,13": [e_l, {2: [5, 6, 7]}], + "2,14": [sono_le, {2: [9, 10, 11]}], + "3,15": [sono_le, {3: [1, 2, 3]}], + "4,16": [sono_le, {6: [1, 2, 3, 4, 5, 6, 7]}], + "5,17": [sono_le, {7: [1, 2, 3, 4, 5, 6]}], + "6,18": [sono_le, {6: [9, 10, 11]}], + "7,19": [sono_le, {5: [7, 8, 9, 10, 11]}], + "8,20": [sono_le, {3: [4, 5, 6, 7]}], + "9,21": [sono_le, {3: [8, 9, 10, 11]}], + "10,22": [sono_le, {4: [1, 2, 3, 4, 5]}], + "11,23": [sono_le, {4: [6, 7, 8, 9, 10, 11]}] + }, + "getHour": function(date) { + var hour = date.getHours(); + if (date.getMinutes() >= 35) { + return (hour + 1) % 24; + } + return hour; + } + }; + $.fritteli.uhr.register('it', layout); +}(jQuery)); +(function($) { + 'use strict'; + var het_is = {1: [1, 2, 3, 5, 6]}; + var over1 = {3: [1, 2, 3, 4]}; + var voor1 = {2: [8, 9, 10, 11]}; + var over2 = {4: [8, 9, 10, 11]}; + var voor2 = {5: [1, 2, 3, 4]}; + var half = {4: [1, 2, 3, 4]}; + var vijf = {1: [8, 9, 10, 11]}; + var tien = {2: [1, 2, 3, 4]}; + var kwart = {3: [7, 8, 9, 10, 11]}; + var uur = {10: [9, 10, 11]}; + + var layout = { + "version": 2, + "language": 'Nederlands', + "letters": [ + 'HETKISAVIJF', + 'TIENBTZVOOR', + 'OVERMEKWART', + 'HALFSPWOVER', + 'VOORTHGEENS', + 'TWEEPVCDRIE', + 'VIERVIJFZES', + 'ZEVENONEGEN', + 'ACHTTIENELF', + 'TWAALFBFUUR' + ], + "permanent": het_is, + "minutes": { + "0,1,2,3,4": uur, + "5,6,7,8,9": [vijf, over1], + "10,11,12,13,14": [tien, over1], + "15,16,17,18,19": [kwart, over2], + "20,21,22,23,24": [tien, voor1, half], + "25,26,27,28,29": [vijf, voor1, half], + "30,31,32,33,34": half, + "35,36,37,38,39": [vijf, over1, half], + "40,41,42,43,44": [tien, over1, half], + "45,46,47,48,49": [kwart, voor2], + "50,51,52,53,54": [tien, voor1], + "55,56,57,58,59": [vijf, voor1] + }, + "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(date) { + var hour = date.getHours(); + if (date.getMinutes() >= 20) { + return (hour + 1) % 24; + } + return hour; + } + }; + $.fritteli.uhr.register('nl', layout); +}(jQuery)); \ No newline at end of file diff --git a/dist/jquery.uhr.langs.min.js b/dist/jquery.uhr.langs.min.js new file mode 100644 index 0000000..a902bf5 --- /dev/null +++ b/dist/jquery.uhr.langs.min.js @@ -0,0 +1,4 @@ +/*! uhr - v0.0.1 - 2015-01-13 +* http://bärneruhr.ch/ +* Copyright (c) 2015 Manuel Friedli; Licensed MIT */ +!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); \ No newline at end of file diff --git a/dist/jquery.uhr.main.js b/dist/jquery.uhr.main.js new file mode 100644 index 0000000..2091a1e --- /dev/null +++ b/dist/jquery.uhr.main.js @@ -0,0 +1,774 @@ +/*! uhr - v0.0.1 - 2015-01-13 +* http://bärneruhr.ch/ +* Copyright (c) 2015 Manuel Friedli; Licensed MIT */ +(function($) { + 'use strict'; + var uhrGlobals = { + "id": 0, + "languages": [], + "themes": [], + registerLanguage: function registerLanguage(code, language) { + 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 + "'!"); + return true; + } + return false; + }); + if (!alreadyExists) { + language.code = code; + uhrGlobals.languages.push(language); + } + } + }; + + // auto-detect themes + $('link[rel=stylesheet]').each(function(index, item) { + var styleSheet = $(item); + var styleClass = styleSheet.attr('data-class'); + if (styleClass !== undefined) { + var name = styleSheet.attr('data-name'); + if (name === undefined) { + name = styleClass; + } + uhrGlobals.themes.push({'styleClass': styleClass, 'name': name}); + } + }); + // fall-back if no theme was included + if (uhrGlobals.themes.length === 0) { + uhrGlobals.themes.push({}); + } + + // public interface methods (exported later) + var start = function start() { + if (!isOn.bind(this)()) { + this.timer = window.setInterval(function() { + this.options.time = new Date(); + update.bind(this)(); + }.bind(this), 1000); + update.bind(this)(); + setCookie.bind(this)('uhr-status', 'on'); + } + }; + var stop = function stop() { + if (isOn.bind(this)()) { + window.clearInterval(this.timer); + this.timer = null; + update.bind(this)(); + setCookie.bind(this)('uhr-status', 'off'); + } + }; + var toggle = function toggle() { + if (isOn.bind(this)()) { + this.stop(); + } else { + 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'); + }; + + // 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 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 + }); + $.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. + */ + 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; + } + } + 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'); + }); + }; + } + + function UhrRendererV2Delegate(layout) { + var vorne0 = { + 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] + }; + var hinten0 = { + 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] + }; + var vorne1 = { + 3: [3], + 4: [2, 3], + 5: [3], + 6: [3], + 7: [3], + 8: [3], + 9: [2, 3, 4] + }; + var hinten1 = { + 3: [9], + 4: [8, 9], + 5: [9], + 6: [9], + 7: [9], + 8: [9], + 9: [8, 9, 10] + }; + var vorne2 = { + 3: [2, 3, 4], + 4: [1, 5], + 5: [5], + 6: [4], + 7: [3], + 8: [2], + 9: [1, 2, 3, 4, 5] + }; + var hinten2 = { + 3: [8, 9, 10], + 4: [7, 11], + 5: [11], + 6: [10], + 7: [9], + 8: [8], + 9: [7, 8, 9, 10, 11] + }; + var vorne3 = { + 3: [1, 2, 3, 4, 5], + 4: [4], + 5: [3], + 6: [4], + 7: [5], + 8: [1, 5], + 9: [2, 3, 4] + }; + var hinten3 = { + 3: [7, 8, 9, 10, 11], + 4: [10], + 5: [9], + 6: [10], + 7: [11], + 8: [7, 11], + 9: [8, 9, 10] + }; + var vorne4 = { + 3: [4], + 4: [3, 4], + 5: [2, 4], + 6: [1, 4], + 7: [1, 2, 3, 4, 5], + 8: [4], + 9: [4] + }; + var hinten4 = { + 3: [10], + 4: [9, 10], + 5: [8, 10], + 6: [7, 10], + 7: [7, 8, 9, 10, 11], + 8: [10], + 9: [10] + }; + var vorne5 = { + 3: [1, 2, 3, 4, 5], + 4: [1], + 5: [1, 2, 3, 4], + 6: [5], + 7: [5], + 8: [1, 5], + 9: [2, 3, 4] + }; + var hinten5 = { + 3: [7, 8, 9, 10, 11], + 4: [7], + 5: [7, 8, 9, 10], + 6: [11], + 7: [11], + 8: [7, 11], + 9: [8, 9, 10] + }; + var hinten6 = { + 3: [9, 10], + 4: [8], + 5: [7], + 6: [7, 8, 9, 10], + 7: [7, 11], + 8: [7, 11], + 9: [8, 9, 10] + }; + var hinten7 = { + 3: [7, 8, 9, 10, 11], + 4: [11], + 5: [10], + 6: [9], + 7: [8], + 8: [8], + 9: [8] + }; + var hinten8 = { + 3: [8, 9, 10], + 4: [7, 11], + 5: [7, 11], + 6: [8, 9, 10], + 7: [7, 11], + 8: [7, 11], + 9: [8, 9, 10] + }; + var hinten9 = { + 3: [8, 9, 10], + 4: [7, 11], + 5: [7, 11], + 6: [8, 9, 10, 11], + 7: [11], + 8: [10], + 9: [8, 9] + }; + var seconds= { + "0": [vorne0, hinten0], + "1": [vorne0, hinten1], + "2": [vorne0, hinten2], + "3": [vorne0, hinten3], + "4": [vorne0, hinten4], + "5": [vorne0, hinten5], + "6": [vorne0, hinten6], + "7": [vorne0, hinten7], + "8": [vorne0, hinten8], + "9": [vorne0, hinten9], + "10": [vorne1, hinten0], + "11": [vorne1, hinten1], + "12": [vorne1, hinten2], + "13": [vorne1, hinten3], + "14": [vorne1, hinten4], + "15": [vorne1, hinten5], + "16": [vorne1, hinten6], + "17": [vorne1, hinten7], + "18": [vorne1, hinten8], + "19": [vorne1, hinten9], + "20": [vorne2, hinten0], + "21": [vorne2, hinten1], + "22": [vorne2, hinten2], + "23": [vorne2, hinten3], + "24": [vorne2, hinten4], + "25": [vorne2, hinten5], + "26": [vorne2, hinten6], + "27": [vorne2, hinten7], + "28": [vorne2, hinten8], + "29": [vorne2, hinten9], + "30": [vorne3, hinten0], + "31": [vorne3, hinten1], + "32": [vorne3, hinten2], + "33": [vorne3, hinten3], + "34": [vorne3, hinten4], + "35": [vorne3, hinten5], + "36": [vorne3, hinten6], + "37": [vorne3, hinten7], + "38": [vorne3, hinten8], + "39": [vorne3, hinten9], + "40": [vorne4, hinten0], + "41": [vorne4, hinten1], + "42": [vorne4, hinten2], + "43": [vorne4, hinten3], + "44": [vorne4, hinten4], + "45": [vorne4, hinten5], + "46": [vorne4, hinten6], + "47": [vorne4, hinten7], + "48": [vorne4, hinten8], + "49": [vorne4, hinten9], + "50": [vorne5, hinten0], + "51": [vorne5, hinten1], + "52": [vorne5, hinten2], + "53": [vorne5, hinten3], + "54": [vorne5, hinten4], + "55": [vorne5, hinten5], + "56": [vorne5, hinten6], + "57": [vorne5, hinten7], + "58": [vorne5, hinten8], + "59": [vorne5, hinten9] + }; + + function parseArrayOrObject(letters, styleClass, input) { + if (typeof input !== 'undefined' && input !== null) { + if (Array.isArray(input)) { + input.forEach(function(item) { + parseObject(letters, styleClass, item); + }); + } else { + parseObject(letters, styleClass, input); + } + } + } + + 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) { + var array = listString.split(','); + var highlightLetters = definition[listString]; + array.forEach(function(item) { + parseArrayOrObject(letters, styleClass + item, highlightLetters); + }); + }); + } + } + + this.parse = function parse() { + var letters = []; + layout.letters.forEach(function(string) { + var line = []; + for (var c = 0; c < string.length; c++) { + var character = new Letter(string[c]); + line.push(character); + } + letters.push(line); + }); + parseArrayOrObject(letters, 'on', layout.permanent); + if (typeof layout.seconds !== 'undefined' && layout.seconds !== null) { + parseTimeDefinition(letters, 'second', layout.seconds); + } else { + parseTimeDefinition(letters, 'second', seconds); + } + parseTimeDefinition(letters, 'minute', layout.minutes); + parseTimeDefinition(letters, 'hour', layout.hours); + return letters; + }; + } + + /** + * 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 Letter(value, style) { + var myValue = value; + var myStyle = style || ''; + this.addStyle = function(style) { + if (myStyle === '') { + myStyle = style; + } else { + myStyle += ' ' + style; + } + }; + this.toString = function() { + return '' + myValue + ''; + }; + } +})(jQuery); diff --git a/dist/jquery.uhr.min.js b/dist/jquery.uhr.min.js new file mode 100644 index 0000000..098dae9 --- /dev/null +++ b/dist/jquery.uhr.min.js @@ -0,0 +1,4 @@ +/*! uhr - v0.0.1 - 2015-01-13 +* http://bärneruhr.ch/ +* Copyright (c) 2015 Manuel Friedli; Licensed MIT */ +!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):!1});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(){s.bind(this)()||(this.timer=window.setInterval(function(){this.options.time=new Date,t.bind(this)()}.bind(this),1e3),t.bind(this)(),r.bind(this)("uhr-status","on"))},g=function(){s.bind(this)()&&(window.clearInterval(this.timer),this.timer=null,t.bind(this)(),r.bind(this)("uhr-status","off"))},h=function(){s.bind(this)()?this.stop():this.start()},i=function(a){if(a!==this.options.language){this.options.language=a;var c=new b(B.bind(this)(),this.element.find(".letterarea"));c.render.bind(this)(function(){this.currentMinute=-1,t.bind(this)()}.bind(this)),r.bind(this)("uhr-language",a),t.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,r.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),t.bind(this)()},l=function(a){this.options.mode=a,this.currentMinute=-1,t.bind(this)(),r.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(){l.bind(this)("seconds"===this.options.mode?"normal":"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),l.bind(this)("seconds"===f?"seconds":"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(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)},s=function(){return null!==this.timer},t=function(){if(s.bind(this)()){var a=this.options.time;if(!B.bind(this)().hasOwnProperty("seconds")&&"seconds"!==this.options.mode){if(a.getMinutes()===this.currentMinute)return;this.currentMinute=a.getMinutes()}u.bind(this)(a)}else w.bind(this)(),this.currentMinute=-1},u=function(a){var b=x.bind(this)(a),c=y.bind(this)(a),d=A.bind(this)(a),e=z.bind(this)(a);if(w.bind(this)(),"seconds"===this.options.mode)v.bind(this)("second"+b);else{v.bind(this)("on");for(var f=1;c>=f;f++)v.bind(this)("dot"+f);v.bind(this)("minute"+e),v.bind(this)("hour"+d)}},v=function(a){this.element.find(".item."+a).addClass("active")},w=function(){this.element.find(".item").removeClass("active")},x=function(a){return"function"==typeof B.bind(this)().getSeconds?B.bind(this)().getSeconds(a):a.getSeconds()},y=function(a){if("function"==typeof B.bind(this)().getDotMinute)return B.bind(this)().getDotMinute(a);var b=a.getMinutes();return b%5},z=function(a){return"function"==typeof B.bind(this)().getCoarseMinute?B.bind(this)().getCoarseMinute(a):a.getMinutes()},A=function(a){if("function"==typeof B.bind(this)().getHour)return B.bind(this)().getHour(a);var b=a.getHours();return a.getMinutes()>=25?(b+1)%24:b},B=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}),a.fritteli.uhr.register=e.registerLanguage}(jQuery); \ No newline at end of file From 351d9b653405aaac98df1be959f1c33a915aa74b Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Tue, 13 Jan 2015 19:52:04 +0100 Subject: [PATCH 03/24] fixed the path in the HTML file --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index c03e6ee..fc446a1 100644 --- a/index.html +++ b/index.html @@ -34,7 +34,7 @@ along with this program. If not, see . - + - - + - - - - + + - - - - - - - -
- + + + + + + diff --git a/test/test.js b/test/test.js index 518a0ba..a67ccd8 100644 --- a/test/test.js +++ b/test/test.js @@ -1,5 +1,21 @@ -suite('Bärneruhr', function() { - "use strict"; - test('dummy', function() { +suite('Bärneruhr', function () { + 'use strict'; + var assert = chai.assert; + test('create widget', function () { + var e = jQuery('#u'); + var uhr = e.uhr('instance'); + assert.isUndefined(uhr); + uhr = e.uhr(); + assert.isNotNull(uhr); + assert.isDefined(uhr); }); -}); \ No newline at end of file + test('destroy widget', function() { + var e = jQuery('#u'); + var uhr = e.uhr('instance'); + assert.isNotNull(uhr); + assert.isDefined(uhr); + e.uhr('destroy'); + uhr = e.uhr('instance'); + assert.isUndefined(uhr); + }); +}); From 1eb733b069a92e724a6e0a4fe13aee4f076ff0bd Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sun, 18 Jan 2015 16:14:23 +0100 Subject: [PATCH 09/24] updated README.md to reflect the latest changes; also added new paragraph about the URL parameter configuration, which was forgotten in the previous releaseupdated README.md to reflect the latest changes; also added new paragraph about the URL parameter configuration, which was forgotten in the previous release.. --- README.md | 73 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 57 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index b54f2fa..6bf060e 100644 --- a/README.md +++ b/README.md @@ -21,23 +21,31 @@ 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: - * jquery-2.1.0.min.js (Falls nicht bereits vorhanden) - * jquery-ui-1.10.4.custom.min.js (Falls nicht bereits vorhanden) + * 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-1.4.0.js (Falls nicht bereits vorhanden) - * uhr.js -* Binde mindestens eine der folgenden Javascript-Dateien im HTML nach uhr.js ein, je nach dem, welche Sprachen deine Uhr unterstützen soll: - * uhr-de_CH.js (Berndeutsch) - * uhr-de_CH_genau.js (Berndeutsch, siehe unten) - * uhr-de.js (Deutsch) - * uhr-dk.js (Dänisch) - * uhr-en.js (Englisch) - * uhr-es.js (Spanisch) - * uhr-fr.js (Französisch) - * uhr-it.js (Italienisch) - * uhr-nl.js (Niederländisch) + * jquery-cookie (getestet mit Version 1.4.0) +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ützden Sprachdateien + * dist/jquery.uhr.base.min.js: Enthält die Hauptdatei sowie Bärndütsch (de_CH) + * dist/jquery.uhr.main.min.js: Enthält ausschliesslich die Hauptdatei. Zusätzlich muss noch mindestens eine Sprachdatei eingebunden werden (siehe unten). -`uhr-de_CH_genau.js` ist eine Variante von Berndeutsch, bei der zur vollen Stunde zusätzlich das Wort "genau" angezeigt wird (also z.B. um 15:00 Uhr "ES ISCH GENAU DRÜ"). +* Je nach dem, welche der obigen Dateien du eingebunden hast, muskannst du noch individuelle Sprachdateien einbinden. Im Einstellungsfenster der Uhr werden diese Sprachen dann in der Reihenfolge zur Auswahl angeboten, in welcher du sie eingebunden hast. + * dist/jquery.uhr.langs.min.js: Enthält alle Sprachen + * dist/jquery.uhr.baselangs.min.js: Enthält alle Sprachen bis auf Bärndütsch (de_CH), welche bereits in dist/jquery.uhr.base.min.js enthalten ist. + * src/uhr-de_CH.js (Bärndütsch) + * src/uhr-de_CH_genau.js (Bärndütsch, siehe unten) + * src/uhr-de.js (Deutsch) + * src/uhr-dk.js (Dänisch) + * src/uhr-en.js (Englisch) + * src/uhr-es.js (Spanisch) + * src/uhr-fr.js (Französisch) + * src/uhr-it.js (Italienisch) + * src/uhr-nl.js (Niederländisch) + +`src/uhr-de_CH_genau.js` ist eine Variante von Bärndütsch, bei der zur vollen Stunde zusätzlich das Wort "genau" angezeigt wird (also z.B. um 15:00 Uhr "ES ISCH GENAU DRÜ" anstelle von "ES ISCH DRÜ"). 2. Uhr-Element im HTML-Dokument einfügen ---------------------------------------- @@ -63,7 +71,7 @@ Damit wird eine Uhr in der Standardkonfiguration erzeugt. Das heisst: Mit den Bedienelementen kannst du die Uhr ein- und ausschalten, zwischen Stunden/Minuten- oder Sekundenanzeige wechseln sowie Sprache und Farbe einstellen. -Wie du diese Optionen ändern kannst, verrät der nächste Abschnitt. +Wie du diese Optionen bereits in der Konfiguration ändern kannst, verrät der nächste Abschnitt. Es kann natürlich auch eine Collection von Elementen übergeben werden. Mit @@ -103,6 +111,39 @@ Die Zeit kann auch über einen Methodenaufruf dynamisch eingestellt werden: jQuery('#uhrcontainer').uhr("time", new Date()); +6. Konfiguration über die URL +----------------------------- +Es ist möglich, die Uhr durch den Aufruf mit URL-Parameters zu konfigurieren. Dies übersteuert auch allfällig bereits in einem Cookie gespeicherte Einstellungen. Folgende Parameter werden unterstützt, wenn du sie mit einem Hash (`#`) an die URL anhängst: + * `l` oder `language`: Bestimmt die Sprache. Der Wert ist der Sprach-Code (abhängig von den eingebundenen Sprachdateien): + * de_CH: Bärndütsch + * de_CH_genau: Bärndütsch (mit "genau") + * de: Deutsch + * dk: Dänisch + * en: Englisch + * es: Spanisch + * fr: Französisch + * it: Italienisch + * nl: Niederländisch + * `t` oder `theme`: Bestimmt die Farbe der Uhr. Der Wert ist der Farb-Code (abhängig von den eingebundenen CSS-Dateien): + * black: Schwarz + * white: Weiss + * red: Rot + * yellow: Gelb + * green: Grün + * blue: Blau + * pink: Pink + * `m` oder `mode`: Bestimmt den Modus der Uhr. Mögliche Werte sind: + * normal: Die Uhr zeit Stunde und Minute an + * seconds: Die Uhr zeigt die Sekunden an + * `s` oder `status`: Bestimmt den anfänglichen Zustand der Uhr. + * on: Die Uhr ist eingeschaltet + * off: Die Uhr ist ausgeschaltet +Eine URL kann also beispielweise so aussehen: + + http://example.com/uhr.html#l=fr&t=red&m=seconds&s=on + +Dies zeigt dann die Uhr auf Französisch in Rot, im Sekunden-Modus und eingeschaltet. + Viel Spass! A. Lizenzbestimmungen From 5bed926072d0a57547cfefd7dedafdfab79f73f3 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sun, 18 Jan 2015 16:18:06 +0100 Subject: [PATCH 10/24] clarified the use of URL configuration and pointed out that the settings apply to all Uhr elements on a page. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6bf060e..163fd76 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ Die Zeit kann auch über einen Methodenaufruf dynamisch eingestellt werden: 6. Konfiguration über die URL ----------------------------- -Es ist möglich, die Uhr durch den Aufruf mit URL-Parameters zu konfigurieren. Dies übersteuert auch allfällig bereits in einem Cookie gespeicherte Einstellungen. Folgende Parameter werden unterstützt, wenn du sie mit einem Hash (`#`) an die URL anhängst: +Es ist möglich, die Uhr durch den Aufruf mit URL-Parameters zu konfigurieren. Dies übersteuert auch allfällig bereits in einem Cookie gespeicherte Einstellungen. Die Einstellungen werden für alle Uhr-Elemente übernommen, welche sich auf der Seite befinden. Folgende Parameter werden unterstützt, wenn du sie mit einem Hash (`#`) an die URL anhängst: * `l` oder `language`: Bestimmt die Sprache. Der Wert ist der Sprach-Code (abhängig von den eingebundenen Sprachdateien): * de_CH: Bärndütsch * de_CH_genau: Bärndütsch (mit "genau") From 684f502cfd21c36306e522225d736d758007d852 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sun, 18 Jan 2015 16:44:28 +0100 Subject: [PATCH 11/24] updated info/index.html --- info/index.html | 131 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 93 insertions(+), 38 deletions(-) diff --git a/info/index.html b/info/index.html index e750cd9..d7f405a 100644 --- a/info/index.html +++ b/info/index.html @@ -50,6 +50,7 @@ along with this program. If not, see .
  • Konfiguration
  • +
  • Konfiguration über die URL
  • Informationen
  • @@ -93,27 +94,16 @@ along with this program. If not, see .

    Füge folgende Zeilen im <head>-Tag deines HTML-Dokumentes ein. Beachte dabei, dass die CSS-Dateien vor den Javascript eingebunden werden.
    - <link rel="stylesheet" type="text/css" href="uhr.css" /> - <link rel="stylesheet" type="text/css" href="uhr-black.css" data-class="black" data-name="Schwarz" /> - <link rel="stylesheet" type="text/css" href="uhr-white.css" data-class="white" data-name="Weiss" /> - <link rel="stylesheet" type="text/css" href="uhr-red.css" data-class="red" data-name="Rot" /> - <link rel="stylesheet" type="text/css" href="uhr-yellow.css" data-class="yellow" data-name="Gelb" /> - <link rel="stylesheet" type="text/css" href="uhr-green.css" data-class="green" data-name="Grün" /> - <link rel="stylesheet" type="text/css" href="uhr-blue.css" data-class="blue" data-name="Blau" /> - <link rel="stylesheet" type="text/css" href="uhr-pink.css" data-class="pink" data-name="Pink" /> - <script type="text/javascript" src="jquery-2.1.0.min.js"></script> - <script type="text/javascript" src="jquery-ui-1.10.4.custom.min.js"></script> - <script type="text/javascript" src="jquery-cookie-1.4.0.js"></script> - <script type="text/javascript" src="uhr.js"></script> - <script type="text/javascript" src="uhr-de_CH.js"></script> - <script type="text/javascript" src="uhr-de_CH_genau.js"></script> - <script type="text/javascript" src="uhr-de.js"></script> - <script type="text/javascript" src="uhr-dk.js"></script> - <script type="text/javascript" src="uhr-en.js"></script> - <script type="text/javascript" src="uhr-es.js"></script> - <script type="text/javascript" src="uhr-fr.js"></script> - <script type="text/javascript" src="uhr-it.js"></script> - <script type="text/javascript" src="uhr-nl.js"></script> + <link rel="stylesheet" type="text/css" href="css/uhr.css" /> + <link rel="stylesheet" type="text/css" href="css/uhr-black.css" data-class="black" data-name="Schwarz" /> + <link rel="stylesheet" type="text/css" href="css/uhr-white.css" data-class="white" data-name="Weiss" /> + <link rel="stylesheet" type="text/css" href="css/uhr-red.css" data-class="red" data-name="Rot" /> + <link rel="stylesheet" type="text/css" href="css/uhr-yellow.css" data-class="yellow" data-name="Gelb" /> + <link rel="stylesheet" type="text/css" href="css/uhr-green.css" data-class="green" data-name="Grün" /> + <link rel="stylesheet" type="text/css" href="css/uhr-blue.css" data-class="blue" data-name="Blau" /> + <link rel="stylesheet" type="text/css" href="css/uhr-pink.css" data-class="pink" data-name="Pink" /> + <script type="text/javascript" src="dist/libs.min.js"></script> + <script type="text/javascript" src="dist/jquery.uhr.complete.min.js"></script>

    Von den Stylesheets zwingend ist uhr.css und mindestens eines der Farbschema-Stylesheets. Die @@ -121,9 +111,6 @@ along with this program. If not, see . deklarierte Klasse bzw. den im Auswahlmenu anzuzeigenden Namen. Der Name kann frei gewählt werden, die Style-Klasse muss mit der im Stylesheet definierten übereinstimmen.

    -

    uhr-de_CH_genau.js ist eine Variante von Berndeutsch, bei der zur vollen Stunde zusätlich das - Wort genau angezeigt wird (also z.B. um 15:00 Uhr - ES ISCH GENAU DRÜ).

    Uhr-Element auf der SeiteZum Inhalt

    Definiere an der Stelle, wo die Uhr angezeigt werden soll, ein leeres @@ -142,10 +129,10 @@ along with this program. If not, see .

    Die Uhr wird so in der Standardkonfiguration angezeigt, das heisst: Berndeutsche Sprache, in der Farbe der - ersten eingebundenen CSS-Datei (im Beispiel also Schwarz), eingeschaltet, Breite 100% des Elternelementes. - Wenn dies nicht deinen Bedürfnissen entspricht, lässt sich die Uhr wie im folgenden Abschnitt beschrieben - konfigurieren. Die Konfiguration wird der .uhr()-Methode als JSON-Objekt übergeben, - beispielsweise so:
    + ersten eingebundenen CSS-Datei (im Beispiel also Schwarz), eingeschaltet, Stunden/Minuten-Modus, Breite + 100% des Elternelementes. Wenn dies nicht deinen Bedürfnissen entspricht, lässt sich die Uhr wie im + folgenden Abschnitt beschrieben konfigurieren. Die Konfiguration wird der .uhr()-Methode als + JSON-Objekt übergeben, beispielsweise so:
    jQuery('#meine-uhr').uhr({ width: '200px', theme: 'red' @@ -173,8 +160,18 @@ along with this program. If not, see .
    Typ: boolean
    Default: false

    language
    -
    Die anfänglich ausgewählte Sprache als String. Welche Sprachen unterstützt werden, hängt davon ab, - welche Sprachdateien eingebunden werden. +
    Die anfänglich ausgewählte Sprache als String. Mögliche Werte sind: +
      +
    • de_CH
    • +
    • de_CH_genau
    • +
    • de
    • +
    • dk
    • +
    • en
    • +
    • es
    • +
    • fr
    • +
    • it
    • +
    • nl
    • +

    Typ: String
    Default: 'de_CH'
    mode
    @@ -187,8 +184,17 @@ along with this program. If not, see .
    Typ: String
    Default: 'on'
    theme
    -
    Die anfänglich ausgewählte Farbe der Uhr. Welche Farben unterstützt werden, hängt davon ab, welche - CSS-Dateien eingebunden werden. +
    Die anfänglich ausgewählte Farbe der Uhr. Abhängig davon, welche CSS-Dateien eingebunden wurden, + werden folgende Werte unterstützt: +
      +
    • black
    • +
    • white
    • +
    • red
    • +
    • yellow
    • +
    • green
    • +
    • blue
    • +
    • pink
    • +

    Typ: String
    Default: Farbe der ersten eingebundenen CSS-Datei
    @@ -220,26 +226,75 @@ along with this program. If not, see . mode: 'seconds' }); })(jQuery); - - + +

    Konfiguration über die URLZum Inhalt

    + +

    Es ist möglich, die Uhr über URL-Parameter zu konfigurieren. Der Parameterstring wird mit einem # + abgetrennt an die URL angehängt, einzelne Parameter trennst du mit &. Folgende Parameter werden + unterstützt:

    +
    +
    l oder language
    +
    Gibt die Sprache an, in welcher die Uhr angezeigt werden soll. Mögliche Werte sind: +
      +
    • de_CH
    • +
    • de_CH_genau
    • +
    • de
    • +
    • dk
    • +
    • en
    • +
    • es
    • +
    • fr
    • +
    • it
    • +
    • nl
    • +
    +
    +
    t oder theme
    +
    Gibt die Farbe an, in welcher die Uhr angezeigt werden soll. Abhängig davon, welche CSS-Dateien + eingebunden wurden, werden folgende Werte unterstützt: +
      +
    • black
    • +
    • white
    • +
    • red
    • +
    • yellow
    • +
    • green
    • +
    • blue
    • +
    • pink
    • +
    +
    +
    m oder mode
    +
    Legt fest, ob die Uhr Stunden/Minuten oder Sekunden anzeigt. Mögliche Werte sind normal + für Stunden/Minutenmodus und seconds für den Sekundenmodus. +
    +
    s oder status
    +
    Bestimmt, ob die Uhr eingeschaltet oder ausgeschaltet sein soll. Mögliche Werte sind on + (eingeschaltet) oder off (ausgeschaltet). +
    +
    +

    Eine URL kann beispielsweise so aussehen, um eine gelbe Uhr in italienischer Sprache, Stunden/Minutenmodus + und eingeschaltet anzuzeigen:
    + http://bärneruhr.ch#l=it&t=yellow&m=normal&s=on +

    +

    InformationenZum Inhalt

    Programmiert von Manuel Friedli mit Inspiration von QLOCKTWO.
    + href="http://www.qlocktwo.com/">QLOCKTWO.
    Diese Uhr ist aus Freude am Programmieren und am Konzept einer die Zeit in Worten ausdrückenden Uhr entstanden. Sollte daraus jemandem Schaden oder ein gravierender Nachteil erwachsen, so soll sich diese Person bei mir melden und wir werden bestimmt eine Lösung finden, die für alle beteiligten angemessen ist. Allen anderen Personen wünsche ich viel Freude mit der Zeit im Wort.

    Der Quellcode ist frei zugänglich unter https://gittr.ch/manuel/uhr.

    + href="https://gittr.ch/manuel/uhr">https://gittr.ch/manuel/uhr.

    + +

    Detaillierte Informationen zur Verwendung und Konfiguration findest du in der README.md. +

    LizenzbestimmungenZum Inhalt

    Der komplette Sourcecode ist unter der GNU GPL 3.0 lizenziert und darf nach deren Vorgaben verwendet, - kopiert, weitergegeben und verändert werden. Die GNU GPL 3.0 findest Du unter folgendem Link: GNU GPL 3.0. Und direkt hier:

    + kopiert, weitergegeben und verändert werden. Die GNU GPL 3.0 findest du unter folgendem Link: GNU GPL 3.0. Und direkt hier:

    GNU GENERAL PUBLIC LICENSE

    From 8c08c93b1da5e919d104fbf5147e379391be86e6 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sun, 18 Jan 2015 17:11:32 +0100 Subject: [PATCH 12/24] added description for the cookiePath config option, which has been completely undocumented so far. my bad. --- README.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 163fd76..467d249 100644 --- a/README.md +++ b/README.md @@ -84,18 +84,19 @@ würde also jedes `
    `-Element der Seite in eine Uhr umgewandelt. Der uhr()-Methode kann ein Options-Objekt mitgegeben werden: jQuery('#uhrcontainer').uhr({ - status: 'on', // 'on' (default) oder 'off' - theme: 'black', // 'black' (default), 'white', 'red', 'yellow', 'green', 'blue' oder 'pink' (je nach eingebundenen Theme-Stylesheets) - language: 'de_CH', // 'de_CH' (default), 'de_CH_genau', 'de', 'dk', 'en', 'es', 'fr', 'it' oder 'nl' (je nach eingebundenen Sprachdateien) - mode: 'normal', // 'normal' (default): Die Uhr zeigt die aktuelle Zeit (Stunden und Minuten) in Worten an - // 'seconds': Die Uhr zeigt die aktuellen Sekunden als grosse Ziffern an - width: '100%', // eine CSS-Grössenangabe (default: 100%) - force: false, // false (default): Falls ein Cookie im Browser besteht, werden dessen Konfigurationswerte übernommen; - // true: immer die angegebene Konfiguration verwenden - controls: true, // true (default): Die Bedienelemente (Ein-/Ausschalter, Theme-, Zeitmodus- und Sprachwähler) werden angezeigt - // false: Die Bedienelemente werden nicht angezeigt - autoresize: true // true (default): Die Uhr passt ihre Grösse dynamisch an - // false: Die Uhr behält ihre anfängliche Grösse + status: 'on', // 'on' (default) oder 'off' + theme: 'black', // 'black' (default), 'white', 'red', 'yellow', 'green', 'blue' oder 'pink' (je nach eingebundenen Theme-Stylesheets) + language: 'de_CH', // 'de_CH' (default), 'de_CH_genau', 'de', 'dk', 'en', 'es', 'fr', 'it' oder 'nl' (je nach eingebundenen Sprachdateien) + mode: 'normal', // 'normal' (default): Die Uhr zeigt die aktuelle Zeit (Stunden und Minuten) in Worten an + // 'seconds': Die Uhr zeigt die aktuellen Sekunden als grosse Ziffern an + width: '100%', // eine CSS-Grössenangabe (default: 100%) + force: false, // false (default): Falls ein Cookie im Browser besteht, werden dessen Konfigurationswerte übernommen; + // true: immer die angegebene Konfiguration verwenden + controls: true, // true (default): Die Bedienelemente (Ein-/Ausschalter, Theme-, Zeitmodus- und Sprachwähler) werden angezeigt + // false: Die Bedienelemente werden nicht angezeigt + autoresize: true, // true (default): Die Uhr passt ihre Grösse dynamisch an + // false: Die Uhr behält ihre anfängliche Grösse + cookiePath: undefined // Gibt den Cookie-Pfad an. Ist normalerweise nicht definiert; in diesem Fall wird der Pfad der Datei benutzt, welche die Uhr anzeigt. Kann für spezielle Zwecke aber explizit gesetzt werden. }); 5. Sonderfunktionen From dfac2ae47acfd97a8b0ac67ac2e7b9769191b80a Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sun, 18 Jan 2015 17:17:17 +0100 Subject: [PATCH 13/24] executed grunt in order to update the version info in the dist/* files --- dist/jquery.uhr.base.js | 2 +- dist/jquery.uhr.base.min.js | 2 +- dist/jquery.uhr.baselangs.js | 2 +- dist/jquery.uhr.baselangs.min.js | 2 +- dist/jquery.uhr.complete.js | 2 +- dist/jquery.uhr.complete.min.js | 2 +- dist/jquery.uhr.langs.js | 2 +- dist/jquery.uhr.langs.min.js | 2 +- dist/jquery.uhr.main.js | 2 +- dist/jquery.uhr.main.min.js | 2 +- dist/libs.js | 2 +- dist/libs.min.js | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dist/jquery.uhr.base.js b/dist/jquery.uhr.base.js index 70d8627..63f2cdf 100644 --- a/dist/jquery.uhr.base.js +++ b/dist/jquery.uhr.base.js @@ -1,4 +1,4 @@ -/*! uhr - v7.0.0-next - 2015-01-16 +/*! uhr - v8.0.0-dev.0 - 2015-01-18 * http://bärneruhr.ch/ * Copyright (c) 2015 Manuel Friedli; Licensed GPLv3 */ (function($) { diff --git a/dist/jquery.uhr.base.min.js b/dist/jquery.uhr.base.min.js index 79bad4f..93244ad 100644 --- a/dist/jquery.uhr.base.min.js +++ b/dist/jquery.uhr.base.min.js @@ -1,4 +1,4 @@ -/*! uhr - v7.0.0-next - 2015-01-16 +/*! uhr - v8.0.0-dev.0 - 2015-01-18 * http://bärneruhr.ch/ * Copyright (c) 2015 Manuel Friedli; Licensed GPLv3 */ !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):!1});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(){l.bind(this)("seconds"===this.options.mode?"normal":"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),l.bind(this)("seconds"===f?"seconds":"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;c>=f;f++)w.bind(this)("dot"+f);w.bind(this)("minute"+e),w.bind(this)("hour"+d)}},w=function(a){this.element.find(".item."+a).addClass("active")},x=function(){this.element.find(".item").removeClass("active")},y=function(a){return"function"==typeof C.bind(this)().getSeconds?C.bind(this)().getSeconds(a):a.getSeconds()},z=function(a){if("function"==typeof C.bind(this)().getDotMinute)return C.bind(this)().getDotMinute(a);var b=a.getMinutes();return b%5},A=function(a){return"function"==typeof C.bind(this)().getCoarseMinute?C.bind(this)().getCoarseMinute(a):a.getMinutes()},B=function(a){if("function"==typeof C.bind(this)().getHour)return C.bind(this)().getHour(a);var b=a.getHours();return a.getMinutes()>=25?(b+1)%24:b},C=function(){var a=e.languages.filter(function(a){return a.code===this.options.language},this);return a.length>0?a[0]:{}};a.widget("fritteli.uhr",{options:{width:"100%",status:"on",language:"de_CH",theme:e.themes[0].styleClass,force:!1,controls:!0,cookiePath:void 0,autoresize:!0,mode:"normal"},start:f,stop:g,toggle:h,language:i,theme:j,time:k,mode:l,width:m,_create:n,_destroy:r}),a.fritteli.uhr.register=e.registerLanguage}(jQuery),function(a){"use strict";var b={1:[1,2,4,5,6,7]},c={4:[1,2]},d={3:[9,10,11]},e={4:[4,5,6,7,8]},f={1:[9,10,11]},g={2:[9,10,11]},h={2:[1,2,3,4,5,6]},i={3:[1,2,3,4,5,6]},j={version:2,language:"Bärndütsch",letters:["ESKISCHAFÜF","VIERTUBFZÄÄ","ZWÄNZGSIVOR","ABOHAUBIEGE","EISZWÖISDRÜ","VIERIFÜFIQT","SÄCHSISIBNI","ACHTINÜNIEL","ZÄNIERBEUFI","ZWÖUFINAUHR"],permanent:b,minutes:{"5,6,7,8,9":[f,c],"10,11,12,13,14":[g,c],"15,16,17,18,19":[h,c],"20,21,22,23,24":[i,c],"25,26,27,28,29":[f,d,e],"30,31,32,33,34":e,"35,36,37,38,39":[f,c,e],"40,41,42,43,44":[i,d],"45,46,47,48,49":[h,d],"50,51,52,53,54":[g,d],"55,56,57,58,59":[f,d]},hours:{"0,12":{10:[1,2,3,4,5,6]},"1,13":{5:[1,2,3]},"2,14":{5:[4,5,6,7]},"3,15":{5:[9,10,11]},"4,16":{6:[1,2,3,4,5]},"5,17":{6:[6,7,8,9]},"6,18":{7:[1,2,3,4,5,6]},"7,19":{7:[7,8,9,10,11]},"8,20":{8:[1,2,3,4,5]},"9,21":{8:[6,7,8,9]},"10,22":{9:[1,2,3,4]},"11,23":{9:[8,9,10,11]}}};a.fritteli.uhr.register("de_CH",j)}(jQuery); \ No newline at end of file diff --git a/dist/jquery.uhr.baselangs.js b/dist/jquery.uhr.baselangs.js index 7a187b1..e2eae4f 100644 --- a/dist/jquery.uhr.baselangs.js +++ b/dist/jquery.uhr.baselangs.js @@ -1,4 +1,4 @@ -/*! uhr - v7.0.0-next - 2015-01-16 +/*! uhr - v8.0.0-dev.0 - 2015-01-18 * http://bärneruhr.ch/ * Copyright (c) 2015 Manuel Friedli; Licensed GPLv3 */ (function($) { diff --git a/dist/jquery.uhr.baselangs.min.js b/dist/jquery.uhr.baselangs.min.js index 02b5c1f..ae58801 100644 --- a/dist/jquery.uhr.baselangs.min.js +++ b/dist/jquery.uhr.baselangs.min.js @@ -1,4 +1,4 @@ -/*! uhr - v7.0.0-next - 2015-01-16 +/*! uhr - v8.0.0-dev.0 - 2015-01-18 * http://bärneruhr.ch/ * Copyright (c) 2015 Manuel Friedli; Licensed GPLv3 */ !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); \ No newline at end of file diff --git a/dist/jquery.uhr.complete.js b/dist/jquery.uhr.complete.js index d204833..8c05059 100644 --- a/dist/jquery.uhr.complete.js +++ b/dist/jquery.uhr.complete.js @@ -1,4 +1,4 @@ -/*! uhr - v7.0.0-next - 2015-01-16 +/*! uhr - v8.0.0-dev.0 - 2015-01-18 * http://bärneruhr.ch/ * Copyright (c) 2015 Manuel Friedli; Licensed GPLv3 */ (function($) { diff --git a/dist/jquery.uhr.complete.min.js b/dist/jquery.uhr.complete.min.js index aaddc80..1c4b6f8 100644 --- a/dist/jquery.uhr.complete.min.js +++ b/dist/jquery.uhr.complete.min.js @@ -1,4 +1,4 @@ -/*! uhr - v7.0.0-next - 2015-01-16 +/*! uhr - v8.0.0-dev.0 - 2015-01-18 * http://bärneruhr.ch/ * Copyright (c) 2015 Manuel Friedli; Licensed GPLv3 */ !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):!1});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(){l.bind(this)("seconds"===this.options.mode?"normal":"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),l.bind(this)("seconds"===f?"seconds":"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;c>=f;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); \ No newline at end of file diff --git a/dist/jquery.uhr.langs.js b/dist/jquery.uhr.langs.js index 7a187b1..e2eae4f 100644 --- a/dist/jquery.uhr.langs.js +++ b/dist/jquery.uhr.langs.js @@ -1,4 +1,4 @@ -/*! uhr - v7.0.0-next - 2015-01-16 +/*! uhr - v8.0.0-dev.0 - 2015-01-18 * http://bärneruhr.ch/ * Copyright (c) 2015 Manuel Friedli; Licensed GPLv3 */ (function($) { diff --git a/dist/jquery.uhr.langs.min.js b/dist/jquery.uhr.langs.min.js index 02b5c1f..ae58801 100644 --- a/dist/jquery.uhr.langs.min.js +++ b/dist/jquery.uhr.langs.min.js @@ -1,4 +1,4 @@ -/*! uhr - v7.0.0-next - 2015-01-16 +/*! uhr - v8.0.0-dev.0 - 2015-01-18 * http://bärneruhr.ch/ * Copyright (c) 2015 Manuel Friedli; Licensed GPLv3 */ !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); \ No newline at end of file diff --git a/dist/jquery.uhr.main.js b/dist/jquery.uhr.main.js index 670eb44..91bbf3b 100644 --- a/dist/jquery.uhr.main.js +++ b/dist/jquery.uhr.main.js @@ -1,4 +1,4 @@ -/*! uhr - v7.0.0-next - 2015-01-16 +/*! uhr - v8.0.0-dev.0 - 2015-01-18 * http://bärneruhr.ch/ * Copyright (c) 2015 Manuel Friedli; Licensed GPLv3 */ (function($) { diff --git a/dist/jquery.uhr.main.min.js b/dist/jquery.uhr.main.min.js index b5cdf9f..e86dd6f 100644 --- a/dist/jquery.uhr.main.min.js +++ b/dist/jquery.uhr.main.min.js @@ -1,4 +1,4 @@ -/*! uhr - v7.0.0-next - 2015-01-16 +/*! uhr - v8.0.0-dev.0 - 2015-01-18 * http://bärneruhr.ch/ * Copyright (c) 2015 Manuel Friedli; Licensed GPLv3 */ !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):!1});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(){l.bind(this)("seconds"===this.options.mode?"normal":"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),l.bind(this)("seconds"===f?"seconds":"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;c>=f;f++)w.bind(this)("dot"+f);w.bind(this)("minute"+e),w.bind(this)("hour"+d)}},w=function(a){this.element.find(".item."+a).addClass("active")},x=function(){this.element.find(".item").removeClass("active")},y=function(a){return"function"==typeof C.bind(this)().getSeconds?C.bind(this)().getSeconds(a):a.getSeconds()},z=function(a){if("function"==typeof C.bind(this)().getDotMinute)return C.bind(this)().getDotMinute(a);var b=a.getMinutes();return b%5},A=function(a){return"function"==typeof C.bind(this)().getCoarseMinute?C.bind(this)().getCoarseMinute(a):a.getMinutes()},B=function(a){if("function"==typeof C.bind(this)().getHour)return C.bind(this)().getHour(a);var b=a.getHours();return a.getMinutes()>=25?(b+1)%24:b},C=function(){var a=e.languages.filter(function(a){return a.code===this.options.language},this);return a.length>0?a[0]:{}};a.widget("fritteli.uhr",{options:{width:"100%",status:"on",language:"de_CH",theme:e.themes[0].styleClass,force:!1,controls:!0,cookiePath:void 0,autoresize:!0,mode:"normal"},start:f,stop:g,toggle:h,language:i,theme:j,time:k,mode:l,width:m,_create:n,_destroy:r}),a.fritteli.uhr.register=e.registerLanguage}(jQuery); \ No newline at end of file diff --git a/dist/libs.js b/dist/libs.js index 6a12f08..6935b75 100644 --- a/dist/libs.js +++ b/dist/libs.js @@ -1,4 +1,4 @@ -/*! uhr - v7.0.0-next - 2015-01-16 +/*! uhr - v8.0.0-dev.0 - 2015-01-18 * http://bärneruhr.ch/ * Copyright (c) 2015 Manuel Friedli; Licensed GPLv3 */ /*! diff --git a/dist/libs.min.js b/dist/libs.min.js index a67f507..55129ef 100644 --- a/dist/libs.min.js +++ b/dist/libs.min.js @@ -1,4 +1,4 @@ -/*! uhr - v7.0.0-next - 2015-01-16 +/*! uhr - v8.0.0-dev.0 - 2015-01-18 * http://bärneruhr.ch/ * Copyright (c) 2015 Manuel Friedli; Licensed GPLv3 */ !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){function c(a){var b=a.length,c=_.type(a);return"function"===c||_.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}function d(a,b,c){if(_.isFunction(b))return _.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return _.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(hb.test(b))return _.filter(b,a,c);b=_.filter(b,a)}return _.grep(a,function(a){return U.call(b,a)>=0!==c})}function e(a,b){for(;(a=a[b])&&1!==a.nodeType;);return a}function f(a){var b=ob[a]={};return _.each(a.match(nb)||[],function(a,c){b[c]=!0}),b}function g(){Z.removeEventListener("DOMContentLoaded",g,!1),a.removeEventListener("load",g,!1),_.ready()}function h(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=_.expando+h.uid++}function i(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(ub,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:tb.test(c)?_.parseJSON(c):c}catch(e){}sb.set(a,b,c)}else c=void 0;return c}function j(){return!0}function k(){return!1}function l(){try{return Z.activeElement}catch(a){}}function m(a,b){return _.nodeName(a,"table")&&_.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function n(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function o(a){var b=Kb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function p(a,b){for(var c=0,d=a.length;d>c;c++)rb.set(a[c],"globalEval",!b||rb.get(b[c],"globalEval"))}function q(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(rb.hasData(a)&&(f=rb.access(a),g=rb.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)_.event.add(b,e,j[e][c])}sb.hasData(a)&&(h=sb.access(a),i=_.extend({},h),sb.set(b,i))}}function r(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&_.nodeName(a,b)?_.merge([a],c):c}function s(a,b){var c=b.nodeName.toLowerCase();"input"===c&&yb.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function t(b,c){var d,e=_(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:_.css(e[0],"display");return e.detach(),f}function u(a){var b=Z,c=Ob[a];return c||(c=t(a,b),"none"!==c&&c||(Nb=(Nb||_("