Upstream version 11.40.271.0
[platform/framework/web/crosswalk.git] / src / third_party / google_input_tools / src / chrome / os / inputview / config / dk_data.js
1 // Copyright 2014 The ChromeOS IME Authors. All Rights Reserved.
2 // limitations under the License.
3 // See the License for the specific language governing permissions and
4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5 // distributed under the License is distributed on an "AS-IS" BASIS,
6 // Unless required by applicable law or agreed to in writing, software
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // You may obtain a copy of the License at
11 // you may not use this file except in compliance with the License.
12 // Licensed under the Apache License, Version 2.0 (the "License");
13 //
14 goog.require('i18n.input.chrome.inputview.content.ContextlayoutUtil');
15 goog.require('i18n.input.chrome.inputview.content.compact.letter');
16 goog.require('i18n.input.chrome.inputview.content.compact.more');
17 goog.require('i18n.input.chrome.inputview.content.compact.numberpad');
18 goog.require('i18n.input.chrome.inputview.content.compact.symbol');
19 goog.require('i18n.input.chrome.inputview.content.compact.util');
20 goog.require('i18n.input.chrome.inputview.content.util');
21 goog.require('i18n.input.chrome.message.ContextType');
22
23 (function() {
24   var ContextType = i18n.input.chrome.message.ContextType;
25   var viewIdPrefix_ = '102kbd-k-';
26
27   var keyCharacters = [
28     ['\u00bd', '\u00a7', '\u00be', '\u00b6'], // TLDE
29     ['\u0031', '\u0021', '\u00a1', '\u00b9'], // AE01
30     ['\u0032', '\u0022', '\u0040', '\u00b2'], // AE02
31     ['\u0033', '\u0023', '\u00a3', '\u00b3'], // AE03
32     ['\u0034', '\u00a4', '\u0024', '\u00bc'], // AE04
33     ['\u0035', '\u0025', '\u00bd', '\u00a2'], // AE05
34     ['\u0036', '\u0026', '\u00a5', '\u215d'], // AE06
35     ['\u0037', '\u002f', '\u007b', '\u00f7'], // AE07
36     ['\u0038', '\u0028', '\u005b', '\u00ab'], // AE08
37     ['\u0039', '\u0029', '\u005d', '\u00bb'], // AE09
38     ['\u0030', '\u003d', '\u007d', '\u00b0'], // AE10
39     ['\u002b', '\u003f', '\u00b1', '\u00bf'], // AE11
40     ['\u0301', '\u0300', '\u007c', '\u00a6'], // AE12
41     ['\u0071', '\u0051', '\u0040', '\u03a9'], // AD01
42     ['\u0077', '\u0057', '\u0142', '\u0141'], // AD02
43     ['\u0065', '\u0045', '\u20ac', '\u00a2'], // AD03
44     ['\u0072', '\u0052', '\u00ae', '\u00ae'], // AD04
45     ['\u0074', '\u0054', '\u00fe', '\u00de'], // AD05
46     ['\u0079', '\u0059', '\u2190', '\u00a5'], // AD06
47     ['\u0075', '\u0055', '\u2193', '\u2191'], // AD07
48     ['\u0069', '\u0049', '\u2192', '\u0131'], // AD08
49     ['\u006f', '\u004f', '\u0153', '\u0152'], // AD09
50     ['\u0070', '\u0050', '\u00fe', '\u00de'], // AD10
51     ['\u00e5', '\u00c5', '\u0308', '\u030a'], // AD11
52     ['\u0308', '\u0302', '\u0303', '\u030c'], // AD12
53     ['\u0061', '\u0041', '\u00aa', '\u00ba'], // AC01
54     ['\u0073', '\u0053', '\u00df', '\u00a7'], // AC02
55     ['\u0064', '\u0044', '\u00f0', '\u00d0'], // AC03
56     ['\u0066', '\u0046', '\u0111', '\u00aa'], // AC04
57     ['\u0067', '\u0047', '\u014b', '\u014a'], // AC05
58     ['\u0068', '\u0048', '\u0127', '\u0126'], // AC06
59     ['\u006a', '\u004a', '\u0309', '\u031b'], // AC07
60     ['\u006b', '\u004b', '\u0138', '\u0026'], // AC08
61     ['\u006c', '\u004c', '\u0142', '\u0141'], // AC09
62     ['\u00e6', '\u00c6', '\u0301', '\u030b'], // AC10
63     ['\u00f8', '\u00d8', '\u0302', '\u030c'], // AC11
64     ['\u0027', '\u002a', '\u030b', '\u00d7'], // BKSL
65     ['\u003c', '\u003e', '\u005c', '\u00ac'], // LSGT
66     ['\u007a', '\u005a', '\u00ab', '\u003c'], // AB01
67     ['\u0078', '\u0058', '\u00bb', '\u003e'], // AB02
68     ['\u0063', '\u0043', '\u00a9', '\u00a9'], // AB03
69     ['\u0076', '\u0056', '\u201c', '\u2018'], // AB04
70     ['\u0062', '\u0042', '\u201d', '\u2019'], // AB05
71     ['\u006e', '\u004e'], // AB06
72     ['\u006d', '\u004d', '\u00b5', '\u00ba'], // AB07
73     ['\u002c', '\u003b', '\u0327', '\u0328'], // AB08
74     ['\u002e', '\u003a', '\u00b7', '\u0307'], // AB09
75     ['\u002d', '\u005f', '\u0323', '\u0307'], // AB10
76     ['\u0020', '\u0020'] // SPCE
77   ];
78
79   var keyCodes = [
80     0xDC, // TLDE
81     0x31, // AE01
82     0x32, // AE02
83     0x33, // AE03
84     0x34, // AE04
85     0x35, // AE05
86     0x36, // AE06
87     0x37, // AE07
88     0x38, // AE08
89     0x39, // AE09
90     0x30, // AE10
91     0xBB, // AE11
92     0xDB, // AE12
93     0x51, // AD01
94     0x57, // AD02
95     0x45, // AD03
96     0x52, // AD04
97     0x54, // AD05
98     0x59, // AD06
99     0x55, // AD07
100     0x49, // AD08
101     0x4F, // AD09
102     0x50, // AD10
103     0xDD, // AD11
104     0xBA, // AD12
105     0x41, // AC01
106     0x53, // AC02
107     0x44, // AC03
108     0x46, // AC04
109     0x47, // AC05
110     0x48, // AC06
111     0x4A, // AC07
112     0x4B, // AC08
113     0x4C, // AC09
114     0xC0, // AC10
115     0xDE, // AC11
116     0xBF, // BKSL
117     0xE2, // LTGT
118     0x5A, // AB01
119     0x58, // AB02
120     0x43, // AB03
121     0x56, // AB04
122     0x42, // AB05
123     0x4E, // AB06
124     0x4D, // AB07
125     0xBC, // AB08
126     0xBE, // AB09
127     0xBD, // AB10
128     0x20  // SPCE
129   ];
130
131   var data = i18n.input.chrome.inputview.content.util.createData(
132       keyCharacters, viewIdPrefix_, true, true, keyCodes, 'dk.compact.qwerty');
133   data['id'] = 'dk';
134   google.ime.chrome.inputview.onConfigLoaded(data);
135
136   var keysetSpecNode =
137       i18n.input.chrome.inputview.content.compact.util.CompactKeysetSpec;
138   var letterKeysetSpec = {};
139   letterKeysetSpec[keysetSpecNode.ID] = 'dk.compact.qwerty';
140   letterKeysetSpec[keysetSpecNode.LAYOUT] = 'compactkbd-nordic';
141   letterKeysetSpec[keysetSpecNode.DATA] =
142       i18n.input.chrome.inputview.content.compact.letter.keyDenmarkCharacters();
143
144   var symbolKeysetSpec = {};
145   symbolKeysetSpec[keysetSpecNode.ID] = 'dk.compact.symbol';
146   symbolKeysetSpec[keysetSpecNode.LAYOUT] = 'compactkbd-qwerty';
147   symbolKeysetSpec[keysetSpecNode.DATA] = i18n.input.chrome.inputview.content.
148       compact.symbol.keyEUSymbolCharacters();
149
150   var moreKeysetSpec = {};
151   moreKeysetSpec[keysetSpecNode.ID] = 'dk.compact.more';
152   moreKeysetSpec[keysetSpecNode.LAYOUT] = 'compactkbd-qwerty';
153   moreKeysetSpec[keysetSpecNode.DATA] =
154       i18n.input.chrome.inputview.content.compact.more.keyEUMoreCharacters();
155
156   i18n.input.chrome.inputview.content.compact.util.generateCompactKeyboard(
157       letterKeysetSpec, symbolKeysetSpec, moreKeysetSpec,
158       google.ime.chrome.inputview.onConfigLoaded);
159
160   var inputTypeToKeysetSpecMap = {};
161
162   var numberKeysetSpec = {};
163   numberKeysetSpec[keysetSpecNode.ID] = 'dk.compact.numberpad';
164   numberKeysetSpec[keysetSpecNode.LAYOUT] = 'compactkbd-numberpad';
165   numberKeysetSpec[keysetSpecNode.DATA] = i18n.input.chrome.inputview.content.
166       compact.numberpad.keyNumberpadCharacters();
167   inputTypeToKeysetSpecMap[ContextType.NUMBER] = numberKeysetSpec;
168
169   var phoneKeysetSpec = {};
170   phoneKeysetSpec[keysetSpecNode.ID] = 'dk.compact.phonepad';
171   phoneKeysetSpec[keysetSpecNode.LAYOUT] = 'compactkbd-numberpad';
172   phoneKeysetSpec[keysetSpecNode.DATA] = i18n.input.chrome.inputview.content.
173       compact.numberpad.keyPhonepadCharacters();
174   inputTypeToKeysetSpecMap[ContextType.PHONE] = phoneKeysetSpec;
175
176   i18n.input.chrome.inputview.content.ContextlayoutUtil.generateContextLayouts(
177       inputTypeToKeysetSpecMap, google.ime.chrome.inputview.onConfigLoaded);
178 }) ();