Rev 3548 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3548 | Rev 5484 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /* ******************************************************************** |
1 | /* ******************************************************************** |
2 | ********************************************************************** |
2 | ********************************************************************** |
3 | * HTML Virtual Keyboard Interface Script - v1. |
3 | * HTML Virtual Keyboard Interface Script - v1.49 |
4 | * Copyright (c) |
4 | * Copyright (c) 2011 - GreyWyvern |
5 | * |
5 | * |
6 | * - Licenced for free distribution under the BSDL |
6 | * - Licenced for free distribution under the BSDL |
7 | * http://www.opensource.org/licenses/bsd-license.php |
7 | * http://www.opensource.org/licenses/bsd-license.php |
8 | * |
8 | * |
9 | * Add a script-driven keyboard interface to text fields, password |
9 | * Add a script-driven keyboard interface to text fields, password |
10 | * fields and textareas. |
10 | * fields and textareas. |
11 | * |
11 | * |
12 | * See http://www.greywyvern.com/code/javascript/keyboard for examples |
12 | * See http://www.greywyvern.com/code/javascript/keyboard for examples |
13 | * and usage instructions. |
13 | * and usage instructions. |
14 | * |
14 | * |
15 | * Version 1. |
15 | * Version 1.49 - November 8, 2011 |
16 | * - Added Dingbats and Misc. Symbols layouts |
- | |
17 | * - Keyboard closes if a non-active form element is clicked |
- | |
18 | * - |
16 | * - Don't display language drop-down if only one keyboard available |
19 | * |
17 | * |
20 | * See full changelog at: |
18 | * See full changelog at: |
21 | * http://www.greywyvern.com/code/javascript/keyboard.changelog.txt |
19 | * http://www.greywyvern.com/code/javascript/keyboard.changelog.txt |
22 | * |
20 | * |
23 | * Keyboard Credits |
21 | * Keyboard Credits |
- | 22 | * - Yiddish (Yidish Lebt) keyboard layout by Simche Taub (jidysz.net) |
|
- | 23 | * - Urdu Phonetic keyboard layout by Khalid Malik |
|
- | 24 | * - Yiddish keyboard layout by Helmut Wollmersdorfer |
|
24 | * - Khmer keyboard layout by Sovann Heng (km-kh.com) |
25 | * - Khmer keyboard layout by Sovann Heng (km-kh.com) |
25 | * - Dari keyboard layout by Saif Fazel |
26 | * - Dari keyboard layout by Saif Fazel |
26 | * - Kurdish keyboard layout by Ara Qadir |
27 | * - Kurdish keyboard layout by Ara Qadir |
27 | * - Assamese keyboard layout by Kanchan Gogoi |
28 | * - Assamese keyboard layout by Kanchan Gogoi |
28 | * - Bulgarian BDS keyboard layout by Milen Georgiev |
29 | * - Bulgarian BDS keyboard layout by Milen Georgiev |
Line 52... | Line 53... | ||
52 | * - Turkish keyboard layouts by offcu |
53 | * - Turkish keyboard layouts by offcu |
53 | * - Dutch and US Int'l keyboard layouts by jerone |
54 | * - Dutch and US Int'l keyboard layouts by jerone |
54 | * |
55 | * |
55 | */ |
56 | */ |
56 | var VKI_attach, VKI_close; |
57 | var VKI_attach, VKI_close; |
57 | (function |
58 | (function() { |
58 | var self = this; |
59 | var self = this; |
59 | 60 | ||
60 | this.VKI_version = "1. |
61 | this.VKI_version = "1.49"; |
61 | this.VKI_showVersion = true; |
62 | this.VKI_showVersion = true; |
62 | this.VKI_target = false; |
63 | this.VKI_target = false; |
63 | this.VKI_shift = this.VKI_shiftlock = false; |
64 | this.VKI_shift = this.VKI_shiftlock = false; |
64 | this.VKI_altgr = this.VKI_altgrlock = false; |
65 | this.VKI_altgr = this.VKI_altgrlock = false; |
65 | this.VKI_dead = false; |
66 | this.VKI_dead = false; |
Line 72... | Line 73... | ||
72 | this.VKI_size = 2; // Default keyboard size (1-5) |
73 | this.VKI_size = 2; // Default keyboard size (1-5) |
73 | this.VKI_sizeAdj = true; // Allow user to adjust keyboard size |
74 | this.VKI_sizeAdj = true; // Allow user to adjust keyboard size |
74 | this.VKI_clearPasswords = false; // Clear password fields on focus |
75 | this.VKI_clearPasswords = false; // Clear password fields on focus |
75 | this.VKI_imageURI = "scripts/js/keyboard/keyboard.png"; // If empty string, use imageless mode |
76 | this.VKI_imageURI = "scripts/js/keyboard/keyboard.png"; // If empty string, use imageless mode |
76 | this.VKI_clickless = 0; // 0 = disabled, > 0 = delay in ms |
77 | this.VKI_clickless = 0; // 0 = disabled, > 0 = delay in ms |
- | 78 | this.VKI_activeTab = 0; // Tab moves to next: 1 = element, 2 = keyboard enabled element |
|
- | 79 | this.VKI_enterSubmit = true; // Submit forms when Enter is pressed |
|
77 | this.VKI_keyCenter = 3; |
80 | this.VKI_keyCenter = 3; |
78 | 81 | ||
79 | this.VKI_isIE = /*@cc_on!@*/false; |
82 | this.VKI_isIE = /*@cc_on!@*/false; |
80 | this.VKI_isIE6 = /*@if(@_jscript_version == 5.6)!@end@*/false; |
83 | this.VKI_isIE6 = /*@if(@_jscript_version == 5.6)!@end@*/false; |
81 | this.VKI_isIElt8 = /*@if(@_jscript_version < 5.8)!@end@*/false; |
84 | this.VKI_isIElt8 = /*@if(@_jscript_version < 5.8)!@end@*/false; |
Line 161... | Line 164... | ||
161 | [[" ", " ", " ", " "], ["Alt", "Alt"]] |
164 | [[" ", " ", " ", " "], ["Alt", "Alt"]] |
162 | ], 'lang': ["ar"] }; |
165 | ], 'lang': ["ar"] }; |
163 | 166 | ||
164 | this.VKI_layout['\u0985\u09b8\u09ae\u09c0\u09df\u09be'] = { |
167 | this.VKI_layout['\u0985\u09b8\u09ae\u09c0\u09df\u09be'] = { |
165 | 'name': "Assamese", 'keys': [ |
168 | 'name': "Assamese", 'keys': [ |
166 | [["+", "?"], ["\u09E7", "{", "\u09E7"], ["\u09E8", "}", "\u09E8"], ["\u09E9", "\u09CD\u09F0", "\u09E9"], ["\u09EA", "\u09F0\u09CD", "\u09EA"], ["\u09EB", "\u099C\u09CD\u09F0", "\u09EB"], ["\u09EC", "", "\u09EC"], ["\u09ED", "\u0995\u09CD\u09F0", "\u09ED"], ["\u09EE", "\u09B6\u09CD\u09F0", "\u09EE"], ["\u09EF", "(", "\u09EF"], ["\u09E6", ")", "\u09E6"], ["-", ""], ["\u09C3", "\u098B", "\u09E2", "\u09E0"], ["Bksp", "Bksp"]], |
169 | [["+", "?"], ["\u09E7", "{", "\u09E7"], ["\u09E8", "}", "\u09E8"], ["\u09E9", "\u09CD\u09F0", "\u09E9"], ["\u09EA", "\u09F0\u09CD", "\u09EA"], ["\u09EB", "\u099C\u09CD\u09F0", "\u09EB"], ["\u09EC", "\u0995\u09CD\u09B7", "\u09EC"], ["\u09ED", "\u0995\u09CD\u09F0", "\u09ED"], ["\u09EE", "\u09B6\u09CD\u09F0", "\u09EE"], ["\u09EF", "(", "\u09EF"], ["\u09E6", ")", "\u09E6"], ["-", ""], ["\u09C3", "\u098B", "\u09E2", "\u09E0"], ["Bksp", "Bksp"]], |
167 | [["Tab", "Tab"], ["\u09CC", "\u0994", "\u09D7"], ["\u09C8", "\u0990"], ["\u09BE", "\u0986"], ["\u09C0", "\u0988", "\u09E3", "\u09E1"], ["\u09C2", "\u098A"], ["\u09F1", "\u09AD"], ["\u09B9", "\u0999"], ["\u0997", "\u0998"], ["\u09A6", "\u09A7"], ["\u099C", "\u099D"], ["\u09A1", "\u09A2", "\u09DC", "\u09DD"], ["Enter", "Enter"]], |
170 | [["Tab", "Tab"], ["\u09CC", "\u0994", "\u09D7"], ["\u09C8", "\u0990"], ["\u09BE", "\u0986"], ["\u09C0", "\u0988", "\u09E3", "\u09E1"], ["\u09C2", "\u098A"], ["\u09F1", "\u09AD"], ["\u09B9", "\u0999"], ["\u0997", "\u0998"], ["\u09A6", "\u09A7"], ["\u099C", "\u099D"], ["\u09A1", "\u09A2", "\u09DC", "\u09DD"], ["Enter", "Enter"]], |
168 | [["Caps", "Caps"], ["\u09CB", "\u0993", "\u09F4", "\u09F5"], ["\u09C7", "\u098F", "\u09F6", "\u09F7"], ["\u09CD", "\u0985", "\u09F8", "\u09F9"], ["\u09BF", "\u0987", "\u09E2", "\u098C"], ["\u09C1", "\u0989"], ["\u09AA", "\u09AB"], ["\u09F0", "", "\u09F0", "\u09F1"], ["\u0995", "\u0996"], ["\u09A4", "\u09A5"], ["\u099A", "\u099B"], ["\u099F", "\u09A0"], ["\u09BC", "\u099E"]], |
171 | [["Caps", "Caps"], ["\u09CB", "\u0993", "\u09F4", "\u09F5"], ["\u09C7", "\u098F", "\u09F6", "\u09F7"], ["\u09CD", "\u0985", "\u09F8", "\u09F9"], ["\u09BF", "\u0987", "\u09E2", "\u098C"], ["\u09C1", "\u0989"], ["\u09AA", "\u09AB"], ["\u09F0", "", "\u09F0", "\u09F1"], ["\u0995", "\u0996"], ["\u09A4", "\u09A5"], ["\u099A", "\u099B"], ["\u099F", "\u09A0"], ["\u09BC", "\u099E"]], |
169 | [["Shift", "Shift"], ["\u09CE", "\u0983"], ["\u0982", "\u0981", "\u09FA"], ["\u09AE", "\u09A3"], ["\u09A8", "\u09F7"], ["\u09AC", "\""], ["\u09B2", "'"], ["\u09B8", "\u09B6"], [",", "\u09B7"], [".", ";"], ["\u09AF", "\u09DF"], ["Shift", "Shift"]], |
172 | [["Shift", "Shift"], ["\u09CE", "\u0983"], ["\u0982", "\u0981", "\u09FA"], ["\u09AE", "\u09A3"], ["\u09A8", "\u09F7"], ["\u09AC", "\""], ["\u09B2", "'"], ["\u09B8", "\u09B6"], [",", "\u09B7"], [".", ";"], ["\u09AF", "\u09DF"], ["Shift", "Shift"]], |
170 | [[" ", " ", " ", " "], ["AltGr", "AltGr"]] |
173 | [[" ", " ", " ", " "], ["AltGr", "AltGr"]] |
171 | ], 'lang': ["as"] }; |
174 | ], 'lang': ["as"] }; |
Line 344... | Line 347... | ||
344 | this.VKI_layout['\u0641\u0627\u0631\u0633\u06cc'] = { |
347 | this.VKI_layout['\u0641\u0627\u0631\u0633\u06cc'] = { |
345 | 'name': "Farsi", 'keys': [ |
348 | 'name': "Farsi", 'keys': [ |
346 | [["\u067e", "\u0651 "], ["1", "!", "\u00a1", "\u00b9"], ["2", "@", "\u00b2"], ["3", "#", "\u00b3"], ["4", "$", "\u00a4", "\u00a3"], ["5", "%", "\u20ac"], ["6", "^", "\u00bc"], ["7", "&", "\u00bd"], ["8", "*", "\u00be"], ["9", "(", "\u2018"], ["0", ")", "\u2019"], ["-", "_", "\u00a5"], ["=", "+", "\u00d7", "\u00f7"], ["Bksp", "Bksp"]], |
349 | [["\u067e", "\u0651 "], ["1", "!", "\u00a1", "\u00b9"], ["2", "@", "\u00b2"], ["3", "#", "\u00b3"], ["4", "$", "\u00a4", "\u00a3"], ["5", "%", "\u20ac"], ["6", "^", "\u00bc"], ["7", "&", "\u00bd"], ["8", "*", "\u00be"], ["9", "(", "\u2018"], ["0", ")", "\u2019"], ["-", "_", "\u00a5"], ["=", "+", "\u00d7", "\u00f7"], ["Bksp", "Bksp"]], |
347 | [["Tab", "Tab"], ["\u0636", "\u064e"], ["\u0635", "\u064b"], ["\u062b", "\u064f"], ["\u0642", "\u064c"], ["\u0641", "\u0644"], ["\u063a", "\u0625"], ["\u0639", "\u2018"], ["\u0647", "\u00f7"], ["\u062e", "\u00d7"], ["\u062d", "\u061b"], ["\u062c", "<"], ["\u0686", ">"], ["\u0698", "|"]], |
350 | [["Tab", "Tab"], ["\u0636", "\u064e"], ["\u0635", "\u064b"], ["\u062b", "\u064f"], ["\u0642", "\u064c"], ["\u0641", "\u0644"], ["\u063a", "\u0625"], ["\u0639", "\u2018"], ["\u0647", "\u00f7"], ["\u062e", "\u00d7"], ["\u062d", "\u061b"], ["\u062c", "<"], ["\u0686", ">"], ["\u0698", "|"]], |
348 | [["Caps", "Caps"], ["\u0634", "\u0650"], ["\u0633", "\u064d"], ["\u064a", "]"], ["\u0628", "["], ["\u0644", "\u0644"], ["\u0627", "\u0623"], ["\u062a", "\u0640"], ["\u0646", "\u060c"], ["\u0645", "\\"], ["\u06af", ":"], ["\u0643", '"'], ["Enter", "Enter"]], |
351 | [["Caps", "Caps"], ["\u0634", "\u0650"], ["\u0633", "\u064d"], ["\u064a", "]"], ["\u0628", "["], ["\u0644", "\u0644"], ["\u0627", "\u0623"], ["\u062a", "\u0640"], ["\u0646", "\u060c"], ["\u0645", "\\"], ["\u06af", ":"], ["\u0643", '"'], ["Enter", "Enter"]], |
349 | [["Shift", "Shift"], ["\u |
352 | [["Shift", "Shift"], ["\u0638", "~"], ["\u0637", "\u0652"], ["\u0632", "}"], ["\u0631", "{"], ["\u0630", "\u0644"], ["\u062f", "\u0622"], ["\u0626", "\u0621"], ["\u0648", ","], [".", "."], ["/", "\u061f"], ["Shift", "Shift"]], |
350 | [[" ", " ", " ", " "], ["Alt", "Alt"]] |
353 | [[" ", " ", " ", " "], ["Alt", "Alt"]] |
351 | ], 'lang': ["fa"] }; |
354 | ], 'lang': ["fa"] }; |
352 | 355 | ||
353 | this.VKI_layout['F\u00f8royskt'] = { |
356 | this.VKI_layout['F\u00f8royskt'] = { |
354 | 'name': "Faeroese", 'keys': [ |
357 | 'name': "Faeroese", 'keys': [ |
Line 735... | Line 738... | ||
735 | 738 | ||
736 | this.VKI_layout['Sloven\u010dina'] = { |
739 | this.VKI_layout['Sloven\u010dina'] = { |
737 | 'name': "Slovak", 'keys': [ |
740 | 'name': "Slovak", 'keys': [ |
738 | [[";", "\u00b0"], ["+", "1", "~"], ["\u013E", "2", "\u02C7"], ["\u0161", "3", "^"], ["\u010D", "4", "\u02D8"], ["\u0165", "5", "\u00B0"], ["\u017E", "6", "\u02DB"], ["\u00FD", "7", "`"], ["\u00E1", "8", "\u02D9"], ["\u00ED", "9", "\u00B4"], ["\u00E9", "0", "\u02DD"], ["=", "%", "\u00A8"], ["\u00B4", "\u02c7", "\u00B8"], ["Bksp", "Bksp"]], |
741 | [[";", "\u00b0"], ["+", "1", "~"], ["\u013E", "2", "\u02C7"], ["\u0161", "3", "^"], ["\u010D", "4", "\u02D8"], ["\u0165", "5", "\u00B0"], ["\u017E", "6", "\u02DB"], ["\u00FD", "7", "`"], ["\u00E1", "8", "\u02D9"], ["\u00ED", "9", "\u00B4"], ["\u00E9", "0", "\u02DD"], ["=", "%", "\u00A8"], ["\u00B4", "\u02c7", "\u00B8"], ["Bksp", "Bksp"]], |
739 | [["Tab", "Tab"], ["q", "Q", "\\"], ["w", "W", "|"], ["e", "E", "\u20AC"], ["r", "R"], ["t", "T"], ["z", "Z"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P", "'"], ["\u00FA", "/", "\u00F7"], ["\u00E4", "(", "\u00D7"], ["\u0148", ")", "\u00A4"]], |
742 | [["Tab", "Tab"], ["q", "Q", "\\"], ["w", "W", "|"], ["e", "E", "\u20AC"], ["r", "R"], ["t", "T"], ["z", "Z"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P", "'"], ["\u00FA", "/", "\u00F7"], ["\u00E4", "(", "\u00D7"], ["\u0148", ")", "\u00A4"]], |
740 | [["Caps", "Caps"], ["a", "A"], ["s", "S", "\u0111"], ["d", "D", "\u0110"], ["f", "F", "["], ["g", "G", "]"], ["h", "H"], ["j", "J"], ["k", "K", "\u0142"], ["l", "L", "\u0141"], ["\u00F4", '"', "$"], ["\u00A7", "!", "\u00DF" |
743 | [["Caps", "Caps"], ["a", "A"], ["s", "S", "\u0111"], ["d", "D", "\u0110"], ["f", "F", "["], ["g", "G", "]"], ["h", "H"], ["j", "J"], ["k", "K", "\u0142"], ["l", "L", "\u0141"], ["\u00F4", '"', "$"], ["\u00A7", "!", "\u00DF"], ["Enter", "Enter"]], |
741 | [["Shift", "Shift"], ["&", "*", "<"], ["y", "Y", ">"], ["x", "X", "#"], ["c", "C", "&"], ["v", "V", "@"], ["b", "B", "{"], ["n", "N", "}"], ["m", "M"], [",", "?", "<"], [".", ":", ">"], ["-", "_", "*", ], ["Shift", "Shift"]], |
744 | [["Shift", "Shift"], ["&", "*", "<"], ["y", "Y", ">"], ["x", "X", "#"], ["c", "C", "&"], ["v", "V", "@"], ["b", "B", "{"], ["n", "N", "}"], ["m", "M"], [",", "?", "<"], [".", ":", ">"], ["-", "_", "*", ], ["Shift", "Shift"]], |
742 | [[" ", " ", " ", " "], ["AltGr", "AltGr"]] |
745 | [[" ", " ", " ", " "], ["AltGr", "AltGr"]] |
743 | ], 'lang': ["sk"] }; |
746 | ], 'lang': ["sk"] }; |
744 | 747 | ||
745 | this.VKI_layout['Sloven\u0161\u010dina'] = { |
748 | this.VKI_layout['Sloven\u0161\u010dina'] = { |
Line 891... | Line 894... | ||
891 | [["Tab", "Tab"], ["\u0637", "\u0638"], ["\u0635", "\u0636"], ["\u06be", "\u0630"], ["\u062f", "\u0688"], ["\u0679", "\u062B"], ["\u067e", "\u0651"], ["\u062a", "\u06C3"], ["\u0628", "\u0640"], ["\u062c", "\u0686"], ["\u062d", "\u062E"], ["]", "}"], ["[", "{"], ["\\", "|"]], |
894 | [["Tab", "Tab"], ["\u0637", "\u0638"], ["\u0635", "\u0636"], ["\u06be", "\u0630"], ["\u062f", "\u0688"], ["\u0679", "\u062B"], ["\u067e", "\u0651"], ["\u062a", "\u06C3"], ["\u0628", "\u0640"], ["\u062c", "\u0686"], ["\u062d", "\u062E"], ["]", "}"], ["[", "{"], ["\\", "|"]], |
892 | [["Caps", "Caps"], ["\u0645", "\u0698"], ["\u0648", "\u0632"], ["\u0631", "\u0691"], ["\u0646", "\u06BA"], ["\u0644", "\u06C2"], ["\u06c1", "\u0621"], ["\u0627", "\u0622"], ["\u06A9", "\u06AF"], ["\u06CC", "\u064A"], ["\u061b", ":"], ["'", '"'], ["Enter", "Enter"]], |
895 | [["Caps", "Caps"], ["\u0645", "\u0698"], ["\u0648", "\u0632"], ["\u0631", "\u0691"], ["\u0646", "\u06BA"], ["\u0644", "\u06C2"], ["\u06c1", "\u0621"], ["\u0627", "\u0622"], ["\u06A9", "\u06AF"], ["\u06CC", "\u064A"], ["\u061b", ":"], ["'", '"'], ["Enter", "Enter"]], |
893 | [["Shift", "Shift"], ["\u0642", "\u200D"], ["\u0641", "\u200C"], ["\u06D2", "\u06D3"], ["\u0633", "\u200E"], ["\u0634", "\u0624"], ["\u063a", "\u0626"], ["\u0639", "\u200F"], ["\u060C", ">"], ["\u06D4", "<"], ["/", "\u061F"], ["Shift", "Shift"]], |
896 | [["Shift", "Shift"], ["\u0642", "\u200D"], ["\u0641", "\u200C"], ["\u06D2", "\u06D3"], ["\u0633", "\u200E"], ["\u0634", "\u0624"], ["\u063a", "\u0626"], ["\u0639", "\u200F"], ["\u060C", ">"], ["\u06D4", "<"], ["/", "\u061F"], ["Shift", "Shift"]], |
894 | [[" ", " "]] |
897 | [[" ", " "]] |
895 | ], 'lang': ["ur"] }; |
898 | ], 'lang': ["ur"] }; |
- | 899 | ||
- | 900 | this.VKI_layout['\u0627\u0631\u062f\u0648 Phonetic'] = { |
|
- | 901 | 'name': "Urdu Phonetic", 'keys': [ |
|
- | 902 | [["\u064D", "\u064B", "~"], ["\u06F1", "1", "!"], ["\u06F2", "2", "@"], ["\u06F3", "3", "#"], ["\u06F4", "4", "$"], ["\u06F5", "5", "\u066A"], ["\u06F6", "6", "^"], ["\u06F7", "7", "&"], ["\u06F8", "8", "*"], ["\u06F9", "9", "("], ["\u06F0", "0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]], |
|
- | 903 | [["Tab", "Tab"], ["\u0642", "\u0652"], ["\u0648", "\u0651", "\u0602"], ["\u0639", "\u0670", "\u0656"], ["\u0631", "\u0691", "\u0613"], ["\u062A", "\u0679", "\u0614"], ["\u06D2", "\u064E", "\u0601"], ["\u0621", "\u0626", "\u0654"], ["\u06CC", "\u0650", "\u0611"], ["\u06C1", "\u06C3"], ["\u067E", "\u064F", "\u0657"], ["[", "{"], ["]", "}"], ["\\", "|"]], |
|
- | 904 | [["Caps", "Caps"], ["\u0627", "\u0622", "\uFDF2"], ["\u0633", "\u0635", "\u0610"], ["\u062F", "\u0688", "\uFDFA"], ["\u0641"], ["\u06AF", "\u063A"], ["\u062D", "\u06BE", "\u0612"], ["\u062C", "\u0636", "\uFDFB"], ["\u06A9", "\u062E"], ["\u0644"], ["\u061B", ":"], ["'", '"'], ["Enter", "Enter"]], |
|
- | 905 | [["Shift", "Shift"], ["\u0632", "\u0630", "\u060F"], ["\u0634", "\u0698", "\u060E"], ["\u0686", "\u062B", "\u0603"], ["\u0637", "\u0638"], ["\u0628", "", "\uFDFD"], ["\u0646", "\u06BA", "\u0600"], ["\u0645", "\u0658"], ["\u060C", "", "<"], ["\u06D4", "\u066B", ">"], ["/", "\u061F"], ["Shift", "Shift"]], |
|
- | 906 | [[" ", " ", " ", " "], ["Alt", "Alt"]] |
|
- | 907 | ]}; |
|
896 | 908 | ||
897 | this.VKI_layout['US Standard'] = { |
909 | this.VKI_layout['US Standard'] = { |
898 | 'name': "US Standard", 'keys': [ |
910 | 'name': "US Standard", 'keys': [ |
899 | [["`", "~"], ["1", "!"], ["2", "@"], ["3", "#"], ["4", "$"], ["5", "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", "("], ["0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]], |
911 | [["`", "~"], ["1", "!"], ["2", "@"], ["3", "#"], ["4", "$"], ["5", "%"], ["6", "^"], ["7", "&"], ["8", "*"], ["9", "("], ["0", ")"], ["-", "_"], ["=", "+"], ["Bksp", "Bksp"]], |
900 | [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["[", "{"], ["]", "}"], ["\\", "|"]], |
912 | [["Tab", "Tab"], ["q", "Q"], ["w", "W"], ["e", "E"], ["r", "R"], ["t", "T"], ["y", "Y"], ["u", "U"], ["i", "I"], ["o", "O"], ["p", "P"], ["[", "{"], ["]", "}"], ["\\", "|"]], |
Line 918... | Line 930... | ||
918 | [["Tab", "Tab"], ["\u0439", "\u0419"], ["\u0446", "\u0426"], ["\u0443", "\u0423"], ["\u043A", "\u041A"], ["\u0435", "\u0415"], ["\u043D", "\u041D"], ["\u0433", "\u0413"], ["\u0448", "\u0428"], ["\u045E", "\u040E"], ["\u0437", "\u0417"], ["\u0445", "\u0425"], ["\u044A", "\u042A"], ["\\", "/"]], |
930 | [["Tab", "Tab"], ["\u0439", "\u0419"], ["\u0446", "\u0426"], ["\u0443", "\u0423"], ["\u043A", "\u041A"], ["\u0435", "\u0415"], ["\u043D", "\u041D"], ["\u0433", "\u0413"], ["\u0448", "\u0428"], ["\u045E", "\u040E"], ["\u0437", "\u0417"], ["\u0445", "\u0425"], ["\u044A", "\u042A"], ["\\", "/"]], |
919 | [["Caps", "Caps"], ["\u0444", "\u0424"], ["\u049B", "\u049A"], ["\u0432", "\u0412"], ["\u0430", "\u0410"], ["\u043F", "\u041F"], ["\u0440", "\u0420"], ["\u043E", "\u041E"], ["\u043B", "\u041B"], ["\u0434", "\u0414"], ["\u0436", "\u0416"], ["\u044D", "\u042D"], ["Enter", "Enter"]], |
931 | [["Caps", "Caps"], ["\u0444", "\u0424"], ["\u049B", "\u049A"], ["\u0432", "\u0412"], ["\u0430", "\u0410"], ["\u043F", "\u041F"], ["\u0440", "\u0420"], ["\u043E", "\u041E"], ["\u043B", "\u041B"], ["\u0434", "\u0414"], ["\u0436", "\u0416"], ["\u044D", "\u042D"], ["Enter", "Enter"]], |
920 | [["Shift", "Shift"], ["\u044F", "\u042F"], ["\u0447", "\u0427"], ["\u0441", "\u0421"], ["\u043C", "\u041C"], ["\u0438", "\u0418"], ["\u0442", "\u0422"], ["\u044C", "\u042C"], ["\u0431", "\u0411"], ["\u044E", "\u042E"], [".", ","], ["Shift", "Shift"]], |
932 | [["Shift", "Shift"], ["\u044F", "\u042F"], ["\u0447", "\u0427"], ["\u0441", "\u0421"], ["\u043C", "\u041C"], ["\u0438", "\u0418"], ["\u0442", "\u0422"], ["\u044C", "\u042C"], ["\u0431", "\u0411"], ["\u044E", "\u042E"], [".", ","], ["Shift", "Shift"]], |
921 | [[" ", " "]] |
933 | [[" ", " "]] |
922 | ], 'lang': ["uz"] }; |
934 | ], 'lang': ["uz"] }; |
- | 935 | ||
- | 936 | this.VKI_layout['\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9'] = { // from http://www.yv.org/uyip/hebyidkbd.txt http://uyip.org/keyboards.html |
|
- | 937 | 'name': "Yiddish", 'keys': [ |
|
- | 938 | [[";", "~", "\u05B0"], ["1", "!", "\u05B1"], ["2", "@", "\u05B2"], ["3", "#", "\u05B3"], ["4", "$", "\u05B4"], ["5", "%", "\u05B5"], ["6", "^", "\u05B6"], ["7", "*", "\u05B7"], ["8", "&", "\u05B8"], ["9", "(", "\u05C2"], ["0", ")", "\u05C1"], ["-", "_", "\u05B9"], ["=", "+", "\u05BC"], ["Bksp", "Bksp"]], |
|
- | 939 | [["Tab", "Tab"], ["/", "\u201F", "\u201F"], ["'", "\u201E", "\u201E"], ["\u05E7", "`", "`"], ["\u05E8", "\uFB2F", "\uFB2F"], ["\u05D0", "\uFB2E", "\uFB2E"], ["\u05D8", "\u05F0", "\u05F0"], ["\u05D5", "\uFB35", "\uFB35"], ["\u05DF", "\uFB4B", "\uFB4B"], ["\u05DD", "\uFB4E", "\uFB4E"], ["\u05E4", "\uFB44", "\uFB44"], ["[", "{", "\u05BD"], ["]", "}", "\u05BF"], ["\\", "|", "\u05BB"]], |
|
- | 940 | [["Caps", "Caps"], ["\u05E9", "\uFB2A", "\uFB2A"], ["\u05D3", "\uFB2B", "\uFB2B"], ["\u05D2"], ["\u05DB", "\uFB3B", "\uFB3B"], ["\u05E2", "\u05F1", "\u05F1"], ["\u05D9", "\uFB1D", "\uFB1D"], ["\u05D7", "\uFF1F", "\uFF1F"], ["\u05DC", "\u05F2", "\u05F2"], ["\u05DA"], ["\u05E3", ":", "\u05C3"], [",", '"', "\u05C0"], ["Enter", "Enter"]], |
|
- | 941 | [["Shift", "Shift"], ["\u05D6", "\u2260", "\u2260"], ["\u05E1", "\uFB4C", "\uFB4C"], ["\u05D1", "\uFB31", "\uFB31"], ["\u05D4", "\u05BE", "\u05BE"], ["\u05E0", "\u2013", "\u2013"], ["\u05DE", "\u2014", "\u2014"], ["\u05E6", "\uFB4A", "\uFB4A"], ["\u05EA", "<", "\u05F3"], ["\u05E5", ">", "\u05F4"], [".", "?", "\u20AA"], ["Shift", "Shift"]], |
|
- | 942 | [[" ", " "], ["Alt", "Alt"]] |
|
- | 943 | ], 'lang': ["yi"] }; |
|
- | 944 | ||
- | 945 | this.VKI_layout['\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9 \u05dc\u05e2\u05d1\u05d8'] = { // from http://jidysz.net/ |
|
- | 946 | 'name': "Yiddish (Yidish Lebt)", 'keys': [ |
|
- | 947 | [[";", "~"], ["1", "!", "\u05B2", "\u05B2"], ["2", "@", "\u05B3", "\u05B3"], ["3", "#", "\u05B1", "\u05B1"], ["4", "$", "\u05B4", "\u05B4"], ["5", "%", "\u05B5", "\u05B5"], ["6", "^", "\u05B7", "\u05B7"], ["7", "&", "\u05B8", "\u05B8"], ["8", "*", "\u05BB", "\u05BB"], ["9", ")", "\u05B6", "\u05B6"], ["0", "(", "\u05B0", "\u05B0"], ["-", "_", "\u05BF", "\u05BF"], ["=", "+", "\u05B9", "\u05B9"], ["Bksp", "Bksp"]], |
|
- | 948 | [["Tab", "Tab"], ["/", "", "\u05F4", "\u05F4"], ["'", "", "\u05F3", "\u05F3"], ["\u05E7", "", "\u20AC"], ["\u05E8"], ["\u05D0", "", "\u05D0\u05B7", "\uFB2E"], ["\u05D8", "", "\u05D0\u05B8", "\uFB2F"], ["\u05D5", "\u05D5\u05B9", "\u05D5\u05BC", "\uFB35"], ["\u05DF", "", "\u05D5\u05D5", "\u05F0"], ["\u05DD", "", "\u05BC"], ["\u05E4", "", "\u05E4\u05BC", "\uFB44"], ["]", "}", "\u201E", "\u201D"], ["[", "{", "\u201A", "\u2019"], ["\\", "|", "\u05BE", "\u05BE"]], |
|
- | 949 | [["Caps", "Caps"], ["\u05E9", "\u05E9\u05C1", "\u05E9\u05C2", "\uFB2B"], ["\u05D3", "", "\u20AA"], ["\u05D2", "\u201E"], ["\u05DB", "", "\u05DB\u05BC", "\uFB3B"], ["\u05E2", "", "", "\uFB20"], ["\u05D9", "", "\u05D9\u05B4", "\uFB1D"], ["\u05D7", "", "\u05F2\u05B7", "\uFB1F"], ["\u05DC", "\u05DC\u05B9", "\u05D5\u05D9", "\u05F1"], ["\u05DA", "", "", "\u05F2"], ["\u05E3", ":", "\u05E4\u05BF", "\uFB4E"], [",", '"', ";", "\u05B2"], ["Enter", "Enter"]], |
|
- | 950 | [["Shift", "Shift"], ["\u05D6", "", "\u2013", "\u2013"], ["\u05E1", "", "\u2014", "\u2014"], ["\u05D1", "\u05DC\u05B9", "\u05D1\u05BF", "\uFB4C"], ["\u05D4", "", "\u201D", "\u201C"], ["\u05E0", "", "\u059C", "\u059E"], ["\u05DE", "", "\u2019", "\u2018"], ["\u05E6", "", "\u05E9\u05C1", "\uFB2A"], ["\u05EA", ">", "\u05EA\u05BC", "\uFB4A"], ["\u05E5", "<"], [".", "?", "\u2026"], ["Shift", "Shift"]], |
|
- | 951 | [[" ", " ", " ", " "], ["Alt", "Alt"]] |
|
- | 952 | ], 'lang': ["yi"] }; |
|
923 | 953 | ||
924 | this.VKI_layout['\u4e2d\u6587\u6ce8\u97f3\u7b26\u53f7'] = { |
954 | this.VKI_layout['\u4e2d\u6587\u6ce8\u97f3\u7b26\u53f7'] = { |
925 | 'name': "Chinese Bopomofo IME", 'keys': [ |
955 | 'name': "Chinese Bopomofo IME", 'keys': [ |
926 | [["\u20AC", "~"], ["\u3105", "!"], ["\u3109", "@"], ["\u02C7", "#"], ["\u02CB", "$"], ["\u3113", "%"], ["\u02CA", "^"], ["\u02D9", "&"], ["\u311A", "*"], ["\u311E", ")"], ["\u3122", "("], ["\u3126", "_"], ["=", "+"], ["Bksp", "Bksp"]], |
956 | [["\u20AC", "~"], ["\u3105", "!"], ["\u3109", "@"], ["\u02C7", "#"], ["\u02CB", "$"], ["\u3113", "%"], ["\u02CA", "^"], ["\u02D9", "&"], ["\u311A", "*"], ["\u311E", ")"], ["\u3122", "("], ["\u3126", "_"], ["=", "+"], ["Bksp", "Bksp"]], |
927 | [["Tab", "Tab"], ["\u3106", "q"], ["\u310A", "w"], ["\u310D", "e"], ["\u3110", "r"], ["\u3114", "t"], ["\u3117", "y"], ["\u3127", "u"], ["\u311B", "i"], ["\u311F", "o"], ["\u3123", "p"], ["[", "{"], ["]", "}"], ["\\", "|"]], |
957 | [["Tab", "Tab"], ["\u3106", "q"], ["\u310A", "w"], ["\u310D", "e"], ["\u3110", "r"], ["\u3114", "t"], ["\u3117", "y"], ["\u3127", "u"], ["\u311B", "i"], ["\u311F", "o"], ["\u3123", "p"], ["[", "{"], ["]", "}"], ["\\", "|"]], |
Line 936... | Line 966... | ||
936 | [["Tab", "Tab"], ["\u624B", "q"], ["\u7530", "w"], ["\u6C34", "e"], ["\u53E3", "r"], ["\u5EFF", "t"], ["\u535C", "y"], ["\u5C71", "u"], ["\u6208", "i"], ["\u4EBA", "o"], ["\u5FC3", "p"], ["[", "{"], ["]", "}"], ["\\", "|"]], |
966 | [["Tab", "Tab"], ["\u624B", "q"], ["\u7530", "w"], ["\u6C34", "e"], ["\u53E3", "r"], ["\u5EFF", "t"], ["\u535C", "y"], ["\u5C71", "u"], ["\u6208", "i"], ["\u4EBA", "o"], ["\u5FC3", "p"], ["[", "{"], ["]", "}"], ["\\", "|"]], |
937 | [["Caps", "Caps"], ["\u65E5", "a"], ["\u5C38", "s"], ["\u6728", "d"], ["\u706B", "f"], ["\u571F", "g"], ["\u7AF9", "h"], ["\u5341", "j"], ["\u5927", "k"], ["\u4E2D", "l"], [";", ":"], ["'", '"'], ["Enter", "Enter"]], |
967 | [["Caps", "Caps"], ["\u65E5", "a"], ["\u5C38", "s"], ["\u6728", "d"], ["\u706B", "f"], ["\u571F", "g"], ["\u7AF9", "h"], ["\u5341", "j"], ["\u5927", "k"], ["\u4E2D", "l"], [";", ":"], ["'", '"'], ["Enter", "Enter"]], |
938 | [["Shift", "Shift"], ["\uFF3A", "z"], ["\u96E3", "x"], ["\u91D1", "c"], ["\u5973", "v"], ["\u6708", "b"], ["\u5F13", "n"], ["\u4E00", "m"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]], |
968 | [["Shift", "Shift"], ["\uFF3A", "z"], ["\u96E3", "x"], ["\u91D1", "c"], ["\u5973", "v"], ["\u6708", "b"], ["\u5F13", "n"], ["\u4E00", "m"], [",", "<"], [".", ">"], ["/", "?"], ["Shift", "Shift"]], |
939 | [[" ", " "]] |
969 | [[" ", " "]] |
940 | ], 'lang': ["zh"] }; |
970 | ], 'lang': ["zh"] }; |
941 | 971 | ||
942 | 972 | ||
943 | /* ***** Define Dead Keys ************************************** */ |
973 | /* ***** Define Dead Keys ************************************** */ |
944 | this.VKI_deadkey = {}; |
974 | this.VKI_deadkey = {}; |
945 | 975 | ||
946 | // - Lay out each dead key set as an object of property/value |
976 | // - Lay out each dead key set as an object of property/value |
947 | // pairs. The rows below are wrapped so uppercase letters are |
977 | // pairs. The rows below are wrapped so uppercase letters are |
Line 983... | Line 1013... | ||
983 | 'A': "\u0100", 'E': "\u0112", 'I': "\u012a", 'O': "\u014c", 'U': "\u016A", 'Y': "\u0232", '\u00dc': "\u01d5" |
1013 | 'A': "\u0100", 'E': "\u0112", 'I': "\u012a", 'O': "\u014c", 'U': "\u016A", 'Y': "\u0232", '\u00dc': "\u01d5" |
984 | }; |
1014 | }; |
985 | this.VKI_deadkey['`'] = { // Grave |
1015 | this.VKI_deadkey['`'] = { // Grave |
986 | 'a': "\u00e0", 'e': "\u00e8", 'i': "\u00ec", 'o': "\u00f2", 'u': "\u00f9", '\u00fc': "\u01dc", |
1016 | 'a': "\u00e0", 'e': "\u00e8", 'i': "\u00ec", 'o': "\u00f2", 'u': "\u00f9", '\u00fc': "\u01dc", |
987 | 'A': "\u00c0", 'E': "\u00c8", 'I': "\u00cc", 'O': "\u00d2", 'U': "\u00d9", '\u00dc': "\u01db" |
1017 | 'A': "\u00c0", 'E': "\u00c8", 'I': "\u00cc", 'O': "\u00d2", 'U': "\u00d9", '\u00dc': "\u01db" |
988 | }; |
1018 | }; |
989 | this.VKI_deadkey["'"] = this.VKI_deadkey['\u00b4'] = this.VKI_deadkey['\u0384'] = { // Acute / Greek Tonos |
1019 | this.VKI_deadkey["'"] = this.VKI_deadkey['\u00b4'] = this.VKI_deadkey['\u0384'] = { // Acute / Greek Tonos |
990 | 'a': "\u00e1", 'e': "\u00e9", 'i': "\u00ed", 'o': "\u00f3", 'u': "\u00fa", 'y': "\u00fd", '\u03b1': "\u03ac", '\u03b5': "\u03ad", '\u03b7': "\u03ae", '\u03b9': "\u03af", '\u03bf': "\u03cc", '\u03c5': "\u03cd", '\u03c9': "\u03ce", '\u00fc': "\u01d8", |
1020 | 'a': "\u00e1", 'e': "\u00e9", 'i': "\u00ed", 'o': "\u00f3", 'u': "\u00fa", 'y': "\u00fd", '\u03b1': "\u03ac", '\u03b5': "\u03ad", '\u03b7': "\u03ae", '\u03b9': "\u03af", '\u03bf': "\u03cc", '\u03c5': "\u03cd", '\u03c9': "\u03ce", '\u00fc': "\u01d8", |
991 | 'A': "\u00c1", 'E': "\u00c9", 'I': "\u00cd", 'O': "\u00d3", 'U': "\u00da", 'Y': "\u00dd", '\u0391': "\u0386", '\u0395': "\u0388", '\u0397': "\u0389", '\u0399': "\u038a", '\u039f': "\u038c", '\u03a5': "\u038e", '\u03a9': "\u038f", '\u00dc': "\u01d7" |
1021 | 'A': "\u00c1", 'E': "\u00c9", 'I': "\u00cd", 'O': "\u00d3", 'U': "\u00da", 'Y': "\u00dd", '\u0391': "\u0386", '\u0395': "\u0388", '\u0397': "\u0389", '\u0399': "\u038a", '\u039f': "\u038c", '\u03a5': "\u038e", '\u03a9': "\u038f", '\u00dc': "\u01d7" |
992 | }; |
1022 | }; |
993 | this.VKI_deadkey['\u02dd'] = { // Hungarian Double Acute Accent |
1023 | this.VKI_deadkey['\u02dd'] = { // Hungarian Double Acute Accent |
994 | 'o': "\u0151", 'u': "\u0171", |
1024 | 'o': "\u0151", 'u': "\u0171", |
995 | 'O': "\u0150", 'U': "\u0170" |
1025 | 'O': "\u0150", 'U': "\u0170" |
996 | }; |
1026 | }; |
997 | this.VKI_deadkey['\u0385'] = { // Greek Dialytika + Tonos |
1027 | this.VKI_deadkey['\u0385'] = { // Greek Dialytika + Tonos |
998 | '\u03b9': "\u0390", '\u03c5': "\u03b0" |
1028 | '\u03b9': "\u0390", '\u03c5': "\u03b0" |
999 | }; |
1029 | }; |
1000 | this.VKI_deadkey['\u00b0'] = this.VKI_deadkey['\u00ba'] = { // Ring |
1030 | this.VKI_deadkey['\u00b0'] = this.VKI_deadkey['\u00ba'] = { // Ring |
1001 | 'a': "\u00e5", 'u': "\u016f", |
1031 | 'a': "\u00e5", 'u': "\u016f", |
1002 | 'A': "\u00c5", 'U': "\u016e" |
1032 | 'A': "\u00c5", 'U': "\u016e" |
1003 | }; |
1033 | }; |
1004 | this.VKI_deadkey['\u02DB'] = { // Ogonek |
1034 | this.VKI_deadkey['\u02DB'] = { // Ogonek |
Line 1024... | Line 1054... | ||
1024 | 1054 | ||
1025 | 1055 | ||
1026 | /* ***** Define Symbols **************************************** */ |
1056 | /* ***** Define Symbols **************************************** */ |
1027 | this.VKI_symbol = { |
1057 | this.VKI_symbol = { |
1028 | '\u00a0': "NB\nSP", '\u200b': "ZW\nSP", '\u200c': "ZW\nNJ", '\u200d': "ZW\nJ" |
1058 | '\u00a0': "NB\nSP", '\u200b': "ZW\nSP", '\u200c': "ZW\nNJ", '\u200d': "ZW\nJ" |
1029 | }; |
1059 | }; |
1030 | 1060 | ||
1031 | 1061 | ||
1032 | /* ***** Layout Number Pad ************************************* */ |
1062 | /* ***** Layout Number Pad ************************************* */ |
1033 | this.VKI_numpad = [ |
1063 | this.VKI_numpad = [ |
1034 | [["$"], ["\u00a3"], ["\u20ac"], ["\u00a5"]], |
1064 | [["$"], ["\u00a3"], ["\u20ac"], ["\u00a5"]], |
1035 | [["7"], ["8"], ["9"], ["/"]], |
1065 | [["7"], ["8"], ["9"], ["/"]], |
1036 | [["4"], ["5"], ["6"], ["*"]], |
1066 | [["4"], ["5"], ["6"], ["*"]], |
Line 1041... | Line 1071... | ||
1041 | 1071 | ||
1042 | /* **************************************************************** |
1072 | /* **************************************************************** |
1043 | * Attach the keyboard to an element |
1073 | * Attach the keyboard to an element |
1044 | * |
1074 | * |
1045 | */ |
1075 | */ |
1046 |
|
1076 | VKI_attach = function(elem) { |
1047 | if (elem.getAttribute("VKI_attached")) return false; |
1077 | if (elem.getAttribute("VKI_attached")) return false; |
1048 | if ( |
1078 | if (self.VKI_imageURI) { |
1049 | var keybut = document.createElement('img'); |
1079 | var keybut = document.createElement('img'); |
1050 | keybut.src = |
1080 | keybut.src = self.VKI_imageURI; |
1051 | keybut.alt = |
1081 | keybut.alt = self.VKI_i18n['01']; |
1052 | keybut.className = "keyboardInputInitiator"; |
1082 | keybut.className = "keyboardInputInitiator"; |
1053 | keybut.title = |
1083 | keybut.title = self.VKI_i18n['01']; |
1054 | keybut.elem = elem; |
1084 | keybut.elem = elem; |
1055 | keybut.onclick = function(e) { |
1085 | keybut.onclick = function(e) { |
1056 | e = e || event; |
1086 | e = e || event; |
1057 | if (e.stopPropagation) { e.stopPropagation(); } else e.cancelBubble = true; |
1087 | if (e.stopPropagation) { e.stopPropagation(); } else e.cancelBubble = true; |
1058 | self.VKI_show(this.elem); |
1088 | self.VKI_show(this.elem); |
1059 | }; |
1089 | }; |
1060 | elem.parentNode.insertBefore(keybut, (elem.dir == "rtl") ? elem : elem.nextSibling); |
1090 | elem.parentNode.insertBefore(keybut, (elem.dir == "rtl") ? elem : elem.nextSibling); |
- | 1091 | } else { |
|
- | 1092 | elem.onfocus = function() { |
|
- | 1093 | if (self.VKI_target != this) { |
|
- | 1094 | if (self.VKI_target) self.VKI_close(); |
|
- | 1095 | self.VKI_show(this); |
|
- | 1096 | } |
|
- | 1097 | }; |
|
- | 1098 | elem.onclick = function() { |
|
1061 |
|
1099 | if (!self.VKI_target) self.VKI_show(this); |
- | 1100 | } |
|
- | 1101 | } |
|
1062 | elem.setAttribute("VKI_attached", 'true'); |
1102 | elem.setAttribute("VKI_attached", 'true'); |
1063 | if ( |
1103 | if (self.VKI_isIE) { |
1064 | elem.onclick = elem.onselect = elem.onkeyup = function(e) { |
1104 | elem.onclick = elem.onselect = elem.onkeyup = function(e) { |
1065 | if ((e || event).type != "keyup" || !this.readOnly) |
1105 | if ((e || event).type != "keyup" || !this.readOnly) |
1066 | this.range = document.selection.createRange(); |
1106 | this.range = document.selection.createRange(); |
1067 | }; |
1107 | }; |
1068 | } |
1108 | } |
Line 1070... | Line 1110... | ||
1070 | if (self.VKI_target == this) { |
1110 | if (self.VKI_target == this) { |
1071 | e = e || event; |
1111 | e = e || event; |
1072 | if (e.stopPropagation) { e.stopPropagation(); } else e.cancelBubble = true; |
1112 | if (e.stopPropagation) { e.stopPropagation(); } else e.cancelBubble = true; |
1073 | } return false; |
1113 | } return false; |
1074 | }, false); |
1114 | }, false); |
- | 1115 | if (self.VKI_isMoz) |
|
- | 1116 | elem.addEventListener('blur', function() { this.setAttribute('_scrollTop', this.scrollTop); }, false); |
|
1075 | }; |
1117 | }; |
1076 | 1118 | ||
1077 | 1119 | ||
1078 | /* ***** Find tagged input & textarea elements ***************** */ |
1120 | /* ***** Find tagged input & textarea elements ***************** */ |
- | 1121 | function VKI_buildKeyboardInputs() { |
|
1079 | var inputElems = [ |
1122 | var inputElems = [ |
1080 | document.getElementsByTagName('input'), |
1123 | document.getElementsByTagName('input'), |
1081 | document.getElementsByTagName('textarea') |
1124 | document.getElementsByTagName('textarea') |
1082 | ]; |
1125 | ]; |
1083 | for (var x = 0, elem; elem = inputElems[x++];) |
1126 | for (var x = 0, elem; elem = inputElems[x++];) |
1084 | for (var y = 0, ex; ex = elem[y++];) |
1127 | for (var y = 0, ex; ex = elem[y++];) |
1085 | if |
1128 | if (ex.nodeName == "TEXTAREA" || ex.type == "text" || ex.type == "password") |
1086 |
|
1129 | if (ex.className.indexOf("keyboardInput") > -1) VKI_attach(ex); |
1087 | 1130 | ||
1088 | VKI_addListener(document.documentElement, 'click', function(e) { self.VKI_close(); }, false); |
1131 | VKI_addListener(document.documentElement, 'click', function(e) { self.VKI_close(); }, false); |
- | 1132 | } |
|
1089 | 1133 | ||
1090 | 1134 | ||
1091 | /* **************************************************************** |
1135 | /* **************************************************************** |
1092 | * Common mouse event actions |
1136 | * Common mouse event actions |
1093 | * |
1137 | * |
Line 1142... | Line 1186... | ||
1142 | }, false); |
1186 | }, false); |
1143 | 1187 | ||
1144 | if (!this.VKI_layout[this.VKI_kt]) |
1188 | if (!this.VKI_layout[this.VKI_kt]) |
1145 | return alert('No keyboard named "' + this.VKI_kt + '"'); |
1189 | return alert('No keyboard named "' + this.VKI_kt + '"'); |
1146 | 1190 | ||
- | 1191 | this.VKI_langCode = {}; |
|
1147 | var thead = document.createElement('thead'); |
1192 | var thead = document.createElement('thead'); |
1148 | var tr = document.createElement('tr'); |
1193 | var tr = document.createElement('tr'); |
1149 | var th = document.createElement('th'); |
1194 | var th = document.createElement('th'); |
1150 | th.colSpan = "2"; |
1195 | th.colSpan = "2"; |
1151 | 1196 | ||
Line 1163... | Line 1208... | ||
1163 | } else li[x].className = ""; |
1208 | } else li[x].className = ""; |
1164 | } setTimeout(function() { ol.scrollTop = scr; }, 0); |
1209 | } setTimeout(function() { ol.scrollTop = scr; }, 0); |
1165 | } else ol.style.display = ""; |
1210 | } else ol.style.display = ""; |
1166 | }, false); |
1211 | }, false); |
1167 | kbSelect.appendChild(document.createTextNode(this.VKI_kt)); |
1212 | kbSelect.appendChild(document.createTextNode(this.VKI_kt)); |
1168 | kbSelect.appendChild(document.createTextNode(this. |
1213 | kbSelect.appendChild(document.createTextNode(this.VKI_isIElt8 ? " \u2193" : " \u25be")); |
- | 1214 | kbSelect.langCount = 0; |
|
1169 | var ol = document.createElement('ol'); |
1215 | var ol = document.createElement('ol'); |
1170 | for (ktype in this.VKI_layout) { |
1216 | for (ktype in this.VKI_layout) { |
1171 | if (typeof this.VKI_layout[ktype] == "object") { |
1217 | if (typeof this.VKI_layout[ktype] == "object") { |
1172 | if (!this.VKI_layout[ktype].lang) this.VKI_layout[ktype].lang = []; |
1218 | if (!this.VKI_layout[ktype].lang) this.VKI_layout[ktype].lang = []; |
- | 1219 | for (var x = 0; x < this.VKI_layout[ktype].lang.length; x++) |
|
- | 1220 | this.VKI_langCode[this.VKI_layout[ktype].lang[x].toLowerCase().replace(/-/g, "_")] = ktype; |
|
1173 | var li = document.createElement('li'); |
1221 | var li = document.createElement('li'); |
1174 | li.title = this.VKI_layout[ktype].name; |
1222 | li.title = this.VKI_layout[ktype].name; |
1175 | VKI_addListener(li, 'click', function(e) { |
1223 | VKI_addListener(li, 'click', function(e) { |
1176 | e = e || event; |
1224 | e = e || event; |
1177 | if (e.stopPropagation) { e.stopPropagation(); } else e.cancelBubble = true; |
1225 | if (e.stopPropagation) { e.stopPropagation(); } else e.cancelBubble = true; |
Line 1181... | Line 1229... | ||
1181 | self.VKI_position(true); |
1229 | self.VKI_position(true); |
1182 | }, false); |
1230 | }, false); |
1183 | VKI_mouseEvents(li); |
1231 | VKI_mouseEvents(li); |
1184 | li.appendChild(document.createTextNode(ktype)); |
1232 | li.appendChild(document.createTextNode(ktype)); |
1185 | ol.appendChild(li); |
1233 | ol.appendChild(li); |
- | 1234 | kbSelect.langCount++; |
|
1186 | } |
1235 | } |
1187 | } kbSelect.appendChild(ol); |
1236 | } kbSelect.appendChild(ol); |
1188 | th.appendChild(kbSelect); |
1237 | if (kbSelect.langCount > 1) th.appendChild(kbSelect); |
- | 1238 | this.VKI_langCode.index = []; |
|
- | 1239 | for (prop in this.VKI_langCode) |
|
- | 1240 | if (prop != "index" && typeof this.VKI_langCode[prop] == "string") |
|
- | 1241 | this.VKI_langCode.index.push(prop); |
|
- | 1242 | this.VKI_langCode.index.sort(); |
|
- | 1243 | this.VKI_langCode.index.reverse(); |
|
1189 | 1244 | ||
1190 | if (this.VKI_numberPad) { |
1245 | if (this.VKI_numberPad) { |
1191 | var span = document.createElement('span'); |
1246 | var span = document.createElement('span'); |
1192 | span.appendChild(document.createTextNode("#")); |
1247 | span.appendChild(document.createTextNode("#")); |
1193 | span.title = this.VKI_i18n['00']; |
1248 | span.title = this.VKI_i18n['00']; |
Line 1212... | Line 1267... | ||
1212 | VKI_addListener(small, 'click', function() { |
1267 | VKI_addListener(small, 'click', function() { |
1213 | --self.VKI_size; |
1268 | --self.VKI_size; |
1214 | self.VKI_kbsize(); |
1269 | self.VKI_kbsize(); |
1215 | }, false); |
1270 | }, false); |
1216 | VKI_mouseEvents(small); |
1271 | VKI_mouseEvents(small); |
1217 | small.appendChild(document.createTextNode(this. |
1272 | small.appendChild(document.createTextNode(this.VKI_isIElt8 ? "\u2193" : "\u21d3")); |
1218 | th.appendChild(small); |
1273 | th.appendChild(small); |
1219 | var big = document.createElement('big'); |
1274 | var big = document.createElement('big'); |
1220 | big.title = this.VKI_i18n['11']; |
1275 | big.title = this.VKI_i18n['11']; |
1221 | VKI_addListener(big, 'click', function() { |
1276 | VKI_addListener(big, 'click', function() { |
1222 | ++self.VKI_size; |
1277 | ++self.VKI_size; |
1223 | self.VKI_kbsize(); |
1278 | self.VKI_kbsize(); |
1224 | }, false); |
1279 | }, false); |
1225 | VKI_mouseEvents(big); |
1280 | VKI_mouseEvents(big); |
1226 | big.appendChild(document.createTextNode(this. |
1281 | big.appendChild(document.createTextNode(this.VKI_isIElt8 ? "\u2191" : "\u21d1")); |
1227 | th.appendChild(big); |
1282 | th.appendChild(big); |
1228 | } |
1283 | } |
1229 | 1284 | ||
1230 | var span = document.createElement('span'); |
1285 | var span = document.createElement('span'); |
1231 | span.appendChild(document.createTextNode(this.VKI_i18n['07'])); |
1286 | span.appendChild(document.createTextNode(this.VKI_i18n['07'])); |
Line 1385... | Line 1440... | ||
1385 | case "Caps": case "Shift": |
1440 | case "Caps": case "Shift": |
1386 | case "Alt": case "AltGr": case "AltLk": |
1441 | case "Alt": case "AltGr": case "AltLk": |
1387 | VKI_addListener(td, 'click', (function(type) { return function() { self.VKI_modify(type); return false; }})(lkey[1]), false); |
1442 | VKI_addListener(td, 'click', (function(type) { return function() { self.VKI_modify(type); return false; }})(lkey[1]), false); |
1388 | break; |
1443 | break; |
1389 | case "Tab": |
1444 | case "Tab": |
1390 | VKI_addListener(td, 'click', function() { |
1445 | VKI_addListener(td, 'click', function() { |
- | 1446 | if (self.VKI_activeTab) { |
|
- | 1447 | if (self.VKI_target.form) { |
|
- | 1448 | var target = self.VKI_target, elems = target.form.elements; |
|
- | 1449 | self.VKI_close(); |
|
- | 1450 | for (var z = 0, me = false, j = -1; z < elems.length; z++) { |
|
- | 1451 | if (j == -1 && elems[z].getAttribute("VKI_attached")) j = z; |
|
- | 1452 | if (me) { |
|
- | 1453 | if (self.VKI_activeTab == 1 && elems[z]) break; |
|
- | 1454 | if (elems[z].getAttribute("VKI_attached")) break; |
|
- | 1455 | } else if (elems[z] == target) me = true; |
|
- | 1456 | } if (z == elems.length) z = Math.max(j, 0); |
|
- | 1457 | if (elems[z].getAttribute("VKI_attached")) { |
|
- | 1458 | self.VKI_show(elems[z]); |
|
- | 1459 | } else elems[z].focus(); |
|
- | 1460 | } else self.VKI_target.focus(); |
|
- | 1461 | } else self.VKI_insert("\t"); |
|
- | 1462 | return false; |
|
- | 1463 | }, false); |
|
1391 | break; |
1464 | break; |
1392 | case "Bksp": |
1465 | case "Bksp": |
1393 | VKI_addListener(td, 'click', function() { |
1466 | VKI_addListener(td, 'click', function() { |
1394 | self.VKI_target.focus(); |
1467 | self.VKI_target.focus(); |
1395 | if (self.VKI_target.setSelectionRange && !self.VKI_target.readOnly) { |
1468 | if (self.VKI_target.setSelectionRange && !self.VKI_target.readOnly) { |
Line 1411... | Line 1484... | ||
1411 | }, false); |
1484 | }, false); |
1412 | break; |
1485 | break; |
1413 | case "Enter": |
1486 | case "Enter": |
1414 | VKI_addListener(td, 'click', function() { |
1487 | VKI_addListener(td, 'click', function() { |
1415 | if (self.VKI_target.nodeName != "TEXTAREA") { |
1488 | if (self.VKI_target.nodeName != "TEXTAREA") { |
1416 | if (self.VKI_target.form) { |
1489 | if (self.VKI_enterSubmit && self.VKI_target.form) { |
1417 | for (var z = 0, subm = false; z < self.VKI_target.form.elements.length; z++) |
1490 | for (var z = 0, subm = false; z < self.VKI_target.form.elements.length; z++) |
1418 | if (self.VKI_target.form.elements[z].type == "submit") subm = true; |
1491 | if (self.VKI_target.form.elements[z].type == "submit") subm = true; |
1419 | if (!subm) self.VKI_target.form.submit(); |
1492 | if (!subm) self.VKI_target.form.submit(); |
1420 | } |
1493 | } |
1421 | self.VKI_close(); |
1494 | self.VKI_close(); |
Line 1423... | Line 1496... | ||
1423 | return true; |
1496 | return true; |
1424 | }, false); |
1497 | }, false); |
1425 | break; |
1498 | break; |
1426 | default: |
1499 | default: |
1427 | VKI_addListener(td, 'click', VKI_keyClick, false); |
1500 | VKI_addListener(td, 'click', VKI_keyClick, false); |
1428 | 1501 | ||
1429 | } VKI_mouseEvents(td); |
1502 | } VKI_mouseEvents(td); |
1430 | tr.appendChild(td); |
1503 | tr.appendChild(td); |
1431 | for (var z = 0; z < 4; z++) |
1504 | for (var z = 0; z < 4; z++) |
1432 | if (this.VKI_deadkey[lkey[z] = lkey[z] || ""]) hasDeadKey = true; |
1505 | if (this.VKI_deadkey[lkey[z] = lkey[z] || ""]) hasDeadKey = true; |
1433 | } tbody.appendChild(tr); |
1506 | } tbody.appendChild(tr); |
Line 1461... | Line 1534... | ||
1461 | case "Caps": this.VKI_shift = 0; this.VKI_shiftlock = !this.VKI_shiftlock; break; |
1534 | case "Caps": this.VKI_shift = 0; this.VKI_shiftlock = !this.VKI_shiftlock; break; |
1462 | case "Shift": this.VKI_shift = !this.VKI_shift; break; |
1535 | case "Shift": this.VKI_shift = !this.VKI_shift; break; |
1463 | } var vchar = 0; |
1536 | } var vchar = 0; |
1464 | if (!this.VKI_shift != !this.VKI_shiftlock) vchar += 1; |
1537 | if (!this.VKI_shift != !this.VKI_shiftlock) vchar += 1; |
1465 | if (!this.VKI_altgr != !this.VKI_altgrlock) vchar += 2; |
1538 | if (!this.VKI_altgr != !this.VKI_altgrlock) vchar += 2; |
1466 | 1539 | ||
1467 | var tables = this.VKI_keyboard.tBodies[0].getElementsByTagName('div')[0].getElementsByTagName('table'); |
1540 | var tables = this.VKI_keyboard.tBodies[0].getElementsByTagName('div')[0].getElementsByTagName('table'); |
1468 | for (var x = 0; x < tables.length; x++) { |
1541 | for (var x = 0; x < tables.length; x++) { |
1469 | var tds = tables[x].getElementsByTagName('td'); |
1542 | var tds = tables[x].getElementsByTagName('td'); |
1470 | for (var y = 0; y < tds.length; y++) { |
1543 | for (var y = 0; y < tds.length; y++) { |
1471 | var className = [], lkey = this.VKI_layout[this.VKI_kt].keys[x][y]; |
1544 | var className = [], lkey = this.VKI_layout[this.VKI_kt].keys[x][y]; |
1472 | 1545 | ||
1473 | switch (lkey[1]) { |
1546 | switch (lkey[1]) { |
1474 | case "Alt": |
1547 | case "Alt": |
1475 | case "AltGr": |
1548 | case "AltGr": |
1476 | if (this.VKI_altgr) className.push("pressed"); |
1549 | if (this.VKI_altgr) className.push("pressed"); |
1477 | break; |
1550 | break; |
1478 | case "AltLk": |
1551 | case "AltLk": |
1479 | if (this.VKI_altgrlock) className.push("pressed"); |
1552 | if (this.VKI_altgrlock) className.push("pressed"); |
1480 | break; |
1553 | break; |
1481 | case "Shift": |
1554 | case "Shift": |
1482 | if (this.VKI_shift) className.push("pressed"); |
1555 | if (this.VKI_shift) className.push("pressed"); |
Line 1495... | Line 1568... | ||
1495 | for (var z = 0; z < text.length; z++) { |
1568 | for (var z = 0; z < text.length; z++) { |
1496 | if (z) small.appendChild(document.createElement("br")); |
1569 | if (z) small.appendChild(document.createElement("br")); |
1497 | small.appendChild(document.createTextNode(text[z])); |
1570 | small.appendChild(document.createTextNode(text[z])); |
1498 | } tds[y].appendChild(small); |
1571 | } tds[y].appendChild(small); |
1499 | } else tds[y].appendChild(document.createTextNode(lkey[vchar] || "\xa0")); |
1572 | } else tds[y].appendChild(document.createTextNode(lkey[vchar] || "\xa0")); |
1500 | } |
1573 | } |
1501 | if (this.VKI_deadkeysOn.checked) { |
1574 | if (this.VKI_deadkeysOn.checked) { |
1502 | var character = tds[y].firstChild.nodeValue || tds[y].firstChild.className; |
1575 | var character = tds[y].firstChild.nodeValue || tds[y].firstChild.className; |
1503 | if (this.VKI_dead) { |
1576 | if (this.VKI_dead) { |
1504 | if (character == this.VKI_dead) className.push("pressed"); |
1577 | if (character == this.VKI_dead) className.push("pressed"); |
1505 | if (this.VKI_deadkey[this.VKI_dead][character]) className.push("target"); |
1578 | if (this.VKI_deadkey[this.VKI_dead][character]) className.push("target"); |
Line 1516... | Line 1589... | ||
1516 | }; |
1589 | }; |
1517 | 1590 | ||
1518 | 1591 | ||
1519 | /* **************************************************************** |
1592 | /* **************************************************************** |
1520 | * Insert text at the cursor |
1593 | * Insert text at the cursor |
1521 | * |
1594 | * |
1522 | */ |
1595 | */ |
1523 | this.VKI_insert = function(text) { |
1596 | this.VKI_insert = function(text) { |
1524 | this.VKI_target.focus(); |
1597 | this.VKI_target.focus(); |
1525 | if (this.VKI_target.maxLength) this.VKI_target.maxlength = this.VKI_target.maxLength; |
1598 | if (this.VKI_target.maxLength) this.VKI_target.maxlength = this.VKI_target.maxLength; |
1526 | if (typeof this.VKI_target.maxlength == "undefined" || |
1599 | if (typeof this.VKI_target.maxlength == "undefined" || |
1527 | this.VKI_target.maxlength < 0 || |
1600 | this.VKI_target.maxlength < 0 || |
1528 | this.VKI_target.value.length < this.VKI_target.maxlength) { |
1601 | this.VKI_target.value.length < this.VKI_target.maxlength) { |
1529 | if (this.VKI_target.setSelectionRange && !this.VKI_target.readOnly) { |
1602 | if (this.VKI_target.setSelectionRange && !this.VKI_target.readOnly && !this.VKI_isIE) { |
1530 | var rng = [this.VKI_target.selectionStart, this.VKI_target.selectionEnd]; |
1603 | var rng = [this.VKI_target.selectionStart, this.VKI_target.selectionEnd]; |
1531 | this.VKI_target.value = this.VKI_target.value.substr(0, rng[0]) + text + this.VKI_target.value.substr(rng[1]); |
1604 | this.VKI_target.value = this.VKI_target.value.substr(0, rng[0]) + text + this.VKI_target.value.substr(rng[1]); |
1532 | if (text == "\n" && this.VKI_isOpera) rng[0]++; |
1605 | if (text == "\n" && this.VKI_isOpera) rng[0]++; |
1533 | this.VKI_target.setSelectionRange(rng[0] + text.length, rng[0] + text.length); |
1606 | this.VKI_target.setSelectionRange(rng[0] + text.length, rng[0] + text.length); |
1534 | } else if (this.VKI_target.createTextRange && !this.VKI_target.readOnly) { |
1607 | } else if (this.VKI_target.createTextRange && !this.VKI_target.readOnly) { |
Line 1553... | Line 1626... | ||
1553 | */ |
1626 | */ |
1554 | this.VKI_show = function(elem) { |
1627 | this.VKI_show = function(elem) { |
1555 | if (!this.VKI_target) { |
1628 | if (!this.VKI_target) { |
1556 | this.VKI_target = elem; |
1629 | this.VKI_target = elem; |
1557 | if (this.VKI_langAdapt && this.VKI_target.lang) { |
1630 | if (this.VKI_langAdapt && this.VKI_target.lang) { |
1558 | var chg = false, sub = []; |
- | |
1559 | for (ktype in this.VKI_layout) { |
- | |
1560 |
|
1631 | var chg = false, sub = [], lang = this.VKI_target.lang.toLowerCase().replace(/-/g, "_"); |
1561 |
|
1632 | for (var x = 0, chg = false; !chg && x < this.VKI_langCode.index.length; x++) |
1562 | if (this.VKI_layout[ktype].lang[x].toLowerCase() == this.VKI_target.lang.toLowerCase()) { |
- | |
1563 | chg = kbSelect.firstChild.nodeValue = this.VKI_kt = ktype; |
- | |
1564 | break; |
- | |
1565 | } else if (this.VKI_layout[ktype].lang[x].toLowerCase().indexOf(this.VKI_target.lang.toLowerCase()) == 0) |
- | |
1566 |
|
1633 | if (lang.indexOf(this.VKI_langCode.index[x]) == 0) |
1567 | } |
- | |
1568 | } if (chg) break; |
- | |
1569 | } if (sub.length) { |
- | |
1570 | sub.sort(function (a, b) { return a[0].length - b[0].length; }); |
- | |
1571 | chg |
1634 | chg = kbSelect.firstChild.nodeValue = this.VKI_kt = this.VKI_langCode[this.VKI_langCode.index[x]]; |
1572 |
|
1635 | if (chg) this.VKI_buildKeys(); |
1573 | } |
1636 | } |
1574 | if (this.VKI_isIE) { |
1637 | if (this.VKI_isIE) { |
1575 | if (!this.VKI_target.range) { |
1638 | if (!this.VKI_target.range) { |
1576 | this.VKI_target.range = this.VKI_target.createTextRange(); |
1639 | this.VKI_target.range = this.VKI_target.createTextRange(); |
1577 | this.VKI_target.range.moveStart('character', this.VKI_target.value.length); |
1640 | this.VKI_target.range.moveStart('character', this.VKI_target.value.length); |
1578 | } this.VKI_target.range.select(); |
1641 | } this.VKI_target.range.select(); |
Line 1591... | Line 1654... | ||
1591 | 1654 | ||
1592 | if (this.VKI_isIE6) document.body.appendChild(this.VKI_iframe); |
1655 | if (this.VKI_isIE6) document.body.appendChild(this.VKI_iframe); |
1593 | document.body.appendChild(this.VKI_keyboard); |
1656 | document.body.appendChild(this.VKI_keyboard); |
1594 | this.VKI_keyboard.style.position = this.VKI_target.keyboardPosition; |
1657 | this.VKI_keyboard.style.position = this.VKI_target.keyboardPosition; |
1595 | if (this.VKI_isOpera) this.VKI_keyboard.reflow(); |
1658 | if (this.VKI_isOpera) this.VKI_keyboard.reflow(); |
1596 | 1659 | ||
1597 | this.VKI_position(true); |
1660 | this.VKI_position(true); |
1598 | if (self.VKI_isMoz || self.VKI_isWebKit) this.VKI_position(true); |
1661 | if (self.VKI_isMoz || self.VKI_isWebKit) this.VKI_position(true); |
1599 | this.VKI_target.blur(); |
1662 | this.VKI_target.blur(); |
1600 | this.VKI_target.focus(); |
1663 | this.VKI_target.focus(); |
1601 | } else this.VKI_close(); |
1664 | } else this.VKI_close(); |
1602 | }; |
1665 | }; |
1603 | 1666 | ||
1604 | 1667 | ||
1605 | /* **************************************************************** |
1668 | /* **************************************************************** |
1606 | * Position the keyboard |
1669 | * Position the keyboard |
1607 | * |
1670 | * |
1608 | */ |
1671 | */ |
1609 | this.VKI_position = function(force) { |
1672 | this.VKI_position = function(force) { |
1610 | if (self.VKI_target) { |
1673 | if (self.VKI_target) { |
1611 | var kPos = VKI_findPos(self.VKI_keyboard), wDim = VKI_innerDimensions(), sDis = VKI_scrollDist(); |
1674 | var kPos = VKI_findPos(self.VKI_keyboard), wDim = VKI_innerDimensions(), sDis = VKI_scrollDist(); |
1612 | var place = false, fudge = self.VKI_target.offsetHeight + 3; |
1675 | var place = false, fudge = self.VKI_target.offsetHeight + 3; |
1613 | if (force !== true) { |
1676 | if (force !== true) { |
Line 1615... | Line 1678... | ||
1615 | place = true; |
1678 | place = true; |
1616 | fudge = -self.VKI_keyboard.offsetHeight - 3; |
1679 | fudge = -self.VKI_keyboard.offsetHeight - 3; |
1617 | } else if (kPos[1] - sDis[1] < 0) place = true; |
1680 | } else if (kPos[1] - sDis[1] < 0) place = true; |
1618 | } |
1681 | } |
1619 | if (place || force === true) { |
1682 | if (place || force === true) { |
1620 | var iPos = VKI_findPos(self.VKI_target); |
1683 | var iPos = VKI_findPos(self.VKI_target), scr = self.VKI_target; |
- | 1684 | while (scr = scr.parentNode) { |
|
- | 1685 | if (scr == document.body) break; |
|
- | 1686 | if (scr.scrollHeight > scr.offsetHeight || scr.scrollWidth > scr.offsetWidth) { |
|
- | 1687 | if (!scr.getAttribute("VKI_scrollListener")) { |
|
- | 1688 | scr.setAttribute("VKI_scrollListener", true); |
|
- | 1689 | VKI_addListener(scr, 'scroll', function() { self.VKI_position(true); }, false); |
|
- | 1690 | } // Check if the input is in view |
|
- | 1691 | var pPos = VKI_findPos(scr), oTop = iPos[1] - pPos[1], oLeft = iPos[0] - pPos[0]; |
|
- | 1692 | var top = oTop + self.VKI_target.offsetHeight; |
|
- | 1693 | var left = oLeft + self.VKI_target.offsetWidth; |
|
- | 1694 | var bottom = scr.offsetHeight - oTop - self.VKI_target.offsetHeight; |
|
- | 1695 | var right = scr.offsetWidth - oLeft - self.VKI_target.offsetWidth; |
|
- | 1696 | self.VKI_keyboard.style.display = (top < 0 || left < 0 || bottom < 0 || right < 0) ? "none" : ""; |
|
- | 1697 | if (self.VKI_isIE6) self.VKI_iframe.style.display = (top < 0 || left < 0 || bottom < 0 || right < 0) ? "none" : ""; |
|
- | 1698 | } |
|
- | 1699 | } |
|
1621 | self.VKI_keyboard.style.top = iPos[1] - ((self.VKI_target.keyboardPosition == "fixed" && !self.VKI_isIE && !self.VKI_isMoz) ? sDis[1] : 0) + fudge + "px"; |
1700 | self.VKI_keyboard.style.top = iPos[1] - ((self.VKI_target.keyboardPosition == "fixed" && !self.VKI_isIE && !self.VKI_isMoz) ? sDis[1] : 0) + fudge + "px"; |
1622 | self.VKI_keyboard.style.left = Math.max(10, Math.min(wDim[0] - self.VKI_keyboard.offsetWidth - 25, iPos[0])) + "px"; |
1701 | self.VKI_keyboard.style.left = Math.max(10, Math.min(wDim[0] - self.VKI_keyboard.offsetWidth - 25, iPos[0])) + "px"; |
1623 | if (self.VKI_isIE6) { |
1702 | if (self.VKI_isIE6) { |
1624 | self.VKI_iframe.style.width = self.VKI_keyboard.offsetWidth + "px"; |
1703 | self.VKI_iframe.style.width = self.VKI_keyboard.offsetWidth + "px"; |
1625 | self.VKI_iframe.style.height = self.VKI_keyboard.offsetHeight + "px"; |
1704 | self.VKI_iframe.style.height = self.VKI_keyboard.offsetHeight + "px"; |
1626 | self.VKI_iframe.style.top = self.VKI_keyboard.style.top; |
1705 | self.VKI_iframe.style.top = self.VKI_keyboard.style.top; |
1627 | self.VKI_iframe.style.left = self.VKI_keyboard.style.left; |
1706 | self.VKI_iframe.style.left = self.VKI_keyboard.style.left; |
1628 | } |
1707 | } |
1629 | } |
1708 | } |
1630 | if (force === true) self.VKI_position(); |
1709 | if (force === true) self.VKI_position(); |
1631 | } |
1710 | } |
1632 | }; |
1711 | }; |
1633 | 1712 | ||
1634 | 1713 | ||
1635 | /* **************************************************************** |
1714 | /* **************************************************************** |
1636 | * Close the keyboard interface |
1715 | * Close the keyboard interface |
Line 1661... | Line 1740... | ||
1661 | } else if (elem.attachEvent) |
1740 | } else if (elem.attachEvent) |
1662 | elem.attachEvent('on' + type, function() { func.call(elem); }); |
1741 | elem.attachEvent('on' + type, function() { func.call(elem); }); |
1663 | } |
1742 | } |
1664 | 1743 | ||
1665 | function VKI_findPos(obj) { |
1744 | function VKI_findPos(obj) { |
1666 | var curleft = curtop = 0; |
1745 | var curleft = curtop = 0, scr = obj; |
- | 1746 | while ((scr = scr.parentNode) && scr != document.body) { |
|
- | 1747 | curleft -= scr.scrollLeft || 0; |
|
- | 1748 | curtop -= scr.scrollTop || 0; |
|
- | 1749 | } |
|
1667 | do { |
1750 | do { |
1668 | curleft += obj.offsetLeft; |
1751 | curleft += obj.offsetLeft; |
1669 | curtop += obj.offsetTop; |
1752 | curtop += obj.offsetTop; |
1670 | } while (obj == obj.offsetParent); |
1753 | } while (obj == obj.offsetParent); |
1671 | return [curleft, curtop]; |
1754 | return [curleft, curtop]; |
Line 1703... | Line 1786... | ||
1703 | 1786 | ||
1704 | VKI_addListener(window, 'resize', this.VKI_position, false); |
1787 | VKI_addListener(window, 'resize', this.VKI_position, false); |
1705 | VKI_addListener(window, 'scroll', this.VKI_position, false); |
1788 | VKI_addListener(window, 'scroll', this.VKI_position, false); |
1706 | this.VKI_kbsize(); |
1789 | this.VKI_kbsize(); |
1707 | VKI_addListener(window, 'load', VKI_buildKeyboardInputs, false); |
1790 | VKI_addListener(window, 'load', VKI_buildKeyboardInputs, false); |
- | 1791 | // VKI_addListener(window, 'load', function() { |
|
- | 1792 | // setTimeout(VKI_buildKeyboardInputs, 5); |
|
- | 1793 | // }, false); |
|
1708 | })(); |
1794 | })(); |