96 lines
3.0 KiB
TypeScript
96 lines
3.0 KiB
TypeScript
/*
|
|
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/>.
|
|
*/
|
|
|
|
import {Layout, WordDefinition} from '../domain/layout';
|
|
|
|
const sonoLe: WordDefinition = {1: [1, 2, 3, 4, 6, 7]};
|
|
const eL: WordDefinition = {2: [1, 3, 4]};
|
|
const e: WordDefinition = {8: [1]};
|
|
const meno: WordDefinition = {7: [8, 9, 10, 11]};
|
|
const mezza: WordDefinition = {10: [7, 8, 9, 10, 11]};
|
|
const cinque: WordDefinition = {9: [6, 7, 8, 9, 10, 11]};
|
|
const dieci: WordDefinition = {10: [1, 2, 3, 4, 5]};
|
|
const unQuarto: WordDefinition = {8: [3, 4, 6, 7, 8, 9, 10, 11]};
|
|
const venti: WordDefinition = {9: [1, 2, 3, 4, 5]};
|
|
const venticinque: WordDefinition = {9: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]};
|
|
|
|
export const LayoutIt: Layout = {
|
|
code: 'it',
|
|
getHour: (time: Date): number => {
|
|
const hour = time.getHours();
|
|
if (time.getMinutes() >= 35) {
|
|
return (hour + 1) % 24;
|
|
}
|
|
return hour;
|
|
},
|
|
hours: {
|
|
'0,12': [sonoLe, {5: [1, 2, 3, 4, 5, 6]}],
|
|
'1,13': [eL, {2: [5, 6, 7]}],
|
|
'2,14': [sonoLe, {2: [9, 10, 11]}],
|
|
'3,15': [sonoLe, {3: [1, 2, 3]}],
|
|
'4,16': [sonoLe, {6: [1, 2, 3, 4, 5, 6, 7]}],
|
|
'5,17': [sonoLe, {7: [1, 2, 3, 4, 5, 6]}],
|
|
'6,18': [sonoLe, {6: [9, 10, 11]}],
|
|
'7,19': [sonoLe, {5: [7, 8, 9, 10, 11]}],
|
|
'8,20': [sonoLe, {3: [4, 5, 6, 7]}],
|
|
'9,21': [sonoLe, {3: [8, 9, 10, 11]}],
|
|
'10,22': [sonoLe, {4: [1, 2, 3, 4, 5]}],
|
|
'11,23': [sonoLe, {4: [6, 7, 8, 9, 10, 11]}]
|
|
},
|
|
letters: [
|
|
'SONORLEBORE',
|
|
'ÈRL\'UNASDUE',
|
|
'TREOTTONOVE',
|
|
'DIECIUNDICI',
|
|
'DODICISETTE',
|
|
'QUATTROCSEI',
|
|
'CINQUEAMENO',
|
|
'ECUNOQUARTO',
|
|
'VENTICINQUE',
|
|
'DIECIPMEZZA'
|
|
],
|
|
minutes: {
|
|
'5,6,7,8,9': [e, cinque],
|
|
'10,11,12,13,14': [e, dieci],
|
|
'15,16,17,18,19': [e, unQuarto],
|
|
'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, unQuarto],
|
|
'50,51,52,53,54': [meno, dieci],
|
|
'55,56,57,58,59': [meno, cinque]
|
|
},
|
|
permanent: null,
|
|
prettyName: 'Italiano',
|
|
version: 2
|
|
};
|
|
|
|
declare namespace Fritteli {
|
|
interface Fritteli {
|
|
uhr: Uhr;
|
|
}
|
|
|
|
interface Uhr {
|
|
register: (layout: Layout) => void;
|
|
}
|
|
}
|
|
declare namespace $ {
|
|
const fritteli: Fritteli.Fritteli;
|
|
}
|
|
|
|
$.fritteli.uhr.register(LayoutIt);
|