wrap the layout definitions in immediately executing anonymous functions

This commit is contained in:
Manuel Friedli 2014-07-03 20:37:34 +02:00
parent 85b5670dfc
commit 3d0245abfa
7 changed files with 440 additions and 395 deletions

View file

@ -12,8 +12,9 @@ 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/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
'use strict'; (function () {
var h = { 'use strict';
var h = {
"_es_ist": {1:[1,2,4,5,6]}, "_es_ist": {1:[1,2,4,5,6]},
"_nach": {4:[8,9,10,11]}, "_nach": {4:[8,9,10,11]},
"_vor": {4:[1,2,3]}, "_vor": {4:[1,2,3]},
@ -23,8 +24,8 @@ var h = {
"_15": {3:[5,6,7,8,9,10,11]}, "_15": {3:[5,6,7,8,9,10,11]},
"_20": {2:[5,6,7,8,9,10,11]}, "_20": {2:[5,6,7,8,9,10,11]},
"_45": {3:[1,2,3,4,5,6,7,8,9,10,11]} "_45": {3:[1,2,3,4,5,6,7,8,9,10,11]}
}; };
var layout = { var layout = {
"version": 2, "version": 2,
"language": 'Deutsch', "language": 'Deutsch',
"letters": [ "letters": [
@ -67,5 +68,6 @@ var layout = {
"10,22": {10:[1,2,3,4]}, "10,22": {10:[1,2,3,4]},
"11,23": {5:[6,7,8]} "11,23": {5:[6,7,8]}
} }
}; };
$.fritteli.uhr.register('de', layout); $.fritteli.uhr.register('de', layout);
}());

View file

@ -12,19 +12,20 @@ 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/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
'use strict'; (function () {
'use strict';
// hilfsvariablen // hilfsvariablen
var h = { var h = {
"_es_isch": {1:[1,2,4,5,6,7]}, "_es_isch": {1: [1, 2, 4, 5, 6, 7]},
"_ab": {4:[1,2]}, "_ab": {4: [1, 2]},
"_vor": {3:[9,10,11]}, "_vor": {3: [9, 10, 11]},
"_haubi": {4:[4,5,6,7,8]}, "_haubi": {4: [4, 5, 6, 7, 8]},
"_5": {1:[9,10,11]}, "_5": {1: [9, 10, 11]},
"_10": {2:[9,10,11]}, "_10": {2: [9, 10, 11]},
"_15": {2:[1,2,3,4,5,6]}, "_15": {2: [1, 2, 3, 4, 5, 6]},
"_20": {3:[1,2,3,4,5,6]} "_20": {3: [1, 2, 3, 4, 5, 6]}
}; };
var layout = { var layout = {
// version: zur Zeit immer 2 (Pflichtattribut) // version: zur Zeit immer 2 (Pflichtattribut)
"version": 2, "version": 2,
// Sprechender Name der Sprache // Sprechender Name der Sprache
@ -79,19 +80,20 @@ var layout = {
}, },
// Die Stunden; gleiches Format wie bei den Minuten // Die Stunden; gleiches Format wie bei den Minuten
"hours": { "hours": {
"0,12": {10:[1,2,3,4,5,6]}, "0,12": {10: [1, 2, 3, 4, 5, 6]},
"1,13": {5:[1,2,3]}, "1,13": {5: [1, 2, 3]},
"2,14": {5:[4,5,6,7]}, "2,14": {5: [4, 5, 6, 7]},
"3,15": {5:[9,10,11]}, "3,15": {5: [9, 10, 11]},
"4,16": {6:[1,2,3,4,5]}, "4,16": {6: [1, 2, 3, 4, 5]},
"5,17": {6:[6,7,8,9]}, "5,17": {6: [6, 7, 8, 9]},
"6,18": {7:[1,2,3,4,5,6]}, "6,18": {7: [1, 2, 3, 4, 5, 6]},
"7,19": {7:[7,8,9,10,11]}, "7,19": {7: [7, 8, 9, 10, 11]},
"8,20": {8:[1,2,3,4,5]}, "8,20": {8: [1, 2, 3, 4, 5]},
"9,21": {8:[6,7,8,9]}, "9,21": {8: [6, 7, 8, 9]},
"10,22": {9:[1,2,3,4]}, "10,22": {9: [1, 2, 3, 4]},
"11,23": {9:[8,9,10,11]} "11,23": {9: [8, 9, 10, 11]}
} }
}; };
// Das Layout bei der Uhr unter dem Code "de_CH" registrieren. // Das Layout bei der Uhr unter dem Code "de_CH" registrieren.
$.fritteli.uhr.register('de_CH', layout); $.fritteli.uhr.register('de_CH', layout);
}());

View file

@ -12,19 +12,20 @@ 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/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
'use strict'; (function () {
var h = { 'use strict';
"_es_isch": {1:[1,2,4,5,6,7]}, var h = {
"_genau": {3:[7,8,9,10,11]}, "_es_isch": {1: [1, 2, 4, 5, 6, 7]},
"_ab": {4:[4,5]}, "_genau": {3: [7, 8, 9, 10, 11]},
"_vor": {4:[1,2,3]}, "_ab": {4: [4, 5]},
"_haubi": {4:[7,8,9,10,11]}, "_vor": {4: [1, 2, 3]},
"_5": {1:[9,10,11]}, "_haubi": {4: [7, 8, 9, 10, 11]},
"_10": {2:[9,10,11]}, "_5": {1: [9, 10, 11]},
"_15": {2:[1,2,3,4,5,6]}, "_10": {2: [9, 10, 11]},
"_20": {3:[1,2,3,4,5,6]} "_15": {2: [1, 2, 3, 4, 5, 6]},
}; "_20": {3: [1, 2, 3, 4, 5, 6]}
var layout = { };
var layout = {
"version": 2, "version": 2,
"language": 'Bärndütsch (genau)', "language": 'Bärndütsch (genau)',
"letters": [ "letters": [
@ -55,18 +56,19 @@ var layout = {
"55,56,57,58,59": [h._5, h._vor] "55,56,57,58,59": [h._5, h._vor]
}, },
"hours": { "hours": {
"0,12": {10:[1,2,3,4,5,6]}, "0,12": {10: [1, 2, 3, 4, 5, 6]},
"1,13": {5:[1,2,3]}, "1,13": {5: [1, 2, 3]},
"2,14": {5:[4,5,6,7]}, "2,14": {5: [4, 5, 6, 7]},
"3,15": {5:[9,10,11]}, "3,15": {5: [9, 10, 11]},
"4,16": {6:[1,2,3,4,5]}, "4,16": {6: [1, 2, 3, 4, 5]},
"5,17": {6:[6,7,8,9]}, "5,17": {6: [6, 7, 8, 9]},
"6,18": {7:[1,2,3,4,5,6]}, "6,18": {7: [1, 2, 3, 4, 5, 6]},
"7,19": {7:[7,8,9,10,11]}, "7,19": {7: [7, 8, 9, 10, 11]},
"8,20": {8:[1,2,3,4,5]}, "8,20": {8: [1, 2, 3, 4, 5]},
"9,21": {8:[6,7,8,9]}, "9,21": {8: [6, 7, 8, 9]},
"10,22": {9:[1,2,3,4]}, "10,22": {9: [1, 2, 3, 4]},
"11,23": {9:[8,9,10,11]} "11,23": {9: [8, 9, 10, 11]}
} }
}; };
$.fritteli.uhr.register('de_CH_genau', layout); $.fritteli.uhr.register('de_CH_genau', layout);
}());

View file

@ -12,20 +12,21 @@ 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/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
'use strict'; (function () {
var h = { 'use strict';
"_it_is": {1:[1,2,4,5]}, var h = {
"_half": {4:[1,2,3,4]}, "_it_is": {1: [1, 2, 4, 5]},
"_to": {4:[10,11]}, "_half": {4: [1, 2, 3, 4]},
"_past": {5:[1,2,3,4]}, "_to": {4: [10, 11]},
"_o_clock": {10:[6,7,8,9,10,11]}, "_past": {5: [1, 2, 3, 4]},
"_5": {3:[7,8,9,10]}, "_o_clock": {10: [6, 7, 8, 9, 10, 11]},
"_10": {4:[6,7,8]}, "_5": {3: [7, 8, 9, 10]},
"_15": {2:[1,3,4,5,6,7,8,9]}, "_10": {4: [6, 7, 8]},
"_20": {3:[1,2,3,4,5,6]}, "_15": {2: [1, 3, 4, 5, 6, 7, 8, 9]},
"_25": {3:[1,2,3,4,5,6,7,8,9,10]} "_20": {3: [1, 2, 3, 4, 5, 6]},
}; "_25": {3: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}
var layout = { };
var layout = {
"version": 2, "version": 2,
"language": 'English', "language": 'English',
"letters": [ "letters": [
@ -56,25 +57,26 @@ var layout = {
"55,56,57,58,59": [h._5, h._to] "55,56,57,58,59": [h._5, h._to]
}, },
"hours": { "hours": {
"0,12": {9:[6,7,8,9,10,11]}, "0,12": {9: [6, 7, 8, 9, 10, 11]},
"1,13": {6:[1,2,3]}, "1,13": {6: [1, 2, 3]},
"2,14": {7:[9,10,11]}, "2,14": {7: [9, 10, 11]},
"3,15": {6:[7,8,9,10,11]}, "3,15": {6: [7, 8, 9, 10, 11]},
"4,16": {7:[1,2,3,4]}, "4,16": {7: [1, 2, 3, 4]},
"5,17": {7:[5,6,7,8]}, "5,17": {7: [5, 6, 7, 8]},
"6,18": {6:[4,5,6]}, "6,18": {6: [4, 5, 6]},
"7,19": {9:[1,2,3,4,5]}, "7,19": {9: [1, 2, 3, 4, 5]},
"8,20": {8:[1,2,3,4,5]}, "8,20": {8: [1, 2, 3, 4, 5]},
"9,21": {5:[8,9,10,11]}, "9,21": {5: [8, 9, 10, 11]},
"10,22": {10:[1,2,3]}, "10,22": {10: [1, 2, 3]},
"11,23": {8:[6,7,8,9,10,11]} "11,23": {8: [6, 7, 8, 9, 10, 11]}
}, },
"getHour": function(date) { "getHour": function (date) {
var hour = date.getHours(); var hour = date.getHours();
if (date.getMinutes() >= 35) { if (date.getMinutes() >= 35) {
return (hour + 1) % 24; return (hour + 1) % 24;
} }
return hour; return hour;
} }
}; };
$.fritteli.uhr.register('en', layout); $.fritteli.uhr.register('en', layout);
}());

View file

@ -13,21 +13,22 @@ 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/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
'use strict'; (function () {
var h = { 'use strict';
"_il_est": {1:[1,2,4,5,6]}, var h = {
"_et": {8:[1,2]}, "_il_est": {1: [1, 2, 4, 5, 6]},
"_moins": {7:[1,2,3,4,5]}, "_et": {8: [1, 2]},
"_demie": {10:[4,5,6,7,8]}, "_moins": {7: [1, 2, 3, 4, 5]},
"_heures": {6:[6,7,8,9,10,11]}, "_demie": {10: [4, 5, 6, 7, 8]},
"_le": {7:[7,8]}, "_heures": {6: [6, 7, 8, 9, 10, 11]},
"_5": {9:[7,8,9,10]}, "_le": {7: [7, 8]},
"_10": {7:[9,10,11]}, "_5": {9: [7, 8, 9, 10]},
"_15": {8:[4,5,6,7,8]}, "_10": {7: [9, 10, 11]},
"_20": {9:[1,2,3,4,5]}, "_15": {8: [4, 5, 6, 7, 8]},
"_25": {9:[1,2,3,4,5,6,7,8,9,10]} "_20": {9: [1, 2, 3, 4, 5]},
}; "_25": {9: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}
var layout = { };
var layout = {
"version": 2, "version": 2,
"language": 'Français', "language": 'Français',
"letters": [ "letters": [
@ -57,26 +58,60 @@ var layout = {
"55,56,57,58,59": [h._moins, h._5] "55,56,57,58,59": [h._moins, h._5]
}, },
"hours": { "hours": {
"0": {5:[6,7,8,9,10,11]}, "0": {5: [6, 7, 8, 9, 10, 11]},
"1,13": [{3:[5,6,7]}, h._heures], "1,13": [
"2,14": [{1:[8,9,10,11]}, h._heures], {3: [5, 6, 7]},
"3,15": [{2:[7,8,9,10,11]}, h._heures], h._heures
"4,16": [{2:[1,2,3,4,5,6]}, h._heures], ],
"5,17": [{4:[8,9,10,11]}, h._heures], "2,14": [
"6,18": [{4:[5,6,7]}, h._heures], {1: [8, 9, 10, 11]},
"7,19": [{3:[8,9,10,11]}, h._heures], h._heures
"8,20": [{4:[1,2,3,4]}, h._heures], ],
"9,21": [{3:[1,2,3,4]}, h._heures], "3,15": [
"10,22": [{5:[3,4,5]}, h._heures], {2: [7, 8, 9, 10, 11]},
"11,23": [{6:[1,2,3,4]}, h._heures], h._heures
"12": {5:[1,2,3,4]} ],
"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) { "getHour": function (date) {
var hour = date.getHours(); var hour = date.getHours();
if (date.getMinutes() >= 35) { if (date.getMinutes() >= 35) {
return (hour + 1) % 24; return (hour + 1) % 24;
} }
return hour; return hour;
} }
}; };
$.fritteli.uhr.register('fr', layout); $.fritteli.uhr.register('fr', layout);
}());

View file

@ -12,20 +12,21 @@ 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/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
'use strict'; (function () {
var h = { 'use strict';
"_sono_le": {1:[1,2,3,4,6,7]}, var h = {
"_e_l": {2:[1,3,4]}, "_sono_le": {1: [1, 2, 3, 4, 6, 7]},
"_e": {8:[1]}, "_e_l": {2: [1, 3, 4]},
"_meno": {7:[8,9,10,11]}, "_e": {8: [1]},
"_mezza": {10:[7,8,9,10,11]}, "_meno": {7: [8, 9, 10, 11]},
"_5": {9:[6,7,8,9,10,11]}, "_mezza": {10: [7, 8, 9, 10, 11]},
"_10": {10:[1,2,3,4,5]}, "_5": {9: [6, 7, 8, 9, 10, 11]},
"_un_quarto": {8:[3,4,6,7,8,9,10,11]}, "_10": {10: [1, 2, 3, 4, 5]},
"_20": {9:[1,2,3,4,5]}, "_un_quarto": {8: [3, 4, 6, 7, 8, 9, 10, 11]},
"_25": {9:[1,2,3,4,5,6,7,8,9,10,11]} "_20": {9: [1, 2, 3, 4, 5]},
}; "_25": {9: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]}
var layout = { };
var layout = {
"version": 2, "version": 2,
"language": 'Italiano', "language": 'Italiano',
"letters": [ "letters": [
@ -55,25 +56,26 @@ var layout = {
"55,56,57,58,59": [h._meno, h._5] "55,56,57,58,59": [h._meno, h._5]
}, },
"hours": { "hours": {
"0,12": [h._sono_le, {5:[1,2,3,4,5,6]}], "0,12": [h._sono_le, {5: [1, 2, 3, 4, 5, 6]}],
"1,13": [h._e_l, {2:[5,6,7]}], "1,13": [h._e_l, {2: [5, 6, 7]}],
"2,14": [h._sono_le, {2:[9,10,11]}], "2,14": [h._sono_le, {2: [9, 10, 11]}],
"3,15": [h._sono_le, {3:[1,2,3]}], "3,15": [h._sono_le, {3: [1, 2, 3]}],
"4,16": [h._sono_le, {6:[1,2,3,4,5,6,7]}], "4,16": [h._sono_le, {6: [1, 2, 3, 4, 5, 6, 7]}],
"5,17": [h._sono_le, {7:[1,2,3,4,5,6]}], "5,17": [h._sono_le, {7: [1, 2, 3, 4, 5, 6]}],
"6,18": [h._sono_le, {6:[9,10,11]}], "6,18": [h._sono_le, {6: [9, 10, 11]}],
"7,19": [h._sono_le, {5:[7,8,9,10,11]}], "7,19": [h._sono_le, {5: [7, 8, 9, 10, 11]}],
"8,20": [h._sono_le, {3:[4,5,6,7]}], "8,20": [h._sono_le, {3: [4, 5, 6, 7]}],
"9,21": [h._sono_le, {3:[8,9,10,11]}], "9,21": [h._sono_le, {3: [8, 9, 10, 11]}],
"10,22": [h._sono_le, {4:[1,2,3,4,5]}], "10,22": [h._sono_le, {4: [1, 2, 3, 4, 5]}],
"11,23": [h._sono_le, {4:[6,7,8,9,10,11]}] "11,23": [h._sono_le, {4: [6, 7, 8, 9, 10, 11]}]
}, },
"getHour": function(date) { "getHour": function (date) {
var hour = date.getHours(); var hour = date.getHours();
if (date.getMinutes() >= 35) { if (date.getMinutes() >= 35) {
return (hour + 1) % 24; return (hour + 1) % 24;
} }
return hour; return hour;
} }
}; };
$.fritteli.uhr.register('it', layout); $.fritteli.uhr.register('it', layout);
}());