From b45b6bcaad970338b4db2f042d7c994c87deb7e2 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sat, 28 Jun 2014 14:34:20 +0200 Subject: [PATCH 01/16] use default cookie-path instead of / --- uhr.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/uhr.js b/uhr.js index a2e4e46..303fc92 100644 --- a/uhr.js +++ b/uhr.js @@ -57,7 +57,7 @@ along with this program. If not, see . uhr._update(); }, 1000); this._update(); - $.cookie('uhr-status' + this._id, 'on', {expires: 365, path: '/'}); + $.cookie('uhr-status' + this._id, 'on', {expires: 365}); } else { } }, @@ -66,7 +66,7 @@ along with this program. If not, see . window.clearInterval(this._timer); this._timer = null; this._update(); - $.cookie('uhr-status' + this._id, 'off', {expires: 365, path: '/'}); + $.cookie('uhr-status' + this._id, 'off', {expires: 365}); } }, toggle: function() { @@ -85,7 +85,7 @@ along with this program. If not, see . uhr._currentMinute = -1; uhr._update(); }); - $.cookie('uhr-language' + this._id, languageKey, {expires: 365, path: '/'}); + $.cookie('uhr-language' + this._id, languageKey, {expires: 365}); this._update(); } }, @@ -94,7 +94,7 @@ along with this program. If not, see . 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: '/'}); + $.cookie('uhr-theme' + this._id, theme, {expires: 365}); } }, time: function(time) { From d334101ae05b5f7b2598715120360fd6eeea8a14 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sat, 28 Jun 2014 14:36:46 +0200 Subject: [PATCH 02/16] updated version in manifest.appcache --- manifest.appcache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.appcache b/manifest.appcache index 90703e1..029c844 100644 --- a/manifest.appcache +++ b/manifest.appcache @@ -1,5 +1,5 @@ CACHE MANIFEST -# 5.1 +# 5.1.1 COPYING README.md From 135a180e128a3653ae6bdd3c3d38fa4ae2f99baf Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sat, 28 Jun 2014 14:41:30 +0200 Subject: [PATCH 03/16] make cookie path configurable --- uhr.js | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/uhr.js b/uhr.js index 303fc92..1f79bfb 100644 --- a/uhr.js +++ b/uhr.js @@ -57,7 +57,11 @@ along with this program. If not, see . uhr._update(); }, 1000); this._update(); - $.cookie('uhr-status' + this._id, 'on', {expires: 365}); + if (this.options.cookiePath !== undefined) { + $.cookie('uhr-status' + this._id, 'on', {expires: 365, path: this.options.cookiePath}); + } else { + $.cookie('uhr-status' + this._id, 'on', {expires: 365}); + } } else { } }, @@ -66,7 +70,11 @@ along with this program. If not, see . window.clearInterval(this._timer); this._timer = null; this._update(); - $.cookie('uhr-status' + this._id, 'off', {expires: 365}); + if (this.options.cookiePath !== undefined) { + $.cookie('uhr-status' + this._id, 'off', {expires: 365, path: this.options.cookiePath}); + } else { + $.cookie('uhr-status' + this._id, 'off', {expires: 365}); + } } }, toggle: function() { @@ -85,7 +93,11 @@ along with this program. If not, see . uhr._currentMinute = -1; uhr._update(); }); - $.cookie('uhr-language' + this._id, languageKey, {expires: 365}); + if (this.options.cookiePath !== undefined) { + $.cookie('uhr-language' + this._id, languageKey, {expires: 365, path: this.options.cookiePath}); + } else { + $.cookie('uhr-language' + this._id, languageKey, {expires: 365}); + } this._update(); } }, @@ -94,7 +106,11 @@ along with this program. If not, see . 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}); + if (this.options.cookiePath !== undefined) { + $.cookie('uhr-theme' + this._id, theme, {expires: 365, path: this.options.cookiePath}); + } else { + $.cookie('uhr-theme' + this._id, theme, {expires: 365}); + } } }, time: function(time) { From 75568578f67cc71514d5813f66ee11b005876cec Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sat, 28 Jun 2014 17:04:30 +0200 Subject: [PATCH 04/16] deleted commented old stuff --- manifest.appcache | 2 +- uhr-en.js | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/manifest.appcache b/manifest.appcache index b8ffb4b..72cb0b3 100644 --- a/manifest.appcache +++ b/manifest.appcache @@ -1,5 +1,5 @@ CACHE MANIFEST -# 6.0 +# 6.0.0.1 COPYING README.md diff --git a/uhr-en.js b/uhr-en.js index 51ea61f..58c7054 100644 --- a/uhr-en.js +++ b/uhr-en.js @@ -27,18 +27,6 @@ var h = { var layout = { "version": 2, "language": 'English', - /* - [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')] - */ "letters": [ 'ITLISBFAMPM', 'ACQUARTERDC', From f93083c1289c58da261c09f9d076782be3dcf0d6 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sat, 28 Jun 2014 22:03:35 +0200 Subject: [PATCH 05/16] preparing to support languages that make a difference between AM and PM --- uhr-de.js | 26 +++++++++++++------------- uhr-de_CH.js | 26 +++++++++++++------------- uhr-de_CH_genau.js | 26 +++++++++++++------------- uhr-en.js | 26 +++++++++++++------------- uhr.js | 13 ------------- 5 files changed, 52 insertions(+), 65 deletions(-) diff --git a/uhr-de.js b/uhr-de.js index 9ff1298..0ddf05f 100644 --- a/uhr-de.js +++ b/uhr-de.js @@ -37,7 +37,7 @@ var layout = { 'SECHSNLACHT', 'SIEBENZWÖLF', 'ZEHNEUNKUHR' - ], + ], "permanent": h._es_ist, "minutes": { "5,6,7,8,9": [h._5, h._nach], @@ -53,18 +53,18 @@ var layout = { "55,56,57,58,59": [h._5, h._vor] }, "hours": { - "1": {6:[1,2,3,4]}, - "2": {6:[8,9,10,11]}, - "3": {7:[1,2,3,4]}, - "4": {7:[8,9,10,11]}, - "5": {5:[8,9,10,11]}, - "6": {8:[1,2,3,4,5]}, - "7": {9:[1,2,3,4,5,6]}, - "8": {8:[8,9,10,11]}, - "9": {10:[4,5,6,7]}, - "10": {10:[1,2,3,4]}, - "11": {5:[6,7,8]}, - "12": {9:[7,8,9,10,11]} + "0,12": {9:[7,8,9,10,11]}, + "1,13": {6:[1,2,3,4]}, + "2,14": {6:[8,9,10,11]}, + "3,15": {7:[1,2,3,4]}, + "4,16": {7:[8,9,10,11]}, + "5,17": {5:[8,9,10,11]}, + "6,18": {8:[1,2,3,4,5]}, + "7,19": {9:[1,2,3,4,5,6]}, + "8,20": {8:[8,9,10,11]}, + "9,21": {10:[4,5,6,7]}, + "10,22": {10:[1,2,3,4]}, + "11,23": {5:[6,7,8]} } }; window,_uhr.register('de', layout); diff --git a/uhr-de_CH.js b/uhr-de_CH.js index d5d2bd3..a2d85c9 100644 --- a/uhr-de_CH.js +++ b/uhr-de_CH.js @@ -40,7 +40,7 @@ var layout = { 'ACHTINÜNIEL', 'ZÄNIERBEUFI', 'ZWÖUFINAUHR' - ], + ], // Permanent aktive Buchstaben. , vgl. ausführliche Beschreibung bei "minutes". "permanent": h._es_isch, /* @@ -78,18 +78,18 @@ var layout = { }, // Die Stunden; gleiches Format wie bei den Minuten "hours": { - "1": {5:[1,2,3]}, - "2": {5:[4,5,6,7]}, - "3": {5:[9,10,11]}, - "4": {6:[1,2,3,4,5]}, - "5": {6:[6,7,8,9]}, - "6": {7:[1,2,3,4,5,6]}, - "7": {7:[7,8,9,10,11]}, - "8": {8:[1,2,3,4,5]}, - "9": {8:[6,7,8,9]}, - "10": {9:[1,2,3,4]}, - "11": {9:[8,9,10,11]}, - "12": {10:[1,2,3,4,5,6]} + "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. diff --git a/uhr-de_CH_genau.js b/uhr-de_CH_genau.js index 32f98cd..7d396c3 100644 --- a/uhr-de_CH_genau.js +++ b/uhr-de_CH_genau.js @@ -37,7 +37,7 @@ var layout = { 'ACHTINÜNIEL', 'ZÄNIERBEUFI', 'ZWÖUFINAUHR' - ], + ], "permanent": h._es_isch, "minutes": { "0": h._genau, @@ -54,18 +54,18 @@ var layout = { "55,56,57,58,59": [h._5, h._vor] }, "hours": { - "1": {5:[1,2,3]}, - "2": {5:[4,5,6,7]}, - "3": {5:[9,10,11]}, - "4": {6:[1,2,3,4,5]}, - "5": {6:[6,7,8,9]}, - "6": {7:[1,2,3,4,5,6]}, - "7": {7:[7,8,9,10,11]}, - "8": {8:[1,2,3,4,5]}, - "9": {8:[6,7,8,9]}, - "10": {9:[1,2,3,4]}, - "11": {9:[8,9,10,11]}, - "12": {10:[1,2,3,4,5,6]} + "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]} } }; window,_uhr.register('de_CH_genau', layout); diff --git a/uhr-en.js b/uhr-en.js index 58c7054..fd5f344 100644 --- a/uhr-en.js +++ b/uhr-en.js @@ -38,7 +38,7 @@ var layout = { 'EIGHTELEVEN', 'SEVENTWELVE', 'TENSEOCLOCK' - ], + ], "permanent": h._it_is, "minutes": { "0,1,2,3,4": h._o_clock, @@ -55,18 +55,18 @@ var layout = { "55,56,57,58,59": [h._5, h._to] }, "hours": { - "1": {6:[1,2,3]}, - "2": {7:[9,10,11]}, - "3": {6:[7,8,9,10,11]}, - "4": {7:[1,2,3,4]}, - "5": {7:[5,6,7,8]}, - "6": {6:[4,5,6]}, - "7": {9:[1,2,3,4,5]}, - "8": {8:[1,2,3,4,5]}, - "9": {5:[8,9,10,11]}, - "10": {10:[1,2,3]}, - "11": {8:[6,7,8,9,10,11]}, - "12": {9:[6,7,8,9,10,11]} + "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(); diff --git a/uhr.js b/uhr.js index 76ae549..a1a58a6 100644 --- a/uhr.js +++ b/uhr.js @@ -151,11 +151,7 @@ along with this program. If not, see . this._highlight('dot' + i); } this._highlight('minute' + coarseMinute); - hour = this._normalizeHour(hour); this._highlight('hour' + hour); - if (coarseMinute == 0) { - this._highlight('sharphour'); - } }, _language: function() { for (var i = 0; i < window._uhr.languages.length; i++) { @@ -196,15 +192,6 @@ along with this program. If not, see . 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++; var userTime = this.options.time; From f7defa96d5b9cb280180a1d93ed0c9efc3671c28 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sat, 28 Jun 2014 22:04:24 +0200 Subject: [PATCH 06/16] added french layout --- uhr-fr.js | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 uhr-fr.js diff --git a/uhr-fr.js b/uhr-fr.js new file mode 100644 index 0000000..bf19885 --- /dev/null +++ b/uhr-fr.js @@ -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 . +*/ +var h = { + "_il_est": {1:[1,2,4,5,6]}, + "_et": {8:[1,2]}, + "_moins": {7:[1,2,3,4,5]}, + "_demie": {10:[4,5,6,7,8]}, + "_heures": {6:[6,7,8,9,10,11]}, + "_le": {7:[7,8]}, + "_5": {9:[7,8,9,10]}, + "_10": {7:[9,10,11]}, + "_15": {8:[4,5,6,7,8]}, + "_20": {9:[1,2,3,4,5]}, + "_25": {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": h._il_est, + "minutes": { + "5,6,7,8,9": h._5, + "10,11,12,13,14": h._10, + "15,16,17,18,19": [h._et, h._15], + "20,21,22,23,24": h._20, + "25,26,27,28,29": h._25, + "30,31,32,33,34": [h._et, h._demie], + "35,36,37,38,39": [h._moins, h._25], + "40,41,42,43,44": [h._moins, h._20], + "45,46,47,48,49": [h._moins, h._le, h._15], + "50,51,52,53,54": [h._moins, h._10], + "55,56,57,58,59": [h._moins, h._5] + }, + "hours": { + "0": {5:[6,7,8,9,10,11]}, + "1,13": [{3:[5,6,7]}, h._heures], + "2,14": [{1:[8,9,10,11]}, h._heures], + "3,15": [{2:[7,8,9,10,11]}, h._heures], + "4,16": [{2:[1,2,3,4,5,6]}, h._heures], + "5,17": [{4:[8,9,10,11]}, h._heures], + "6,18": [{4:[5,6,7]}, h._heures], + "7,19": [{3:[8,9,10,11]}, h._heures], + "8,20": [{4:[1,2,3,4]}, h._heures], + "9,21": [{3:[1,2,3,4]}, h._heures], + "10,22": [{5:[3,4,5]}, h._heures], + "11,23": [{6:[1,2,3,4]}, h._heures], + "12": {5:[1,2,3,4]} + }, + "getHour": function(date) { + var hour = date.getHours(); + if (date.getMinutes() >= 35) { + return hour + 1; + } + return hour; + } +}; +window,_uhr.register('fr', layout); From a378f45470b7eac142e8ad8c45d9bdcc436e8b66 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sat, 28 Jun 2014 22:06:15 +0200 Subject: [PATCH 07/16] activate french in the showcase and update manifest --- manifest.appcache | 3 ++- showcase/index.html | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/manifest.appcache b/manifest.appcache index 72cb0b3..db0f8b0 100644 --- a/manifest.appcache +++ b/manifest.appcache @@ -1,5 +1,5 @@ CACHE MANIFEST -# 6.0.0.1 +# 6.0.1 COPYING README.md @@ -15,6 +15,7 @@ uhr-de.js uhr-de_CH.js uhr-de_CH_genau.js uhr-en.js +uhr-fr.js uhr-green.css uhr-pink.css uhr-red.css diff --git a/showcase/index.html b/showcase/index.html index 549bb20..211ca88 100644 --- a/showcase/index.html +++ b/showcase/index.html @@ -43,6 +43,7 @@ along with this program. If not, see . + + + + + + + +
+

Created by fritteli, inspired by QLOCKTWO. Read more! - View full showcase!

+ + + + + + + + + diff --git a/uhr.js b/uhr.js index a1a58a6..af451aa 100644 --- a/uhr.js +++ b/uhr.js @@ -35,7 +35,7 @@ along with this program. If not, see . } }; // auto-detect themes - var styleSheets = $('head link[rel=stylesheet]'); + var styleSheets = $('link[rel=stylesheet]'); for (var i = 0; i < styleSheets.length; i++) { var styleSheet = $(styleSheets[i]); var styleClass = styleSheet.attr('data-class'); From 065d9a28532b367a4d516fbd3c79cafbedf427b9 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sat, 28 Jun 2014 23:12:54 +0200 Subject: [PATCH 12/16] update manifest version --- manifest.appcache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.appcache b/manifest.appcache index 7c0a0d0..57166d8 100644 --- a/manifest.appcache +++ b/manifest.appcache @@ -1,5 +1,5 @@ CACHE MANIFEST -# 6.1.1 +# 6.1.2 COPYING README.md From 4811367f46f666cb27ae0c4645f496cbc19afd36 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sat, 28 Jun 2014 23:14:09 +0200 Subject: [PATCH 13/16] deleted test.html --- test.html | 90 ------------------------------------------------------- 1 file changed, 90 deletions(-) delete mode 100644 test.html diff --git a/test.html b/test.html deleted file mode 100644 index f6cf045..0000000 --- a/test.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - Bärneruhr - TEST - - - - - - - - - - - - - - - - - - - - - -
-

