Compare commits
357 commits
Author | SHA1 | Date | |
---|---|---|---|
d82bd08d12 | |||
5d6f519564 | |||
2fdbbe888e | |||
a45d25ded6 | |||
09b6658788 | |||
3cb1a940f0 | |||
41c8f57146 | |||
e06d1d6f73 | |||
621468b27f | |||
b6a368040c | |||
4f82a9175f | |||
4979cb2371 | |||
079bda7fb0 | |||
dd8356861f | |||
92817becc8 | |||
1655a24aa4 | |||
3355ee5cf5 | |||
40d762f90a | |||
864f0052b4 | |||
1583f73220 | |||
5a3e672b9c | |||
82f867a8ec | |||
17fd6f70b8 | |||
d7581628af | |||
a482920f44 | |||
9f63969eff | |||
fc8dc28fb7 | |||
bb0dab5434 | |||
c5bc72c0ad | |||
909e263d41 | |||
852ff910f0 | |||
61d180fcfd | |||
eec51682ac | |||
cf27fa9d04 | |||
57aba62acf | |||
cdb30e405f | |||
1c2015b41b | |||
7d774e6f6a | |||
f6a24858d0 | |||
1163a6e357 | |||
36a94a07a7 | |||
9cb3b60335 | |||
c218052556 | |||
c7dc93e092 | |||
65c113913f | |||
7448563449 | |||
491a130991 | |||
9a2c22ec64 | |||
12838e31ee | |||
c942c42bf6 | |||
5206457484 | |||
797088c988 | |||
49b4fc4dfe | |||
9e4a00e4bc | |||
bc835598a4 | |||
f810da8f0e | |||
c666ee8022 | |||
6f7a77e355 | |||
0035264f27 | |||
0b26225c87 | |||
63cbc1da3c | |||
a64b1d02e7 | |||
b919bc2243 | |||
574d3ad271 | |||
306b54c3e9 | |||
dc93de27e5 | |||
3e2a37f3e7 | |||
2394301b10 | |||
b57ee1534a | |||
6075d74022 | |||
a3cbfe8de5 | |||
4ff55d967e | |||
a261d807cc | |||
2daf130c68 | |||
04afcad428 | |||
3b2fcbe16e | |||
fcf16cc80e | |||
2bc132b76b | |||
f07ccb9918 | |||
5db6f042cf | |||
b98913ccf8 | |||
5944c3d487 | |||
250a5beb73 | |||
672c453b90 | |||
7c227ef572 | |||
2ab2e36349 | |||
2f57cb4054 | |||
9ead720de6 | |||
e19e11e4d6 | |||
6e7e5afc55 | |||
11495c1cca | |||
e104df7aa9 | |||
76a97046c8 | |||
2344a400d8 | |||
ef6d48b906 | |||
80857bd69a | |||
2bc3298628 | |||
055cb6aca6 | |||
b8fbffdf3e | |||
91ac2ce048 | |||
6692d2d6d9 | |||
316e045770 | |||
959e4a41aa | |||
607eeabfd2 | |||
bb69485b9f | |||
1e314cba57 | |||
2295283ba4 | |||
a8f8aa0947 | |||
5e85458936 | |||
e035362905 | |||
dfac2ae47a | |||
8c08c93b1d | |||
3c193c5472 | |||
9218b331f9 | |||
c1a17a315d | |||
0684b57321 | |||
684f502cfd | |||
5bed926072 | |||
1eb733b069 | |||
0c7aebc200 | |||
51d21d8ff6 | |||
d0a28a0097 | |||
9848cc4961 | |||
057d2a51a8 | |||
319c08d74e | |||
5932eba348 | |||
a28df80158 | |||
f9b6bd6117 | |||
2e55875262 | |||
fa79447259 | |||
387a89dcbc | |||
351d9b6534 | |||
c990752abc | |||
018367f1ce | |||
589751be5f | |||
b431a46dfb | |||
02599b22af | |||
3b497435ae | |||
f952690dd1 | |||
a444094779 | |||
04b8fa02a8 | |||
4c867f50a7 | |||
9669f25312 | |||
3deaafaebe | |||
7dda927326 | |||
c53f1479f2 | |||
80864851eb | |||
6690ea4978 | |||
2ac305c640 | |||
78eea9ac1e | |||
284ec8fb8c | |||
58e93c0d6d | |||
df856c22f7 | |||
4e902cb6a1 | |||
8ce86f4d4c | |||
36f0bdf93f | |||
5cf26ca23a | |||
18319d15e6 | |||
4c6567cc0f | |||
72de912636 | |||
0e137ec0b4 | |||
4ab7b71848 | |||
ae911be61d | |||
8a05f00f6e | |||
c345209450 | |||
f6904bfdd5 | |||
e9d0d57c15 | |||
2a45b8fc0b | |||
665fc71dd3 | |||
ff4c90c673 | |||
92abc8e15b | |||
9f37f1f971 | |||
35eef98722 | |||
80df0d24cb | |||
3afc388856 | |||
5f6f67cfef | |||
8a18858bd1 | |||
164ef0c6c3 | |||
72de1a90d7 | |||
cf9c6ab5f7 | |||
87d2a01244 | |||
a5599242f6 | |||
28670a66bb | |||
4ba32fc443 | |||
7afe681ec2 | |||
ef4ec5fc4b | |||
bc37a5cfa9 | |||
4e98987653 | |||
ed7f36552e | |||
8d471226b4 | |||
3c22e2ab5f | |||
9abfc59786 | |||
f171b9c8aa | |||
3e7451ac6d | |||
f576347c06 | |||
ced6306c30 | |||
6442a80d60 | |||
0bd5c3bc16 | |||
28108572c4 | |||
8a6f336d9e | |||
c885b15fcb | |||
53831896bb | |||
2edf130472 | |||
e8a0bfe5be | |||
0a86959c32 | |||
3f6a315208 | |||
be1e1cf89b | |||
fcfdaaa2cd | |||
a3dce2322b | |||
dbbfae83b3 | |||
79430a6821 | |||
504e139bf2 | |||
020fc96036 | |||
3ef3ce346f | |||
072ef1e2d1 | |||
c0742a6f11 | |||
633401862f | |||
055cd4ff52 | |||
fa0da37425 | |||
e03102172c | |||
6deb0d50fe | |||
27435ed9a8 | |||
275234abd8 | |||
501dfb50be | |||
c0af4a976f | |||
a0e2588d91 | |||
8badcc549f | |||
69a843fc29 | |||
689e348532 | |||
cca9e21d08 | |||
65e1466508 | |||
be221aa88d | |||
b23a56f866 | |||
6f6feb5cf5 | |||
de75a3bdaf | |||
ec8a185dd7 | |||
cd58ff4ba3 | |||
dd752c8db0 | |||
9720d1dcd1 | |||
df9e435da3 | |||
60e68ffeaf | |||
ec9b44427c | |||
08cca0a915 | |||
3d0245abfa | |||
85b5670dfc | |||
5a9ec0e0df | |||
7b0e77f16f | |||
218a0f40e5 | |||
09562d47a4 | |||
afe923c136 | |||
e316557ac8 | |||
f3d8aab61f | |||
340669c5eb | |||
0fb0551783 | |||
348177e52a | |||
719a2a8343 | |||
c890429dd6 | |||
6047499a18 | |||
9ffc1bec75 | |||
4811367f46 | |||
065d9a2853 | |||
bd3fb48b0d | |||
9eba4192ed | |||
8a5912af98 | |||
0461411c6a | |||
9971763697 | |||
ff850fca64 | |||
120574c36b | |||
e666350b3f | |||
a378f45470 | |||
f7defa96d5 | |||
f93083c128 | |||
bde19624b2 | |||
75568578f6 | |||
07b64480cd | |||
deb8f40080 | |||
56f20907d9 | |||
f04d5a9aef | |||
59c5b8d358 | |||
bb027261b2 | |||
d9ae1f3783 | |||
2564eec812 | |||
194ebc58de | |||
480736e877 | |||
ffcf8fa2f2 | |||
135a180e12 | |||
d334101ae0 | |||
b45b6bcaad | |||
96507d58a2 | |||
28b74b30c5 | |||
66287994ca | |||
fd940192f4 | |||
7be99ce264 | |||
fbf0217719 | |||
4c1ea9e1cd | |||
ee60105130 | |||
448747626c | |||
ae3da935be | |||
1bc60d7a1b | |||
a4a440c8f0 | |||
1a8e268a6a | |||
38df0a87c9 | |||
09a53b0883 | |||
455068d069 | |||
a72aacb504 | |||
600b84c36a | |||
011e4cdf64 | |||
32d19fe85e | |||
e5ce0ab2bb | |||
a263a1f18c | |||
29b280cf8b | |||
fa1c6a1ea3 | |||
a9d8888f6a | |||
4942cfda2f | |||
d4874d1ec2 | |||
14d7ee79bc | |||
c25a0d6c33 | |||
c1961d7fca | |||
0c67a41116 | |||
77ccc95b93 | |||
428074b1f8 | |||
8f609294ff | |||
57556987ac | |||
8234d4f3ea | |||
b9473f405f | |||
6d588aa08b | |||
f9b6acf8b6 | |||
3e8252fa13 | |||
eff9700864 | |||
9a1160f66e | |||
10c07a05cf | |||
0d90b3dd76 | |||
b4f2a466b7 | |||
d7c461f39a | |||
78dcd7c66f | |||
dc098233fe | |||
8e0aaacbd8 | |||
ad50e9237a | |||
ad809a6a6e | |||
6b24cc3eb3 | |||
1b06330329 | |||
c39ea30e9b | |||
50e4006a84 | |||
8b5b343e35 | |||
2c5ac65bad | |||
90e6d6d0f3 | |||
aeeb197104 | |||
b4d67be48c | |||
23411bc59b | |||
a9f5667954 | |||
c629833812 | |||
8f9adbe567 | |||
e640fe4362 | |||
18460cfbbe | |||
7f86fa1a4a | |||
76cefba0fb | |||
013c6c48c4 |
100 changed files with 35348 additions and 1497 deletions
13
.drone.yml
Normal file
13
.drone.yml
Normal file
|
@ -0,0 +1,13 @@
|
|||
kind: pipeline
|
||||
type: docker
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: prepare
|
||||
image: node:15-alpine
|
||||
commands:
|
||||
- npm install
|
||||
- name: build
|
||||
image: node:15-alpine
|
||||
commands:
|
||||
- npm run build
|
15
.editorconfig
Normal file
15
.editorconfig
Normal file
|
@ -0,0 +1,15 @@
|
|||
# http://editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.yml]
|
||||
indent_size = 2
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -1 +1,6 @@
|
|||
*~
|
||||
.idea
|
||||
*.iml
|
||||
atlassian-ide-plugin.xml
|
||||
/node_modules/
|
||||
/bower_components/
|
||||
|
|
52
.jshintrc
Normal file
52
.jshintrc
Normal file
|
@ -0,0 +1,52 @@
|
|||
{
|
||||
// Settings
|
||||
"passfail" : false, // Stop on first error.
|
||||
"maxerr" : 100, // Maximum error before stopping.
|
||||
|
||||
|
||||
// Predefined globals whom JSHint will ignore.
|
||||
"browser" : true, // Standard browser globals e.g. `window`, `document`.
|
||||
"node" : true,
|
||||
"jquery" : true,
|
||||
|
||||
// Development.
|
||||
"debug" : false, // Allow debugger statements e.g. browser breakpoints.
|
||||
"devel" : true, // Allow developments statements e.g. `console.log();`.
|
||||
|
||||
"strict" : true, // Require `use strict` pragma in every file.
|
||||
"globalstrict" : false, // Allow global "use strict" (also enables 'strict').
|
||||
|
||||
|
||||
// The Good Parts.
|
||||
"asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons).
|
||||
"laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
|
||||
"bitwise" : true, // Prohibit bitwise operators (&, |, ^, etc.).
|
||||
"boss" : false, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
|
||||
"curly" : true, // Require {} for every new block or scope.
|
||||
"eqeqeq" : true, // Require triple equals i.e. `===`.
|
||||
"eqnull" : false, // Tolerate use of `== null`.
|
||||
"evil" : false, // Tolerate use of `eval`.
|
||||
"expr" : false, // Tolerate `ExpressionStatement` as Programs.
|
||||
"forin" : false, // Tolerate `for in` loops without `hasOwnPrototype`.
|
||||
"immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
|
||||
"latedef" : true, // Prohipit variable use before definition.
|
||||
"loopfunc" : false, // Allow functions to be defined within loops.
|
||||
"noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`.
|
||||
"scripturl" : true, // Tolerate script-targeted URLs.
|
||||
"shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`.
|
||||
"supernew" : false, // Tolerate `new function () { ... };` and `new Object;`.
|
||||
"undef" : true, // Require all non-global variables be declared before they are used.
|
||||
|
||||
|
||||
// Personal styling preferences.
|
||||
"newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`.
|
||||
"noempty" : true, // Prohibit use of empty blocks.
|
||||
"nonew" : true, // Prohibit use of constructors for side-effects.
|
||||
"nomen" : true, // Prohibit use of initial or trailing underbars in names.
|
||||
"onevar" : false, // Allow only one `var` statement per function.
|
||||
"plusplus" : false, // Prohibit use of `++` & `--`.
|
||||
"sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
|
||||
"trailing" : true, // Prohibit trailing whitespaces.
|
||||
"white" : true, // Check against strict whitespace and indentation rules.
|
||||
"indent" : 0 // Specify indentation spacing
|
||||
}
|
199
README.md
199
README.md
|
@ -1,97 +1,172 @@
|
|||
Bärneruhr
|
||||
=========
|
||||
|
||||
# Bärneruhr
|
||||
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
|
||||
------------------------------
|
||||
* Binde folgende Javascript-Dateien im HTML-Dokument ein:
|
||||
* jquery-2.0.3.min.js (Falls nicht bereits vorhanden)
|
||||
* jquery-ui-1.10.3.custom.min.js (Falls nicht bereits vorhanden)
|
||||
* 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 ein, je nach dem, welche Sprachen deine Uhr unterstützen soll:
|
||||
* uhr-de_CH.js
|
||||
* uhr-de.js
|
||||
* uhr-en.js
|
||||
* Binde folgende CSS-Dateien im HTML-Dokument ein:
|
||||
* uhr.css
|
||||
* uhr-black.css
|
||||
* uhr-blue.css
|
||||
* uhr-green.css
|
||||
* uhr-red.css
|
||||
* uhr-white.css
|
||||
* Die möglichen Themes (Farbschemata) sind im Moment noch hartcodiert, deshalb sollten alle Dateien eingebunden werden.
|
||||
## 1. Benötigte Dateien einbinden
|
||||
* 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
|
||||
|
||||
2. Uhr-Element im HTML-Dokument einfügen
|
||||
----------------------------------------
|
||||
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:
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" type="text/css" href="dist/uhr-black.min.css" data-class="black" data-name="Schwarz" />
|
||||
```
|
||||
|
||||
* 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).
|
||||
|
||||
* 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Ü").
|
||||
|
||||
## 2. Uhr-Element im HTML-Dokument einfügen
|
||||
Erstelle ein leeres `<div>` mit einer ID:
|
||||
|
||||
<div id="uhrcontainer"></div>
|
||||
3. Uhr per Javascript konfigurieren
|
||||
-----------------------------------
|
||||
```html
|
||||
<div id="uhrcontainer"></div>
|
||||
```
|
||||
|
||||
## 3. Uhr per Javascript konfigurieren
|
||||
Initialisiere die Uhr mit einer einzigen Zeile Javascript:
|
||||
|
||||
jQuery('#uhrcontainer').uhr();
|
||||
```javascript
|
||||
jQuery('#uhrcontainer').uhr();
|
||||
```
|
||||
|
||||
Damit wird eine Uhr in der Standardkonfiguration erzeugt. Das heisst:
|
||||
|
||||
* Breite ist 100% des Eltenelements
|
||||
* Farbe ist Schwarz
|
||||
* Breite ist 100% des Elternelements
|
||||
* Farbe ist diejenige des ersten eingebundenen Theme-Stylesheets.
|
||||
* Sprache ist Bärndütsch
|
||||
* Die Uhr ist eingeschaltet
|
||||
* Die Bedienelemente werden angezeigt
|
||||
* Die Uhr passt sich in der Grösse an, wenn das Elternelement seine Grösse ändert
|
||||
* Die Uhr zeigt die aktuelle Stunde und Minute
|
||||
|
||||
Wie du diese Optionen ändern kannst, verrät der nächte Abschnitt.
|
||||
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 bereits in der Konfiguration ändern kannst, verrät der nächste Abschnitt.
|
||||
|
||||
Es kann natürlich auch eine Collection von Elementen übergeben werden. Mit
|
||||
|
||||
jQuery('div').uhr();
|
||||
```javascript
|
||||
jQuery('div').uhr();
|
||||
```
|
||||
|
||||
würde also jedes `<div>`-Element der Seite in eine Uhr umgewandelt
|
||||
würde also jedes `<div>`-Element der Seite in eine Uhr umgewandelt.
|
||||
|
||||
4. Weitere Optionen
|
||||
-------------------
|
||||
## 4. Weitere Optionen
|
||||
Der uhr()-Methode kann ein Options-Objekt mitgegeben werden:
|
||||
|
||||
jQuery('#uhrcontainer').uhr({
|
||||
status: 'on', // 'on' (default) oder 'off'
|
||||
theme: 'black', // 'black' (default), 'red', 'blue', 'green' oder 'white'
|
||||
language: 'de_CH', // 'de_CH' (default), 'de' oder 'en' (je nach eingebundenen Sprachdateien)
|
||||
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- und Sprachwähler) werden angezeigt
|
||||
// false: Die Bedienelemente werden nicht angezeigt
|
||||
});
|
||||
```javascript
|
||||
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', '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%)
|
||||
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
|
||||
-------------------
|
||||
Es gibt noch einen zusätzlichen Konfigurationsparameter. Mit
|
||||
## 5. Sonderfunktionen
|
||||
Es gibt noch einen zusätzlichen Konfigurationsparameter. Mittels
|
||||
|
||||
{
|
||||
time: new Date()
|
||||
}
|
||||
```javascript
|
||||
{
|
||||
time: new Date()
|
||||
}
|
||||
```
|
||||
kann die Uhr auf eine fixe Zeit eingestellt werden. Sie bleibt dann statisch und aktualisiert sich nicht, sondern zeigt immer diese Zeit an. Beim Klick auf den On/Off-Schalter oder beim Wechsel der Sprache wird dies allerdings rückgängig gemacht und die Uhr nimmt das Standardverhalten mit der aktuellen Systemzeit an.
|
||||
|
||||
Die Zeit kann auch über einen Methodenaufruf dynamisch eingestellt werden:
|
||||
|
||||
jQuery('#uhrcontainer').uhr("time", new Date());
|
||||
```javascript
|
||||
jQuery('#uhrcontainer').uhr("time", new Date());
|
||||
```
|
||||
|
||||
## 6. Konfiguration über die URL
|
||||
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
|
||||
* 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
|
||||
* pt: Portugiesisch
|
||||
* `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 beispielsweise 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
|
||||
=====================
|
||||
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
|
||||
# A. Lizenzbestimmungen
|
||||
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
|
||||
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
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
|
1
VERSION
Normal file
1
VERSION
Normal file
|
@ -0,0 +1 @@
|
|||
9.0.0-dev.0
|
1
build-config/entrypoints/css-app.js
Normal file
1
build-config/entrypoints/css-app.js
Normal file
|
@ -0,0 +1 @@
|
|||
import '../../css/uhr.css';
|
1
build-config/entrypoints/css-black.js
Normal file
1
build-config/entrypoints/css-black.js
Normal file
|
@ -0,0 +1 @@
|
|||
import '../../css/uhr-black.css';
|
1
build-config/entrypoints/css-blue.js
Normal file
1
build-config/entrypoints/css-blue.js
Normal file
|
@ -0,0 +1 @@
|
|||
import '../../css/uhr-blue.css';
|
1
build-config/entrypoints/css-green.js
Normal file
1
build-config/entrypoints/css-green.js
Normal file
|
@ -0,0 +1 @@
|
|||
import '../../css/uhr-green.css';
|
1
build-config/entrypoints/css-pink.js
Normal file
1
build-config/entrypoints/css-pink.js
Normal file
|
@ -0,0 +1 @@
|
|||
import '../../css/uhr-pink.css';
|
1
build-config/entrypoints/css-red.js
Normal file
1
build-config/entrypoints/css-red.js
Normal file
|
@ -0,0 +1 @@
|
|||
import '../../css/uhr-red.css';
|
1
build-config/entrypoints/css-white.js
Normal file
1
build-config/entrypoints/css-white.js
Normal file
|
@ -0,0 +1 @@
|
|||
import '../../css/uhr-white.css';
|
1
build-config/entrypoints/css-yellow.js
Normal file
1
build-config/entrypoints/css-yellow.js
Normal file
|
@ -0,0 +1 @@
|
|||
import '../../css/uhr-yellow.css';
|
1
build-config/entrypoints/js-app.js
Normal file
1
build-config/entrypoints/js-app.js
Normal file
|
@ -0,0 +1 @@
|
|||
import '../../src/uhr';
|
2
build-config/entrypoints/js-base.js
Normal file
2
build-config/entrypoints/js-base.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
import '../../src/uhr';
|
||||
import '../../src/uhr-de_CH';
|
9
build-config/entrypoints/js-baselangs.js
Normal file
9
build-config/entrypoints/js-baselangs.js
Normal file
|
@ -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';
|
11
build-config/entrypoints/js-complete.js
Normal file
11
build-config/entrypoints/js-complete.js
Normal file
|
@ -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';
|
10
build-config/entrypoints/js-langs.js
Normal file
10
build-config/entrypoints/js-langs.js
Normal file
|
@ -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';
|
3
build-config/entrypoints/js-libs.js
Normal file
3
build-config/entrypoints/js-libs.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
import 'jquery';
|
||||
import 'jquery-ui';
|
||||
import 'jquery.cookie';
|
11
build-config/rollup.config.css-app.js
Normal file
11
build-config/rollup.config.css-app.js
Normal file
|
@ -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'
|
||||
})]
|
||||
}
|
11
build-config/rollup.config.css-black.js
Normal file
11
build-config/rollup.config.css-black.js
Normal file
|
@ -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'
|
||||
})]
|
||||
}
|
11
build-config/rollup.config.css-blue.js
Normal file
11
build-config/rollup.config.css-blue.js
Normal file
|
@ -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'
|
||||
})]
|
||||
}
|
11
build-config/rollup.config.css-green.js
Normal file
11
build-config/rollup.config.css-green.js
Normal file
|
@ -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'
|
||||
})]
|
||||
}
|
11
build-config/rollup.config.css-pink.js
Normal file
11
build-config/rollup.config.css-pink.js
Normal file
|
@ -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'
|
||||
})]
|
||||
}
|
11
build-config/rollup.config.css-red.js
Normal file
11
build-config/rollup.config.css-red.js
Normal file
|
@ -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'
|
||||
})]
|
||||
}
|
11
build-config/rollup.config.css-white.js
Normal file
11
build-config/rollup.config.css-white.js
Normal file
|
@ -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'
|
||||
})]
|
||||
}
|
11
build-config/rollup.config.css-yellow.js
Normal file
11
build-config/rollup.config.css-yellow.js
Normal file
|
@ -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'
|
||||
})]
|
||||
}
|
23
build-config/rollup.config.js-app.js
Normal file
23
build-config/rollup.config.js-app.js
Normal file
|
@ -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()]
|
||||
}
|
||||
]
|
||||
}
|
23
build-config/rollup.config.js-base.js
Normal file
23
build-config/rollup.config.js-base.js
Normal file
|
@ -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()]
|
||||
}
|
||||
]
|
||||
}
|
23
build-config/rollup.config.js-baselangs.js
Normal file
23
build-config/rollup.config.js-baselangs.js
Normal file
|
@ -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()]
|
||||
}
|
||||
]
|
||||
}
|
23
build-config/rollup.config.js-complete.js
Normal file
23
build-config/rollup.config.js-complete.js
Normal file
|
@ -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()]
|
||||
}
|
||||
]
|
||||
}
|
23
build-config/rollup.config.js-langs.js
Normal file
23
build-config/rollup.config.js-langs.js
Normal file
|
@ -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()]
|
||||
}
|
||||
]
|
||||
}
|
21
build-config/rollup.config.js-libs.js
Normal file
21
build-config/rollup.config.js-libs.js
Normal file
|
@ -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()]
|
||||
}
|
|
@ -13,16 +13,19 @@ You should have received a copy of the GNU General Public License
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
.uhr.black {
|
||||
background-color: #111;
|
||||
background-color: #111;
|
||||
}
|
||||
|
||||
.black .onoffswitch-inner:before {
|
||||
background-color: #111;
|
||||
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);
|
||||
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);
|
||||
color: rgba(255, 255, 255, 0.1);
|
||||
text-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
|
||||
}
|
|
@ -13,16 +13,19 @@ You should have received a copy of the GNU General Public License
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
.uhr.blue {
|
||||
background-color: #00a;
|
||||
background-color: #00a;
|
||||
}
|
||||
|
||||
.blue .onoffswitch-inner:before {
|
||||
background-color: #00a;
|
||||
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);
|
||||
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);
|
||||
color: rgba(255, 255, 255, 0.1);
|
||||
text-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
|
||||
}
|
|
@ -13,16 +13,19 @@ You should have received a copy of the GNU General Public License
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
.uhr.green {
|
||||
background-color: #0c0;
|
||||
background-color: #0c0;
|
||||
}
|
||||
|
||||
.green .onoffswitch-inner:before {
|
||||
background-color: #0c0;
|
||||
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);
|
||||
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);
|
||||
color: rgba(0, 0, 0, 0.1);
|
||||
text-shadow: 0 0 0.1em rgba(0, 0, 0, 0.1);
|
||||
}
|
41
css/uhr-pink.css
Normal file
41
css/uhr-pink.css
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
.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);
|
||||
}
|
|
@ -13,16 +13,19 @@ You should have received a copy of the GNU General Public License
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
.uhr.red {
|
||||
background-color: #700;
|
||||
background-color: #700;
|
||||
}
|
||||
|
||||
.red .onoffswitch-inner:before {
|
||||
background-color: #700;
|
||||
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 .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);
|
||||
color: rgba(255, 255, 255, 0.1);
|
||||
text-shadow: 0 0 0.1em rgba(255, 255, 255, 0.1);
|
||||
}
|
|
@ -13,24 +13,29 @@ You should have received a copy of the GNU General Public License
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
.uhr.white {
|
||||
background-color: #ccc;
|
||||
background-color: #ccc;
|
||||
}
|
||||
.uhr.white .dot.active{
|
||||
border-color: #fff;
|
||||
box-shadow: 0 0 0.1em #fff;
|
||||
|
||||
.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;
|
||||
|
||||
.uhr.white .letter.active {
|
||||
color: #fff;
|
||||
text-shadow: 0 0 0.1em #fff;
|
||||
}
|
||||
|
||||
.white .onoffswitch-inner:before {
|
||||
background-color: #ccc;
|
||||
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);
|
||||
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);
|
||||
color: rgba(0, 0, 0, 0.1);
|
||||
text-shadow: 0 0 0.1em rgba(0, 0, 0, 0.1);
|
||||
}
|
41
css/uhr-yellow.css
Normal file
41
css/uhr-yellow.css
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
.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);
|
||||
}
|
249
css/uhr.css
Normal file
249
css/uhr.css
Normal file
|
@ -0,0 +1,249 @@
|
|||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@font-face {
|
||||
font-family: 'Uhrenfont';
|
||||
src: url('../resources/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;
|
||||
}
|
||||
|
||||
#themeswitcher {
|
||||
}
|
||||
|
||||
.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("../resources/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("../resources/close.png") no-repeat;
|
||||
}
|
||||
|
||||
#disclaimer {
|
||||
font-size: 0.5em;
|
||||
}
|
||||
|
||||
#disclaimer a {
|
||||
color: #444;
|
||||
text-decoration: underline;
|
||||
}
|
914
dist/jquery.uhr.base.js
vendored
Normal file
914
dist/jquery.uhr.base.js
vendored
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(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 '<span class="item letter ' + myStyle + '">' + myValue + '</span>';
|
||||
};
|
||||
}
|
||||
|
||||
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('<br/>');
|
||||
}
|
||||
});
|
||||
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('<span class="item dot dot1"></span>');
|
||||
e.append('<span class="item dot dot2"></span>');
|
||||
e.append('<span class="item dot dot3"></span>');
|
||||
e.append('<span class="item dot dot4"></span>');
|
||||
e.append('<div class="letterarea"></div>');
|
||||
e.append('<div class="reflection"></div>');
|
||||
setWidth.bind(this)(this.options.width);
|
||||
|
||||
if (this.options.controls) {
|
||||
var controlpanel = $('<div class="uhr-controlpanel" id="uhr-controlpanel' + this.id + '"></div>');
|
||||
var content = $('<div class="content"></div>');
|
||||
controlpanel.append(content);
|
||||
// on/off switch
|
||||
var toggleSwitch = $('<div class="onoffswitch" id="uhr-onoffswitch' + this.id + '"></div>');
|
||||
toggleSwitch.append('<input type="checkbox" class="onoffswitch-checkbox" id="uhr-onoffswitch-checkbox' + this.id +
|
||||
'" checked="checked" />');
|
||||
toggleSwitch.append('<label class="onoffswitch-label" for="uhr-onoffswitch-checkbox' + this.id + '">' +
|
||||
'<div class="onoffswitch-inner"></div>' + '<div class="onoffswitch-switch"></div>' + '</label>');
|
||||
content.append(toggleSwitch);
|
||||
|
||||
// time mode switch
|
||||
var modeSwitch = $('<div class="onoffswitch" id="uhr-modeswitch' + this.id + '"></div>');
|
||||
modeSwitch.append('<input type="checkbox" class="onoffswitch-checkbox" id="uhr-modeswitch-checkbox' + this.id +
|
||||
'" checked="checked" />');
|
||||
modeSwitch.append('<label class="onoffswitch-label" for="uhr-modeswitch-checkbox' + this.id + '">' +
|
||||
'<div class="modeswitch-inner"></div>' + '<div class="onoffswitch-switch"></div>' +
|
||||
'</label>');
|
||||
content.append(modeSwitch);
|
||||
// language chooser
|
||||
if (uhrGlobals.languages.length > 1) {
|
||||
var languageChooser = $('<select id="uhr-languagechooser' + this.id + '"></select>');
|
||||
uhrGlobals.languages.forEach(function (item) {
|
||||
languageChooser.append('<option value="' + item.code + '">' + item.language + '</option>');
|
||||
});
|
||||
content.append(languageChooser);
|
||||
}
|
||||
|
||||
// theme chooser
|
||||
if (uhrGlobals.themes.length > 1) {
|
||||
var themeChooser = $('<select id="uhr-themechooser' + this.id + '"></select>');
|
||||
uhrGlobals.themes.forEach(function (item) {
|
||||
themeChooser.append('<option value="' + item.styleClass + '">' + item.name + '</option>');
|
||||
});
|
||||
content.append(themeChooser);
|
||||
}
|
||||
var closebutton = $('<a class="uhr-closecontrolpanel" id="uhr-closecontrolpanel' + this.id + '"></a>');
|
||||
closebutton.on('click', function () {
|
||||
$('#uhr-controlpanel' + this.id).hide('fast');
|
||||
}.bind(this));
|
||||
content.append(closebutton);
|
||||
e.after(controlpanel);
|
||||
controlpanel.hide();
|
||||
var configlink = $('<a class="uhr-configlink" id="uhr-configlink' + this.id + '"></a>');
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(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. <array-or-object>, vgl. ausführliche Beschreibung bei "minutes".
|
||||
"permanent": es_isch,
|
||||
/*
|
||||
* Minuten: Objekt im folgenden Format:
|
||||
* {
|
||||
* <minuten>: <array-or-object>,
|
||||
* ...
|
||||
* }
|
||||
* <minuten>: String von Komma-separierten Minutenwerten, zu welchem die in <array-or-object> angegebenen Buchstaben aktiv sein sollen
|
||||
* <array-or-object> : [ <object>, ...] | <object>
|
||||
* <object>: { <zeile> : [ <spalte>, ... ] }
|
||||
* <zeile>: Die Zeile, in welcher die Buchstaben liegen; von oben gezählt, oben ist 1.
|
||||
* <spalte>: 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));
|
1
dist/jquery.uhr.base.min.js
vendored
Normal file
1
dist/jquery.uhr.base.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
743
dist/jquery.uhr.baselangs.js
vendored
Normal file
743
dist/jquery.uhr.baselangs.js
vendored
Normal file
|
@ -0,0 +1,743 @@
|
|||
'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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(function($) {
|
||||
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));
|
||||
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(function($) {
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
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));
|
||||
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(function($) {
|
||||
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));
|
||||
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(function($) {
|
||||
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));
|
||||
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(function($) {
|
||||
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));
|
||||
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(function($) {
|
||||
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));
|
||||
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(function($) {
|
||||
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));
|
||||
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(function ($) {
|
||||
var e_ = {1: [1]};
|
||||
var sao = {1: [2, 3, 4]};
|
||||
var e1 = {7: [8]};
|
||||
var e2 = {10: [5]};
|
||||
var menos = {7: [7, 8, 9, 10, 11]};
|
||||
var meia = {8: [8, 9, 10, 11]};
|
||||
var cinco = {10: [7, 8, 9, 10, 11]};
|
||||
var dez = {10: [1, 2, 3]};
|
||||
var um_quarto = {9: [1, 2, 4, 5, 6, 7, 8, 9]};
|
||||
var vinte = {8: [1, 2, 3, 4, 5]};
|
||||
var layout = {
|
||||
"version": 2,
|
||||
"language": 'Português',
|
||||
"letters": [
|
||||
'ÉSÃOUMATRÊS',
|
||||
'MEIOLDIADEZ',
|
||||
'DUASEISETEY',
|
||||
'QUATROHNOVE',
|
||||
'CINCOITONZE',
|
||||
'ZMEIALNOITE',
|
||||
'HORASYMENOS',
|
||||
'VINTECAMEIA',
|
||||
'UMVQUARTOPM',
|
||||
'DEZOEYCINCO'
|
||||
],
|
||||
"minutes": {
|
||||
"5,6,7,8,9": [e1, cinco],
|
||||
"10,11,12,13,14": [e1, dez],
|
||||
"15,16,17,18,19": [e1, um_quarto],
|
||||
"20,21,22,23,24": [e1, vinte],
|
||||
"25,26,27,28,29": [e1, vinte, e2, cinco],
|
||||
"30,31,32,33,34": [e1, meia],
|
||||
"35,36,37,38,39": [menos, vinte, e2, cinco],
|
||||
"40,41,42,43,44": [menos, vinte],
|
||||
"45,46,47,48,49": [menos, um_quarto],
|
||||
"50,51,52,53,54": [menos, dez],
|
||||
"55,56,57,58,59": [menos, cinco]
|
||||
},
|
||||
"hours": {
|
||||
"0": [e_, {"6": [2, 3, 4, 5, 7, 8, 9, 10, 11]}],
|
||||
"12": [e_, {"2": [1, 2, 3, 4, 6, 7, 8]}],
|
||||
"1,13": [e_, {"1": [5, 6, 7]}],
|
||||
"2,14": [sao, {"3": [1, 2, 3, 4]}],
|
||||
"3,15": [sao, {"1": [8, 9, 10, 11]}],
|
||||
"4,16": [sao, {"4": [1, 2, 3, 4, 5, 6]}],
|
||||
"5,17": [sao, {"5": [1, 2, 3, 4, 5]}],
|
||||
"6,18": [sao, {"3": [4, 5, 6, 7]}],
|
||||
"7,19": [sao, {"3": [7, 8, 9, 10]}],
|
||||
"8,20": [sao, {"5": [5, 6, 7, 8]}],
|
||||
"9,21": [sao, {"4": [8, 9, 10, 11]}],
|
||||
"10,22": [sao, {"2": [9, 10, 11]}],
|
||||
"11,23": [sao, {"5": [8, 9, 10, 11]}]
|
||||
},
|
||||
"getHour": function (date) {
|
||||
var hour = date.getHours();
|
||||
if (date.getMinutes() >= 35) {
|
||||
return (hour + 1) % 24;
|
||||
}
|
||||
return hour;
|
||||
}
|
||||
};
|
||||
$.fritteli.uhr.register('pt', layout);
|
||||
}(jQuery));
|
1
dist/jquery.uhr.baselangs.min.js
vendored
Normal file
1
dist/jquery.uhr.baselangs.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1656
dist/jquery.uhr.complete.js
vendored
Normal file
1656
dist/jquery.uhr.complete.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
1
dist/jquery.uhr.complete.min.js
vendored
Normal file
1
dist/jquery.uhr.complete.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
840
dist/jquery.uhr.langs.js
vendored
Normal file
840
dist/jquery.uhr.langs.js
vendored
Normal file
|
@ -0,0 +1,840 @@
|
|||
'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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(function($) {
|
||||
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));
|
||||
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(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. <array-or-object>, vgl. ausführliche Beschreibung bei "minutes".
|
||||
"permanent": es_isch,
|
||||
/*
|
||||
* Minuten: Objekt im folgenden Format:
|
||||
* {
|
||||
* <minuten>: <array-or-object>,
|
||||
* ...
|
||||
* }
|
||||
* <minuten>: String von Komma-separierten Minutenwerten, zu welchem die in <array-or-object> angegebenen Buchstaben aktiv sein sollen
|
||||
* <array-or-object> : [ <object>, ...] | <object>
|
||||
* <object>: { <zeile> : [ <spalte>, ... ] }
|
||||
* <zeile>: Die Zeile, in welcher die Buchstaben liegen; von oben gezählt, oben ist 1.
|
||||
* <spalte>: 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));
|
||||
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(function($) {
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
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));
|
||||
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(function($) {
|
||||
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));
|
||||
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(function($) {
|
||||
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));
|
||||
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(function($) {
|
||||
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));
|
||||
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(function($) {
|
||||
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));
|
||||
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(function($) {
|
||||
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));
|
||||
|
||||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(function ($) {
|
||||
var e_ = {1: [1]};
|
||||
var sao = {1: [2, 3, 4]};
|
||||
var e1 = {7: [8]};
|
||||
var e2 = {10: [5]};
|
||||
var menos = {7: [7, 8, 9, 10, 11]};
|
||||
var meia = {8: [8, 9, 10, 11]};
|
||||
var cinco = {10: [7, 8, 9, 10, 11]};
|
||||
var dez = {10: [1, 2, 3]};
|
||||
var um_quarto = {9: [1, 2, 4, 5, 6, 7, 8, 9]};
|
||||
var vinte = {8: [1, 2, 3, 4, 5]};
|
||||
var layout = {
|
||||
"version": 2,
|
||||
"language": 'Português',
|
||||
"letters": [
|
||||
'ÉSÃOUMATRÊS',
|
||||
'MEIOLDIADEZ',
|
||||
'DUASEISETEY',
|
||||
'QUATROHNOVE',
|
||||
'CINCOITONZE',
|
||||
'ZMEIALNOITE',
|
||||
'HORASYMENOS',
|
||||
'VINTECAMEIA',
|
||||
'UMVQUARTOPM',
|
||||
'DEZOEYCINCO'
|
||||
],
|
||||
"minutes": {
|
||||
"5,6,7,8,9": [e1, cinco],
|
||||
"10,11,12,13,14": [e1, dez],
|
||||
"15,16,17,18,19": [e1, um_quarto],
|
||||
"20,21,22,23,24": [e1, vinte],
|
||||
"25,26,27,28,29": [e1, vinte, e2, cinco],
|
||||
"30,31,32,33,34": [e1, meia],
|
||||
"35,36,37,38,39": [menos, vinte, e2, cinco],
|
||||
"40,41,42,43,44": [menos, vinte],
|
||||
"45,46,47,48,49": [menos, um_quarto],
|
||||
"50,51,52,53,54": [menos, dez],
|
||||
"55,56,57,58,59": [menos, cinco]
|
||||
},
|
||||
"hours": {
|
||||
"0": [e_, {"6": [2, 3, 4, 5, 7, 8, 9, 10, 11]}],
|
||||
"12": [e_, {"2": [1, 2, 3, 4, 6, 7, 8]}],
|
||||
"1,13": [e_, {"1": [5, 6, 7]}],
|
||||
"2,14": [sao, {"3": [1, 2, 3, 4]}],
|
||||
"3,15": [sao, {"1": [8, 9, 10, 11]}],
|
||||
"4,16": [sao, {"4": [1, 2, 3, 4, 5, 6]}],
|
||||
"5,17": [sao, {"5": [1, 2, 3, 4, 5]}],
|
||||
"6,18": [sao, {"3": [4, 5, 6, 7]}],
|
||||
"7,19": [sao, {"3": [7, 8, 9, 10]}],
|
||||
"8,20": [sao, {"5": [5, 6, 7, 8]}],
|
||||
"9,21": [sao, {"4": [8, 9, 10, 11]}],
|
||||
"10,22": [sao, {"2": [9, 10, 11]}],
|
||||
"11,23": [sao, {"5": [8, 9, 10, 11]}]
|
||||
},
|
||||
"getHour": function (date) {
|
||||
var hour = date.getHours();
|
||||
if (date.getMinutes() >= 35) {
|
||||
return (hour + 1) % 24;
|
||||
}
|
||||
return hour;
|
||||
}
|
||||
};
|
||||
$.fritteli.uhr.register('pt', layout);
|
||||
}(jQuery));
|
1
dist/jquery.uhr.langs.min.js
vendored
Normal file
1
dist/jquery.uhr.langs.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
817
dist/jquery.uhr.main.js
vendored
Normal file
817
dist/jquery.uhr.main.js
vendored
Normal file
|
@ -0,0 +1,817 @@
|
|||
'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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(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 '<span class="item letter ' + myStyle + '">' + myValue + '</span>';
|
||||
};
|
||||
}
|
||||
|
||||
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('<br/>');
|
||||
}
|
||||
});
|
||||
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('<span class="item dot dot1"></span>');
|
||||
e.append('<span class="item dot dot2"></span>');
|
||||
e.append('<span class="item dot dot3"></span>');
|
||||
e.append('<span class="item dot dot4"></span>');
|
||||
e.append('<div class="letterarea"></div>');
|
||||
e.append('<div class="reflection"></div>');
|
||||
setWidth.bind(this)(this.options.width);
|
||||
|
||||
if (this.options.controls) {
|
||||
var controlpanel = $('<div class="uhr-controlpanel" id="uhr-controlpanel' + this.id + '"></div>');
|
||||
var content = $('<div class="content"></div>');
|
||||
controlpanel.append(content);
|
||||
// on/off switch
|
||||
var toggleSwitch = $('<div class="onoffswitch" id="uhr-onoffswitch' + this.id + '"></div>');
|
||||
toggleSwitch.append('<input type="checkbox" class="onoffswitch-checkbox" id="uhr-onoffswitch-checkbox' + this.id +
|
||||
'" checked="checked" />');
|
||||
toggleSwitch.append('<label class="onoffswitch-label" for="uhr-onoffswitch-checkbox' + this.id + '">' +
|
||||
'<div class="onoffswitch-inner"></div>' + '<div class="onoffswitch-switch"></div>' + '</label>');
|
||||
content.append(toggleSwitch);
|
||||
|
||||
// time mode switch
|
||||
var modeSwitch = $('<div class="onoffswitch" id="uhr-modeswitch' + this.id + '"></div>');
|
||||
modeSwitch.append('<input type="checkbox" class="onoffswitch-checkbox" id="uhr-modeswitch-checkbox' + this.id +
|
||||
'" checked="checked" />');
|
||||
modeSwitch.append('<label class="onoffswitch-label" for="uhr-modeswitch-checkbox' + this.id + '">' +
|
||||
'<div class="modeswitch-inner"></div>' + '<div class="onoffswitch-switch"></div>' +
|
||||
'</label>');
|
||||
content.append(modeSwitch);
|
||||
// language chooser
|
||||
if (uhrGlobals.languages.length > 1) {
|
||||
var languageChooser = $('<select id="uhr-languagechooser' + this.id + '"></select>');
|
||||
uhrGlobals.languages.forEach(function (item) {
|
||||
languageChooser.append('<option value="' + item.code + '">' + item.language + '</option>');
|
||||
});
|
||||
content.append(languageChooser);
|
||||
}
|
||||
|
||||
// theme chooser
|
||||
if (uhrGlobals.themes.length > 1) {
|
||||
var themeChooser = $('<select id="uhr-themechooser' + this.id + '"></select>');
|
||||
uhrGlobals.themes.forEach(function (item) {
|
||||
themeChooser.append('<option value="' + item.styleClass + '">' + item.name + '</option>');
|
||||
});
|
||||
content.append(themeChooser);
|
||||
}
|
||||
var closebutton = $('<a class="uhr-closecontrolpanel" id="uhr-closecontrolpanel' + this.id + '"></a>');
|
||||
closebutton.on('click', function () {
|
||||
$('#uhr-controlpanel' + this.id).hide('fast');
|
||||
}.bind(this));
|
||||
content.append(closebutton);
|
||||
e.after(controlpanel);
|
||||
controlpanel.hide();
|
||||
var configlink = $('<a class="uhr-configlink" id="uhr-configlink' + this.id + '"></a>');
|
||||
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);
|
1
dist/jquery.uhr.main.min.js
vendored
Normal file
1
dist/jquery.uhr.main.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
11717
dist/libs.js
vendored
Normal file
11717
dist/libs.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
42
dist/libs.min.js
vendored
Normal file
42
dist/libs.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/uhr-black.min.css
vendored
Normal file
1
dist/uhr-black.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.black .onoffswitch-inner:before,.uhr.black{background-color:#111}.uhr.black .dot:not(.active){border-color:hsla(0,0%,100%,.1);box-shadow:0 0 .1em hsla(0,0%,100%,.1)}.uhr.black .letter:not(.active){color:hsla(0,0%,100%,.1);text-shadow:0 0 .1em hsla(0,0%,100%,.1)}
|
1
dist/uhr-blue.min.css
vendored
Normal file
1
dist/uhr-blue.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.blue .onoffswitch-inner:before,.uhr.blue{background-color:#00a}.uhr.blue .dot:not(.active){border-color:hsla(0,0%,100%,.1);box-shadow:0 0 .1em hsla(0,0%,100%,.1)}.uhr.blue .letter:not(.active){color:hsla(0,0%,100%,.1);text-shadow:0 0 .1em hsla(0,0%,100%,.1)}
|
1
dist/uhr-green.min.css
vendored
Normal file
1
dist/uhr-green.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.green .onoffswitch-inner:before,.uhr.green{background-color:#0c0}.uhr.green .dot:not(.active){border-color:rgba(0,0,0,.1);box-shadow:0 0 .1em rgba(0,0,0,.1)}.uhr.green .letter:not(.active){color:rgba(0,0,0,.1);text-shadow:0 0 .1em rgba(0,0,0,.1)}
|
1
dist/uhr-pink.min.css
vendored
Normal file
1
dist/uhr-pink.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.uhr.pink{background-color:#f0a}.uhr.pink .dot.active{border-color:#fff;box-shadow:0 0 .1em #fff}.uhr.pink .letter.active{color:#fff;text-shadow:0 0 .1em #fff}.pink .onoffswitch-inner:before{background-color:#f0a}.uhr.pink .dot:not(.active){border-color:hsla(0,0%,100%,.1);box-shadow:0 0 .1em hsla(0,0%,100%,.1)}.uhr.pink .letter:not(.active){color:hsla(0,0%,100%,.1);text-shadow:0 0 .1em hsla(0,0%,100%,.1)}
|
1
dist/uhr-red.min.css
vendored
Normal file
1
dist/uhr-red.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.red .onoffswitch-inner:before,.uhr.red{background-color:#700}.uhr.red .dot:not(.active){border-color:hsla(0,0%,100%,.1);box-shadow:0 0 .1em hsla(0,0%,100%,.1)}.uhr.red .letter:not(.active){color:hsla(0,0%,100%,.1);text-shadow:0 0 .1em hsla(0,0%,100%,.1)}
|
1
dist/uhr-white.min.css
vendored
Normal file
1
dist/uhr-white.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.uhr.white{background-color:#ccc}.uhr.white .dot.active{border-color:#fff;box-shadow:0 0 .1em #fff}.uhr.white .letter.active{color:#fff;text-shadow:0 0 .1em #fff}.white .onoffswitch-inner:before{background-color:#ccc}.uhr.white .dot:not(.active){border-color:rgba(0,0,0,.1);box-shadow:0 0 .1em rgba(0,0,0,.1)}.uhr.white .letter:not(.active){color:rgba(0,0,0,.1);text-shadow:0 0 .1em rgba(0,0,0,.1)}
|
1
dist/uhr-yellow.min.css
vendored
Normal file
1
dist/uhr-yellow.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.uhr.yellow{background-color:#fd0}.uhr.yellow .dot.active{border-color:#fff;box-shadow:0 0 .1em #fff}.uhr.yellow .letter.active{color:#fff;text-shadow:0 0 .1em #fff}.yellow .onoffswitch-inner:before{background-color:#fd0}.uhr.yellow .dot:not(.active){border-color:rgba(0,0,0,.05);box-shadow:0 0 .1em rgba(0,0,0,.05)}.uhr.yellow .letter:not(.active){color:rgba(0,0,0,.05);text-shadow:0 0 .1em rgba(0,0,0,.05)}
|
1
dist/uhr.min.css
vendored
Normal file
1
dist/uhr.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
@font-face{font-family:Uhrenfont;src:url(../resources/uhr.woff) format("woff")}body{font-family:Uhrenfont,sans-serif}.uhr{position:relative;margin:0;transition:background-color .5s}.uhr .reflection{position:absolute;top:0;bottom:0;left:0;right:0;background:radial-gradient(225em 45em at 160% 0,hsla(0,0%,100%,.4) 0,hsla(0,0%,100%,.05) 40%,hsla(0,0%,100%,0) 0) no-repeat scroll;display:block;margin:.15em}.uhr .letterarea{display:block;position:absolute;top:12%;bottom:12%;left:12%;right:12%;overflow:hidden;font-size:200%}.item{transition:box-shadow .5s,text-shadow .5s,border-color .5s,color .5s}.dot{position:absolute;display:block;height:0;width:0;border:.2em solid;border-radius:1em}.dot.active{border-color:#eee;box-shadow:0 0 .2em #eee}.dot1{top:3.75%;left:3.75%}.dot2{top:3.75%;right:3.75%}.dot3{right:3.75%}.dot3,.dot4{bottom:3.75%}.dot4{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 .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}.modeswitch-inner,.onoffswitch-inner{width:200%;margin-left:-100%;-moz-transition:margin .3s ease-in 0s;-webkit-transition:margin .3s ease-in 0s;-o-transition:margin .3s ease-in 0s;transition:margin .3s ease-in 0s}.modeswitch-inner:after,.modeswitch-inner:before,.onoffswitch-inner:after,.onoffswitch-inner:before{float:left;width:50%;height:24px;padding:0;line-height:24px;font-size:18px;color:#fff;font-weight:700;-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 .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 .3s ease-in 0s;-webkit-transition:all .3s ease-in 0s;-o-transition:all .3s ease-in 0s;transition:all .3s ease-in 0s}.onoffswitch-checkbox:checked+.onoffswitch-label .modeswitch-inner,.onoffswitch-checkbox:checked+.onoffswitch-label .onoffswitch-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/settings.png) no-repeat;width:24px;height:24px;display:inline-block;margin:2px;vertical-align:top}.uhr-controlpanel{border-radius:.5em;box-shadow:0 0 1em #000;background-color:#fff;display:inline-block;padding:.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(../resources/close.png) no-repeat}#disclaimer{font-size:.5em}#disclaimer a{color:#444;text-decoration:underline}
|
71
index.html
71
index.html
|
@ -13,41 +13,46 @@ 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 <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<html manifest="manifest.appcache">
|
||||
<html lang="de" manifest="manifest.appcache">
|
||||
<head>
|
||||
<title>Die Zeit im Wort</title>
|
||||
<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>
|
||||
<link rel="stylesheet" type="text/css" href="uhr.css" />
|
||||
<link rel="stylesheet" type="text/css" href="uhr-black.css" />
|
||||
<link rel="stylesheet" type="text/css" href="uhr-blue.css" />
|
||||
<link rel="stylesheet" type="text/css" href="uhr-green.css" />
|
||||
<link rel="stylesheet" type="text/css" href="uhr-red.css" />
|
||||
<link rel="stylesheet" type="text/css" href="uhr-white.css" />
|
||||
<link rel="shortcut icon" type="image/png" href="favicon.png" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
||||
<title>Bärneruhr - Die Zeit im Wort</title>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="apple-mobile-web-app-capable" content="yes"/>
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
|
||||
<meta name="apple-mobile-web-app-title" content="Bärneruhr"/>
|
||||
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1"/>
|
||||
<link rel="stylesheet" type="text/css" href="dist/uhr.min.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="dist/uhr-black.min.css" data-class="black" data-name="Schwarz"/>
|
||||
<link rel="stylesheet" type="text/css" href="dist/uhr-white.min.css" data-class="white" data-name="Weiss"/>
|
||||
<link rel="stylesheet" type="text/css" href="dist/uhr-red.min.css" data-class="red" data-name="Rot"/>
|
||||
<link rel="stylesheet" type="text/css" href="dist/uhr-yellow.min.css" data-class="yellow" data-name="Gelb"/>
|
||||
<link rel="stylesheet" type="text/css" href="dist/uhr-green.min.css" data-class="green" data-name="Grün"/>
|
||||
<link rel="stylesheet" type="text/css" href="dist/uhr-blue.min.css" data-class="blue" data-name="Blau"/>
|
||||
<link rel="stylesheet" type="text/css" href="dist/uhr-pink.min.css" data-class="pink" data-name="Pink"/>
|
||||
<link rel="shortcut icon" type="image/png" href="resources/favicon.png"/>
|
||||
<link rel="apple-touch-icon-precomposed" href="resources/apple-touch-icon-precomposed.png"/>
|
||||
<script type="text/javascript" src="dist/libs.min.js"></script>
|
||||
<script type="text/javascript" src="dist/jquery.uhr.complete.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
function go(url) {
|
||||
window.location = url;
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body style="padding:0;margin:0;">
|
||||
<a href="info/">
|
||||
<div id="uhr"></div>
|
||||
</a>
|
||||
<p id="disclaimer">Created by <a href="http://www.fritteli.ch/">fritteli</a>, inspired by <a href="http://www.qlocktwo.com/">QLOCKTWO</a>.
|
||||
<script type="text/javascript" src="uhr-de_CH.js"></script>
|
||||
<script type="text/javascript">
|
||||
(function($) {
|
||||
var width = $(window).width();
|
||||
var height = $(window).height();
|
||||
var size = (width < height ? width : height) + 'px';
|
||||
$('#uhr').uhr({
|
||||
width: size,
|
||||
color: 'black',
|
||||
language: 'de_CH',
|
||||
force: true,
|
||||
controls: false
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
<div id="uhr"></div>
|
||||
<p id="disclaimer">Created by <a href="http://www.fritteli.ch/">fritteli</a>, inspired by <a href="http://www.qlocktwo.com/">QLOCKTWO</a>. <a
|
||||
onclick="go('info/index.html')" href="#">Read more!</a></p>
|
||||
<script type="text/javascript">
|
||||
(function($) {
|
||||
var width = $(window).width();
|
||||
var height = $(window).height();
|
||||
var size = Math.min(width, height) + 'px';
|
||||
$('#uhr').uhr({
|
||||
width: size
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
1319
info/index.html
1319
info/index.html
File diff suppressed because it is too large
Load diff
|
@ -1,14 +1,48 @@
|
|||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
body {
|
||||
font-size: 120%;
|
||||
}
|
||||
|
||||
code {
|
||||
white-space: pre;
|
||||
white-space: pre-line;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
code.inline {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
ol {
|
||||
counter-reset: item;
|
||||
padding-left: 1em;
|
||||
counter-reset: item;
|
||||
padding-left: 1em;
|
||||
}
|
||||
|
||||
ol li {
|
||||
display: block;
|
||||
display: block;
|
||||
}
|
||||
|
||||
ol li:before {
|
||||
content: counters(item, ".") ". ";
|
||||
counter-increment: item;
|
||||
content: counters(item, ".") ". ";
|
||||
counter-increment: item;
|
||||
}
|
||||
|
||||
a.toclink {
|
||||
font-size: 25%;
|
||||
}
|
||||
|
||||
a.toclink:before {
|
||||
content: "▲ ";
|
||||
}
|
4
jquery-2.1.0.min.js
vendored
4
jquery-2.1.0.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,117 +0,0 @@
|
|||
/*!
|
||||
* jQuery Cookie Plugin v1.4.0
|
||||
* https://github.com/carhartl/jquery-cookie
|
||||
*
|
||||
* Copyright 2013 Klaus Hartl
|
||||
* Released under the MIT license
|
||||
*/
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as anonymous module.
|
||||
define(['jquery'], factory);
|
||||
} else {
|
||||
// Browser globals.
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
|
||||
var pluses = /\+/g;
|
||||
|
||||
function encode(s) {
|
||||
return config.raw ? s : encodeURIComponent(s);
|
||||
}
|
||||
|
||||
function decode(s) {
|
||||
return config.raw ? s : decodeURIComponent(s);
|
||||
}
|
||||
|
||||
function stringifyCookieValue(value) {
|
||||
return encode(config.json ? JSON.stringify(value) : String(value));
|
||||
}
|
||||
|
||||
function parseCookieValue(s) {
|
||||
if (s.indexOf('"') === 0) {
|
||||
// This is a quoted cookie as according to RFC2068, unescape...
|
||||
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
|
||||
}
|
||||
|
||||
try {
|
||||
// Replace server-side written pluses with spaces.
|
||||
// If we can't decode the cookie, ignore it, it's unusable.
|
||||
s = decodeURIComponent(s.replace(pluses, ' '));
|
||||
} catch(e) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// If we can't parse the cookie, ignore it, it's unusable.
|
||||
return config.json ? JSON.parse(s) : s;
|
||||
} catch(e) {}
|
||||
}
|
||||
|
||||
function read(s, converter) {
|
||||
var value = config.raw ? s : parseCookieValue(s);
|
||||
return $.isFunction(converter) ? converter(value) : value;
|
||||
}
|
||||
|
||||
var config = $.cookie = function (key, value, options) {
|
||||
|
||||
// Write
|
||||
if (value !== undefined && !$.isFunction(value)) {
|
||||
options = $.extend({}, config.defaults, options);
|
||||
|
||||
if (typeof options.expires === 'number') {
|
||||
var days = options.expires, t = options.expires = new Date();
|
||||
t.setDate(t.getDate() + days);
|
||||
}
|
||||
|
||||
return (document.cookie = [
|
||||
encode(key), '=', stringifyCookieValue(value),
|
||||
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
|
||||
options.path ? '; path=' + options.path : '',
|
||||
options.domain ? '; domain=' + options.domain : '',
|
||||
options.secure ? '; secure' : ''
|
||||
].join(''));
|
||||
}
|
||||
|
||||
// Read
|
||||
|
||||
var result = key ? undefined : {};
|
||||
|
||||
// To prevent the for loop in the first place assign an empty array
|
||||
// in case there are no cookies at all. Also prevents odd result when
|
||||
// calling $.cookie().
|
||||
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
||||
|
||||
for (var i = 0, l = cookies.length; i < l; i++) {
|
||||
var parts = cookies[i].split('=');
|
||||
var name = decode(parts.shift());
|
||||
var cookie = parts.join('=');
|
||||
|
||||
if (key && key === name) {
|
||||
// If second argument (value) is a function it's a converter...
|
||||
result = read(cookie, value);
|
||||
break;
|
||||
}
|
||||
|
||||
// Prevent storing a cookie that we couldn't decode.
|
||||
if (!key && (cookie = read(cookie)) !== undefined) {
|
||||
result[name] = cookie;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
config.defaults = {};
|
||||
|
||||
$.removeCookie = function (key, options) {
|
||||
if ($.cookie(key) !== undefined) {
|
||||
// Must not alter options, thus extending a fresh object...
|
||||
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
}));
|
6
jquery-ui-1.10.4.custom.min.js
vendored
6
jquery-ui-1.10.4.custom.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,20 +1,25 @@
|
|||
CACHE MANIFEST
|
||||
# 4.1
|
||||
# Version 9.0.0-dev.0
|
||||
|
||||
COPYING
|
||||
favicon.png
|
||||
/
|
||||
dist/jquery.uhr.base.min.js
|
||||
dist/jquery.uhr.complete.min.js
|
||||
dist/libs.min.js
|
||||
dist/uhr.min.css
|
||||
dist/uhr-black.min.css
|
||||
dist/uhr-blue.min.css
|
||||
dist/uhr-green.min.css
|
||||
dist/uhr-pink.min.css
|
||||
dist/uhr-red.min.css
|
||||
dist/uhr-white.min.css
|
||||
dist/uhr-yellow.min.css
|
||||
info/
|
||||
info/index.html
|
||||
info/info.css
|
||||
resources/apple-touch-icon-precomposed.png
|
||||
resources/close.png
|
||||
resources/favicon.png
|
||||
resources/settings.png
|
||||
resources/uhr.woff
|
||||
index.html
|
||||
jquery-2.0.3.min.js
|
||||
jquery-cookie-1.4.0.js
|
||||
jquery-ui-1.10.3.custom.min.js
|
||||
uhr-black.css
|
||||
uhr-blue.css
|
||||
uhr-de.js
|
||||
uhr-de_CH.js
|
||||
uhr-en.js
|
||||
uhr-green.css
|
||||
uhr-red.css
|
||||
uhr-white.css
|
||||
uhr.css
|
||||
uhr.js
|
||||
uhr.woff
|
||||
README.md
|
||||
|
|
3953
package-lock.json
generated
Normal file
3953
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
63
package.json
Normal file
63
package.json
Normal file
|
@ -0,0 +1,63 @@
|
|||
{
|
||||
"name": "uhr",
|
||||
"version": "9.0.0-dev.0",
|
||||
"description": "jQuery QLOCKTWO plugin",
|
||||
"keywords": [
|
||||
"jquery-plugin",
|
||||
"qlocktwo"
|
||||
],
|
||||
"scripts": {
|
||||
"prebuild": "npm run clean",
|
||||
"build": "npm-run-all --parallel rollup:js:* rollup:css:*",
|
||||
"clean": "rimraf dist",
|
||||
"rollup:js:app": "rollup --config build-config/rollup.config.js-app.js",
|
||||
"rollup:js:base": "rollup --config build-config/rollup.config.js-base.js",
|
||||
"rollup:js:baselangs": "rollup --config build-config/rollup.config.js-baselangs.js",
|
||||
"rollup:js:complete": "rollup --config build-config/rollup.config.js-complete.js",
|
||||
"rollup:js:langs": "rollup --config build-config/rollup.config.js-langs.js",
|
||||
"rollup:js:libs": "rollup --config build-config/rollup.config.js-libs.js",
|
||||
"rollup:css:app": "rollup --config build-config/rollup.config.css-app.js",
|
||||
"rollup:css:black": "rollup --config build-config/rollup.config.css-black.js",
|
||||
"rollup:css:blue": "rollup --config build-config/rollup.config.css-blue.js",
|
||||
"rollup:css:green": "rollup --config build-config/rollup.config.css-green.js",
|
||||
"rollup:css:pink": "rollup --config build-config/rollup.config.css-pink.js",
|
||||
"rollup:css:red": "rollup --config build-config/rollup.config.css-red.js",
|
||||
"rollup:css:white": "rollup --config build-config/rollup.config.css-white.js",
|
||||
"rollup:css:yellow": "rollup --config build-config/rollup.config.css-yellow.js"
|
||||
},
|
||||
"homepage": "http://bärneruhr.ch/",
|
||||
"author": {
|
||||
"name": "Manuel Friedli",
|
||||
"email": "manuel@fritteli.ch",
|
||||
"url": "http://www.fritteli.ch/"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://gittr.ch/manuel/uhr"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"type": "GPL-3.0"
|
||||
}
|
||||
],
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"jquery": "^3.5.0",
|
||||
"jquery-ui": "1.12.1",
|
||||
"jquery.cookie": "1.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-node-resolve": "^11.2.0",
|
||||
"chai": "4.2.0",
|
||||
"cssnano": "^4.1.10",
|
||||
"jshint-stylish": "2.2.1",
|
||||
"mocha": "^8.3.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"phantomjs-prebuilt": "2.1.16",
|
||||
"postcss": "^8.2.6",
|
||||
"rimraf": "^3.0.2",
|
||||
"rollup": "^2.39.1",
|
||||
"rollup-plugin-css-bundle": "^1.0.4",
|
||||
"rollup-plugin-terser": "^7.0.2"
|
||||
}
|
||||
}
|
BIN
resources/apple-touch-icon-precomposed.png
Normal file
BIN
resources/apple-touch-icon-precomposed.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
BIN
resources/close.png
Normal file
BIN
resources/close.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 407 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
resources/settings.png
Normal file
BIN
resources/settings.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 435 B |
74
src/uhr-de.js
Normal file
74
src/uhr-de.js
Normal file
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(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));
|
97
src/uhr-de_CH.js
Normal file
97
src/uhr-de_CH.js
Normal file
|
@ -0,0 +1,97 @@
|
|||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(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. <array-or-object>, vgl. ausführliche Beschreibung bei "minutes".
|
||||
"permanent": es_isch,
|
||||
/*
|
||||
* Minuten: Objekt im folgenden Format:
|
||||
* {
|
||||
* <minuten>: <array-or-object>,
|
||||
* ...
|
||||
* }
|
||||
* <minuten>: String von Komma-separierten Minutenwerten, zu welchem die in <array-or-object> angegebenen Buchstaben aktiv sein sollen
|
||||
* <array-or-object> : [ <object>, ...] | <object>
|
||||
* <object>: { <zeile> : [ <spalte>, ... ] }
|
||||
* <zeile>: Die Zeile, in welcher die Buchstaben liegen; von oben gezählt, oben ist 1.
|
||||
* <spalte>: 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));
|
72
src/uhr-de_CH_genau.js
Normal file
72
src/uhr-de_CH_genau.js
Normal file
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(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));
|
80
src/uhr-dk.js
Normal file
80
src/uhr-dk.js
Normal file
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(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));
|
81
src/uhr-en.js
Normal file
81
src/uhr-en.js
Normal file
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(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));
|
80
src/uhr-es.js
Normal file
80
src/uhr-es.js
Normal file
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(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));
|
115
src/uhr-fr.js
Normal file
115
src/uhr-fr.js
Normal file
|
@ -0,0 +1,115 @@
|
|||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(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));
|
80
src/uhr-it.js
Normal file
80
src/uhr-it.js
Normal file
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(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));
|
81
src/uhr-nl.js
Normal file
81
src/uhr-nl.js
Normal file
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(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));
|
79
src/uhr-pt.js
Normal file
79
src/uhr-pt.js
Normal file
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(function ($) {
|
||||
'use strict';
|
||||
var e_ = {1: [1]};
|
||||
var sao = {1: [2, 3, 4]};
|
||||
var e1 = {7: [8]};
|
||||
var e2 = {10: [5]};
|
||||
var menos = {7: [7, 8, 9, 10, 11]};
|
||||
var meia = {8: [8, 9, 10, 11]};
|
||||
var cinco = {10: [7, 8, 9, 10, 11]};
|
||||
var dez = {10: [1, 2, 3]};
|
||||
var um_quarto = {9: [1, 2, 4, 5, 6, 7, 8, 9]};
|
||||
var vinte = {8: [1, 2, 3, 4, 5]};
|
||||
var layout = {
|
||||
"version": 2,
|
||||
"language": 'Português',
|
||||
"letters": [
|
||||
'ÉSÃOUMATRÊS',
|
||||
'MEIOLDIADEZ',
|
||||
'DUASEISETEY',
|
||||
'QUATROHNOVE',
|
||||
'CINCOITONZE',
|
||||
'ZMEIALNOITE',
|
||||
'HORASYMENOS',
|
||||
'VINTECAMEIA',
|
||||
'UMVQUARTOPM',
|
||||
'DEZOEYCINCO'
|
||||
],
|
||||
"minutes": {
|
||||
"5,6,7,8,9": [e1, cinco],
|
||||
"10,11,12,13,14": [e1, dez],
|
||||
"15,16,17,18,19": [e1, um_quarto],
|
||||
"20,21,22,23,24": [e1, vinte],
|
||||
"25,26,27,28,29": [e1, vinte, e2, cinco],
|
||||
"30,31,32,33,34": [e1, meia],
|
||||
"35,36,37,38,39": [menos, vinte, e2, cinco],
|
||||
"40,41,42,43,44": [menos, vinte],
|
||||
"45,46,47,48,49": [menos, um_quarto],
|
||||
"50,51,52,53,54": [menos, dez],
|
||||
"55,56,57,58,59": [menos, cinco]
|
||||
},
|
||||
"hours": {
|
||||
"0": [e_, {"6": [2, 3, 4, 5, 7, 8, 9, 10, 11]}],
|
||||
"12": [e_, {"2": [1, 2, 3, 4, 6, 7, 8]}],
|
||||
"1,13": [e_, {"1": [5, 6, 7]}],
|
||||
"2,14": [sao, {"3": [1, 2, 3, 4]}],
|
||||
"3,15": [sao, {"1": [8, 9, 10, 11]}],
|
||||
"4,16": [sao, {"4": [1, 2, 3, 4, 5, 6]}],
|
||||
"5,17": [sao, {"5": [1, 2, 3, 4, 5]}],
|
||||
"6,18": [sao, {"3": [4, 5, 6, 7]}],
|
||||
"7,19": [sao, {"3": [7, 8, 9, 10]}],
|
||||
"8,20": [sao, {"5": [5, 6, 7, 8]}],
|
||||
"9,21": [sao, {"4": [8, 9, 10, 11]}],
|
||||
"10,22": [sao, {"2": [9, 10, 11]}],
|
||||
"11,23": [sao, {"5": [8, 9, 10, 11]}]
|
||||
},
|
||||
"getHour": function (date) {
|
||||
var hour = date.getHours();
|
||||
if (date.getMinutes() >= 35) {
|
||||
return (hour + 1) % 24;
|
||||
}
|
||||
return hour;
|
||||
}
|
||||
};
|
||||
$.fritteli.uhr.register('pt', layout);
|
||||
}(jQuery));
|
816
src/uhr.js
Normal file
816
src/uhr.js
Normal file
|
@ -0,0 +1,816 @@
|
|||
/*
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(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 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 '<span class="item letter ' + myStyle + '">' + myValue + '</span>';
|
||||
};
|
||||
}
|
||||
|
||||
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('<br/>');
|
||||
}
|
||||
});
|
||||
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('<span class="item dot dot1"></span>');
|
||||
e.append('<span class="item dot dot2"></span>');
|
||||
e.append('<span class="item dot dot3"></span>');
|
||||
e.append('<span class="item dot dot4"></span>');
|
||||
e.append('<div class="letterarea"></div>');
|
||||
e.append('<div class="reflection"></div>');
|
||||
setWidth.bind(this)(this.options.width);
|
||||
|
||||
if (this.options.controls) {
|
||||
var controlpanel = $('<div class="uhr-controlpanel" id="uhr-controlpanel' + this.id + '"></div>');
|
||||
var content = $('<div class="content"></div>');
|
||||
controlpanel.append(content);
|
||||
// on/off switch
|
||||
var toggleSwitch = $('<div class="onoffswitch" id="uhr-onoffswitch' + this.id + '"></div>');
|
||||
toggleSwitch.append('<input type="checkbox" class="onoffswitch-checkbox" id="uhr-onoffswitch-checkbox' + this.id +
|
||||
'" checked="checked" />');
|
||||
toggleSwitch.append('<label class="onoffswitch-label" for="uhr-onoffswitch-checkbox' + this.id + '">' +
|
||||
'<div class="onoffswitch-inner"></div>' + '<div class="onoffswitch-switch"></div>' + '</label>');
|
||||
content.append(toggleSwitch);
|
||||
|
||||
// time mode switch
|
||||
var modeSwitch = $('<div class="onoffswitch" id="uhr-modeswitch' + this.id + '"></div>');
|
||||
modeSwitch.append('<input type="checkbox" class="onoffswitch-checkbox" id="uhr-modeswitch-checkbox' + this.id +
|
||||
'" checked="checked" />');
|
||||
modeSwitch.append('<label class="onoffswitch-label" for="uhr-modeswitch-checkbox' + this.id + '">' +
|
||||
'<div class="modeswitch-inner"></div>' + '<div class="onoffswitch-switch"></div>' +
|
||||
'</label>');
|
||||
content.append(modeSwitch);
|
||||
// language chooser
|
||||
if (uhrGlobals.languages.length > 1) {
|
||||
var languageChooser = $('<select id="uhr-languagechooser' + this.id + '"></select>');
|
||||
uhrGlobals.languages.forEach(function (item) {
|
||||
languageChooser.append('<option value="' + item.code + '">' + item.language + '</option>');
|
||||
});
|
||||
content.append(languageChooser);
|
||||
}
|
||||
|
||||
// theme chooser
|
||||
if (uhrGlobals.themes.length > 1) {
|
||||
var themeChooser = $('<select id="uhr-themechooser' + this.id + '"></select>');
|
||||
uhrGlobals.themes.forEach(function (item) {
|
||||
themeChooser.append('<option value="' + item.styleClass + '">' + item.name + '</option>');
|
||||
});
|
||||
content.append(themeChooser);
|
||||
}
|
||||
var closebutton = $('<a class="uhr-closecontrolpanel" id="uhr-closecontrolpanel' + this.id + '"></a>');
|
||||
closebutton.on('click', function () {
|
||||
$('#uhr-controlpanel' + this.id).hide('fast');
|
||||
}.bind(this));
|
||||
content.append(closebutton);
|
||||
e.after(controlpanel);
|
||||
controlpanel.hide();
|
||||
var configlink = $('<a class="uhr-configlink" id="uhr-configlink' + this.id + '"></a>');
|
||||
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);
|
60
test/.jshintrc
Normal file
60
test/.jshintrc
Normal file
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
// Settings
|
||||
"passfail" : false, // Stop on first error.
|
||||
"maxerr" : 100, // Maximum error before stopping.
|
||||
|
||||
|
||||
// Predefined globals whom JSHint will ignore.
|
||||
"browser" : true, // Standard browser globals e.g. `window`, `document`.
|
||||
"node" : true,
|
||||
"jquery" : true,
|
||||
|
||||
"predef" : [
|
||||
"suite",
|
||||
"chai",
|
||||
"setup",
|
||||
"teardown",
|
||||
"test"
|
||||
],
|
||||
|
||||
// Development.
|
||||
"debug" : false, // Allow debugger statements e.g. browser breakpoints.
|
||||
"devel" : true, // Allow developments statements e.g. `console.log();`.
|
||||
|
||||
"strict" : true, // Require `use strict` pragma in every file.
|
||||
"globalstrict" : false, // Allow global "use strict" (also enables 'strict').
|
||||
|
||||
|
||||
// The Good Parts.
|
||||
"asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons).
|
||||
"laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
|
||||
"bitwise" : true, // Prohibit bitwise operators (&, |, ^, etc.).
|
||||
"boss" : false, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
|
||||
"curly" : true, // Require {} for every new block or scope.
|
||||
"eqeqeq" : true, // Require triple equals i.e. `===`.
|
||||
"eqnull" : false, // Tolerate use of `== null`.
|
||||
"evil" : false, // Tolerate use of `eval`.
|
||||
"expr" : false, // Tolerate `ExpressionStatement` as Programs.
|
||||
"forin" : false, // Tolerate `for in` loops without `hasOwnPrototype`.
|
||||
"immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
|
||||
"latedef" : true, // Prohipit variable use before definition.
|
||||
"loopfunc" : false, // Allow functions to be defined within loops.
|
||||
"noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`.
|
||||
"scripturl" : true, // Tolerate script-targeted URLs.
|
||||
"shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`.
|
||||
"supernew" : false, // Tolerate `new function () { ... };` and `new Object;`.
|
||||
"undef" : true, // Require all non-global variables be declared before they are used.
|
||||
|
||||
|
||||
// Personal styling preferences.
|
||||
"newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`.
|
||||
"noempty" : true, // Prohibit use of empty blocks.
|
||||
"nonew" : true, // Prohibit use of constructors for side-effects.
|
||||
"nomen" : true, // Prohibit use of initial or trailing underbars in names.
|
||||
"onevar" : false, // Allow only one `var` statement per function.
|
||||
"plusplus" : false, // Prohibit use of `++` & `--`.
|
||||
"sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
|
||||
"trailing" : true, // Prohibit trailing whitespaces.
|
||||
"white" : true, // Check against strict whitespace and indentation rules.
|
||||
"indent" : 0 // Specify indentation spacing
|
||||
}
|
270
test/css/mocha.css
Normal file
270
test/css/mocha.css
Normal file
|
@ -0,0 +1,270 @@
|
|||
@charset "utf-8";
|
||||
|
||||
body {
|
||||
margin:0;
|
||||
}
|
||||
|
||||
#mocha {
|
||||
font: 20px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
margin: 60px 50px;
|
||||
}
|
||||
|
||||
#mocha ul,
|
||||
#mocha li {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#mocha ul {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#mocha h1,
|
||||
#mocha h2 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#mocha h1 {
|
||||
margin-top: 15px;
|
||||
font-size: 1em;
|
||||
font-weight: 200;
|
||||
}
|
||||
|
||||
#mocha h1 a {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
#mocha h1 a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#mocha .suite .suite h1 {
|
||||
margin-top: 0;
|
||||
font-size: .8em;
|
||||
}
|
||||
|
||||
#mocha .hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#mocha h2 {
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#mocha .suite {
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
#mocha .test {
|
||||
margin-left: 15px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#mocha .test.pending:hover h2::after {
|
||||
content: '(pending)';
|
||||
font-family: arial, sans-serif;
|
||||
}
|
||||
|
||||
#mocha .test.pass.medium .duration {
|
||||
background: #c09853;
|
||||
}
|
||||
|
||||
#mocha .test.pass.slow .duration {
|
||||
background: #b94a48;
|
||||
}
|
||||
|
||||
#mocha .test.pass::before {
|
||||
content: '✓';
|
||||
font-size: 12px;
|
||||
display: block;
|
||||
float: left;
|
||||
margin-right: 5px;
|
||||
color: #00d6b2;
|
||||
}
|
||||
|
||||
#mocha .test.pass .duration {
|
||||
font-size: 9px;
|
||||
margin-left: 5px;
|
||||
padding: 2px 5px;
|
||||
color: #fff;
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
|
||||
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
|
||||
box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
-ms-border-radius: 5px;
|
||||
-o-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
#mocha .test.pass.fast .duration {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#mocha .test.pending {
|
||||
color: #0b97c4;
|
||||
}
|
||||
|
||||
#mocha .test.pending::before {
|
||||
content: '◦';
|
||||
color: #0b97c4;
|
||||
}
|
||||
|
||||
#mocha .test.fail {
|
||||
color: #c00;
|
||||
}
|
||||
|
||||
#mocha .test.fail pre {
|
||||
color: black;
|
||||
}
|
||||
|
||||
#mocha .test.fail::before {
|
||||
content: '✖';
|
||||
font-size: 12px;
|
||||
display: block;
|
||||
float: left;
|
||||
margin-right: 5px;
|
||||
color: #c00;
|
||||
}
|
||||
|
||||
#mocha .test pre.error {
|
||||
color: #c00;
|
||||
max-height: 300px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* (1): approximate for browsers not supporting calc
|
||||
* (2): 42 = 2*15 + 2*10 + 2*1 (padding + margin + border)
|
||||
* ^^ seriously
|
||||
*/
|
||||
#mocha .test pre {
|
||||
display: block;
|
||||
float: left;
|
||||
clear: left;
|
||||
font: 12px/1.5 monaco, monospace;
|
||||
margin: 5px;
|
||||
padding: 15px;
|
||||
border: 1px solid #eee;
|
||||
max-width: 85%; /*(1)*/
|
||||
max-width: calc(100% - 42px); /*(2)*/
|
||||
word-wrap: break-word;
|
||||
border-bottom-color: #ddd;
|
||||
-webkit-border-radius: 3px;
|
||||
-webkit-box-shadow: 0 1px 3px #eee;
|
||||
-moz-border-radius: 3px;
|
||||
-moz-box-shadow: 0 1px 3px #eee;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
#mocha .test h2 {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#mocha .test a.replay {
|
||||
position: absolute;
|
||||
top: 3px;
|
||||
right: 0;
|
||||
text-decoration: none;
|
||||
vertical-align: middle;
|
||||
display: block;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
line-height: 15px;
|
||||
text-align: center;
|
||||
background: #eee;
|
||||
font-size: 15px;
|
||||
-moz-border-radius: 15px;
|
||||
border-radius: 15px;
|
||||
-webkit-transition: opacity 200ms;
|
||||
-moz-transition: opacity 200ms;
|
||||
transition: opacity 200ms;
|
||||
opacity: 0.3;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
#mocha .test:hover a.replay {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#mocha-report.pass .test.fail {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#mocha-report.fail .test.pass {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#mocha-report.pending .test.pass,
|
||||
#mocha-report.pending .test.fail {
|
||||
display: none;
|
||||
}
|
||||
#mocha-report.pending .test.pass.pending {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#mocha-error {
|
||||
color: #c00;
|
||||
font-size: 1.5em;
|
||||
font-weight: 100;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
#mocha-stats {
|
||||
position: fixed;
|
||||
top: 15px;
|
||||
right: 10px;
|
||||
font-size: 12px;
|
||||
margin: 0;
|
||||
color: #888;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
#mocha-stats .progress {
|
||||
float: right;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
#mocha-stats em {
|
||||
color: black;
|
||||
}
|
||||
|
||||
#mocha-stats a {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
#mocha-stats a:hover {
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
#mocha-stats li {
|
||||
display: inline-block;
|
||||
margin: 0 5px;
|
||||
list-style: none;
|
||||
padding-top: 11px;
|
||||
}
|
||||
|
||||
#mocha-stats canvas {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
#mocha code .comment { color: #ddd; }
|
||||
#mocha code .init { color: #2f6fad; }
|
||||
#mocha code .string { color: #5890ad; }
|
||||
#mocha code .keyword { color: #8a6343; }
|
||||
#mocha code .number { color: #2f6fad; }
|
||||
|
||||
@media screen and (max-device-width: 480px) {
|
||||
#mocha {
|
||||
margin: 60px 0px;
|
||||
}
|
||||
|
||||
#mocha #stats {
|
||||
position: absolute;
|
||||
}
|
||||
}
|
76
test/fastforward.html
Normal file
76
test/fastforward.html
Normal file
|
@ -0,0 +1,76 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<html lang="de" manifest="manifest.appcache">
|
||||
<head>
|
||||
<title>Fastforward bärneruhr.ch</title>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="apple-mobile-web-app-capable" content="yes"/>
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
|
||||
<meta name="apple-mobile-web-app-title" content="Bärneruhr"/>
|
||||
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1"/>
|
||||
<link rel="stylesheet" type="text/css" href="../dist/uhr.min.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="../dist/uhr-black.min.css" data-class="black" data-name="Schwarz"/>
|
||||
<link rel="stylesheet" type="text/css" href="../dist/uhr-white.min.css" data-class="white" data-name="Weiss"/>
|
||||
<link rel="stylesheet" type="text/css" href="../dist/uhr-red.min.css" data-class="red" data-name="Rot"/>
|
||||
<link rel="stylesheet" type="text/css" href="../dist/uhr-yellow.min.css" data-class="yellow" data-name="Gelb"/>
|
||||
<link rel="stylesheet" type="text/css" href="../dist/uhr-green.min.css" data-class="green" data-name="Grün"/>
|
||||
<link rel="stylesheet" type="text/css" href="../dist/uhr-blue.min.css" data-class="blue" data-name="Blau"/>
|
||||
<link rel="stylesheet" type="text/css" href="../dist/uhr-pink.min.css" data-class="pink" data-name="Pink"/>
|
||||
<link rel="shortcut icon" type="image/png" href="../resources/favicon.png"/>
|
||||
<link rel="apple-touch-icon-precomposed" href="../resources/apple-touch-icon-precomposed.png"/>
|
||||
<script type="text/javascript" src="../dist/libs.min.js"></script>
|
||||
<script type="text/javascript" src="../dist/jquery.uhr.complete.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="uhr"></div>
|
||||
<button id="timer">Start</button>
|
||||
<button id="reset">Reset</button>
|
||||
<script type="text/javascript">
|
||||
(function ($) {
|
||||
var time = new Date(2000, 0, 1, 0, 0, 0, 0);
|
||||
var timer = null;
|
||||
$('#timer').on('click', function () {
|
||||
if (timer == null) {
|
||||
timer = window.setInterval(function () {
|
||||
var minutes = time.getMinutes();
|
||||
var hours = time.getHours();
|
||||
minutes = (minutes + 1) % 60;
|
||||
if (minutes == 0) {
|
||||
hours = (hours + 1) % 24;
|
||||
time.setHours(hours);
|
||||
}
|
||||
time.setMinutes(minutes);
|
||||
$('#uhr').uhr('time', time);
|
||||
}, 200);
|
||||
$('#timer').html('Pause');
|
||||
} else {
|
||||
window.clearInterval(timer);
|
||||
timer = null;
|
||||
$('#timer').html('Start');
|
||||
}
|
||||
});
|
||||
$('#reset').on('click', function () {
|
||||
time = new Date(2000, 0, 1, 0, 0, 0, 0);
|
||||
$('#uhr').uhr('time', time);
|
||||
});
|
||||
$('#uhr').uhr({
|
||||
width: '200px',
|
||||
time: time
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
4782
test/lib/chai.js
Normal file
4782
test/lib/chai.js
Normal file
File diff suppressed because it is too large
Load diff
5842
test/lib/mocha.js
Normal file
5842
test/lib/mocha.js
Normal file
File diff suppressed because it is too large
Load diff
48
test/test.html
Normal file
48
test/test.html
Normal file
|
@ -0,0 +1,48 @@
|
|||
<!DOCTYPE html>
|
||||
<!--
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<html>
|
||||
<head lang="en">
|
||||
<meta charset="UTF-8">
|
||||
<title>Test bärneruhr.ch</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/mocha.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="../css/uhr.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="../css/uhr-black.css" data-class="black"/>
|
||||
<link rel="stylesheet" type="text/css" href="../css/uhr-red.css" data-class="red"/>
|
||||
<link rel="stylesheet" type="text/css" href="../css/uhr-pink.css" data-class="pink"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="u"></div>
|
||||
<div id="mocha"></div>
|
||||
<script type="text/javascript" src="lib/mocha.js"></script>
|
||||
<script type="text/javascript" src="lib/chai.js"></script>
|
||||
<script type="text/javascript" src="../dist/libs.js"></script>
|
||||
<script type="text/javascript" src="../dist/jquery.uhr.complete.js"></script>
|
||||
<script type="text/javascript">
|
||||
mocha.setup('tdd');
|
||||
</script>
|
||||
<script type="text/javascript" src="test.js"></script>
|
||||
<script type="text/javascript">
|
||||
// mocha.checkLeaks();
|
||||
// mocha.globals(['jQuery*']);
|
||||
if (window.mochaPhantomJS) {
|
||||
mochaPhantomJS.run();
|
||||
}
|
||||
else {
|
||||
mocha.run();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
141
test/test.js
Normal file
141
test/test.js
Normal file
|
@ -0,0 +1,141 @@
|
|||
suite('Bärneruhr', function () {
|
||||
'use strict';
|
||||
var assert = chai.assert;
|
||||
var $ = jQuery;
|
||||
var elem;
|
||||
|
||||
setup(function () {
|
||||
elem = $('#u');
|
||||
});
|
||||
|
||||
function cleanupCookies(id) {
|
||||
$.removeCookie('uhr-language' + id);
|
||||
$.removeCookie('uhr-mode' + id);
|
||||
$.removeCookie('uhr-status' + id);
|
||||
$.removeCookie('uhr-theme' + id);
|
||||
}
|
||||
|
||||
teardown(function () {
|
||||
var uhr = elem.uhr('instance');
|
||||
if (uhr !== undefined) {
|
||||
cleanupCookies(uhr.id);
|
||||
}
|
||||
try {
|
||||
elem.uhr('destroy');
|
||||
} catch (e) {
|
||||
// just TRY to clean up, but don't DIE trying.
|
||||
}
|
||||
window.location.hash = '';
|
||||
});
|
||||
|
||||
test('create and destroy widget', function () {
|
||||
var uhr = elem.uhr('instance');
|
||||
var id;
|
||||
assert.isUndefined(uhr);
|
||||
elem.uhr();
|
||||
uhr = elem.uhr('instance');
|
||||
assert.isNotNull(uhr);
|
||||
assert.isDefined(uhr);
|
||||
id = uhr.id;
|
||||
elem.uhr('destroy');
|
||||
uhr = elem.uhr('instance');
|
||||
assert.isUndefined(uhr);
|
||||
// cookies need to be cleaned up separately in this case, because in teardown(), the uhr widget doesn't exist anymore
|
||||
cleanupCookies(id);
|
||||
});
|
||||
|
||||
test('default config', function () {
|
||||
var options;
|
||||
elem.uhr();
|
||||
options = elem.uhr('instance').options;
|
||||
assert.isTrue(options.autoresize);
|
||||
assert.isTrue(options.controls);
|
||||
assert.isUndefined(options.cookiePath);
|
||||
assert.isFalse(options.force);
|
||||
assert.equal(options.language, 'de_CH');
|
||||
assert.equal(options.mode, 'normal');
|
||||
assert.equal(options.status, 'on');
|
||||
assert.equal(options.theme, 'black');
|
||||
});
|
||||
|
||||
test('custom config', function () {
|
||||
var options;
|
||||
var realWidth;
|
||||
var myWidth = 100;
|
||||
var myOptions = {
|
||||
autoresize: false,
|
||||
controls: false,
|
||||
cookiePath: '/foo/bar',
|
||||
force: true,
|
||||
language: 'de',
|
||||
mode: 'seconds',
|
||||
status: 'off',
|
||||
theme: 'red',
|
||||
width: myWidth + 'px'
|
||||
};
|
||||
elem.uhr(myOptions);
|
||||
options = elem.uhr('instance').options;
|
||||
assert.equal(options.autoresize, myOptions.autoresize);
|
||||
assert.equal(options.controls, myOptions.controls);
|
||||
assert.equal(options.cookiePath, myOptions.cookiePath);
|
||||
assert.equal(options.force, myOptions.force);
|
||||
assert.equal(options.language, myOptions.language);
|
||||
assert.equal(options.mode, myOptions.mode);
|
||||
assert.equal(options.status, myOptions.status);
|
||||
assert.equal(options.theme, myOptions.theme);
|
||||
assert.equal(options.width, myOptions.width);
|
||||
|
||||
realWidth = elem.width();
|
||||
assert.equal(myWidth, realWidth);
|
||||
});
|
||||
|
||||
test('unknown language', function () {
|
||||
var uhr;
|
||||
elem.uhr({
|
||||
language: 'klingon'
|
||||
});
|
||||
uhr = elem.uhr('instance');
|
||||
// The 'uhr' element must be created, and a fall-back language must have been selected
|
||||
assert.isTrue(!!uhr);
|
||||
assert.isTrue(!!uhr.options.language);
|
||||
assert.notEqual(uhr.options.language, 'klingon');
|
||||
});
|
||||
|
||||
test('unknown theme', function () {
|
||||
var uhr;
|
||||
elem.uhr({
|
||||
theme: 'klingon'
|
||||
});
|
||||
uhr = elem.uhr('instance');
|
||||
// NB: 'black' is the first theme that is included in the test page.
|
||||
assert.equal(uhr.options.theme, 'black');
|
||||
});
|
||||
|
||||
test('URL params, short', function () {
|
||||
var options;
|
||||
|
||||
window.location.hash = '#t=red&l=dk&m=seconds&s=on';
|
||||
|
||||
elem.uhr();
|
||||
options = elem.uhr('instance').options;
|
||||
assert.isTrue(options.force);
|
||||
assert.equal(options.language, 'dk');
|
||||
assert.equal(options.mode, 'seconds');
|
||||
assert.equal(options.status, 'on');
|
||||
assert.equal(options.theme, 'red');
|
||||
});
|
||||
|
||||
test('URL params, long', function () {
|
||||
var options;
|
||||
|
||||
window.location.hash = '#theme=pink&language=de_CH&mode=normal&status=off';
|
||||
|
||||
elem.uhr();
|
||||
options = elem.uhr('instance').options;
|
||||
assert.isTrue(options.force);
|
||||
assert.equal(options.language, 'de_CH');
|
||||
assert.equal(options.mode, 'normal');
|
||||
assert.equal(options.status, 'off');
|
||||
assert.equal(options.theme, 'pink');
|
||||
});
|
||||
});
|
30
uhr-de.js
30
uhr-de.js
|
@ -1,30 +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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
var layout = {
|
||||
language: 'Deutsch',
|
||||
values: [
|
||||
[l('E', 'on'), l('S', 'on'),l('K'),l('I', 'on'),l('S', 'on'),l('T', 'on'),l('A'),m('F', 5, 25, 35, 55),m('Ü', 5, 25, 35, 55),m('N', 5, 25, 35, 55),m('F', 5, 25, 35, 55)],
|
||||
[m('Z', 10, 50), m('E', 10, 50),m('H', 10, 50),m('N', 10, 50),m('Z', 20, 40),m('W', 20, 40),m('A', 20, 40),m('N', 20, 40),m('Z', 20, 40),m('I', 20, 40),m('G', 20, 40)],
|
||||
[m('D', 45), m('R', 45),m('E', 45),m('I', 45),m('V', 15, 45),m('I', 15, 45),m('E', 15, 45),m('R', 15, 45),m('T', 15, 45),m('E', 15, 45),m('L', 15, 45)],
|
||||
[m('V', 25, 40, 50, 55), m('O', 25, 40, 50, 55),m('R', 25, 40, 50, 55),l('F'),l('U'),l('N'),l('K'),m('N', 5, 10, 15, 20, 35),m('A', 5, 10, 15, 20, 35),m('C', 5, 10, 15, 20, 35),m('H', 5, 10, 15, 20, 35)],
|
||||
[m('H', 25, 30, 35),m('A', 25, 30, 35),m('L', 25, 30, 35),m('B', 25, 30, 35),l('A'),h('E', 11),h('L', 11),h('F', 5, 11),h('Ü', 5),h('N', 5),h('F', 5)],
|
||||
[h('E', 1), h('I', 1),h('N', 1),h('S', 1),l('X'),l('A'),l('M'),h('Z', 2),h('W', 2),h('E', 2),h('I', 2)],
|
||||
[h('D', 3), h('R', 3),h('E', 3),h('I', 3),l('P'),l('M'),l('J'),h('V', 4),h('I', 4),h('E', 4),h('R', 4)],
|
||||
[h('S', 6), h('E', 6),h('C', 6),h('H', 6),h('S', 6),l('N'),l('L'),h('A', 8),h('C', 8),h('H', 8),h('T', 8)],
|
||||
[h('S', 7), h('I', 7),h('E', 7),h('B', 7),h('E', 7),h('N', 7),h('Z', 12),h('W', 12),h('Ö', 12),h('L', 12),h('F', 12)],
|
||||
[h('Z', 10), h('E', 10),h('H', 10),h('N', 9, 10),h('E', 9),h('U', 9),h('N', 9),l('K'),l('U'),l('H'),l('R')]
|
||||
]
|
||||
};
|
||||
window._uhr.languages['de'] = layout;
|
30
uhr-de_CH.js
30
uhr-de_CH.js
|
@ -1,30 +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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
var layout = {
|
||||
language: 'Bärndütsch',
|
||||
values: [
|
||||
[l('E', 'on'), l('S', 'on'),l('K'),l('I', 'on'),l('S', 'on'),l('C', 'on'),l('H', 'on'),l('A'),m('F', 5, 25, 35, 55),m('Ü', 5, 25, 35, 55),m('F', 5, 25, 35, 55)],
|
||||
[m('V', 15, 45), m('I', 15, 45),m('E', 15, 45),m('R', 15, 45),m('T', 15, 45),m('U', 15, 45),l('B'),l('F'),m('Z', 10, 50),m('Ä', 10, 50),m('Ä', 10, 50)],
|
||||
[m('Z', 20, 40), m('W', 20, 40),m('Ä', 20, 40),m('N', 20, 40),m('Z', 20, 40),m('G', 20, 40),l('S'),l('I'),m('V', 25, 40, 45, 50, 55),m('O', 25, 40, 45, 50, 55),m('R', 25, 40, 45, 50, 55)],
|
||||
[m('A', 5, 10, 15, 20, 35), m('B', 5, 10, 15, 20, 35),l('O'),m('H', 25, 30, 35),m('A', 25, 30, 35),m('U', 25, 30, 35),m('B', 25, 30, 35),m('I', 25, 30, 35),l('E'),l('G'),l('E')],
|
||||
[h('E', 1), h('I', 1),h('S', 1),h('Z', 2),h('W', 2),h('Ö', 2),h('I', 2),l('S'),h('D', 3),h('R', 3),h('Ü', 3)],
|
||||
[h('V', 4), h('I', 4),h('E', 4),h('R', 4),h('I', 4),h('F', 5),h('Ü', 5),h('F', 5),h('I', 5),l('Q'),l('T')],
|
||||
[h('S', 6), h('Ä', 6),h('C', 6),h('H', 6),h('S', 6),h('I', 6),h('S', 7),h('I', 7),h('B', 7),h('N', 7),h('I', 7)],
|
||||
[h('A', 8), h('C', 8),h('H', 8),h('T', 8),h('I', 8),h('N', 9),h('Ü', 9),h('N', 9),h('I', 9),l('E'),l('L')],
|
||||
[h('Z', 10), h('Ä', 10),h('N', 10),h('I', 10),l('E'),l('R'),l('B'),h('E', 11),h('U', 11),h('F', 11),h('I', 11)],
|
||||
[h('Z', 12), h('W', 12),h('Ö', 12),h('U', 12),h('F', 12),h('I', 12),l('N'),l('A'),l('U'),l('H'),l('R')]
|
||||
]
|
||||
};
|
||||
window._uhr.languages['de_CH'] = layout;
|
37
uhr-en.js
37
uhr-en.js
|
@ -1,37 +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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
var layout = {
|
||||
language: 'English',
|
||||
values: [
|
||||
[l('I', 'on'), l('T', 'on'),l('L'),l('I', 'on'),l('S', 'on'),l('B'),l('F'),l('A'),l('M'),l('P'),l('M')],
|
||||
[m('A', 15, 45), l('C'),m('Q', 15, 45),m('U', 15, 45),m('A', 15, 45),m('R', 15, 45),m('T', 15, 45),m('E', 15, 45),m('R', 15, 45),l('D'),l('C')],
|
||||
[m('T', 20, 25, 35, 40), m('W', 20, 25, 35, 40),m('E', 20, 25, 35, 40),m('N', 20, 25, 35, 40),m('T', 20, 25, 35, 40),m('Y', 20, 25, 35, 40),m('F', 5, 25, 35, 55),m('I', 5, 25, 35, 55),m('V', 5, 25, 35, 55),m('E', 5, 25, 35, 55),l('X')],
|
||||
[m('H', 30), m('A', 30),m('L', 30),m('F', 30),l('B'),m('T', 10, 50),m('E', 10, 50),m('N', 10, 50),l('F'),m('T', 35, 40, 45, 50, 55),m('O', 35, 40, 45, 50, 55)],
|
||||
[m('P', 5, 10, 15, 20, 25, 30),m('A', 5, 10, 15, 20, 25, 30),m('S', 5, 10, 15, 20, 25, 30),m('T', 5, 10, 15, 20, 25, 30),l('E'),l('R'),l('U'),h('N', 9),h('I', 9),h('N', 9),h('E', 9)],
|
||||
[h('O', 1), h('N', 1),h('E', 1),h('S', 6),h('I', 6),h('X', 6),h('T', 3),h('H', 3),h('R', 3),h('E', 3),h('E', 3)],
|
||||
[h('F', 4), h('O', 4),h('U', 4),h('R', 4),h('F', 5),h('I', 5),h('V', 5),h('E', 5),h('T', 2),h('W', 2),h('O', 2)],
|
||||
[h('E', 8), h('I', 8),h('G', 8),h('H', 8),h('T', 8),h('E', 11),h('L', 11),h('E', 11),h('V', 11),h('E', 11),h('N', 11)],
|
||||
[h('S', 7), h('E', 7),h('V', 7),h('E', 7),h('N', 7),h('T', 12),h('W', 12),h('E', 12),h('L', 12),h('V', 12),h('E', 12)],
|
||||
[h('T', 10), h('E', 10),h('N', 10),l('S'),l('E'),l('O', 'sharphour'),l('C', 'sharphour'),l('L', 'sharphour'),l('O', 'sharphour'),l('C', 'sharphour'),l('K', 'sharphour')]
|
||||
],
|
||||
getHour: function(date) {
|
||||
var hour = date.getHours();
|
||||
if (date.getMinutes() >= 35) {
|
||||
return hour + 1;
|
||||
}
|
||||
return hour;
|
||||
}
|
||||
};
|
||||
window._uhr.languages['en'] = layout;
|
175
uhr.css
175
uhr.css
|
@ -1,175 +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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@font-face {
|
||||
font-family: 'Uhrenfont';
|
||||
src: url('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;
|
||||
}
|
||||
#themeswitcher {
|
||||
}
|
||||
.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 {
|
||||
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 {
|
||||
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 {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch {
|
||||
right: 0px;
|
||||
}
|
||||
#disclaimer {
|
||||
font-size: 0.5em;
|
||||
}
|
||||
#disclaimer a {
|
||||
color: #444;
|
||||
text-decoration: underline;
|
||||
}
|
364
uhr.js
364
uhr.js
|
@ -1,364 +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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
(function($) {
|
||||
"use strict";
|
||||
|
||||
if (window._uhr !== undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
window._uhr = {
|
||||
id: 0,
|
||||
languages: new Array()
|
||||
};
|
||||
$.widget("fritteli.uhr", {
|
||||
options: {
|
||||
width: '100%',
|
||||
status: 'on',
|
||||
language: 'de_CH',
|
||||
theme: 'black',
|
||||
force: false,
|
||||
controls: true
|
||||
},
|
||||
start: function() {
|
||||
if (!this._isOn()) {
|
||||
var uhr = this;
|
||||
this._timer = window.setInterval(function() {
|
||||
uhr._update();
|
||||
}, 1000);
|
||||
this._update();
|
||||
$.cookie('uhr-status' + this._id, 'on', {expires: 365, path: '/'});
|
||||
} else {
|
||||
}
|
||||
},
|
||||
stop: function() {
|
||||
if(this._isOn()) {
|
||||
window.clearInterval(this._timer);
|
||||
this._timer = null;
|
||||
this._update();
|
||||
$.cookie('uhr-status' + this._id, 'off', {expires: 365, path: '/'});
|
||||
}
|
||||
},
|
||||
toggle: function() {
|
||||
if(this._isOn()) {
|
||||
this.stop();
|
||||
} else {
|
||||
this.start();
|
||||
}
|
||||
},
|
||||
language: function(languageKey) {
|
||||
if (languageKey !== this.options.language) {
|
||||
this.options.language = languageKey;
|
||||
var renderer = new UhrRenderer(this._language(), this.element.find('.letterarea'));
|
||||
var uhr = this;
|
||||
renderer.render(this, function() {
|
||||
uhr._currentMinute = -1;
|
||||
uhr._update();
|
||||
});
|
||||
$.cookie('uhr-language' + this._id, languageKey, {expires: 365, path: '/'});
|
||||
this._update();
|
||||
}
|
||||
},
|
||||
theme: function(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;
|
||||
$.cookie('uhr-theme' + this._id, theme, {expires: 365, path: '/'});
|
||||
}
|
||||
},
|
||||
time: function(time) {
|
||||
this.options.time = time;
|
||||
if (time == null) {
|
||||
this._currentMinute = -1;
|
||||
this._update();
|
||||
} else {
|
||||
if (this._timer != null) {
|
||||
window.clearInterval(this._timer);
|
||||
}
|
||||
var renderer = new UhrRenderer(this._language(), this.element.find('.letterarea'));
|
||||
var uhr = this;
|
||||
renderer.render(this, function() {
|
||||
uhr._show(time);
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
// private variables
|
||||
_id: -1,
|
||||
_timer: null,
|
||||
_currentMinute: -1,
|
||||
// private methods
|
||||
_isOn: function() {
|
||||
return this._timer !== null;
|
||||
},
|
||||
_update: function() {
|
||||
if (this._isOn()) {
|
||||
var time = new Date();
|
||||
if (time.getMinutes() == this._currentMinute) {
|
||||
return;
|
||||
}
|
||||
this._currentMinute = time.getMinutes();
|
||||
this._show(time);
|
||||
} else {
|
||||
this._clear();
|
||||
this._currentMinute = -1;
|
||||
}
|
||||
},
|
||||
_show: function(time) {
|
||||
var dotMinute = this._getDotMinute(time);
|
||||
var hour = this._getHour(time);
|
||||
var coarseMinute = this._getCoarseMinute(time);
|
||||
this._clear();
|
||||
this._highlight('on');
|
||||
for (var i = 1; i <= dotMinute; i++) {
|
||||
this._highlight('dot' + i);
|
||||
}
|
||||
this._highlight('minute' + coarseMinute);
|
||||
hour = this._normalizeHour(hour);
|
||||
this._highlight('hour' + hour);
|
||||
if (coarseMinute == 0) {
|
||||
this._highlight('sharphour');
|
||||
}
|
||||
},
|
||||
_language: function() {
|
||||
return window._uhr.languages[this.options.language];
|
||||
},
|
||||
_highlight: function(itemClass) {
|
||||
this.element.find('.item.' + itemClass).addClass('active');
|
||||
},
|
||||
_clear: function() {
|
||||
this.element.find('.item').removeClass('active');
|
||||
},
|
||||
_getHour: function(date) {
|
||||
if (typeof this._language().getHour === 'function') {
|
||||
return this._language().getHour(date);
|
||||
}
|
||||
var hour = date.getHours();
|
||||
if (date.getMinutes() >= 25) {
|
||||
return hour + 1;
|
||||
}
|
||||
return hour;
|
||||
},
|
||||
_getCoarseMinute: function(date) {
|
||||
if (typeof this._language().getCoarseMinute === 'function') {
|
||||
return this._language().getCoarseMinute(date);
|
||||
}
|
||||
var minutes = date.getMinutes();
|
||||
return minutes - this._getDotMinute(date);
|
||||
},
|
||||
_getDotMinute: function(date) {
|
||||
if (typeof this._language().getDotMinute === 'function') {
|
||||
return this._language().getDotMinute(date);
|
||||
}
|
||||
var minutes = date.getMinutes();
|
||||
return minutes % 5;
|
||||
},
|
||||
_normalizeHour: function(hour) {
|
||||
if (hour > 12) {
|
||||
hour %= 12;
|
||||
}
|
||||
if (hour == 0) {
|
||||
return 12;
|
||||
}
|
||||
return hour;
|
||||
},
|
||||
_create: function() {
|
||||
this._id = window._uhr.id++;
|
||||
this._setupHTML();
|
||||
this._wireFunctionality();
|
||||
if (this.options.time !== undefined) {
|
||||
this.time(this.options.time);
|
||||
}
|
||||
},
|
||||
_setupHTML: function() {
|
||||
var e = this.element;
|
||||
// Base clock area
|
||||
e.addClass('uhr');
|
||||
e.empty();
|
||||
e.append('<span class="item dot dot1"></span>');
|
||||
e.append('<span class="item dot dot2"></span>');
|
||||
e.append('<span class="item dot dot3"></span>');
|
||||
e.append('<span class="item dot dot4"></span>');
|
||||
e.append('<div class="letterarea"></div>');
|
||||
e.append('<div class="reflection"></div>');
|
||||
e.css('width', this.options.width);
|
||||
var realWidth = e.width()
|
||||
e.width(realWidth);
|
||||
e.height(realWidth);
|
||||
e.css('font-size', (realWidth / 40) + 'px');
|
||||
|
||||
if (this.options.controls) {
|
||||
// on/off switch
|
||||
var toggleSwitch = $('<div class="onoffswitch" id="uhr-onoffswitch' + this._id + '"></div>');
|
||||
toggleSwitch.append('<input type="checkbox" class="onoffswitch-checkbox" id="uhr-onoffswitch-checkbox' + this._id + '" checked="checked" />');
|
||||
toggleSwitch.append('<label class="onoffswitch-label" for="uhr-onoffswitch-checkbox' + this._id + '">'
|
||||
+ '<div class="onoffswitch-inner"></div>'
|
||||
+ '<div class="onoffswitch-switch"></div>'
|
||||
+ '</label>');
|
||||
e.after(toggleSwitch);
|
||||
|
||||
// language chooser
|
||||
var languageChooser = $('<select id="uhr-languagechooser' + this._id + '"></select>')
|
||||
for (var code in window._uhr.languages) {
|
||||
if (window._uhr.languages.hasOwnProperty(code)) {
|
||||
var language = window._uhr.languages[code];
|
||||
languageChooser.append('<option value="' + code + '">' + language.language + '</option>');
|
||||
}
|
||||
}
|
||||
e.after(languageChooser);
|
||||
|
||||
// theme chooser
|
||||
var themeChooser = $('<select id="uhr-themechooser' + this._id + '"></select>');
|
||||
themeChooser.append('<option value="black">Schwarz</option>');
|
||||
themeChooser.append('<option value="red">Rot</option>');
|
||||
themeChooser.append('<option value="blue">Blau</option>');
|
||||
themeChooser.append('<option value="green">Grün</option>');
|
||||
themeChooser.append('<option value="white">Weiss</option>');
|
||||
e.after(themeChooser);
|
||||
}
|
||||
},
|
||||
_wireFunctionality: function() {
|
||||
var e = this.element;
|
||||
var uhr = this;
|
||||
|
||||
// on/off switch
|
||||
var toggleSwitch = $('#uhr-onoffswitch-checkbox' + this._id);
|
||||
toggleSwitch.on('click', function() {
|
||||
uhr.toggle();
|
||||
});
|
||||
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();
|
||||
}
|
||||
|
||||
// language chooser
|
||||
var languageChooser = $('#uhr-languagechooser' + this._id);
|
||||
languageChooser.on('change', function() {
|
||||
uhr.language(this.value);
|
||||
});
|
||||
var selectedLanguage = $.cookie('uhr-language' + this._id);
|
||||
if (selectedLanguage == undefined || this.options.force) {
|
||||
selectedLanguage = this.options.language;
|
||||
}
|
||||
languageChooser.val(selectedLanguage);
|
||||
this.options.language = "";
|
||||
this.language(selectedLanguage);
|
||||
|
||||
// theme chooser
|
||||
var themeChooser = $('#uhr-themechooser' + this._id);
|
||||
themeChooser.on('change', function() {
|
||||
uhr.theme(this.value);
|
||||
});
|
||||
var selectedTheme = $.cookie('uhr-theme' + this._id);
|
||||
if (selectedTheme == undefined || this.options.force) {
|
||||
selectedTheme = this.options.theme;
|
||||
}
|
||||
themeChooser.val(selectedTheme);
|
||||
this.options.theme = "";
|
||||
this.theme(selectedTheme);
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
|
||||
/**
|
||||
* 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.layout = layout;
|
||||
this.renderarea = renderarea;
|
||||
}
|
||||
UhrRenderer.prototype.render = function(uhr, beforeshow) {
|
||||
var renderer = this;
|
||||
this.renderarea.fadeOut('fast', function() {
|
||||
renderer.renderarea.empty();
|
||||
for (var y = 0; y < renderer.layout.values.length; y++) {
|
||||
for (var x = 0; x < renderer.layout.values[y].length; x++) {
|
||||
var letter = renderer.layout.values[y][x];
|
||||
renderer.renderarea.append(letter.toString());
|
||||
}
|
||||
if (y < renderer.layout.values.length - 1) {
|
||||
renderer.renderarea.append('<br/>');
|
||||
}
|
||||
}
|
||||
if (typeof beforeshow === 'function') {
|
||||
beforeshow();
|
||||
}
|
||||
renderer.renderarea.fadeIn('fast');
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 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) {
|
||||
this.value = value;
|
||||
this.style = style || '';
|
||||
this.getStyle = function() {
|
||||
return 'item letter ' + style;
|
||||
}
|
||||
this.getValue = function() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
Letter.prototype.toString = function letterToString() {
|
||||
return '<span class="' + this.getStyle() + '">' + this.getValue() + '</span>';
|
||||
}
|
||||
/**
|
||||
* Hilfsfunktion, um einen Buchstaben zu erzeugen.
|
||||
*
|
||||
* @param letter string: Der Buchstabe, der angezeigt werden soll
|
||||
* @example l('I', 'is') erzeugt den Buchstaben 'I' mit der CSS-Styleklasse 'is'
|
||||
*/
|
||||
function l(letter, style) {
|
||||
return new Letter(letter, style);
|
||||
}
|
||||
/**
|
||||
* Hilfsfunktion, um einen Buchstaben zu erzeugen, der zu einem Stunden-Wort gehört.
|
||||
*
|
||||
* @param letter string: Der Buchstabe, der angezeigt werden soll
|
||||
* @param hours... integer: Eine Aufzählung von Stundenwerten, zu welchen der Buchstabe als aktiv angezeigt werden soll
|
||||
* @example h('Z', 2, 11) erzeugt den Buchstaben 'Z', der um 2:xx, 11:xx, 14:xx und 23:xx aktiv angezeigt wird
|
||||
*/
|
||||
function h(letter) {
|
||||
var style = '';
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
style += ' hour' + arguments[i];
|
||||
}
|
||||
return l(letter, style);
|
||||
}
|
||||
/**
|
||||
* Hilfsfunktion, um einen Buchstaben zu erzeugen, der zu einem Minuten-Wort gehört.
|
||||
*
|
||||
* @param letter string: Der Buchstabe, der angezeigt werden soll
|
||||
* @param minutes... integer: Eine Aufzählung von Minutenwerten, zu welchen der Buchstabe als aktiv angezeigt werden soll
|
||||
* @example m('A', 5, 10, 15, 20, 35) erzeugt den Buchstaben 'A' der um :05, :10, :15, :20 und :35 aktiv angezeigt wird
|
||||
*/
|
||||
function m(letter) {
|
||||
var style = '';
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
style += ' minute' + arguments[i];
|
||||
}
|
||||
return l(letter, style);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue