diff --git a/.drone.yml b/.drone.yml
index bd92dc4..76b65fc 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -1,40 +1,13 @@
kind: pipeline
+type: docker
name: default
steps:
- name: prepare
- image: node:12
+ image: node:15-alpine
commands:
- npm install
- - name: audit
- image: node:12
- failure: ignore
- commands:
- - npm audit
- name: build
- image: node:12
+ image: node:15-alpine
commands:
- - npm run build:prod
- - name: update version
- image: node:12
- commands:
- - npm version prerelease
- when:
- branch:
- - develop
- - feature/*
-# - name: release
-# image: plugins/gitea-release
-# settings:
-# api_key:
-# from_secret: gitea_token
-# base_url: https://gittr.ch/
-# checksum:
-# - md5
-# - sha512
-# files: dist/*
-# file_exists: fail
-# note: README.md
-# title: VERSION
-# when:
-# event: tag
+ - npm run build
diff --git a/.editorconfig b/.editorconfig
index 1eaa865..87a3009 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -11,6 +11,5 @@ insert_final_newline = true
[*.yml]
indent_size = 2
-
[*.md]
trim_trailing_whitespace = false
diff --git a/.eslintrc.json b/.eslintrc.json
deleted file mode 100644
index 8024652..0000000
--- a/.eslintrc.json
+++ /dev/null
@@ -1,74 +0,0 @@
-{
- "parserOptions": {
- "ecmaVersion": 6,
- "project": "./tsconfig.json",
- "sourceType": "module"
- },
- "parser": "@typescript-eslint/parser",
- "plugins": [
- "header",
- "@typescript-eslint"
- ],
- "env": {
- "browser": true
- },
- "extends": [
- "eslint:recommended",
- "plugin:@typescript-eslint/recommended"
- ],
- "rules": {
- "curly": "error",
- "eol-last": [
- "error",
- "always"
- ],
- "no-console": [
- "error",
- {
- "allow": [
- "warn",
- "error"
- ]
- }
- ],
- "no-unused-vars": "off",
- "quotes": [
- "error",
- "single"
- ],
- "semi": [
- "error",
- "always"
- ],
- "sort-imports": "error",
- "header/header": [
- "error",
- "header.ts"
- ],
- "@typescript-eslint/member-ordering": [
- "error"
- ],
- "@typescript-eslint/no-namespace": [
- "error",
- {
- "allowDeclarations": true
- }
- ],
- "@typescript-eslint/no-parameter-properties": [
- "error",
- {
- "allows": [
- "private readonly"
- ]
- }
- ],
- "@typescript-eslint/no-unused-vars": [
- "error",
- {
- "vars": "all",
- "args": "after-used",
- "ignoreRestSiblings": false
- }
- ]
- }
-}
diff --git a/Gruntfile.js b/Gruntfile.js
deleted file mode 100644
index ae194d4..0000000
--- a/Gruntfile.js
+++ /dev/null
@@ -1,180 +0,0 @@
-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 <%= pkg.licenses[0].type %> */\n',
- // Task configuration.
- clean: {
- files: ['dist']
- },
- concat: {
- options: {
- banner: '<%= banner %>',
- stripBanners: true
- },
- libs: {
- src: [
- 'node_modules/jquery/dist/jquery.js',
- 'node_modules/jquery-ui/ui/widget.js',
- 'node_modules/jquery.cookie/jquery.cookie.js'
- ],
- dest: 'dist/libs.js'
- },
- dist: {
- src: ['src/uhr.js', 'src/uhr-*.js'],
- dest: 'dist/jquery.<%= pkg.name %>.complete.js'
- },
- main: {
- src: ['src/uhr.js'],
- dest: 'dist/jquery.<%= pkg.name %>.main.js'
- },
- base: {
- src: ['src/uhr.js', 'src/uhr-de_CH.js'],
- dest: 'dist/jquery.<%= pkg.name %>.base.js'
- },
- baselangs: {
- src: ['src/uhr-*.js'],
- exclude: ['src/uhr-de_CH.js'],
- dest: 'dist/jquery.<%= pkg.name %>.baselangs.js'
- },
- langs: {
- src: ['src/uhr-*.js'],
- dest: 'dist/jquery.<%= pkg.name %>.langs.js'
- }
- },
- uglify: {
- options: {
- banner: '<%= banner %>'
- },
- libs: {
- src: '<%= concat.libs.dest %>',
- dest: 'dist/libs.min.js'
- },
- dist: {
- src: '<%= concat.dist.dest %>',
- dest: 'dist/jquery.<%= pkg.name %>.complete.min.js'
- },
- main: {
- src: '<%= concat.main.dest %>',
- dest: 'dist/jquery.<%= pkg.name %>.main.min.js'
- },
- base: {
- src: '<%= concat.base.dest %>',
- dest: 'dist/jquery.<%= pkg.name %>.base.min.js'
- },
- baselangs: {
- src: '<%= concat.baselangs.dest %>',
- dest: 'dist/jquery.<%= pkg.name %>.baselangs.min.js'
- },
- langs: {
- src: '<%= concat.langs.dest %>',
- dest: 'dist/jquery.<%= pkg.name %>.langs.min.js'
- }
- },
- cssmin: {
- allcss: {
- files: [{
- expand: true,
- cwd: 'css',
- src: ['*.css'],
- dest: 'dist',
- ext: '.min.css'
- }]
- }
- },
- mocha_phantomjs: {
- all: {
- options: {
- urls: ['http://localhost:9000/test/test.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', 'mocha_phantomjs']
- },
- test: {
- files: ['test/test.html', '<%= jshint.test.src %>'],
- tasks: ['jshint:test', 'mocha_phantomjs']
- }
- },
- connect: {
- server: {
- options: {
- hostname: '*',
- port: 9000
- }
- }
- },
- version: {
- VERSION: {
- options: {
- prefix: ''
- },
- src: ['VERSION']
- },
- bower: {
- src: ['bower.json']
- },
- manifest: {
- options: {
- prefix: 'Version\\s+'
- },
- src: ['manifest.appcache']
- }
- }
- });
-
- grunt.loadNpmTasks('grunt-mocha-phantomjs');
- grunt.loadNpmTasks('grunt-contrib-cssmin');
- grunt.loadNpmTasks('grunt-version');
-
- // Default task.
- grunt.registerTask('default', ['jshint', 'clean', 'version', 'concat', 'connect', 'mocha_phantomjs', 'uglify', 'cssmin']);
- grunt.registerTask('buildonly', ['clean', 'version', 'concat', 'uglify', 'cssmin']);
- 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', 'mocha_phantomjs']);
-};
diff --git a/README.md b/README.md
index f45d99e..1792900 100644
--- a/README.md
+++ b/README.md
@@ -2,19 +2,16 @@
Du willst Bärneruhr auf deiner Website verwenden? Dank des jQuery-Plugins geht das so einfach, dass es sogar deine Grossmutter tun könnte!
## 1. Benötigte Dateien einbinden
-**FIXME Folgender Absatz muss angepasst werden**
-Binde folgende CSS-Datei im HTML-Dokument ein:
-* dist/uhr.min.css
-
-**FIXME Folgender Absatz muss angepasst werden**
-Binde zusätzlich mindestens eine der folgenden CSS-Dateien im HTML ein, je nach dem, welche Farben deine Uhr unterstützen soll:
-* dist/uhr-black.min.css
-* dist/uhr-white.min.css
-* dist/uhr-red.min.css
-* dist/uhr-yellow.min.css
-* dist/uhr-green.min.css
-* dist/uhr-blue.min.css
-* dist/uhr-pink.min.css
+* Binde folgende CSS-Datei im HTML-Dokument ein:
+ * dist/uhr.min.css
+* Binde zusätzlich mindestens eine der folgenden CSS-Dateien im HTML ein, je nach dem, welche Farben deine Uhr unterstützen soll:
+ * dist/uhr-black.min.css
+ * dist/uhr-white.min.css
+ * dist/uhr-red.min.css
+ * dist/uhr-yellow.min.css
+ * dist/uhr-green.min.css
+ * dist/uhr-blue.min.css
+ * dist/uhr-pink.min.css
Beim Einbinden muss das attribut `data-class` angegeben werden, welches die CSS-Klasse des Themes definiert. Optional kann mit `data-name` ein im Dropdown anzuzeigender Name angegeben werden. Beispiel:
@@ -22,32 +19,31 @@ Beim Einbinden muss das attribut `data-class` angegeben werden, welches die CSS-
```
-Binde nach den CSS-Dateien (wichtig: *nicht* vorher) die benötigten Bibliotheken ein:
-* jquery (getestet mit Version 3.4.1)
-* jquery-ui (getestet mit Version 1.12.1)
- * Von jquery-ui wird die Komponente 'widget' benötigt.
-* js-cookie (getestet mit Version 2.2.0)
-
-**FIXME Folgender Absatz muss angepasst werden**
+* Binde nach den CSS-Dateien (wichtig!) folgende Javascript-Dateien im HTML-Dokument ein:
+ * dist/libs.min.js: Dies enthält die minifizierten Versionen von jQuery, jQuery-UI (mit den Komponenten `code` und `widget`) und jQuery-Cookie.
+Alternativ kannst Du auch direkt die benötigten Bibliotheken einbinden:
+ * jquery (getestet mit Version 3.4.1)
+ * jquery-ui (getestet mit Version 1.12.1)
+ * Von jquery-ui wird die Komponente 'widget' benötigt.
+ * jquery-cookie (getestet mit Version 1.4.1)
Je nach dem, in welchen Sprachen du die Uhr verwenden willst, noch eine der folgenden Dateien:
-* dist/jquery.uhr.complete.min.js: Enthält die Hauptdatei sowie alle unterstützten Sprachdateien
-* dist/jquery.uhr.base.min.js: Enthält die Hauptdatei sowie Bärndütsch (de_CH)
-* dist/jquery.uhr.main.min.js: Enthält ausschliesslich die Hauptdatei. Zusätzlich muss noch mindestens eine Sprachdatei eingebunden werden (siehe unten).
+ * dist/jquery.uhr.complete.min.js: Enthält die Hauptdatei sowie alle unterstützten Sprachdateien
+ * dist/jquery.uhr.base.min.js: Enthält die Hauptdatei sowie Bärndütsch (de_CH)
+ * dist/jquery.uhr.main.min.js: Enthält ausschliesslich die Hauptdatei. Zusätzlich muss noch mindestens eine Sprachdatei eingebunden werden (siehe unten).
-**FIXME Folgender Absatz muss angepasst werden**
-Je nach dem, welche der obigen Dateien du eingebunden hast, kannst 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 (Variante von 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-pt.js (Portugiesisch)
+* Je nach dem, welche der obigen Dateien du eingebunden hast, kannst 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-pt.js (Portugiesisch)
`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Ü").
@@ -97,7 +93,7 @@ jQuery('#uhrcontainer').uhr({
language: 'de_CH', // 'de_CH' (default), 'de_CH_genau', 'de', 'dk', 'en', 'es', 'fr', 'it', 'nl' oder 'pt' (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%)
+ 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
@@ -125,7 +121,7 @@ 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. 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:
+Es ist möglich, die Uhr durch den Aufruf mit URL-Parametern 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
diff --git a/VERSION b/VERSION
index 85b581a..2b1a7b3 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-$npm_package_version
+9.0.0-dev.0
diff --git a/build-config/entrypoints/css-app.js b/build-config/entrypoints/css-app.js
new file mode 100644
index 0000000..f57a652
--- /dev/null
+++ b/build-config/entrypoints/css-app.js
@@ -0,0 +1 @@
+import '../../css/uhr.css';
diff --git a/build-config/entrypoints/css-black.js b/build-config/entrypoints/css-black.js
new file mode 100644
index 0000000..9924336
--- /dev/null
+++ b/build-config/entrypoints/css-black.js
@@ -0,0 +1 @@
+import '../../css/uhr-black.css';
diff --git a/build-config/entrypoints/css-blue.js b/build-config/entrypoints/css-blue.js
new file mode 100644
index 0000000..13e3df9
--- /dev/null
+++ b/build-config/entrypoints/css-blue.js
@@ -0,0 +1 @@
+import '../../css/uhr-blue.css';
diff --git a/build-config/entrypoints/css-green.js b/build-config/entrypoints/css-green.js
new file mode 100644
index 0000000..ff54518
--- /dev/null
+++ b/build-config/entrypoints/css-green.js
@@ -0,0 +1 @@
+import '../../css/uhr-green.css';
diff --git a/build-config/entrypoints/css-pink.js b/build-config/entrypoints/css-pink.js
new file mode 100644
index 0000000..d314a16
--- /dev/null
+++ b/build-config/entrypoints/css-pink.js
@@ -0,0 +1 @@
+import '../../css/uhr-pink.css';
diff --git a/build-config/entrypoints/css-red.js b/build-config/entrypoints/css-red.js
new file mode 100644
index 0000000..caca988
--- /dev/null
+++ b/build-config/entrypoints/css-red.js
@@ -0,0 +1 @@
+import '../../css/uhr-red.css';
diff --git a/build-config/entrypoints/css-white.js b/build-config/entrypoints/css-white.js
new file mode 100644
index 0000000..b3c2dc6
--- /dev/null
+++ b/build-config/entrypoints/css-white.js
@@ -0,0 +1 @@
+import '../../css/uhr-white.css';
diff --git a/build-config/entrypoints/css-yellow.js b/build-config/entrypoints/css-yellow.js
new file mode 100644
index 0000000..6f1f258
--- /dev/null
+++ b/build-config/entrypoints/css-yellow.js
@@ -0,0 +1 @@
+import '../../css/uhr-yellow.css';
diff --git a/build-config/entrypoints/js-app.js b/build-config/entrypoints/js-app.js
new file mode 100644
index 0000000..b764aac
--- /dev/null
+++ b/build-config/entrypoints/js-app.js
@@ -0,0 +1 @@
+import '../../src/uhr';
diff --git a/build-config/entrypoints/js-base.js b/build-config/entrypoints/js-base.js
new file mode 100644
index 0000000..51f9973
--- /dev/null
+++ b/build-config/entrypoints/js-base.js
@@ -0,0 +1,2 @@
+import '../../src/uhr';
+import '../../src/uhr-de_CH';
diff --git a/build-config/entrypoints/js-baselangs.js b/build-config/entrypoints/js-baselangs.js
new file mode 100644
index 0000000..503ee3d
--- /dev/null
+++ b/build-config/entrypoints/js-baselangs.js
@@ -0,0 +1,9 @@
+import '../../src/uhr-de';
+import '../../src/uhr-de_CH_genau';
+import '../../src/uhr-dk';
+import '../../src/uhr-en';
+import '../../src/uhr-es';
+import '../../src/uhr-fr';
+import '../../src/uhr-it';
+import '../../src/uhr-nl';
+import '../../src/uhr-pt';
diff --git a/build-config/entrypoints/js-complete.js b/build-config/entrypoints/js-complete.js
new file mode 100644
index 0000000..8f63442
--- /dev/null
+++ b/build-config/entrypoints/js-complete.js
@@ -0,0 +1,11 @@
+import '../../src/uhr';
+import '../../src/uhr-de';
+import '../../src/uhr-de_CH';
+import '../../src/uhr-de_CH_genau';
+import '../../src/uhr-dk';
+import '../../src/uhr-en';
+import '../../src/uhr-es';
+import '../../src/uhr-fr';
+import '../../src/uhr-it';
+import '../../src/uhr-nl';
+import '../../src/uhr-pt';
diff --git a/build-config/entrypoints/js-langs.js b/build-config/entrypoints/js-langs.js
new file mode 100644
index 0000000..938e011
--- /dev/null
+++ b/build-config/entrypoints/js-langs.js
@@ -0,0 +1,10 @@
+import '../../src/uhr-de';
+import '../../src/uhr-de_CH';
+import '../../src/uhr-de_CH_genau';
+import '../../src/uhr-dk';
+import '../../src/uhr-en';
+import '../../src/uhr-es';
+import '../../src/uhr-fr';
+import '../../src/uhr-it';
+import '../../src/uhr-nl';
+import '../../src/uhr-pt';
diff --git a/build-config/entrypoints/js-libs.js b/build-config/entrypoints/js-libs.js
new file mode 100644
index 0000000..6642c62
--- /dev/null
+++ b/build-config/entrypoints/js-libs.js
@@ -0,0 +1,3 @@
+import 'jquery';
+import 'jquery-ui';
+import 'jquery.cookie';
diff --git a/build-config/rollup.config.css-app.js b/build-config/rollup.config.css-app.js
new file mode 100644
index 0000000..f7d53b3
--- /dev/null
+++ b/build-config/rollup.config.css-app.js
@@ -0,0 +1,11 @@
+import cssbundle from 'rollup-plugin-css-bundle';
+import postcss from "postcss";
+import cssnano from "cssnano";
+
+export default {
+ input: 'build-config/entrypoints/css-app.js',
+ plugins: [cssbundle({
+ transform: code => postcss([cssnano]).process(code),
+ output: 'dist/uhr.min.css'
+ })]
+}
diff --git a/build-config/rollup.config.css-black.js b/build-config/rollup.config.css-black.js
new file mode 100644
index 0000000..b402865
--- /dev/null
+++ b/build-config/rollup.config.css-black.js
@@ -0,0 +1,11 @@
+import cssbundle from 'rollup-plugin-css-bundle';
+import postcss from 'postcss';
+import cssnano from 'cssnano';
+
+export default {
+ input: 'build-config/entrypoints/css-black.js',
+ plugins: [cssbundle({
+ transform: code => postcss([cssnano]).process(code),
+ output: 'dist/uhr-black.min.css'
+ })]
+}
diff --git a/build-config/rollup.config.css-blue.js b/build-config/rollup.config.css-blue.js
new file mode 100644
index 0000000..8b00d77
--- /dev/null
+++ b/build-config/rollup.config.css-blue.js
@@ -0,0 +1,11 @@
+import cssbundle from 'rollup-plugin-css-bundle';
+import postcss from 'postcss';
+import cssnano from 'cssnano';
+
+export default {
+ input: 'build-config/entrypoints/css-blue.js',
+ plugins: [cssbundle({
+ transform: code => postcss([cssnano]).process(code),
+ output: 'dist/uhr-blue.min.css'
+ })]
+}
diff --git a/build-config/rollup.config.css-green.js b/build-config/rollup.config.css-green.js
new file mode 100644
index 0000000..949dbd0
--- /dev/null
+++ b/build-config/rollup.config.css-green.js
@@ -0,0 +1,11 @@
+import cssbundle from 'rollup-plugin-css-bundle';
+import postcss from 'postcss';
+import cssnano from 'cssnano';
+
+export default {
+ input: 'build-config/entrypoints/css-green.js',
+ plugins: [cssbundle({
+ transform: code => postcss([cssnano]).process(code),
+ output: 'dist/uhr-green.min.css'
+ })]
+}
diff --git a/build-config/rollup.config.css-pink.js b/build-config/rollup.config.css-pink.js
new file mode 100644
index 0000000..1eadbae
--- /dev/null
+++ b/build-config/rollup.config.css-pink.js
@@ -0,0 +1,11 @@
+import cssbundle from 'rollup-plugin-css-bundle';
+import postcss from 'postcss';
+import cssnano from 'cssnano';
+
+export default {
+ input: 'build-config/entrypoints/css-pink.js',
+ plugins: [cssbundle({
+ transform: code => postcss([cssnano]).process(code),
+ output: 'dist/uhr-pink.min.css'
+ })]
+}
diff --git a/build-config/rollup.config.css-red.js b/build-config/rollup.config.css-red.js
new file mode 100644
index 0000000..9cfec11
--- /dev/null
+++ b/build-config/rollup.config.css-red.js
@@ -0,0 +1,11 @@
+import cssbundle from 'rollup-plugin-css-bundle';
+import postcss from 'postcss';
+import cssnano from 'cssnano';
+
+export default {
+ input: 'build-config/entrypoints/css-red.js',
+ plugins: [cssbundle({
+ transform: code => postcss([cssnano]).process(code),
+ output: 'dist/uhr-red.min.css'
+ })]
+}
diff --git a/build-config/rollup.config.css-white.js b/build-config/rollup.config.css-white.js
new file mode 100644
index 0000000..62f2808
--- /dev/null
+++ b/build-config/rollup.config.css-white.js
@@ -0,0 +1,11 @@
+import cssbundle from 'rollup-plugin-css-bundle';
+import postcss from 'postcss';
+import cssnano from 'cssnano';
+
+export default {
+ input: 'build-config/entrypoints/css-white.js',
+ plugins: [cssbundle({
+ transform: code => postcss([cssnano]).process(code),
+ output: 'dist/uhr-white.min.css'
+ })]
+}
diff --git a/build-config/rollup.config.css-yellow.js b/build-config/rollup.config.css-yellow.js
new file mode 100644
index 0000000..9ec2766
--- /dev/null
+++ b/build-config/rollup.config.css-yellow.js
@@ -0,0 +1,11 @@
+import cssbundle from 'rollup-plugin-css-bundle';
+import postcss from 'postcss';
+import cssnano from 'cssnano';
+
+export default {
+ input: 'build-config/entrypoints/css-yellow.js',
+ plugins: [cssbundle({
+ transform: code => postcss([cssnano]).process(code),
+ output: 'dist/uhr-yellow.min.css'
+ })]
+}
diff --git a/build-config/rollup.config.js-app.js b/build-config/rollup.config.js-app.js
new file mode 100644
index 0000000..5a040ca
--- /dev/null
+++ b/build-config/rollup.config.js-app.js
@@ -0,0 +1,23 @@
+import {terser} from 'rollup-plugin-terser';
+
+export default {
+ external: [
+ 'jquery',
+ 'jquery-ui',
+ 'jquery.cookie'
+ ],
+ input: 'build-config/entrypoints/js-app.js',
+ output: [
+ {
+ dir: 'dist',
+ entryFileNames: 'jquery.uhr.main.js',
+ format: 'cjs'
+ },
+ {
+ dir: 'dist',
+ entryFileNames: 'jquery.uhr.main.min.js',
+ format: 'cjs',
+ plugins: [terser()]
+ }
+ ]
+}
diff --git a/build-config/rollup.config.js-base.js b/build-config/rollup.config.js-base.js
new file mode 100644
index 0000000..0c5f2ba
--- /dev/null
+++ b/build-config/rollup.config.js-base.js
@@ -0,0 +1,23 @@
+import {terser} from 'rollup-plugin-terser';
+
+export default {
+ external: [
+ 'jquery',
+ 'jquery-ui',
+ 'jquery.cookie'
+ ],
+ input: 'build-config/entrypoints/js-base.js',
+ output: [
+ {
+ dir: 'dist',
+ entryFileNames: 'jquery.uhr.base.js',
+ format: 'cjs'
+ },
+ {
+ dir: 'dist',
+ entryFileNames: 'jquery.uhr.base.min.js',
+ format: 'cjs',
+ plugins: [terser()]
+ }
+ ]
+}
diff --git a/build-config/rollup.config.js-baselangs.js b/build-config/rollup.config.js-baselangs.js
new file mode 100644
index 0000000..c53f20e
--- /dev/null
+++ b/build-config/rollup.config.js-baselangs.js
@@ -0,0 +1,23 @@
+import {terser} from 'rollup-plugin-terser';
+
+export default {
+ external: [
+ 'jquery',
+ 'jquery-ui',
+ 'jquery.cookie'
+ ],
+ input: 'build-config/entrypoints/js-baselangs.js',
+ output: [
+ {
+ dir: 'dist',
+ entryFileNames: 'jquery.uhr.baselangs.js',
+ format: 'cjs'
+ },
+ {
+ dir: 'dist',
+ entryFileNames: 'jquery.uhr.baselangs.min.js',
+ format: 'cjs',
+ plugins: [terser()]
+ }
+ ]
+}
diff --git a/build-config/rollup.config.js-complete.js b/build-config/rollup.config.js-complete.js
new file mode 100644
index 0000000..36405df
--- /dev/null
+++ b/build-config/rollup.config.js-complete.js
@@ -0,0 +1,23 @@
+import {terser} from 'rollup-plugin-terser';
+
+export default {
+ external: [
+ 'jquery',
+ 'jquery-ui',
+ 'jquery.cookie'
+ ],
+ input: 'build-config/entrypoints/js-complete.js',
+ output: [
+ {
+ dir: 'dist',
+ entryFileNames: 'jquery.uhr.complete.js',
+ format: 'cjs'
+ },
+ {
+ dir: 'dist',
+ entryFileNames: 'jquery.uhr.complete.min.js',
+ format: 'cjs',
+ plugins: [terser()]
+ }
+ ]
+}
diff --git a/build-config/rollup.config.js-langs.js b/build-config/rollup.config.js-langs.js
new file mode 100644
index 0000000..3024332
--- /dev/null
+++ b/build-config/rollup.config.js-langs.js
@@ -0,0 +1,23 @@
+import {terser} from 'rollup-plugin-terser';
+
+export default {
+ external: [
+ 'jquery',
+ 'jquery-ui',
+ 'jquery.cookie'
+ ],
+ input: 'build-config/entrypoints/js-langs.js',
+ output: [
+ {
+ dir: 'dist',
+ entryFileNames: 'jquery.uhr.langs.js',
+ format: 'cjs'
+ },
+ {
+ dir: 'dist',
+ entryFileNames: 'jquery.uhr.langs.min.js',
+ format: 'cjs',
+ plugins: [terser()]
+ }
+ ]
+}
diff --git a/build-config/rollup.config.js-libs.js b/build-config/rollup.config.js-libs.js
new file mode 100644
index 0000000..238fad0
--- /dev/null
+++ b/build-config/rollup.config.js-libs.js
@@ -0,0 +1,21 @@
+import {terser} from 'rollup-plugin-terser';
+import {nodeResolve} from '@rollup/plugin-node-resolve';
+
+export default {
+ input: 'build-config/entrypoints/js-libs.js',
+ output: [
+ {
+ dir: 'dist',
+ entryFileNames: 'libs.js',
+ format: 'cjs'
+ },
+ {
+ dir: 'dist',
+ entryFileNames: 'libs.min.js',
+ format: 'cjs',
+ plugins: [terser()]
+ }
+ ],
+ context: 'this',
+ plugins: [nodeResolve()]
+}
diff --git a/css/uhr-green.scss b/css/uhr-black.css
similarity index 60%
rename from css/uhr-green.scss
rename to css/uhr-black.css
index 56b9abb..fc2a48c 100644
--- a/css/uhr-green.scss
+++ b/css/uhr-black.css
@@ -12,22 +12,20 @@ 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 .
*/
-.green {
- &.uhr {
- background-color: #0c0;
-
- .dot:not(.active) {
- border-color: rgba(0, 0, 0, 0.1);
- box-shadow: 0 0 0.1em rgba(0, 0, 0, 0.1);
- }
-
- .letter:not(.active) {
- color: rgba(0, 0, 0, 0.1);
- text-shadow: 0 0 0.1em rgba(0, 0, 0, 0.1);
- }
- }
-
- .onoffswitch-inner:before {
- background-color: #0c0;
- }
+.uhr.black {
+ background-color: #111;
+}
+
+.black .onoffswitch-inner:before {
+ background-color: #111;
+}
+
+.uhr.black .dot:not(.active) {
+ border-color: rgba(255, 255, 255, 0.1);
+ box-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
+}
+
+.uhr.black .letter:not(.active) {
+ color: rgba(255, 255, 255, 0.1);
+ text-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
}
diff --git a/css/uhr-red.scss b/css/uhr-blue.css
similarity index 59%
rename from css/uhr-red.scss
rename to css/uhr-blue.css
index 428ee49..743fc10 100644
--- a/css/uhr-red.scss
+++ b/css/uhr-blue.css
@@ -12,22 +12,20 @@ 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 .
*/
-.red {
- &.uhr {
- background-color: #700;
-
- .dot:not(.active) {
- border-color: rgba(255, 255, 255, 0.1);
- box-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
- }
-
- .letter:not(.active) {
- color: rgba(255, 255, 255, 0.1);
- text-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
- }
- }
-
- .onoffswitch-inner:before {
- background-color: #700;
- }
+.uhr.blue {
+ background-color: #00a;
+}
+
+.blue .onoffswitch-inner:before {
+ background-color: #00a;
+}
+
+.uhr.blue .dot:not(.active) {
+ border-color: rgba(255, 255, 255, 0.1);
+ box-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
+}
+
+.uhr.blue .letter:not(.active) {
+ color: rgba(255, 255, 255, 0.1);
+ text-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
}
diff --git a/css/uhr-blue.scss b/css/uhr-green.css
similarity index 59%
rename from css/uhr-blue.scss
rename to css/uhr-green.css
index 613e709..bd821a5 100644
--- a/css/uhr-blue.scss
+++ b/css/uhr-green.css
@@ -12,22 +12,20 @@ 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 .
*/
-.blue {
- &.uhr {
- background-color: #00a;
-
- .dot:not(.active) {
- border-color: rgba(255, 255, 255, 0.1);
- box-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
- }
-
- .letter:not(.active) {
- color: rgba(255, 255, 255, 0.1);
- text-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
- }
- }
-
- .onoffswitch-inner:before {
- background-color: #00a;
- }
+.uhr.green {
+ background-color: #0c0;
+}
+
+.green .onoffswitch-inner:before {
+ background-color: #0c0;
+}
+
+.uhr.green .dot:not(.active) {
+ border-color: rgba(0, 0, 0, 0.1);
+ box-shadow: 0 0 0.1em rgba(0, 0, 0, 0.1);
+}
+
+.uhr.green .letter:not(.active) {
+ color: rgba(0, 0, 0, 0.1);
+ text-shadow: 0 0 0.1em rgba(0, 0, 0, 0.1);
}
diff --git a/css/uhr-pink.css b/css/uhr-pink.css
new file mode 100644
index 0000000..27525f4
--- /dev/null
+++ b/css/uhr-pink.css
@@ -0,0 +1,41 @@
+/*
+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 .
+*/
+.uhr.pink {
+ background-color: #f0a;
+}
+
+.uhr.pink .dot.active {
+ border-color: #fff;
+ box-shadow: 0 0 0.1em #fff;
+}
+
+.uhr.pink .letter.active {
+ color: #fff;
+ text-shadow: 0 0 0.1em #fff;
+}
+
+.pink .onoffswitch-inner:before {
+ background-color: #f0a;
+}
+
+.uhr.pink .dot:not(.active) {
+ border-color: rgba(255, 255, 255, 0.1);
+ box-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
+}
+
+.uhr.pink .letter:not(.active) {
+ color: rgba(255, 255, 255, 0.1);
+ text-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
+}
diff --git a/css/uhr-pink.scss b/css/uhr-pink.scss
deleted file mode 100644
index 5c9a3dd..0000000
--- a/css/uhr-pink.scss
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-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 .
-*/
-.pink {
- &.uhr {
- background-color: #f0a;
-
- .dot.active {
- border-color: #fff;
- box-shadow: 0 0 0.1em #fff;
- }
-
- .letter.active {
- color: #fff;
- text-shadow: 0 0 0.1em #fff;
- }
-
- .dot:not(.active) {
- border-color: rgba(255, 255, 255, 0.1);
- box-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
- }
-
- .letter:not(.active) {
- color: rgba(255, 255, 255, 0.1);
- text-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
- }
- }
-
- .onoffswitch-inner:before {
- background-color: #f0a;
- }
-}
diff --git a/css/uhr-black.scss b/css/uhr-red.css
similarity index 59%
rename from css/uhr-black.scss
rename to css/uhr-red.css
index 764c4be..621517c 100644
--- a/css/uhr-black.scss
+++ b/css/uhr-red.css
@@ -12,22 +12,20 @@ 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 .
*/
-.black {
- &.uhr {
- background-color: #111;
-
- .dot:not(.active) {
- border-color: rgba(255, 255, 255, 0.1);
- box-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
- }
-
- .letter:not(.active) {
- color: rgba(255, 255, 255, 0.1);
- text-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
- }
- }
-
- .onoffswitch-inner:before {
- background-color: #111;
- }
+.uhr.red {
+ background-color: #700;
+}
+
+.red .onoffswitch-inner:before {
+ background-color: #700;
+}
+
+.uhr.red .dot:not(.active) {
+ border-color: rgba(255, 255, 255, 0.1);
+ box-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
+}
+
+.uhr.red .letter:not(.active) {
+ color: rgba(255, 255, 255, 0.1);
+ text-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
}
diff --git a/css/uhr-white.css b/css/uhr-white.css
new file mode 100644
index 0000000..7989be0
--- /dev/null
+++ b/css/uhr-white.css
@@ -0,0 +1,41 @@
+/*
+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 .
+*/
+.uhr.white {
+ background-color: #ccc;
+}
+
+.uhr.white .dot.active {
+ border-color: #fff;
+ box-shadow: 0 0 0.1em #fff;
+}
+
+.uhr.white .letter.active {
+ color: #fff;
+ text-shadow: 0 0 0.1em #fff;
+}
+
+.white .onoffswitch-inner:before {
+ background-color: #ccc;
+}
+
+.uhr.white .dot:not(.active) {
+ border-color: rgba(0, 0, 0, 0.1);
+ box-shadow: 0 0 0.1em rgba(0, 0, 0, 0.1);
+}
+
+.uhr.white .letter:not(.active) {
+ color: rgba(0, 0, 0, 0.1);
+ text-shadow: 0 0 0.1em rgba(0, 0, 0, 0.1);
+}
diff --git a/css/uhr-white.scss b/css/uhr-white.scss
deleted file mode 100644
index 969d1a0..0000000
--- a/css/uhr-white.scss
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-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 .
-*/
-.white {
- &.uhr {
- background-color: #ccc;
-
- .dot.active {
- border-color: #fff;
- box-shadow: 0 0 0.1em #fff;
- }
-
- .letter.active {
- color: #fff;
- text-shadow: 0 0 0.1em #fff;
- }
-
- .dot:not(.active) {
- border-color: rgba(0, 0, 0, 0.1);
- box-shadow: 0 0 0.1em rgba(0, 0, 0, 0.1);
- }
-
- .letter:not(.active) {
- color: rgba(0, 0, 0, 0.1);
- text-shadow: 0 0 0.1em rgba(0, 0, 0, 0.1);
- }
- }
-
- .onoffswitch-inner:before {
- background-color: #ccc;
- }
-}
diff --git a/css/uhr-yellow.css b/css/uhr-yellow.css
new file mode 100644
index 0000000..d109178
--- /dev/null
+++ b/css/uhr-yellow.css
@@ -0,0 +1,41 @@
+/*
+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 .
+*/
+.uhr.yellow {
+ background-color: #fd0;
+}
+
+.uhr.yellow .dot.active {
+ border-color: #fff;
+ box-shadow: 0 0 0.1em #fff;
+}
+
+.uhr.yellow .letter.active {
+ color: #fff;
+ text-shadow: 0 0 0.1em #fff;
+}
+
+.yellow .onoffswitch-inner:before {
+ background-color: #fd0;
+}
+
+.uhr.yellow .dot:not(.active) {
+ border-color: rgba(0, 0, 0, 0.05);
+ box-shadow: 0 0 0.1em rgba(0, 0, 0, 0.05);
+}
+
+.uhr.yellow .letter:not(.active) {
+ color: rgba(0, 0, 0, 0.05);
+ text-shadow: 0 0 0.1em rgba(0, 0, 0, 0.05);
+}
diff --git a/css/uhr-yellow.scss b/css/uhr-yellow.scss
deleted file mode 100644
index 9d44d1b..0000000
--- a/css/uhr-yellow.scss
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-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 .
-*/
-.yellow {
- &.uhr {
- background-color: #fd0;
-
- .dot.active {
- border-color: #fff;
- box-shadow: 0 0 0.1em #fff;
- }
-
- .letter.active {
- color: #fff;
- text-shadow: 0 0 0.1em #fff;
- }
-
- .dot:not(.active) {
- border-color: rgba(0, 0, 0, 0.05);
- box-shadow: 0 0 0.1em rgba(0, 0, 0, 0.05);
- }
-
- .letter:not(.active) {
- color: rgba(0, 0, 0, 0.05);
- text-shadow: 0 0 0.1em rgba(0, 0, 0, 0.05);
- }
- }
-
- .onoffswitch-inner:before {
- background-color: #fd0;
- }
-}
diff --git a/resources/styles/uhr.scss b/css/uhr.css
similarity index 89%
rename from resources/styles/uhr.scss
rename to css/uhr.css
index 34f1eb8..7ea3917 100644
--- a/resources/styles/uhr.scss
+++ b/css/uhr.css
@@ -14,7 +14,7 @@ along with this program. If not, see .
*/
@font-face {
font-family: 'Uhrenfont';
- src: url('../assets/fonts/uhr.woff') format('woff');
+ src: url('../resources/uhr.woff') format('woff');
}
body {
@@ -25,17 +25,17 @@ body {
position: relative;
margin: 0;
transition: background-color 0.5s;
+}
- .reflection {
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- background: radial-gradient(225em 45em at 160% 0, rgba(255, 255, 255, 0.4) 0, rgba(255, 255, 255, 0.05) 40%, rgba(255, 255, 255, 0) 40%) no-repeat scroll;
- display: block;
- margin: 0.15em;
- }
+.uhr .reflection {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ background: radial-gradient(225em 45em at 160% 0, rgba(255, 255, 255, 0.4) 0, rgba(255, 255, 255, 0.05) 40%, rgba(255, 255, 255, 0) 40%) no-repeat scroll;
+ display: block;
+ margin: 0.15em;
}
#themeswitcher {
@@ -206,7 +206,7 @@ body {
a.uhr-configlink {
cursor: pointer;
- background: url("../assets/images/settings.png") no-repeat;
+ background: url("../resources/settings.png") no-repeat;
width: 24px;
height: 24px;
display: inline-block;
@@ -228,7 +228,6 @@ a.uhr-configlink {
.uhr-controlpanel .content {
position: relative;
}
-
a.uhr-closecontrolpanel {
cursor: pointer;
display: inline-block;
@@ -237,7 +236,7 @@ a.uhr-closecontrolpanel {
top: -1em;
width: 24px;
height: 24px;
- background: url("../assets/images/close.png") no-repeat;
+ background: url("../resources/close.png") no-repeat;
}
#disclaimer {
diff --git a/css/uhr.scss b/css/uhr.scss
deleted file mode 100644
index f11612a..0000000
--- a/css/uhr.scss
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
-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 .
-*/
-@font-face {
- font-family: 'Uhrenfont';
- src: url('../resources/assets/fonts/uhr.woff') format('woff');
-}
-
-body {
- font-family: 'Uhrenfont', sans-serif;
-}
-
-.uhr {
- position: relative;
- margin: 0;
- transition: background-color 0.5s;
-
- .reflection {
- position: absolute;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- background: radial-gradient(225em 45em at 160% 0, rgba(255, 255, 255, 0.4) 0, rgba(255, 255, 255, 0.05) 40%, rgba(255, 255, 255, 0) 40%) no-repeat scroll;
- display: block;
- margin: 0.15em;
- }
-
- .letterarea {
- display: block;
- position: absolute;
- top: 12%;
- bottom: 12%;
- left: 12%;
- right: 12%;
- overflow: hidden;
- font-size: 200%;
- }
-}
-
-#themeswitcher {
-}
-
-.item {
- transition: box-shadow 0.5s, text-shadow 0.5s, border-color 0.5s, color 0.5s;
-}
-
-.dot {
- position: absolute;
- display: block;
- height: 0;
- width: 0;
- border: 0.2em solid;
- border-radius: 1em;
-
- &.active {
- border-color: #eee;
- box-shadow: 0 0 0.2em #eee;
- }
-}
-
-.dot1 {
- top: 3.75%;
- left: 3.75%;
-}
-
-.dot2 {
- top: 3.75%;
- right: 3.75%;
-}
-
-.dot3 {
- bottom: 3.75%;
- right: 3.75%;
-}
-
-.dot4 {
- bottom: 3.75%;
- left: 3.75%;
-}
-
-.letter {
- height: 10%;
- width: 9.0909%;
- padding: 0;
- margin: 0;
- display: inline-block;
- text-align: center;
- line-height: 160%;
-
- &.active {
- color: #eee;
- text-shadow: 0 0 0.2em #eee;
- }
-}
-
-.onoffswitch {
- position: relative;
- width: 86px;
- margin: 1em;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
-}
-
-.onoffswitch-checkbox {
- display: none;
-}
-
-.onoffswitch-label {
- display: block;
- overflow: hidden;
- cursor: pointer;
- border: 2px solid #999;
- border-radius: 50px;
-}
-
-.onoffswitch-inner, .modeswitch-inner {
- width: 200%;
- margin-left: -100%;
- -moz-transition: margin 0.3s ease-in 0s;
- -webkit-transition: margin 0.3s ease-in 0s;
- -o-transition: margin 0.3s ease-in 0s;
- transition: margin 0.3s ease-in 0s;
-}
-
-.onoffswitch-inner:before, .onoffswitch-inner:after, .modeswitch-inner:before, .modeswitch-inner:after {
- float: left;
- width: 50%;
- height: 24px;
- padding: 0;
- line-height: 24px;
- font-size: 18px;
- color: white;
- font-weight: bold;
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
-}
-
-.onoffswitch-inner:before {
- content: "EIN";
- padding-left: 12px;
- color: #eee;
- transition: background-color 0.5s;
-}
-
-.onoffswitch-inner:after {
- content: "AUS";
- padding-right: 12px;
- background-color: #eee;
- color: #999;
- text-align: right;
-}
-
-.onoffswitch-switch {
- width: 30px;
- margin: -3px;
- background: #fff;
- border: 2px solid #999;
- border-radius: 50px;
- position: absolute;
- top: 0;
- bottom: 0;
- right: 58px;
- -moz-transition: all 0.3s ease-in 0s;
- -webkit-transition: all 0.3s ease-in 0s;
- -o-transition: all 0.3s ease-in 0s;
- transition: all 0.3s ease-in 0s;
-}
-
-.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner,
-.onoffswitch-checkbox:checked + .onoffswitch-label .modeswitch-inner {
- margin-left: 0;
-}
-
-.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch {
- right: 0;
-}
-
-.modeswitch-inner:before {
- content: "MIN";
- padding-left: 12px;
- background-color: #fff;
- color: #000;
-}
-
-.modeswitch-inner:after {
- content: "SEC";
- padding-right: 12px;
- background-color: #fff;
- color: #000;
- text-align: right;
-}
-
-a.uhr-configlink {
- cursor: pointer;
- background: url("../resources/assets/images/settings.png") no-repeat;
- width: 24px;
- height: 24px;
- display: inline-block;
- margin: 2px;
- vertical-align: top;
-}
-
-.uhr-controlpanel {
- border-radius: 0.5em;
- box-shadow: 0 0 1em black;
- background-color: #fff;
- display: inline-block;
- padding: 0.5em;
- position: sticky;
- bottom: 0;
- margin-left: 1em;
-
- .content {
- position: relative;
- }
-}
-
-a.uhr-closecontrolpanel {
- cursor: pointer;
- display: inline-block;
- position: absolute;
- right: 0;
- top: -1em;
- width: 24px;
- height: 24px;
- background: url("../resources/assets/images/close.png") no-repeat;
-}
-
-#disclaimer {
- font-size: 0.5em;
-
- a {
- color: #444;
- text-decoration: underline;
- }
-}
diff --git a/dist/assets/uhr-black.css b/dist/assets/uhr-black.css
deleted file mode 100644
index e02e7f2..0000000
--- a/dist/assets/uhr-black.css
+++ /dev/null
@@ -1 +0,0 @@
-.black.uhr{background-color:#111}.black.uhr .dot:not(.active){border-color:rgba(255,255,255,0.1);box-shadow:0 0 0.1em rgba(255,255,255,0.1)}.black.uhr .letter:not(.active){color:rgba(255,255,255,0.1);text-shadow:0 0 0.1em rgba(255,255,255,0.1)}.black .onoffswitch-inner:before{background-color:#111}
diff --git a/dist/assets/uhr-blue.css b/dist/assets/uhr-blue.css
deleted file mode 100644
index 92e51e6..0000000
--- a/dist/assets/uhr-blue.css
+++ /dev/null
@@ -1 +0,0 @@
-.blue.uhr{background-color:#00a}.blue.uhr .dot:not(.active){border-color:rgba(255,255,255,0.1);box-shadow:0 0 0.1em rgba(255,255,255,0.1)}.blue.uhr .letter:not(.active){color:rgba(255,255,255,0.1);text-shadow:0 0 0.1em rgba(255,255,255,0.1)}.blue .onoffswitch-inner:before{background-color:#00a}
diff --git a/dist/assets/uhr-green.css b/dist/assets/uhr-green.css
deleted file mode 100644
index 77a98dd..0000000
--- a/dist/assets/uhr-green.css
+++ /dev/null
@@ -1 +0,0 @@
-.green.uhr{background-color:#0c0}.green.uhr .dot:not(.active){border-color:rgba(0,0,0,0.1);box-shadow:0 0 0.1em rgba(0,0,0,0.1)}.green.uhr .letter:not(.active){color:rgba(0,0,0,0.1);text-shadow:0 0 0.1em rgba(0,0,0,0.1)}.green .onoffswitch-inner:before{background-color:#0c0}
diff --git a/dist/assets/uhr-pink.css b/dist/assets/uhr-pink.css
deleted file mode 100644
index efde2c3..0000000
--- a/dist/assets/uhr-pink.css
+++ /dev/null
@@ -1 +0,0 @@
-.pink.uhr{background-color:#f0a}.pink.uhr .dot.active{border-color:#fff;box-shadow:0 0 0.1em #fff}.pink.uhr .letter.active{color:#fff;text-shadow:0 0 0.1em #fff}.pink.uhr .dot:not(.active){border-color:rgba(255,255,255,0.1);box-shadow:0 0 0.1em rgba(255,255,255,0.1)}.pink.uhr .letter:not(.active){color:rgba(255,255,255,0.1);text-shadow:0 0 0.1em rgba(255,255,255,0.1)}.pink .onoffswitch-inner:before{background-color:#f0a}
diff --git a/dist/assets/uhr-red.css b/dist/assets/uhr-red.css
deleted file mode 100644
index fd902e7..0000000
--- a/dist/assets/uhr-red.css
+++ /dev/null
@@ -1 +0,0 @@
-.red.uhr{background-color:#700}.red.uhr .dot:not(.active){border-color:rgba(255,255,255,0.1);box-shadow:0 0 0.1em rgba(255,255,255,0.1)}.red.uhr .letter:not(.active){color:rgba(255,255,255,0.1);text-shadow:0 0 0.1em rgba(255,255,255,0.1)}.red .onoffswitch-inner:before{background-color:#700}
diff --git a/dist/assets/uhr-white.css b/dist/assets/uhr-white.css
deleted file mode 100644
index c921f95..0000000
--- a/dist/assets/uhr-white.css
+++ /dev/null
@@ -1 +0,0 @@
-.white.uhr{background-color:#ccc}.white.uhr .dot.active{border-color:#fff;box-shadow:0 0 0.1em #fff}.white.uhr .letter.active{color:#fff;text-shadow:0 0 0.1em #fff}.white.uhr .dot:not(.active){border-color:rgba(0,0,0,0.1);box-shadow:0 0 0.1em rgba(0,0,0,0.1)}.white.uhr .letter:not(.active){color:rgba(0,0,0,0.1);text-shadow:0 0 0.1em rgba(0,0,0,0.1)}.white .onoffswitch-inner:before{background-color:#ccc}
diff --git a/dist/assets/uhr-yellow.css b/dist/assets/uhr-yellow.css
deleted file mode 100644
index 60a4638..0000000
--- a/dist/assets/uhr-yellow.css
+++ /dev/null
@@ -1 +0,0 @@
-.yellow.uhr{background-color:#fd0}.yellow.uhr .dot.active{border-color:#fff;box-shadow:0 0 0.1em #fff}.yellow.uhr .letter.active{color:#fff;text-shadow:0 0 0.1em #fff}.yellow.uhr .dot:not(.active){border-color:rgba(0,0,0,0.05);box-shadow:0 0 0.1em rgba(0,0,0,0.05)}.yellow.uhr .letter:not(.active){color:rgba(0,0,0,0.05);text-shadow:0 0 0.1em rgba(0,0,0,0.05)}.yellow .onoffswitch-inner:before{background-color:#fd0}
diff --git a/dist/assets/uhr.css b/dist/assets/uhr.css
deleted file mode 100644
index 2a02ca8..0000000
--- a/dist/assets/uhr.css
+++ /dev/null
@@ -1 +0,0 @@
-@font-face{font-family:'Uhrenfont';src:url(../assets/uhr.woff) format("woff")}body{font-family:'Uhrenfont', sans-serif}.uhr{position:relative;margin:0;transition:background-color 0.5s}.uhr .reflection{position:absolute;top:0;bottom:0;left:0;right:0;background:radial-gradient(225em 45em at 160% 0, rgba(255,255,255,0.4) 0, rgba(255,255,255,0.05) 40%, rgba(255,255,255,0) 40%) no-repeat scroll;display:block;margin:0.15em}.uhr .letterarea{display:block;position:absolute;top:12%;bottom:12%;left:12%;right:12%;overflow:hidden;font-size:200%}.item{transition:box-shadow 0.5s, text-shadow 0.5s, border-color 0.5s, color 0.5s}.dot{position:absolute;display:block;height:0;width:0;border:0.2em solid;border-radius:1em}.dot.active{border-color:#eee;box-shadow:0 0 0.2em #eee}.dot1{top:3.75%;left:3.75%}.dot2{top:3.75%;right:3.75%}.dot3{bottom:3.75%;right:3.75%}.dot4{bottom:3.75%;left:3.75%}.letter{height:10%;width:9.0909%;padding:0;margin:0;display:inline-block;text-align:center;line-height:160%}.letter.active{color:#eee;text-shadow:0 0 0.2em #eee}.onoffswitch{position:relative;width:86px;margin:1em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.onoffswitch-checkbox{display:none}.onoffswitch-label{display:block;overflow:hidden;cursor:pointer;border:2px solid #999;border-radius:50px}.onoffswitch-inner,.modeswitch-inner{width:200%;margin-left:-100%;-moz-transition:margin 0.3s ease-in 0s;-webkit-transition:margin 0.3s ease-in 0s;-o-transition:margin 0.3s ease-in 0s;transition:margin 0.3s ease-in 0s}.onoffswitch-inner:before,.onoffswitch-inner:after,.modeswitch-inner:before,.modeswitch-inner:after{float:left;width:50%;height:24px;padding:0;line-height:24px;font-size:18px;color:white;font-weight:bold;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.onoffswitch-inner:before{content:"EIN";padding-left:12px;color:#eee;transition:background-color 0.5s}.onoffswitch-inner:after{content:"AUS";padding-right:12px;background-color:#eee;color:#999;text-align:right}.onoffswitch-switch{width:30px;margin:-3px;background:#fff;border:2px solid #999;border-radius:50px;position:absolute;top:0;bottom:0;right:58px;-moz-transition:all 0.3s ease-in 0s;-webkit-transition:all 0.3s ease-in 0s;-o-transition:all 0.3s ease-in 0s;transition:all 0.3s ease-in 0s}.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-inner,.onoffswitch-checkbox:checked+.onoffswitch-label .modeswitch-inner{margin-left:0}.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-switch{right:0}.modeswitch-inner:before{content:"MIN";padding-left:12px;background-color:#fff;color:#000}.modeswitch-inner:after{content:"SEC";padding-right:12px;background-color:#fff;color:#000;text-align:right}a.uhr-configlink{cursor:pointer;background:url(../assets/settings.png) no-repeat;width:24px;height:24px;display:inline-block;margin:2px;vertical-align:top}.uhr-controlpanel{border-radius:0.5em;box-shadow:0 0 1em black;background-color:#fff;display:inline-block;padding:0.5em;position:sticky;bottom:0;margin-left:1em}.uhr-controlpanel .content{position:relative}a.uhr-closecontrolpanel{cursor:pointer;display:inline-block;position:absolute;right:0;top:-1em;width:24px;height:24px;background:url(../assets/close.png) no-repeat}#disclaimer{font-size:0.5em}#disclaimer a{color:#444;text-decoration:underline}
diff --git a/dist/jquery.uhr.base.js b/dist/jquery.uhr.base.js
new file mode 100644
index 0000000..0356c71
--- /dev/null
+++ b/dist/jquery.uhr.base.js
@@ -0,0 +1,914 @@
+'use strict';
+
+/*
+ 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 ($) {
+ 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 setCookie;
+ var isOn;
+ var update;
+ 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 language;
+
+ /**
+ * 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 + '';
+ };
+ }
+
+ 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 parseObject(letters, styleClass, object) {
+ if (typeof object !== 'undefined' && object !== null) {
+ Object.keys(object).forEach(function (y) {
+ var highlightLetters = object[y];
+ highlightLetters.forEach(function (x) {
+ letters[y - 1][x - 1].addStyle(styleClass);
+ });
+ });
+ }
+ }
+
+ function parseArrayOrObject(letters, styleClass, input) {
+ if (typeof input !== 'undefined' && input !== null) {
+ if (Array.isArray(input)) {
+ input.forEach(function (item) {
+ parseObject(letters, styleClass, item);
+ });
+ } else {
+ parseObject(letters, styleClass, input);
+ }
+ }
+ }
+
+ 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;
+ };
+ }
+
+ /**
+ * 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');
+ });
+ };
+ }
+
+ var setLanguage = function setLanguage(languageKey) {
+ if (languageKey !== this.options.language) {
+ this.options.language = languageKey;
+ var renderer = new UhrRenderer(language.bind(this)(), this.element.find('.letterarea'));
+ renderer.render.bind(this)(function () {
+ this.currentMinute = -1;
+ update.bind(this)();
+ }.bind(this));
+ setCookie.bind(this)('uhr-language', languageKey);
+ update.bind(this)();
+ }
+ };
+ var setTheme = function setTheme(theme) {
+ if (theme !== this.options.theme) {
+ this.element.removeClass(this.options.theme).addClass(theme);
+ $('#uhr-onoffswitch' + this.id).removeClass(this.options.theme).addClass(theme);
+ this.options.theme = theme;
+ setCookie.bind(this)('uhr-theme', theme);
+ }
+ };
+ var setTime = function setTime(time) {
+ this.currentMinute = -1;
+ if (time === null) {
+ this.options.time = new Date();
+ } else {
+ if (this.timer !== null) {
+ window.clearInterval(this.timer);
+ }
+ this.options.time = time;
+ }
+ update.bind(this)();
+ };
+ var setMode = function (mode) {
+ this.options.mode = mode;
+ this.currentMinute = -1;
+ update.bind(this)();
+ setCookie.bind(this)('uhr-mode', mode);
+ };
+ var setWidth = function setWidth(width) {
+ var e = this.element;
+ e.css('width', width);
+ var realWidth = e.width();
+ e.width(realWidth);
+ e.height(realWidth);
+ e.css('font-size', (realWidth / 40) + 'px');
+ };
+
+ // private interface methods
+ var setupHTML;
+ var wireFunctionality;
+ var create = function create() {
+ this.id = uhrGlobals.id++;
+ this.timer = null;
+ this.currentMinute = -1;
+ var userTime = this.options.time;
+ var hash, params;
+ if (this.options.time === undefined) {
+ this.options.time = new Date();
+ }
+ // parse the URL params
+ hash = window.location.hash;
+ if (hash !== undefined && typeof hash === 'string' && hash.charAt(0) === '#') {
+ hash = hash.substring(1);
+ hash = decodeURIComponent(hash);
+ params = hash.split('&');
+ params.forEach(function (element) {
+ var pair = element.split('=');
+ var key = pair[0];
+ var value = pair[1];
+ switch (key) {
+ case 'l':
+ case 'language':
+ this.options.language = value;
+ this.options.force = true;
+ break;
+ case 't':
+ case 'theme':
+ this.options.theme = value;
+ this.options.force = true;
+ break;
+ case 'm':
+ case 'mode':
+ this.options.mode = value;
+ this.options.force = true;
+ break;
+ case 's':
+ case 'status':
+ this.options.status = value;
+ this.options.force = true;
+ break;
+ }
+ }.bind(this));
+ }
+ // end parse the URL params
+ setupHTML.bind(this)();
+ wireFunctionality.bind(this)();
+ if (userTime !== undefined) {
+ this.time(userTime);
+ }
+ };
+ // private helper methods (not exported)
+ var toggleConfigScreen = function toggleConfigScreen() {
+ $('#uhr-controlpanel' + this.id).toggle('fast');
+ };
+ // set up
+ setupHTML = function setupHTML() {
+ var e = this.element;
+ // Base clock area
+ e.addClass('uhr');
+ e.empty();
+ e.append('');
+ e.append('');
+ e.append('');
+ e.append('');
+ e.append('
');
+ e.append('');
+ setWidth.bind(this)(this.options.width);
+
+ if (this.options.controls) {
+ var controlpanel = $('');
+ var content = $('');
+ controlpanel.append(content);
+ // on/off switch
+ var toggleSwitch = $('');
+ toggleSwitch.append('');
+ toggleSwitch.append('');
+ content.append(toggleSwitch);
+
+ // time mode switch
+ var modeSwitch = $('');
+ modeSwitch.append('');
+ modeSwitch.append('');
+ content.append(modeSwitch);
+ // language chooser
+ if (uhrGlobals.languages.length > 1) {
+ var languageChooser = $('');
+ uhrGlobals.languages.forEach(function (item) {
+ languageChooser.append('');
+ });
+ content.append(languageChooser);
+ }
+
+ // theme chooser
+ if (uhrGlobals.themes.length > 1) {
+ var themeChooser = $('');
+ uhrGlobals.themes.forEach(function (item) {
+ themeChooser.append('');
+ });
+ content.append(themeChooser);
+ }
+ var closebutton = $('');
+ closebutton.on('click', function () {
+ $('#uhr-controlpanel' + this.id).hide('fast');
+ }.bind(this));
+ content.append(closebutton);
+ e.after(controlpanel);
+ controlpanel.hide();
+ var configlink = $('');
+ configlink.on('click', function () {
+ toggleConfigScreen.bind(this)();
+ }.bind(this));
+ e.after(configlink);
+ }
+ };
+ wireFunctionality = function wireFunctionality() {
+ // on/off switch
+ var toggleSwitch = $('#uhr-onoffswitch-checkbox' + this.id);
+ toggleSwitch.on('click', function () {
+ this.toggle();
+ }.bind(this));
+ var status = $.cookie('uhr-status' + this.id);
+ if (status === undefined || this.options.force) {
+ status = this.options.status;
+ }
+ toggleSwitch.prop('checked', status === 'on');
+ if (status === 'on') {
+ this.start();
+ } else {
+ this.stop();
+ }
+
+ // time mode switch
+ var modeSwitch = $('#uhr-modeswitch-checkbox' + this.id);
+ modeSwitch.on('click', function () {
+ if (this.options.mode === 'seconds') {
+ setMode.bind(this)('normal');
+ } else {
+ setMode.bind(this)('seconds');
+ }
+ }.bind(this));
+
+ var mode = $.cookie('uhr-mode' + this.id);
+ if (mode === undefined || this.options.force) {
+ mode = this.options.mode;
+ }
+ modeSwitch.prop('checked', mode !== 'seconds');
+ if (mode === 'seconds') {
+ setMode.bind(this)('seconds');
+ } else {
+ setMode.bind(this)('normal');
+ }
+
+ // language chooser
+ var languageChooser = $('#uhr-languagechooser' + this.id);
+ languageChooser.on('change', function () {
+ var languageKey = $('#uhr-languagechooser' + this.id).val();
+ this.language(languageKey);
+ }.bind(this));
+ var selectedLanguage = $.cookie('uhr-language' + this.id);
+ if (selectedLanguage === undefined || this.options.force) {
+ selectedLanguage = this.options.language;
+ }
+ var found = uhrGlobals.languages.some(function (item) {
+ return selectedLanguage === item.code;
+ });
+ if (!found) {
+ var fallbackLanguage;
+ if (uhrGlobals.languages.length > 0) {
+ fallbackLanguage = uhrGlobals.languages[0].code;
+ } else {
+ fallbackLanguage = '';
+ }
+ console.warn("Language '" + selectedLanguage + "' not found! Using fallback '" + fallbackLanguage + "'");
+ selectedLanguage = fallbackLanguage;
+ }
+ languageChooser.val(selectedLanguage);
+ this.options.language = "";
+ this.language(selectedLanguage);
+
+ // theme chooser
+ var themeChooser = $('#uhr-themechooser' + this.id);
+ themeChooser.on('change', function () {
+ var themeKey = $('#uhr-themechooser' + this.id).val();
+ this.theme(themeKey);
+ }.bind(this));
+ var selectedTheme = $.cookie('uhr-theme' + this.id);
+ if (selectedTheme === undefined || this.options.force) {
+ selectedTheme = this.options.theme;
+ }
+ found = uhrGlobals.themes.some(function (item) {
+ return selectedTheme === item.styleClass;
+ });
+ if (!found) {
+ var fallbackTheme = uhrGlobals.themes[0].styleClass;
+ console.warn("Theme '" + selectedTheme + "' not found! Using fallback '" + fallbackTheme + "'");
+ selectedTheme = fallbackTheme;
+ }
+ themeChooser.val(selectedTheme);
+ this.options.theme = "";
+ this.theme(selectedTheme);
+ if (this.options.autoresize) {
+ $(window).on('resize', function () {
+ var $e = this.element;
+ var $parent = $e.parent();
+ var $window = $(window);
+ var parentWidth = $parent.width();
+ var parentHeight = $parent.height();
+ var windowWidth = $window.width();
+ var windowHeight = $window.height();
+ var size = Math.min(parentWidth, parentHeight, windowWidth, windowHeight) + 'px';
+ setWidth.bind(this)(size);
+ }.bind(this));
+ }
+ };
+ var destroy = function destroy() {
+ this.timer = null;
+ $(this.element)
+ .removeAttr('style')
+ .removeAttr('class')
+ .empty();
+ $('#uhr-configlink' + this.id).remove();
+ $('#uhr-controlpanel' + this.id).remove();
+
+ };
+ setCookie = function setCookie(cookieName, cookieValue) {
+ var options = {};
+ if (this.options.cookiePath !== undefined) {
+ options = {expires: 365, path: this.options.cookiePath};
+ } else {
+ options = {expires: 365};
+ }
+ $.cookie(cookieName + this.id, cookieValue, options);
+ };
+
+ // business logic
+ isOn = function isOn() {
+ return this.timer !== null;
+ };
+ var show;
+ var clear;
+ update = function update() {
+ if (isOn.bind(this)()) {
+ var time = this.options.time;
+ if (!language.bind(this)().hasOwnProperty('seconds') && this.options.mode !== 'seconds') {
+ if (time.getMinutes() === this.currentMinute) {
+ return;
+ }
+ this.currentMinute = time.getMinutes();
+ }
+ show.bind(this)(time);
+ } else {
+ clear.bind(this)();
+ this.currentMinute = -1;
+ }
+ };
+ var highlight;
+ var getSecond;
+ var getDotMinute;
+ var getCoarseMinute;
+ var getHour;
+ show = function show(time) {
+ var second = getSecond.bind(this)(time);
+ var dotMinute = getDotMinute.bind(this)(time);
+ var hour = getHour.bind(this)(time);
+ var coarseMinute = getCoarseMinute.bind(this)(time);
+ clear.bind(this)();
+ if (this.options.mode === 'seconds') {
+ highlight.bind(this)('second' + second);
+ } else {
+ highlight.bind(this)('on');
+ for (var i = 1; i <= dotMinute; i++) {
+ highlight.bind(this)('dot' + i);
+ }
+ highlight.bind(this)('minute' + coarseMinute);
+ highlight.bind(this)('hour' + hour);
+ }
+ };
+ highlight = function highlight(itemClass) {
+ this.element.find('.item.' + itemClass).addClass('active');
+ };
+ clear = function clear() {
+ this.element.find('.item').removeClass('active');
+ };
+ getSecond = function getSecond(date) {
+ if (typeof language.bind(this)().getSeconds === 'function') {
+ return language.bind(this)().getSeconds(date);
+ }
+ return date.getSeconds();
+ };
+ getDotMinute = function getDotMinute(date) {
+ if (typeof language.bind(this)().getDotMinute === 'function') {
+ return language.bind(this)().getDotMinute(date);
+ }
+ var minutes = date.getMinutes();
+ return minutes % 5;
+ };
+ getCoarseMinute = function getCoarseMinute(date) {
+ if (typeof language.bind(this)().getCoarseMinute === 'function') {
+ return language.bind(this)().getCoarseMinute(date);
+ }
+ return date.getMinutes();
+ };
+ getHour = function getHour(date) {
+ if (typeof language.bind(this)().getHour === 'function') {
+ return language.bind(this)().getHour(date);
+ }
+ var hour = date.getHours();
+ if (date.getMinutes() >= 25) {
+ return (hour + 1) % 24;
+ }
+ return hour;
+ };
+ language = function language() {
+ var matchingLanguages = uhrGlobals.languages.filter(function (element) {
+ return (element.code === this.options.language);
+ }, this);
+ if (matchingLanguages.length > 0) {
+ return matchingLanguages[0];
+ }
+ // fallback: return empty object
+ return {};
+ };
+
+ $.widget("fritteli.uhr", {
+ "options": {
+ width: '100%',
+ status: 'on',
+ language: 'de_CH',
+ theme: uhrGlobals.themes[0].styleClass,
+ force: false,
+ controls: true,
+ cookiePath: undefined,
+ autoresize: true,
+ mode: 'normal'
+ },
+ "start": start,
+ "stop": stop,
+ "toggle": toggle,
+ "language": setLanguage,
+ "theme": setTheme,
+ "time": setTime,
+ "mode": setMode,
+ "width": setWidth,
+ // constructor method
+ "_create": create,
+ // destructor method
+ "_destroy": destroy
+ });
+ $.fritteli.uhr.register = uhrGlobals.registerLanguage;
+})(jQuery);
+
+/*
+ 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($) {
+// 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
+ * : [