Created by fritteli, inspired by QLOCKTWO. Read more! - View full showcase!

- - - - - - - - - From c890429dd6c0357d0eeebd7938bb8a915cca4e80 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sat, 28 Jun 2014 23:27:41 +0200 Subject: [PATCH 14/16] consider the path when setting a cookie, but make it overridable with the configuration parameter 'cookiePath'. --- uhr.js | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/uhr.js b/uhr.js index d2c6f3c..94e2280 100644 --- a/uhr.js +++ b/uhr.js @@ -68,11 +68,7 @@ along with this program. If not, see . uhr._update(); }, 1000); this._update(); - if (this.options.cookiePath !== undefined) { - $.cookie('uhr-status' + this._id, 'on', {expires: 365, path: this.options.cookiePath}); - } else { - $.cookie('uhr-status' + this._id, 'on', {expires: 365}); - } + this._setCookie('uhr-status', 'on'); } else { } }, @@ -81,11 +77,7 @@ along with this program. If not, see . window.clearInterval(this._timer); this._timer = null; this._update(); - if (this.options.cookiePath !== undefined) { - $.cookie('uhr-status' + this._id, 'off', {expires: 365, path: this.options.cookiePath}); - } else { - $.cookie('uhr-status' + this._id, 'off', {expires: 365}); - } + this._setCookie('uhr-status', 'off'); } }, toggle: function() { @@ -104,11 +96,7 @@ along with this program. If not, see . uhr._currentMinute = -1; uhr._update(); }); - if (this.options.cookiePath !== undefined) { - $.cookie('uhr-language' + this._id, languageKey, {expires: 365, path: this.options.cookiePath}); - } else { - $.cookie('uhr-language' + this._id, languageKey, {expires: 365}); - } + this._setCookie('uhr-language', languageKey); this._update(); } }, @@ -117,11 +105,7 @@ along with this program. If not, see . this.element.removeClass(this.options.theme).addClass(theme); $('#uhr-onoffswitch' + this._id).removeClass(this.options.theme).addClass(theme); this.options.theme = theme; - if (this.options.cookiePath !== undefined) { - $.cookie('uhr-theme' + this._id, theme, {expires: 365, path: this.options.cookiePath}); - } else { - $.cookie('uhr-theme' + this._id, theme, {expires: 365}); - } + this._setCookie('uhr-theme', theme); } }, time: function(time) { @@ -343,6 +327,15 @@ along with this program. If not, see . themeChooser.val(selectedTheme); this.options.theme = ""; this.theme(selectedTheme); + }, + _setCookie: function(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); } }); /** From 719a2a83430ca7ac134b1aaa0f7297ba4a34f7d9 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sat, 28 Jun 2014 23:31:47 +0200 Subject: [PATCH 15/16] update manifest version --- manifest.appcache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.appcache b/manifest.appcache index 57166d8..577fdf4 100644 --- a/manifest.appcache +++ b/manifest.appcache @@ -1,5 +1,5 @@ CACHE MANIFEST -# 6.1.2 +# 6.2 COPYING README.md From 340669c5ebb735736c423b4a195edca7e5c1e993 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Sat, 28 Jun 2014 23:46:12 +0200 Subject: [PATCH 16/16] fixed 24h bug --- manifest.appcache | 2 +- uhr-en.js | 2 +- uhr-fr.js | 3 ++- uhr-it.js | 2 +- uhr.js | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/manifest.appcache b/manifest.appcache index 577fdf4..201ee99 100644 --- a/manifest.appcache +++ b/manifest.appcache @@ -1,5 +1,5 @@ CACHE MANIFEST -# 6.2 +# 6.2.1 COPYING README.md diff --git a/uhr-en.js b/uhr-en.js index fd5f344..4ababd1 100644 --- a/uhr-en.js +++ b/uhr-en.js @@ -71,7 +71,7 @@ var layout = { "getHour": function(date) { var hour = date.getHours(); if (date.getMinutes() >= 35) { - return hour + 1; + return (hour + 1) % 24; } return hour; } diff --git a/uhr-fr.js b/uhr-fr.js index bf19885..cf0bbce 100644 --- a/uhr-fr.js +++ b/uhr-fr.js @@ -1,3 +1,4 @@ + /* 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 @@ -72,7 +73,7 @@ var layout = { "getHour": function(date) { var hour = date.getHours(); if (date.getMinutes() >= 35) { - return hour + 1; + return (hour + 1) % 24; } return hour; } diff --git a/uhr-it.js b/uhr-it.js index 26ad717..6666a0a 100644 --- a/uhr-it.js +++ b/uhr-it.js @@ -70,7 +70,7 @@ var layout = { "getHour": function(date) { var hour = date.getHours(); if (date.getMinutes() >= 35) { - return hour + 1; + return (hour + 1) % 24; } return hour; } diff --git a/uhr.js b/uhr.js index 94e2280..21196a2 100644 --- a/uhr.js +++ b/uhr.js @@ -175,7 +175,7 @@ along with this program. If not, see . } var hour = date.getHours(); if (date.getMinutes() >= 25) { - return hour + 1; + return (hour + 1) % 24; } return hour; },