Publish Vulpes Preview 15 sources for desktop, Android and Tundra

Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
OverSu 2026-09-30 23:13:03 +02:00
commit b38dea0597
25901 changed files with 9982925 additions and 369 deletions

View file

@ -0,0 +1,93 @@
/* global InputMethods, PromiseStorage*/
'use strict';
(function() {
function RecentKeys() {
this._items = [];
}
RecentKeys.prototype.RECENT_KEY_COUNT = 18;
RecentKeys.prototype.getItems = function() {
return this._items || [];
};
RecentKeys.prototype.setItems = function(val) {
if (Array.isArray(val) && val.length) {
this._items = val.slice(0, this.RECENT_KEY_COUNT);
}
};
RecentKeys.prototype.getPanelKeys = function() {
if (!this._items) {
throw new Error('Emoji:Unable to get recently used keys');
}
return this.getItems().map(function(val) {
return { compositeKey: val, type: 'emoji' };
});
};
RecentKeys.prototype.add = function(key) {
var duplicateKeyIndex = this._items.indexOf(key);
// splice an element from array can always reduce length by 1.
// this ensure that we remove the last element or existent key,
// before unshifting clicked key into array.
if (this._items.length >= this.RECENT_KEY_COUNT ||
duplicateKeyIndex !== -1) {
this._items.splice(duplicateKeyIndex, 1);
}
this._items.unshift(key);
};
function EmojiInputMethod() {
this._glue = null;
this._dbStore = null;
this._recentKeys = new RecentKeys();
}
EmojiInputMethod.prototype.EMOJI_DB_NAME = 'Emoji';
EmojiInputMethod.prototype.EMOJI_RECENT_STORE_KEY = 'emojiRecentUsedKeys';
EmojiInputMethod.prototype.init = function(glue) {
this._glue = glue;
this._dbStore = new PromiseStorage(this.EMOJI_DB_NAME);
var p = this._dbStore.start()
.then(function() {
return this._dbStore.getItem(this.EMOJI_RECENT_STORE_KEY);
}.bind(this))
.then(function(keys) {
this._recentKeys.setItems(keys);
}.bind(this));
return p;
};
EmojiInputMethod.prototype.deactivate = function() {
return this._dbStore.setItem(
this.EMOJI_RECENT_STORE_KEY, this._recentKeys.getItems());
};
EmojiInputMethod.prototype.click = function(key, repeat) {
return this._glue.sendKey(key, repeat);
};
EmojiInputMethod.prototype.handleKey = function(key, repeat) {
this._recentKeys.add(key.key);
return this._glue.sendKey(key, repeat);
};
EmojiInputMethod.prototype.updatePageKeys = function(page) {
page.panelKeys = this._recentKeys.getPanelKeys();
return page;
};
InputMethods.emoji = new EmojiInputMethod();
}());

View file

@ -0,0 +1,20 @@
'use strict';
/* global InputMethods */
InputMethods.india = {
_glue: null,
init: function(glue) {
this._glue = glue;
},
click: function(keyCode) {
this._glue.setUpperCase(false);
return this._glue.sendKey(keyCode);
},
displaysCandidates: function() {
return false;
}
};

View file

@ -0,0 +1,456 @@
MOZILLA PUBLIC LICENSE
Version 1.1
---------------
1. Definitions.
1.0.1. "Commercial Use" means distribution or otherwise making the
Covered Code available to a third party.
1.1. "Contributor" means each entity that creates or contributes to
the creation of Modifications.
1.2. "Contributor Version" means the combination of the Original
Code, prior Modifications used by a Contributor, and the Modifications
made by that particular Contributor.
1.3. "Covered Code" means the Original Code or Modifications or the
combination of the Original Code and Modifications, in each case
including portions thereof.
1.4. "Electronic Distribution Mechanism" means a mechanism generally
accepted in the software development community for the electronic
transfer of data.
1.5. "Executable" means Covered Code in any form other than Source
Code.
1.6. "Initial Developer" means the individual or entity identified
as the Initial Developer in the Source Code notice required by Exhibit
A.
1.7. "Larger Work" means a work which combines Covered Code or
portions thereof with code not governed by the terms of this License.
1.8. "License" means this document.
1.8.1. "Licensable" means having the right to grant, to the maximum
extent possible, whether at the time of the initial grant or
subsequently acquired, any and all of the rights conveyed herein.
1.9. "Modifications" means any addition to or deletion from the
substance or structure of either the Original Code or any previous
Modifications. When Covered Code is released as a series of files, a
Modification is:
A. Any addition to or deletion from the contents of a file
containing Original Code or previous Modifications.
B. Any new file that contains any part of the Original Code or
previous Modifications.
1.10. "Original Code" means Source Code of computer software code
which is described in the Source Code notice required by Exhibit A as
Original Code, and which, at the time of its release under this
License is not already Covered Code governed by this License.
1.10.1. "Patent Claims" means any patent claim(s), now owned or
hereafter acquired, including without limitation, method, process,
and apparatus claims, in any patent Licensable by grantor.
1.11. "Source Code" means the preferred form of the Covered Code for
making modifications to it, including all modules it contains, plus
any associated interface definition files, scripts used to control
compilation and installation of an Executable, or source code
differential comparisons against either the Original Code or another
well known, available Covered Code of the Contributor's choice. The
Source Code can be in a compressed or archival form, provided the
appropriate decompression or de-archiving software is widely available
for no charge.
1.12. "You" (or "Your") means an individual or a legal entity
exercising rights under, and complying with all of the terms of, this
License or a future version of this License issued under Section 6.1.
For legal entities, "You" includes any entity which controls, is
controlled by, or is under common control with You. For purposes of
this definition, "control" means (a) the power, direct or indirect,
to cause the direction or management of such entity, whether by
contract or otherwise, or (b) ownership of more than fifty percent
(50%) of the outstanding shares or beneficial ownership of such
entity.
2. Source Code License.
2.1. The Initial Developer Grant.
The Initial Developer hereby grants You a world-wide, royalty-free,
non-exclusive license, subject to third party intellectual property
claims:
(a) under intellectual property rights (other than patent or
trademark) Licensable by Initial Developer to use, reproduce,
modify, display, perform, sublicense and distribute the Original
Code (or portions thereof) with or without Modifications, and/or
as part of a Larger Work; and
(b) under Patents Claims infringed by the making, using or
selling of Original Code, to make, have made, use, practice,
sell, and offer for sale, and/or otherwise dispose of the
Original Code (or portions thereof).
(c) the licenses granted in this Section 2.1(a) and (b) are
effective on the date Initial Developer first distributes
Original Code under the terms of this License.
(d) Notwithstanding Section 2.1(b) above, no patent license is
granted: 1) for code that You delete from the Original Code; 2)
separate from the Original Code; or 3) for infringements caused
by: i) the modification of the Original Code or ii) the
combination of the Original Code with other software or devices.
2.2. Contributor Grant.
Subject to third party intellectual property claims, each Contributor
hereby grants You a world-wide, royalty-free, non-exclusive license
(a) under intellectual property rights (other than patent or
trademark) Licensable by Contributor, to use, reproduce, modify,
display, perform, sublicense and distribute the Modifications
created by such Contributor (or portions thereof) either on an
unmodified basis, with other Modifications, as Covered Code
and/or as part of a Larger Work; and
(b) under Patent Claims infringed by the making, using, or
selling of Modifications made by that Contributor either alone
and/or in combination with its Contributor Version (or portions
of such combination), to make, use, sell, offer for sale, have
made, and/or otherwise dispose of: 1) Modifications made by that
Contributor (or portions thereof); and 2) the combination of
Modifications made by that Contributor with its Contributor
Version (or portions of such combination).
(c) the licenses granted in Sections 2.2(a) and 2.2(b) are
effective on the date Contributor first makes Commercial Use of
the Covered Code.
(d) Notwithstanding Section 2.2(b) above, no patent license is
granted: 1) for any code that Contributor has deleted from the
Contributor Version; 2) separate from the Contributor Version;
3) for infringements caused by: i) third party modifications of
Contributor Version or ii) the combination of Modifications made
by that Contributor with other software (except as part of the
Contributor Version) or other devices; or 4) under Patent Claims
infringed by Covered Code in the absence of Modifications made by
that Contributor.
3. Distribution Obligations.
3.1. Application of License.
The Modifications which You create or to which You contribute are
governed by the terms of this License, including without limitation
Section 2.2. The Source Code version of Covered Code may be
distributed only under the terms of this License or a future version
of this License released under Section 6.1, and You must include a
copy of this License with every copy of the Source Code You
distribute. You may not offer or impose any terms on any Source Code
version that alters or restricts the applicable version of this
License or the recipients' rights hereunder. However, You may include
an additional document offering the additional rights described in
Section 3.5.
3.2. Availability of Source Code.
Any Modification which You create or to which You contribute must be
made available in Source Code form under the terms of this License
either on the same media as an Executable version or via an accepted
Electronic Distribution Mechanism to anyone to whom you made an
Executable version available; and if made available via Electronic
Distribution Mechanism, must remain available for at least twelve (12)
months after the date it initially became available, or at least six
(6) months after a subsequent version of that particular Modification
has been made available to such recipients. You are responsible for
ensuring that the Source Code version remains available even if the
Electronic Distribution Mechanism is maintained by a third party.
3.3. Description of Modifications.
You must cause all Covered Code to which You contribute to contain a
file documenting the changes You made to create that Covered Code and
the date of any change. You must include a prominent statement that
the Modification is derived, directly or indirectly, from Original
Code provided by the Initial Developer and including the name of the
Initial Developer in (a) the Source Code, and (b) in any notice in an
Executable version or related documentation in which You describe the
origin or ownership of the Covered Code.
3.4. Intellectual Property Matters
(a) Third Party Claims.
If Contributor has knowledge that a license under a third party's
intellectual property rights is required to exercise the rights
granted by such Contributor under Sections 2.1 or 2.2,
Contributor must include a text file with the Source Code
distribution titled "LEGAL" which describes the claim and the
party making the claim in sufficient detail that a recipient will
know whom to contact. If Contributor obtains such knowledge after
the Modification is made available as described in Section 3.2,
Contributor shall promptly modify the LEGAL file in all copies
Contributor makes available thereafter and shall take other steps
(such as notifying appropriate mailing lists or newsgroups)
reasonably calculated to inform those who received the Covered
Code that new knowledge has been obtained.
(b) Contributor APIs.
If Contributor's Modifications include an application programming
interface and Contributor has knowledge of patent licenses which
are reasonably necessary to implement that API, Contributor must
also include this information in the LEGAL file.
(c) Representations.
Contributor represents that, except as disclosed pursuant to
Section 3.4(a) above, Contributor believes that Contributor's
Modifications are Contributor's original creation(s) and/or
Contributor has sufficient rights to grant the rights conveyed by
this License.
3.5. Required Notices.
You must duplicate the notice in Exhibit A in each file of the Source
Code. If it is not possible to put such notice in a particular Source
Code file due to its structure, then You must include such notice in a
location (such as a relevant directory) where a user would be likely
to look for such a notice. If You created one or more Modification(s)
You may add your name as a Contributor to the notice described in
Exhibit A. You must also duplicate this License in any documentation
for the Source Code where You describe recipients' rights or ownership
rights relating to Covered Code. You may choose to offer, and to
charge a fee for, warranty, support, indemnity or liability
obligations to one or more recipients of Covered Code. However, You
may do so only on Your own behalf, and not on behalf of the Initial
Developer or any Contributor. You must make it absolutely clear than
any such warranty, support, indemnity or liability obligation is
offered by You alone, and You hereby agree to indemnify the Initial
Developer and every Contributor for any liability incurred by the
Initial Developer or such Contributor as a result of warranty,
support, indemnity or liability terms You offer.
3.6. Distribution of Executable Versions.
You may distribute Covered Code in Executable form only if the
requirements of Section 3.1-3.5 have been met for that Covered Code,
and if You include a notice stating that the Source Code version of
the Covered Code is available under the terms of this License,
including a description of how and where You have fulfilled the
obligations of Section 3.2. The notice must be conspicuously included
in any notice in an Executable version, related documentation or
collateral in which You describe recipients' rights relating to the
Covered Code. You may distribute the Executable version of Covered
Code or ownership rights under a license of Your choice, which may
contain terms different from this License, provided that You are in
compliance with the terms of this License and that the license for the
Executable version does not attempt to limit or alter the recipient's
rights in the Source Code version from the rights set forth in this
License. If You distribute the Executable version under a different
license You must make it absolutely clear that any terms which differ
from this License are offered by You alone, not by the Initial
Developer or any Contributor. You hereby agree to indemnify the
Initial Developer and every Contributor for any liability incurred by
the Initial Developer or such Contributor as a result of any such
terms You offer.
3.7. Larger Works.
You may create a Larger Work by combining Covered Code with other code
not governed by the terms of this License and distribute the Larger
Work as a single product. In such a case, You must make sure the
requirements of this License are fulfilled for the Covered Code.
4. Inability to Comply Due to Statute or Regulation.
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Code due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description
must be included in the LEGAL file described in Section 3.4 and must
be included with all distributions of the Source Code. Except to the
extent prohibited by statute or regulation, such description must be
sufficiently detailed for a recipient of ordinary skill to be able to
understand it.
5. Application of this License.
This License applies to code to which the Initial Developer has
attached the notice in Exhibit A and to related Covered Code.
6. Versions of the License.
6.1. New Versions.
Netscape Communications Corporation ("Netscape") may publish revised
and/or new versions of the License from time to time. Each version
will be given a distinguishing version number.
6.2. Effect of New Versions.
Once Covered Code has been published under a particular version of the
License, You may always continue to use it under the terms of that
version. You may also choose to use such Covered Code under the terms
of any subsequent version of the License published by Netscape. No one
other than Netscape has the right to modify the terms applicable to
Covered Code created under this License.
6.3. Derivative Works.
If You create or use a modified version of this License (which you may
only do in order to apply it to code which is not already Covered Code
governed by this License), You must (a) rename Your license so that
the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
"MPL", "NPL" or any confusingly similar phrase do not appear in your
license (except to note that your license differs from this License)
and (b) otherwise make it clear that Your version of the license
contains terms which differ from the Mozilla Public License and
Netscape Public License. (Filling in the name of the Initial
Developer, Original Code or Contributor in the notice described in
Exhibit A shall not of themselves be deemed to be modifications of
this License.)
7. DISCLAIMER OF WARRANTY.
COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
8. TERMINATION.
8.1. This License and the rights granted hereunder will terminate
automatically if You fail to comply with terms herein and fail to cure
such breach within 30 days of becoming aware of the breach. All
sublicenses to the Covered Code which are properly granted shall
survive any termination of this License. Provisions which, by their
nature, must remain in effect beyond the termination of this License
shall survive.
8.2. If You initiate litigation by asserting a patent infringement
claim (excluding declatory judgment actions) against Initial Developer
or a Contributor (the Initial Developer or Contributor against whom
You file such action is referred to as "Participant") alleging that:
(a) such Participant's Contributor Version directly or indirectly
infringes any patent, then any and all rights granted by such
Participant to You under Sections 2.1 and/or 2.2 of this License
shall, upon 60 days notice from Participant terminate prospectively,
unless if within 60 days after receipt of notice You either: (i)
agree in writing to pay Participant a mutually agreeable reasonable
royalty for Your past and future use of Modifications made by such
Participant, or (ii) withdraw Your litigation claim with respect to
the Contributor Version against such Participant. If within 60 days
of notice, a reasonable royalty and payment arrangement are not
mutually agreed upon in writing by the parties or the litigation claim
is not withdrawn, the rights granted by Participant to You under
Sections 2.1 and/or 2.2 automatically terminate at the expiration of
the 60 day notice period specified above.
(b) any software, hardware, or device, other than such Participant's
Contributor Version, directly or indirectly infringes any patent, then
any rights granted to You by such Participant under Sections 2.1(b)
and 2.2(b) are revoked effective as of the date You first made, used,
sold, distributed, or had made, Modifications made by that
Participant.
8.3. If You assert a patent infringement claim against Participant
alleging that such Participant's Contributor Version directly or
indirectly infringes any patent where such claim is resolved (such as
by license or settlement) prior to the initiation of patent
infringement litigation, then the reasonable value of the licenses
granted by such Participant under Sections 2.1 or 2.2 shall be taken
into account in determining the amount or value of any payment or
license.
8.4. In the event of termination under Sections 8.1 or 8.2 above,
all end user license agreements (excluding distributors and resellers)
which have been validly granted by You or any distributor hereunder
prior to termination shall survive termination.
9. LIMITATION OF LIABILITY.
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
10. U.S. GOVERNMENT END USERS.
The Covered Code is a "commercial item," as that term is defined in
48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
software" and "commercial computer software documentation," as such
terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
all U.S. Government End Users acquire Covered Code with only those
rights set forth herein.
11. MISCELLANEOUS.
This License represents the complete agreement concerning subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. This License shall be governed by
California law provisions (except to the extent applicable law, if
any, provides otherwise), excluding its conflict-of-law provisions.
With respect to disputes in which at least one party is a citizen of,
or an entity chartered or registered to do business in the United
States of America, any litigation relating to this License shall be
subject to the jurisdiction of the Federal Courts of the Northern
District of California, with venue lying in Santa Clara County,
California, with the losing party responsible for costs, including
without limitation, court costs and reasonable attorneys' fees and
expenses. The application of the United Nations Convention on
Contracts for the International Sale of Goods is expressly excluded.
Any law or regulation which provides that the language of a contract
shall be construed against the drafter shall not apply to this
License.
12. RESPONSIBILITY FOR CLAIMS.
As between Initial Developer and the Contributors, each party is
responsible for claims and damages arising, directly or indirectly,
out of its utilization of rights under this License and You agree to
work with Initial Developer and Contributors to distribute such
responsibility on an equitable basis. Nothing herein is intended or
shall be deemed to constitute any admission of liability.
13. MULTIPLE-LICENSED CODE.
Initial Developer may designate portions of the Covered Code as
"Multiple-Licensed". "Multiple-Licensed" means that the Initial
Developer permits you to utilize portions of the Covered Code under
Your choice of the NPL or the alternative licenses, if any, specified
by the Initial Developer in the file described in Exhibit A.
EXHIBIT A -Mozilla Public License.
``The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
The Original Code is jsAvroPhonetic.
The Initial Developer of the Original Code is
Rifat Nabi <to.rifat@gmail.com>
Copyright (C) OmicronLab <http://www.omicronlab.com>. All Rights Reserved.
Contributor(s): Mehdi Hasan <mhasan@omicronlab.com>"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,299 @@
/* -*- Mode: js; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* global KeyEvent, InputMethods */
'use strict';
(function() {
var keyboard, ime, composingText, JangmiIME;
var BACKSPACE = KeyEvent.DOM_VK_BACK_SPACE;
/*
JangmiIME
https://github.com/sangpire/jangmiIME
Copyright 2013, BYUN Sangpil. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS-IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
(function() {
var isCompatibleJamoKeyCode;
var UTF8_HANGUL_SYLLABLES_START = 0xAC00;
var UTF8_HANGUL_COMPATIBILITY_START = 0x3131;
var UTF8_CHOSEONG_DIFF = '까'.charCodeAt(0) - '가'.charCodeAt(0);
var UTF8_JUNGSEONG_DIFF = '개'.charCodeAt(0) - '가'.charCodeAt(0);
var COMPATIBILITY_MULTI_JAMO_MAP = {
'ㄱㄱ' : 0x1, 'ㄷㄷ' : 0x7, 'ㅂㅂ' : 0x12, 'ㅅㅅ' : 0x15,
'ㅈㅈ' : 0x18, 'ㅗㅏ' : 0x27, 'ㅗㅐ' : 0x28, 'ㅗㅣ' : 0x29,
'ㅜㅓ' : 0x2C, 'ㅜㅔ' : 0x2E, 'ㅜㅣ' : 0x2E, 'ㅡㅣ' : 0x31
};
var CHO_SEONG_MAP = {
'ㄱ' : 0, 'ㄱㄱ' : 1, 'ㄲ' : 1, 'ㄴ' : 2, 'ㄷ' : 3,
'ㄷㄷ' : 4, 'ㄸ' : 4, 'ㄹ' : 5, 'ㅁ' : 6, 'ㅂ' : 7,
'ㅂㅂ' : 8, 'ㅃ' : 8, 'ㅅ' : 9, 'ㅅㅅ' : 10, 'ㅆ' : 10,
'ㅇ' : 11, 'ㅈ' : 12, 'ㅈㅈ' : 13, 'ㅉ' : 13, 'ㅊ' : 14,
'ㅋ' : 15, 'ㅌ' : 16, 'ㅍ' : 17, 'ㅎ' : 18
};
var JUNG_SEONG_MAP = {
'ㅏ' : 0, 'ㅐ' : 1, 'ㅑ' : 2, 'ㅒ' : 3, 'ㅓ' : 4,
'ㅔ' : 5, 'ㅕ' : 6, 'ㅖ' : 7, 'ㅗ' : 8, 'ㅘ' : 9,
'ㅗㅏ' : 9, 'ㅙ' : 10, 'ㅗㅐ' : 10, 'ㅚ' : 11, 'ㅗㅣ' : 11,
'ㅛ' : 12, 'ㅜ' : 13, 'ㅝ' : 14, 'ㅜㅓ' : 14, 'ㅞ' : 15,
'ㅜㅔ' : 15, 'ㅟ' : 16, 'ㅜㅣ' : 16, 'ㅠ' : 17, 'ㅡ' : 18,
'ㅢ' : 19, 'ㅡㅣ' : 19, 'ㅣ' : 20
};
var JONG_SEONG_MAP = {
'ㄱ' : 1, 'ㄲ' : 2, 'ㄱㅅ' : 3, 'ㄴ' : 4, 'ㄴㅈ' : 5,
'ㄴㅎ' : 6, 'ㄷ' : 7, 'ㄹ' : 8, 'ㄹㄱ' : 9, 'ㄹㅁ' : 10,
'ㄹㅂ' : 11, 'ㄹㅅ' : 12, 'ㄹㅌ' : 13, 'ㄹㅍ' : 14, 'ㄹㅎ' : 15,
'ㅁ' : 16, 'ㅂ' : 17, 'ㅂㅅ' : 18, 'ㅅ' : 19, 'ㅆ' : 20,
'ㅇ' : 21, 'ㅈ' : 22, 'ㅊ' : 23, 'ㅋ' : 24, 'ㅌ' : 25,
'ㅍ' : 26, 'ㅎ' : 27
};
isCompatibleJamoKeyCode = function(keyCode) {
return (0x3131 <= keyCode && keyCode <= 0x318e);
};
JangmiIME = (function() {
/*
@handler =
passed: (keyCode) ->
added: (gul) ->
changed: (gul) ->
*/
function JangmiIME(handler) {
this.handler = handler;
this.reset();
}
/*
Reset Current State.
*/
JangmiIME.prototype.reset = function() {
this.curJamo = null;
this.choSeong = [];
this.jungSeong = [];
this.jongSeong = [];
};
JangmiIME.prototype.added = function() {
var curGul;
curGul = this.peep();
if (curGul != null) {
return this.handler.added(curGul);
}
};
JangmiIME.prototype.changed = function() {
var curGul;
curGul = this.peep();
if (curGul != null) {
return this.handler.changed(curGul);
}
};
JangmiIME.prototype.isEmpty = function() {
return (this.choSeong.length +
this.jungSeong.length +
this.jongSeong.length) === 0;
};
/*
Add KeyCode
*/
JangmiIME.prototype.add = function(keyCode) {
var curJamo, jamo, temp;
if (!isCompatibleJamoKeyCode(keyCode)) {
this.reset();
return this.handler.passed(keyCode);
} else {
jamo = String.fromCharCode(keyCode);
if (this.curJamo == null) {
if (CHO_SEONG_MAP.hasOwnProperty(jamo)) {
this.curJamo = this.choSeong;
}
if (JUNG_SEONG_MAP.hasOwnProperty(jamo)) {
this.curJamo = this.jungSeong;
}
this.curJamo.push(jamo);
return this.added();
} else {
curJamo = this.curJamo.join('') + jamo;
switch (this.curJamo) {
case this.choSeong:
if (CHO_SEONG_MAP.hasOwnProperty(curJamo)) {
this.curJamo.push(jamo);
return this.changed();
} else {
if (JUNG_SEONG_MAP.hasOwnProperty(jamo)) {
this.jungSeong.push(jamo);
this.curJamo = this.jungSeong;
return this.changed();
} else {
this.reset();
return this.add(keyCode);
}
}
break;
case this.jungSeong:
if (JUNG_SEONG_MAP.hasOwnProperty(curJamo)) {
this.curJamo.push(jamo);
return this.changed();
} else {
if (this.choSeong.length > 0 &&
JONG_SEONG_MAP.hasOwnProperty(jamo)) {
this.jongSeong.push(jamo);
this.curJamo = this.jongSeong;
return this.changed();
} else {
this.reset();
return this.add(keyCode);
}
}
break;
case this.jongSeong:
if (JONG_SEONG_MAP.hasOwnProperty(curJamo)) {
this.curJamo.push(jamo);
return this.changed();
} else {
if (JUNG_SEONG_MAP.hasOwnProperty(jamo)) {
temp = this.curJamo.pop();
this.changed();
this.reset();
this.choSeong.push(temp);
this.jungSeong.push(jamo);
this.curJamo = this.jungSeong;
return this.added();
} else {
this.reset();
this.curJamo = null;
return this.add(keyCode);
}
}
}
}
}
};
/*
Delete Last Input
*/
JangmiIME.prototype.back = function() {
if (this.curJamo.length > 0) {
this.curJamo.pop();
return this.changed();
} else {
switch (this.curJamo) {
case this.jungSeong:
this.curJamo = this.choSeong;
return this.back();
case this.jongSeong:
this.curJamo = this.jungSeong;
return this.back();
}
}
};
/*
peep current hangul
*/
JangmiIME.prototype.peep = function() {
var code;
if (this.choSeong.length > 0 && this.jungSeong.length > 0) {
code = UTF8_HANGUL_SYLLABLES_START +
CHO_SEONG_MAP[this.choSeong.join('')] * UTF8_CHOSEONG_DIFF;
code += JUNG_SEONG_MAP[this.jungSeong.join('')] * UTF8_JUNGSEONG_DIFF;
if (this.jongSeong.length > 0) {
code += JONG_SEONG_MAP[this.jongSeong.join('')];
}
} else {
if (this.choSeong.length === 1) {
code = this.choSeong[0].charCodeAt(0);
} else if (this.choSeong.length > 1) {
code = UTF8_HANGUL_COMPATIBILITY_START +
COMPATIBILITY_MULTI_JAMO_MAP[this.choSeong.join('')];
} else if (this.jungSeong.length === 1) {
code = this.jungSeong[0].charCodeAt(0);
} else if (this.jungSeong.length > 1) {
code = UTF8_HANGUL_COMPATIBILITY_START +
COMPATIBILITY_MULTI_JAMO_MAP[this.jungSeong.join('')];
} else {
return '';
}
}
return String.fromCharCode(code);
};
return JangmiIME;
})();
})();
InputMethods.jshangul = {
init: init,
click: click,
deactivate: deactivate
};
function setComposition(gul) {
composingText = gul;
keyboard.setComposition(gul);
}
function endComposition() {
if (composingText.length > 0) {
keyboard.endComposition(composingText);
composingText = '';
}
}
function init(interfaceObject) {
keyboard = interfaceObject;
composingText = '';
ime = new JangmiIME({
passed: function(keyCode) {
endComposition();
keyboard.sendKey(keyCode);
},
added: function(gul) {
endComposition();
setComposition(gul);
},
changed: function(gul) {
setComposition(gul);
}
});
}
function deactivate() {
endComposition();
ime.reset();
}
function click(keycode, x, y) {
if (keycode === BACKSPACE && !ime.isEmpty()) {
ime.back();
} else {
ime.add(keycode);
}
keyboard.setUpperCase({
isUpperCase: false
});
}
})();

View file

@ -0,0 +1,213 @@
Jspinyin is a Simplified Chinese input method for gaia and is licensed under
the Apache Version 2.0, 2012. The original code is based on the Google
PinyinIME project as part of the android project hosted at:
http://android.googlesource.com/platform/packages/inputmethods/PinyinIME.
We use Emscripten (https://github.com/kripken/emscripten) to compile the
original code into JavaScript version.
==========================================================================
Copyright notice for jspinyin.
Copyright (c) 2012, Mozilla Online
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==========================================================================
Copyright notice for PinyinIME.
Copyright (c) 2009, The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS

View file

@ -0,0 +1,132 @@
/* jshint sub: true */
/* global Module */
'use strict';
(function() {
if (typeof Module == 'undefined') {
/*jshint -W020 */
Module = {};
/*jshint +W020 */
}
if (!Module['preRun']) {
Module['preRun'] = [];
}
Module['preRun'].push(function() {
function assert(check, msg) {
if (!check) {
throw msg + new Error().stack;
}
}
Module['FS_createPath']('/', 'data', true, true);
function DataRequest() {}
DataRequest.prototype = {
requests: {},
open: function(mode, name) {
this.requests[name] = this;
},
send: function() {}
};
var filePreload0 = new DataRequest();
filePreload0.open('GET', 'data/dict.data', true);
filePreload0.responseType = 'arraybuffer';
filePreload0.onload = function() {
var arrayBuffer = filePreload0.response;
assert(arrayBuffer, 'Loading file data/dict.data failed.');
var byteArray = !arrayBuffer.subarray ?
new Uint8Array(arrayBuffer) : arrayBuffer;
Module['FS_createPreloadedFile'](
'/data', 'dict.data', byteArray, true, true, function() {
Module['removeRunDependency']('fp data/dict.data');
}
);
};
Module['addRunDependency']('fp data/dict.data');
filePreload0.send(null);
if (!Module.expectedDataFileDownloads) {
Module.expectedDataFileDownloads = 0;
Module.finishedDataFileDownloads = 0;
}
Module.expectedDataFileDownloads++;
var PACKAGE_NAME = 'empinyin_files.data';
var REMOTE_PACKAGE_NAME =
(Module['empinyin_files_path'] ? Module['empinyin_files_path'] + '/' : '') +
'empinyin_files.data';
function fetchRemotePackage(packageName, callback, errback) {
var xhr = new XMLHttpRequest();
xhr.open('GET', packageName, true);
xhr.responseType = 'arraybuffer';
xhr.onprogress = function(event) {
var url = packageName;
if (event.loaded && event.total) {
if (!xhr.addedTotal) {
xhr.addedTotal = true;
if (!Module.dataFileDownloads) {
Module.dataFileDownloads = {};
}
Module.dataFileDownloads[url] = {
loaded: event.loaded,
total: event.total
};
} else {
Module.dataFileDownloads[url].loaded = event.loaded;
}
var total = 0;
var loaded = 0;
var num = 0;
for (var download in Module.dataFileDownloads) {
var data = Module.dataFileDownloads[download];
total += data.total;
loaded += data.loaded;
num++;
}
total = Math.ceil(total * Module.expectedDataFileDownloads / num);
Module['setStatus'](
'Downloading data... (' + loaded + '/' + total + ')'
);
} else if (!Module.dataFileDownloads) {
Module['setStatus']('Downloading data...');
}
};
xhr.onload = function(event) {
var packageData = xhr.response;
callback(packageData);
};
xhr.send(null);
}
function processPackageData(arrayBuffer) {
Module.finishedDataFileDownloads++;
assert(arrayBuffer, 'Loading data file failed.');
var byteArray = new Uint8Array(arrayBuffer);
var curr;
curr = DataRequest.prototype.requests['data/dict.data'];
var data = byteArray.subarray(0, 1068442);
var ptr = Module['_malloc'](1068442);
Module['HEAPU8'].set(data, ptr);
curr.response = Module['HEAPU8'].subarray(ptr, ptr + 1068442);
curr.onload();
Module['removeRunDependency']('datafile_empinyin_files.data');
}
Module['addRunDependency']('datafile_empinyin_files.data');
function handleError(error) {
console.error('package error:', error);
}
if (!Module.preloadResults) {
Module.preloadResults = {};
}
Module.preloadResults[PACKAGE_NAME] = {fromCache: false};
fetchRemotePackage(REMOTE_PACKAGE_NAME, processPackageData, handleError);
});
})();

View file

@ -0,0 +1,771 @@
/* -*- Mode: js; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* global KeyEvent, define, InputMethods */
'use strict';
(function() {
var debugging = false;
var debug = function jspinyin_debug(str) {
if (!debugging) {
return;
}
var done = false;
if (typeof window != 'undefined' && window.dump) {
window.dump('jspinyin: ' + str + '\n');
done = true;
}
if (typeof console != 'undefined' && console.log) {
console.log('jspinyin: ' + str);
if (arguments.length > 1) {
console.log.apply(this, arguments);
}
done = true;
}
if (done) {
return;
}
if (typeof Test != 'undefined') {
print('jspinyin: ' + str + '\n');
}
};
var assert = function jspinyin_assert(condition, msg) {
if (!debugging) {
return;
}
if (!condition) {
var str = typeof msg === 'undefined' ? assert.caller.toString() : msg;
if (typeof alert === 'function') {
alert(msg);
} else {
throw str;
}
}
};
var IMEngineBase = function engineBase_constructor() {
this._glue = {};
};
IMEngineBase.prototype = {
/**
* Glue ojbect between the IMEngieBase and the IMEManager.
*/
_glue: {
/**
* The source code path of the IMEngine
* @type String
*/
path: '',
/**
* Sends candidates to the IMEManager
*/
sendCandidates: function(candidates) {},
/**
* Sends pending symbols to the IMEManager.
*/
sendPendingSymbols: function(symbols) {},
/**
* Passes the clicked key to IMEManager for default action.
* @param {number} keyCode The key code of an integer.
*/
sendKey: function(keyCode) {},
/**
* Sends the input string to the IMEManager.
* @param {String} str The input string.
*/
sendString: function(str) {}
},
/**
* Initialization.
* @param {Glue} glue Glue object of the IMManager.
*/
init: function engineBase_init(glue) {
this._glue = glue;
},
/**
* Destruction.
*/
uninit: function engineBase_uninit() {
},
/**
* Notifies when a keyboard key is clicked.
* @param {number} keyCode The key code of an integer number.
*/
click: function engineBase_click(keyCode) {
},
/**
* Notifies when pending symbols need be cleared
*/
empty: function engineBase_empty() {
},
/**
* Notifies when a candidate is selected.
* @param {String} text The text of the candidate.
* @param {Object} data User data of the candidate.
*/
select: function engineBase_select(text, data) {
},
/**
* Notifies when selection changes
*/
stateChange: function engineBase_stateChange(detail) {
},
/**
* Notifies when surrounding text changes
*/
surroundingtextChange: function engineBase_surroundingtextChange(detail) {
},
/**
* Notifies when the IM is shown
*/
activate: function engineBase_activate(language, state, options) {
},
/**
* Called when the keyboard is hidden
*/
deactivate: function engineBase_deactivate() {
}
};
var emEngineWrapper = {
_worker: null,
_callback: null,
_initialized: false,
post: function(id, param, callback) {
if (!this._initialized && id != 'init') {
throw 'Database not ready!';
}
if (!this._callback[id]) {
this._callback[id] = [];
}
this._callback[id].push(callback);
this._worker.postMessage({
id: id,
param: param
});
return true;
},
init: function(path, byteArray, callback) {
if (this._initialized) {
callback(true);
return;
}
var self = this;
this._callback = {};
this._worker = new Worker(path + '/worker.js');
this._worker.onmessage = function(e) {
var data = e.data;
switch (data.id) {
case 'message':
console.log('emEngineWrapper: ' + data.returnValue);
break;
default:
var msgCallback = self._callback[data.id].shift();
if (msgCallback) {
msgCallback(data.returnValue);
}
}
};
this.post('init', {
userDict: byteArray
}, function(isOk) {
if (isOk) {
self._initialized = true;
} else {
self.uninit();
}
callback(isOk);
});
},
uninit: function() {
if (this._worker) {
this._worker.terminate();
}
this._worker = null;
this._callback = null;
this._initialized = false;
},
isReady: function() {
return this._initialized;
}
};
var IMEngine = function engine_constructor() {
IMEngineBase.call(this);
};
// We use keycode 65 to represent "'" for pinyin input method
var SPECIAL_KEYCODE_FOR_DELIMITER = 65;
IMEngine.prototype = {
// Implements IMEngineBase
__proto__: new IMEngineBase(),
// Buffer limit will force output the longest matching terms
// if the length of the syllables buffer is reached.
_kBufferLenLimit: 30,
// Remember the candidate length of last searching result because we don't
// want to output all candidates at a time.
// Set it to 0 when we don't need the candidates buffer anymore.
_candidatesLength: 0,
_workerTimeout: 600000,
/**
* The last selected text used to generate prediction.
* @type string
*/
_historyText: '',
_pendingSymbols: '',
_firstCandidate: '',
_keypressQueue: [],
_isWorking: false,
_isActive: false,
_uninitTimer: null,
_sendPendingSymbols: function engine_sendPendingSymbols() {
debug('SendPendingSymbol: ' + this._pendingSymbols);
if (this._pendingSymbols) {
var self = this;
emEngineWrapper.post(
'im_get_pending_symbols_info',
{},
function(returnValue) {
var fixedLen = returnValue.fixedLen;
var splStart = returnValue.splStart;
var splStartLen = splStart.length;
var display = self._firstCandidate.substring(0, fixedLen);
if (splStartLen > 1) {
for (var i = fixedLen; i < splStartLen - 1; i++) {
display += self._pendingSymbols.substring(splStart[i],
splStart[i + 1]) + ' ';
}
display +=
self._pendingSymbols.substring(splStart[splStartLen - 1]);
} else {
display += self._pendingSymbols;
}
self._glue.setComposition(display.trim());
}
);
} else {
this._glue.endComposition();
}
},
/**
* Send candidates list.
* @param {Array.<string>} candidates The candidates to be sent.
* @return {void} No return value.
*/
_sendCandidates: function engine_sendCandidates(candidates) {
var list = [];
var len = candidates.length;
for (var id = 0; id < len; id++) {
var cand = candidates[id];
if (id === 0) {
this._firstCandidate = cand;
}
list.push([cand, id]);
}
this._glue.sendCandidates(list);
},
_start: function engine_start() {
if (this._isWorking) {
return;
}
if (!emEngineWrapper.isReady()) {
debug('emEngineWrapper is not ready!');
return;
}
this._isWorking = true;
debug('Start keyQueue loop.');
this._next();
},
_next: function engine_next() {
debug('Processing keypress');
if (!this._keypressQueue.length) {
debug('keyQueue emptied.');
this._isWorking = false;
return;
}
var code = this._keypressQueue.shift();
// We use keycode 65 to represent "'" for pinyin input method
var realCode = (code === SPECIAL_KEYCODE_FOR_DELIMITER) ? 39 : code;
if (code === 0) {
// This is a select function operation.
this._updateCandidatesAndSymbols(this._next.bind(this));
return;
}
debug('key code: ' + code);
// Backspace - delete last input symbol if exists
if (code === KeyEvent.DOM_VK_BACK_SPACE) {
debug('Backspace key');
if (!this._pendingSymbols) {
if (this._firstCandidate) {
debug('Remove candidates.');
// prevent updateCandidateList from making the same suggestions
this.empty();
}
// pass the key to IMEManager for default action
debug('Default action.');
this._glue.sendKey(realCode);
this._next();
} else {
this._pendingSymbols = this._pendingSymbols.substring(0,
this._pendingSymbols.length - 1);
this._updateCandidatesAndSymbols(this._next.bind(this));
}
return;
}
// Select the first candidate if needed.
if (code === KeyEvent.DOM_VK_RETURN ||
!this._isPinyinKey(code) ||
this._pendingSymbols.length >= this._kBufferLenLimit) {
debug('Non-pinyin key is pressed or the input is too long.');
var sendKey = true;
if (this._firstCandidate) {
if (this._pendingSymbols) {
// candidate list exists; output the first candidate
debug('Sending first candidate.');
this._glue.endComposition(this._firstCandidate);
// no return here
if (code === KeyEvent.DOM_VK_RETURN) {
sendKey = false;
}
}
this._sendCandidates([]);
}
//pass the key to IMEManager for default action
debug('Default action.');
this.empty();
if (sendKey) {
this._glue.sendKey(realCode);
}
this._next();
return;
}
debug('Processing symbol: ' + String.fromCharCode(realCode));
// add symbol to pendingSymbols
this._appendNewSymbol(realCode);
this._updateCandidatesAndSymbols(this._next.bind(this));
},
_isPinyinKey: function engine_isPinyinKey(code) {
// keycode 65 is used to represent "'" for pinyin input method
// a-z
if ((code >= 97 && code <= 122) ||
code === SPECIAL_KEYCODE_FOR_DELIMITER) {
return true;
}
return false;
},
_appendNewSymbol: function engine_appendNewSymbol(code) {
var symbol = String.fromCharCode(code);
this._pendingSymbols += symbol;
},
_updateCandidatesAndSymbols: function engine_updateCandsAndSymbols(callback) {
var self = this;
this._updateCandidateList(function() {
self._sendPendingSymbols();
callback();
});
},
_updateCandidateList: function engine_updateCandidateList(callback) {
debug('Update Candidate List.');
var self = this;
var numberOfCandidatesPerRow = this._glue.getNumberOfCandidatesPerRow ?
this._glue.getNumberOfCandidatesPerRow() : Number.Infinity;
this._candidatesLength = 0;
if (!this._pendingSymbols) {
// If there is no pending symbols, make prediction with the previous
// select words.
if (this._historyText) {
debug('Buffer is empty; make suggestions based on select term.');
emEngineWrapper.post('im_search_predicts', {
queryString: this._historyText,
limit: numberOfCandidatesPerRow + 1
}, function(returnValue) {
var num = returnValue.length;
var predicts = returnValue.results;
if (num > numberOfCandidatesPerRow + 1) {
self._candidatesLength = num;
}
self._sendCandidates(predicts);
callback();
});
} else {
this._sendCandidates([]);
callback();
}
} else {
// Update the candidates list by the pending pinyin string.
this._historyText = '';
emEngineWrapper.post('im_search', {
queryString: this._pendingSymbols,
limit: numberOfCandidatesPerRow + 1
}, function(returnValue) {
var num = returnValue.length;
var candidates = returnValue.results;
if (num > numberOfCandidatesPerRow + 1) {
self._candidatesLength = num;
}
self._sendCandidates(candidates);
callback();
});
}
},
_resetKeypressQueue: function engine_abortKeypressQueue() {
this._keypressQueue = [];
this._isWorking = false;
},
_accessUserDict: function engine_loadUserDict(action, param, callback) {
var indexedDB = window.indexedDB;
if (!indexedDB) {
callback(null);
return;
}
// Access user_dict.data from IndexedDB
var dbVersion = 1;
var STORE_NAME = 'files';
var USER_DICT = 'user_dict';
var request = indexedDB.open('EmpinyinDatabase', dbVersion);
request.onerror = function opendb_onerror(event) {
debug('Error occurs when openning database: ' + event.target.errorCode);
callback(null);
};
request.onsuccess = function opendb_onsuccess(event) {
var db = event.target.result;
var request;
if (action == 'load') {
request = db.transaction([STORE_NAME], 'readonly')
.objectStore(STORE_NAME).get(USER_DICT);
request.onsuccess = function readdb_oncomplete(event) {
db.close();
if (!event.target.result) {
callback(null);
} else {
callback(event.target.result.content);
}
};
request.onerror = function readdb_oncomplete(event) {
debug('Failed to read file from DB: ' + event.target.result.name);
db.close();
callback(null);
};
} else if (action == 'save') {
var obj = {
name: USER_DICT,
content: param
};
request = db.transaction([STORE_NAME], 'readwrite')
.objectStore(STORE_NAME).put(obj);
request.onsuccess = function readdb_oncomplete(event) {
db.close();
callback(true);
};
request.onerror = function readdb_oncomplete(event) {
debug('Failed to write file to DB: ' + event.target.result.name);
db.close();
callback(false);
};
}
};
request.onupgradeneeded = function opendb_onupgradeneeded(event) {
var db = event.target.result;
// Delete the old ObjectStore if present
if (db.objectStoreNames.length !== 0) {
db.deleteObjectStore(STORE_NAME);
}
db.createObjectStore(STORE_NAME, { keyPath: 'name' });
};
},
/**
* Override
*/
init: function engine_init(glue) {
IMEngineBase.prototype.init.call(this, glue);
debug('init.');
},
/**
* Override
*/
uninit: function engine_uninit() {
IMEngineBase.prototype.uninit.call(this);
debug('Uninit.');
if (this._uninitTimer) {
clearTimeout(this._uninitTimer);
this._uninitTimer = null;
}
if (emEngineWrapper.isReady()) {
emEngineWrapper.uninit();
}
this._resetKeypressQueue();
this.empty();
},
/**
*Override
*/
click: function engine_click(keyCode) {
IMEngineBase.prototype.click.call(this, keyCode);
this._keypressQueue.push(keyCode);
this._start();
},
/**
* Override
*/
select: function engine_select(text, data) {
IMEngineBase.prototype.select.call(this, text, data);
if (!emEngineWrapper.isReady()) {
return;
}
var self = this;
var nextStep = function(text) {
if (text) {
if (self._pendingSymbols) {
self._pendingSymbols = '';
self._glue.endComposition(text);
} else {
self._glue.setComposition('');
self._glue.endComposition(text);
}
self._historyText = text;
self._candidatesLength = 0;
}
self._keypressQueue.push(0);
self._start();
};
if (this._pendingSymbols) {
emEngineWrapper.post('im_choose', {
candId: parseInt(data)
}, nextStep);
} else {
// A predication candidate is selected.
nextStep(text);
}
},
/**
* Override
*/
empty: function engine_empty() {
IMEngineBase.prototype.empty.call(this);
debug('empty.');
this._pendingSymbols = '';
this._historyText = '';
this._firstCandidate = '';
this._sendPendingSymbols();
this._sendCandidates([]);
},
/**
* Override
*/
stateChange: function engine_stateChange(detail) {
debug('stateChange');
if (detail.ownAction) {
return;
}
this.empty();
},
/**
* Override
*/
activate: function engine_activate(language, state, options) {
IMEngineBase.prototype.activate.call(this, language, state, options);
if (this._uninitTimer) {
clearTimeout(this._uninitTimer);
this._uninitTimer = null;
}
var inputType = state.type;
debug('Activate. Input type: ' + inputType);
if (!emEngineWrapper.isReady()) {
var self = this;
this._accessUserDict('load', null, function(byteArray) {
emEngineWrapper.init(self._glue.path, byteArray, function(isOk) {
if (isOk) {
self._start();
} else {
debug('emEngineWrapper initialize failed!!');
}
});
});
} else {
emEngineWrapper.post('im_flush_cache', {}, null);
}
this._isActive = true;
},
/**
* Override
*/
deactivate: function engine_deactivate() {
IMEngineBase.prototype.deactivate.call(this);
debug('Deactivate.');
if (!this._isActive) {
return;
}
this._isActive = false;
this._resetKeypressQueue();
this.empty();
var self = this;
emEngineWrapper.post('im_get_user_dict_data', {}, function(byteArray) {
if (byteArray) {
self._accessUserDict('save', byteArray, function(isOk) {
if (isOk) {
debug('Saved user dictionary to DB.');
} else {
debug('Failed to save user dictionary to DB.');
}
if (!self._uninitTimer) {
self._uninitTimer =
setTimeout(self.uninit.bind(self), self._workerTimeout);
}
});
}
});
},
getMoreCandidates: function engine_getMore(indicator, maxCount, callback) {
if (this._candidatesLength === 0) {
callback(null);
return;
}
var num = this._candidatesLength;
maxCount = Math.min((maxCount || num) + indicator, num);
var msgId = this._pendingSymbols ? 'im_get_candidates' : 'im_get_predicts';
emEngineWrapper.post(msgId, {
start: indicator,
count: maxCount
}, function(results) {
var len = results.length;
var list = [];
for (var i = 0; i < len; i++) {
list.push([results[i], i + indicator]);
}
callback(list);
});
}
};
var jspinyin = new IMEngine();
// Expose jspinyin as an AMD module
if (typeof define === 'function' && define.amd) {
define('jspinyin', [], function() { return jspinyin; });
}
// Expose the engine to the Gaia keyboard
if (typeof InputMethods !== 'undefined') {
InputMethods.jspinyin = jspinyin;
}
})();

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1">
<meta charset="UTF-8">
<title>Emscripten Pinyin Engine Test</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h1>Emscripten Pinyin Engine Test</h1>
<section>
<p><input type="text" value="z" id="pinyin"></p>
<p>
<input type="button" value="test" id="test">
<input type="button" value="test x n" id="test2">
</p>
</section>
<div id="status"></div>
<div id="log"></div>
<script type="text/javascript" src="init.js"></script>
</body>
</html>

View file

@ -0,0 +1,192 @@
'use strict';
const testRepeatCount = 10;
var emEngineWrapper = {
_worker: null,
_callback: null,
_initialized: false,
post: function(id, param, callback) {
if (!this._initialized && id != 'init') {
throw 'Database not ready!';
}
if (!this._callback[id]) {
this._callback[id] = [];
}
this._callback[id].push(callback);
this._worker.postMessage({
id: id,
param: param
});
return true;
},
init: function(path, byteArray, callback) {
if (this._initialized) {
callback(true);
}
var self = this;
this._callback = {};
this._worker = new Worker(path + '/worker.js');
this._worker.onmessage = function(e) {
var data = e.data;
switch (data.id) {
case 'message':
console.log('emEngineWrapper: ' + data.returnValue);
break;
default:
var msgCallback = self._callback[data.id].shift();
if (msgCallback) {
msgCallback(data.returnValue);
}
}
};
this.post('init', {
userDict: byteArray
}, function(isOk) {
if (isOk) {
self._initialized = true;
} else {
self.uninit();
}
callback(isOk);
});
},
uninit: function() {
if (this._worker) {
this._worker.terminate();
}
this._worker = null;
this._callback = null;
this._initialized = false;
},
isReady: function() {
return this._initialized;
}
};
window.addEventListener('load', function() {
document.getElementById('status').textContent =
'NOTE: please copy "../empinyin_files.*", "../libpinyin.js" and ' +
'"worker.js" to this "tests" folder first.';
document.getElementById('test2').value = 'test x ' + testRepeatCount;
emEngineWrapper.init('.', null, function(isOk) {
if (isOk) {
document.getElementById('status').textContent = '';
log('Engine ready!');
initTest();
} else {
log('Load data failed!');
}
});
});
function log(msg) {
var date = new Date();
var loggerTime = date.getHours() + ':' + date.getMinutes() + ':' +
date.getSeconds() + ':' + date.getMilliseconds();
var divLog = document.getElementById('log');
var p = document.createElement('p');
p.innerHTML = loggerTime + ' : ' + msg;
divLog.insertBefore(p, divLog.firstChild);
}
function initTest() {
document.getElementById('test').onclick = function() {
var keyword = document.getElementById('pinyin').value;
try {
log('search keyword ' + keyword);
var startTime = new Date().getTime();
emEngineWrapper.post('im_search', {
queryString: keyword,
limit: -1
}, function(returnValue) {
var endTime = new Date().getTime();
log('total cost: ' + (endTime - startTime) + 'ms');
var size = returnValue.length;
var candidates = returnValue.results;
log('length: ' + size);
log('Candidates: ' + candidates.join(' '));
emEngineWrapper.post('im_choose', {
candId: 0
}, function(convertedText) {
log('Choose: ' + convertedText);
if (convertedText) {
startTime = new Date().getTime();
emEngineWrapper.post('im_search_predicts', {
queryString: convertedText,
limit: -1
}, function(returnValue) {
endTime = new Date().getTime();
log('total cost: ' + (endTime - startTime) + 'ms');
var nPredicts = returnValue.length;
var predicts = returnValue.results;
log('length: ' + nPredicts);
log('Predicts: ' + predicts.join(' '));
});
}
});
});
} catch (e) {
log('error: ' + e);
}
};
document.getElementById('test2').onclick = function() {
var keyword = document.getElementById('pinyin').value;
try {
log('search ' + testRepeatCount + ' times keyword ' + keyword);
var startTime = new Date().getTime();
var counter = 0;
var doTest = function() {
emEngineWrapper.post('im_search', {
queryString: keyword,
limit: -1
}, function(returnValue) {
if (++counter == testRepeatCount) {
var endTime = new Date().getTime();
var period = endTime - startTime;
log('total cost: ' + period + 'ms');
log('average cost: ' + (period / testRepeatCount) + 'ms');
log('length: ' + returnValue.length);
} else {
doTest();
}
});
};
doTest();
} catch (e) {
log('error: ' + e);
}
};
}

View file

@ -0,0 +1,22 @@
input[type="text"] {
font-size: 1.5rem;
width: 18rem;
}
button, input[type="button"] {
width: 9rem;
height: 2.5rem;
font-size: 1.5rem;
}
#log, #status {
margin-top: 1rem;
}
#output {
margin-top: 1rem;
}
p {
margin: 0.3rem;
}

View file

@ -0,0 +1,175 @@
/* -*- Mode: js; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* jshint sub: true */
'use strict';
var Module;
var emEngine;
var procFunction;
self.onmessage = function(e) {
var data = e.data;
if (data.id == 'init') {
initModule(data.id, data.param);
} else if (procFunction[data.id]) {
var result = procFunction[data.id](data.param);
post(data.id, result);
} else {
log('echo: ' + JSON.stringify(e.data));
}
};
function initModule(msgId, param) {
Module = {
canvas: {},
stdout: null,
setStatus: log,
preRun: [function() {
if (param.userDict) {
Module['addRunDependency']('fp data/user_dict.data');
Module['FS_createPreloadedFile'](
'/data', 'user_dict.data', param.userDict, true, true, function() {
Module['removeRunDependency']('fp data/user_dict.data');
});
}
}],
_main: function() {
emEngine = {
openDecoder:
Module.cwrap('im_open_decoder', 'number', ['string', 'string']),
closeDecoder:
Module.cwrap('im_close_decoder', '', []),
search:
Module.cwrap('im_search', 'number', ['string', 'number']),
resetSearch:
Module.cwrap('im_reset_search', '', []),
getCandidateAt:
Module.cwrap('im_get_candidate_char', 'string', ['number']),
getPredicts:
Module.cwrap('im_get_predicts_utf8', 'number', ['string', 'number']),
getPredictAt:
Module.cwrap('im_get_predict_at', 'string', ['number']),
choose:
Module.cwrap('im_choose', 'number', ['number']),
getSplStart:
Module.cwrap('im_get_spl_start', 'number', []),
getSplStartAt:
Module.cwrap('im_get_spl_start_at', 'number', ['number']),
getFixedLen:
Module.cwrap('im_get_fixed_len', 'number', []),
flushCache:
Module.cwrap('im_flush_cache', '', [])
};
if (emEngine.openDecoder('data/dict.data', 'data/user_dict.data')) {
initProcFunctions();
post(msgId, true);
} else {
post(msgId, false);
}
}
};
try {
importScripts('empinyin_files.js');
importScripts('libpinyin.js');
} catch (e) {
log(e.toString());
post(msgId, false);
}
}
function initProcFunctions() {
var getSearchResult = function(emEngineGetAt, param) {
var start = param.start;
var count = param.count;
var results = [];
for (var i = start; i < count; i++) {
results.push(emEngineGetAt(i));
}
return results;
};
var search = function(emEngineSearch, emEngineGetAt, param) {
var query = param.queryString;
var numberToReturn = param.limit;
var resultLen = emEngineSearch(query, query.length);
var results;
if (numberToReturn) {
if (numberToReturn < 0 || numberToReturn > resultLen) {
numberToReturn = resultLen;
}
results = getSearchResult(emEngineGetAt, {
start: 0,
count: numberToReturn
});
}
return {
length: resultLen,
results: results
};
};
procFunction = {};
/*jshint -W040 */
procFunction['im_search'] =
search.bind(this, emEngine.search, emEngine.getCandidateAt);
procFunction['im_get_candidates'] =
getSearchResult.bind(this, emEngine.getCandidateAt);
procFunction['im_search_predicts'] =
search.bind(this, emEngine.getPredicts, emEngine.getPredictAt);
procFunction['im_get_predicts'] =
getSearchResult.bind(this, emEngine.getPredictAt);
/*jshint +W040 */
procFunction['im_flush_cache'] =
emEngine.flushCache;
procFunction['im_choose'] = function(param) {
var candsNum = emEngine.choose(param.candId);
if (candsNum == 1 && emEngine.getFixedLen() == emEngine.getSplStart()) {
var convertedText = emEngine.getCandidateAt(0);
emEngine.resetSearch();
return convertedText;
}
return null;
};
procFunction['im_get_pending_symbols_info'] = function() {
var fixedLen = emEngine.getFixedLen();
var splStartLen = emEngine.getSplStart();
var splStart = [];
for (var i = 0; i <= splStartLen; i++) {
splStart.push(emEngine.getSplStartAt(i));
}
return {
fixedLen: fixedLen,
splStart: splStart
};
};
procFunction['im_get_user_dict_data'] = function() {
if (!Module['FS']) {
return null;
}
emEngine.flushCache();
return Module['FS'].findObject('data/user_dict.data').contents;
};
}
function post(id, returnValue) {
postMessage({
id: id,
returnValue: returnValue
});
}
function log(message) {
post('message', message);
}

View file

@ -0,0 +1,488 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* global InputMethods */
(function() {
'use strict';
/* BoGo Engine. https://github.com/lewtds/bogo.js
*
* Copyright 2014, Trung Ngo <ndtrung4419@gmail.com>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
function BoGo() {
var EffectType = {
APPENDING: 0,
MARK: 1,
TONE: 2
};
var Mark = {
NONE: 0,
HAT: 1,
BREVE: 2,
HORN: 3,
DASH: 4
};
var Tone = {
NONE: 0,
GRAVE: 1,
ACUTE: 2,
HOOK: 3,
TILDE: 4,
DOT: 5
};
var VOWELS = 'aàáảãạăằắẳẵặâầấẩẫậeèéẻẽẹêềếểễệiìíỉĩị' +
'oòóỏõọôồốổỗộơờớởỡợuùúủũụưừứửữựyỳýỷỹỵ';
var composition = [];
var rules = [];
var MARKS_MAP = {
'a': 'aâă__',
'â': 'aâă__',
'ă': 'aâă__',
'e': 'eê___',
'ê': 'eê___',
'o': 'oô_ơ_',
'ô': 'oô_ơ_',
'ơ': 'oô_ơ_',
'u': 'u__ư_',
'ư': 'u__ư_',
'd': 'd___đ',
'đ': 'd___đ'
};
var MARK_CHARS = {
'^': Mark.HAT,
'(': Mark.BREVE,
'+': Mark.HORN,
'-': Mark.DASH
};
var TONE_CHARS = {
'~': Tone.TILDE,
'\'': Tone.ACUTE,
'?': Tone.HOOK,
'`': Tone.GRAVE,
'.': Tone.DOT
};
function is_vowel(chr) {
return VOWELS.indexOf(chr) != -1;
}
function add_mark_to_char(chr, mark) {
var result;
var tone = get_tone_from_char(chr);
chr = add_tone_to_char(chr, Tone.NONE);
if (chr in MARKS_MAP && MARKS_MAP[chr][mark] != '_') {
result = MARKS_MAP[chr][mark];
} else {
result = chr;
}
result = add_tone_to_char(result, tone);
return result;
}
function get_tone_from_char(chr) {
var position = VOWELS.indexOf(chr);
if (position != -1) {
return position % 6;
} else {
return Tone.NONE;
}
}
function add_tone_to_char(chr, tone) {
var result;
var position = VOWELS.indexOf(chr);
if (position != -1) {
var current_tone = position % 6;
var offset = tone - current_tone;
result = VOWELS[position + offset];
} else {
result = chr;
}
return result;
}
function find_mark_target(rule) {
var target;
for (var i = composition.length - 1; i > -1; i--) {
if (composition[i].rule.key == rule.effective_on) {
target = composition[i];
}
}
return target;
}
function find_rightmost_vowels() {
var vowels = [];
for (var i = composition.length - 1; i >= 0; i--) {
var trans = composition[i];
if (trans.rule.type == EffectType.APPENDING &&
is_vowel(trans.rule.key)) {
vowels.unshift(trans);
}
}
return vowels;
}
function find_next_appending_trans(trans) {
var from_index = composition.indexOf(trans);
var next_appending_trans;
// FIXME: Need not-found guard.
for (var i = from_index + 1; i < composition.length; i++) {
if (composition[i].rule.type == EffectType.APPENDING) {
next_appending_trans = composition[i];
}
}
return next_appending_trans;
}
function find_tone_target(rule) {
var vowels = find_rightmost_vowels();
var target;
if (vowels.length == 1) {
// cá
target = vowels[0];
} else if (vowels.length == 2) {
if (find_next_appending_trans(vowels[1]) !== undefined ||
flatten(vowels) == 'uo') {
// nước, thuở
target = vowels[1];
} else {
// cáo
target = vowels[0];
}
} else if (vowels.length == 3) {
if (flatten(vowels) == 'uye') {
// chuyển
target = vowels[2];
} else {
// khuỷu
target = vowels[1];
}
}
return target;
}
function refresh_last_tone_target() {
// Refresh the tone position of the last EffectType.TONE transformation.
for (var i = composition.length - 1; i >= 0; i--) {
var trans = composition[i];
if (trans.rule.type == EffectType.TONE) {
var new_target = find_tone_target(trans.rule);
trans.target = new_target;
break;
}
}
}
function process_char(chr) {
var isUpperCase = chr === chr.toUpperCase();
chr = chr.toLowerCase();
var applicable_rules = [];
rules.forEach(function(rule) {
if (rule.key == chr) {
applicable_rules.push(rule);
}
});
// If none of the applicable_rules can actually be applied then this new
// transformation fallbacks to an APPENDING one.
var trans = {
rule: {
type: EffectType.APPENDING,
key: chr
},
isUpperCase: isUpperCase
};
for (var i = 0; i < applicable_rules.length; i++) {
var rule = applicable_rules[i];
var target;
if (rule.type == EffectType.MARK) {
target = find_mark_target(rule);
} else if (rule.type == EffectType.TONE) {
target = find_tone_target(rule);
}
if (target !== undefined) {
// Fix uaw being wrongly processed to muă by skipping
// the aw rule. Then the uw rule will be matched later.
// Note that this requires the aw rule be placed before
// uw in the rule list.
if (chr == 'w') {
var target_index = composition.indexOf(target);
var prev_trans = composition[target_index - 1];
if (target.rule.key == 'a' &&
prev_trans.rule.key == 'u') {
continue;
}
}
trans.rule = rule;
trans.target = target;
break;
}
}
composition.push(trans);
// Implement the uow typing shortcut by creating a virtual
// Mark.HORN rule that targets 'u'.
//
// FIXME: This is a potential slowdown. Perhaps it should be
// toggled by a config key.
if (flatten().match(/uơ.+$/)) {
var vowels = find_rightmost_vowels();
var virtual_trans = {
rule: {
type: EffectType.MARK,
key: '', // This is a virtual rule,
// it should not appear in the raw string.
effect: Mark.HORN
},
target: vowels[0]
};
composition.push(virtual_trans);
}
// Sometimes, a tone's position in a previous state must be changed to
// fit the new state.
//
// e.g.
// prev state: chuyenr -> chuỷen
// this state: chuyenre -> chuyển
if (trans.rule.type == EffectType.APPENDING) {
refresh_last_tone_target();
}
}
function flatten() {
var canvas = [];
composition.forEach(function(trans, index) {
function apply_effect(func, trans) {
var index = trans.target.dest;
var char_with_effect = func(canvas[index], trans.rule.effect);
// Double typing an effect key undoes it. Btw, we're playing
// fast-and-loose here by relying on the fact that Tone.NONE
// equals Mark.None and equals 0.
if (char_with_effect == canvas[index]) {
canvas[index] = func(canvas[index], Tone.NONE);
} else {
canvas[index] = char_with_effect;
}
}
switch (trans.rule.type) {
case EffectType.APPENDING:
trans.dest = canvas.length;
canvas.push(trans.rule.key);
break;
case EffectType.MARK:
apply_effect(add_mark_to_char, trans);
break;
case EffectType.TONE:
apply_effect(add_tone_to_char, trans);
break;
default:
break;
}
});
composition.forEach(function(trans) {
if (trans.rule.type == EffectType.APPENDING) {
if (trans.isUpperCase) {
canvas[trans.dest] = canvas[trans.dest].toUpperCase();
}
}
});
return canvas.join('');
}
function process_string(string) {
for (var i = 0; i < string.length; i++) {
process_char(string[i]);
}
}
// js > parse_rule('a a a^')
// {type: EffectType.MARK, effect: HAT, key: a, effective_on: a}
//
// js > parse_rule('a w a(')
// {type: EffectType.MARK, effect: BREVE, key: w, effective_on: a}
//
// js > parse_rule('a f a`')
// {type: EffectType.MARK, effect: HAT, key: a, effective_on: a}
//
// js > parse_rule('w u+')
// {type: EffectType.APPEND, effect: ư, key: w}
function parse_rule(string) {
var tokens = string.trim().replace(/\s\s+/, ' ').split(' ');
var effective_on = tokens[0];
var key = tokens[1];
var type;
var effect;
var effect_char = tokens[2][1];
if (effect_char in MARK_CHARS) {
type = EffectType.MARK;
effect = MARK_CHARS[effect_char];
} else if (effect_char in TONE_CHARS) {
type = EffectType.TONE;
effect = TONE_CHARS[effect_char];
}
var trans = {
type: type,
key: key,
effect: effect,
effective_on: effective_on
};
return trans;
}
function process_backspace() {
var indexes_to_remove = [];
var last_appending_trans;
var i;
var trans;
// Find the last APPENDING transformation and all
// the transformations that add effects to it.
for (i = composition.length - 1; i >= 0; i--) {
trans = composition[i];
if (trans.rule.type == EffectType.APPENDING) {
last_appending_trans = trans;
indexes_to_remove.push(i);
break;
}
}
for (i = indexes_to_remove[0] + 1; i < composition.length; i++) {
trans = composition[i];
if (trans.hasOwnProperty('target') &&
trans.target === last_appending_trans) {
indexes_to_remove.push(i);
}
}
// Then remove them
indexes_to_remove.sort().reverse();
indexes_to_remove.forEach(function(index) {
composition.splice(index, 1);
});
}
function get_raw_input_string() {
var raw_input_keys = [];
composition.forEach(function(trans) {
raw_input_keys.push(trans.rule.key);
});
return raw_input_keys.join('');
}
function clear_composition() {
composition = [];
}
function clear_rules() {
rules = [];
}
function has_composition() {
return composition.length !== 0;
}
var exports = {
add_rule: function(rule_string) {
rules.push(parse_rule(rule_string));
},
clear_rules: clear_rules,
process_char: process_char,
process_string: process_string,
process_backspace: process_backspace,
clear_composition: clear_composition,
get_processed_string: flatten,
get_raw_input_string: get_raw_input_string,
has_composition: has_composition
};
return exports;
}
var input_context;
var engine;
function init(_input_context) {
console.log('KEYBOARD: ' + _input_context);
input_context = _input_context;
engine = new BoGo();
engine.add_rule('o w o+');
engine.add_rule('u w u+');
engine.add_rule('a a a^');
engine.add_rule('a w a(');
engine.add_rule('e e e^');
engine.add_rule('o o o^');
engine.add_rule('d d d-');
engine.add_rule('_ f _`');
engine.add_rule('_ r _?');
engine.add_rule('_ x _~');
engine.add_rule('_ j _.');
engine.add_rule('_ s _\'');
}
function click(keycode, x, y) {
if (keycode == 32) {
input_context.endComposition(engine.get_processed_string());
engine.clear_composition();
input_context.sendKey(keycode);
} else if (keycode == 8) {
if (engine.has_composition()) {
engine.process_backspace();
input_context.setComposition(engine.get_processed_string());
} else {
engine.clear_composition();
input_context.sendKey(keycode);
}
} else {
var chr = String.fromCharCode(keycode);
engine.process_char(chr);
input_context.setComposition(engine.get_processed_string());
}
}
// Expose the engine to the Gaia keyboard
InputMethods.jstelex = {
init: init,
click: click
};
})();

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,316 @@
'use strict';
/* global Predictions */
//
// The Latin input method provides word suggestions/auto completions
// using the algorithm in predictions.js. For efficiency, however, this code
// runs in a different thread. This is the web worker wrapper around
// predictions.js. This file defines the code that interfaces predictions.js
// with latin.js.
//
// This worker uses the convention that all messages send or received have
// "cmd" and "args" fields. cmd is the message name or command. args is
// an array of arguments required by the command, in a form suitable for
// passing to Function.apply().
//
// This worker responds to the following messages:
//
// setLanguage: the input method uses this message to tell the worker
// to load a dictionary for the prediction engine. If no such dictionary
// is found or if the dictionary is invalid, the worker responds with
// an "error" message.
//
// setNearbyKeys: the input method uses this message to pass information about
// what keys are near each other in the current keyboard layout
//
// predict: the input method uses this message to ask the prediction
// engine to suggestion completions for (or corrections to) the specified
// string. The worker responds with a "predictions" message whose argument
// is an array of up to 3 predicted words. If the the specified string
// is a word in the dictionary, the worker may send a "word" message
// first to quickly tell the keyboard that the word is valid.
//
// Load the predictions.js module. This defines the Predictions object.
importScripts('predictions.js');
// We invoke a "null" predictor when user dictionary is empty (incoming dict
// blob is "undefined"). This is to avoid modifying the complex predictions.js
// to adapt to "undefined" dict blob.
// The switching mechanism is implemented in ProxyUserDictPredictor depending on
// its setDictionary parameter when called. Note that PUDP.setNearByKeys is
// always called upon userDictPredictor for setting the predictor up.
// For pattern conformity in this file we don't use "new" to instantiate the
// null and proxy instances.
var NullPredictions = function(){
return {
predict: function(input, maxSuggestions, maxCandidates, maxCorrections,
callback, onerror) {
var status = {
state: 'predicting',
abort: function nullAbort() {
if (this.state !== 'done' && this.state !== 'aborted') {
this.state = 'aborting';
}
}
};
setTimeout(function nullFinish() {
if (status.state === 'aborting') {
status.state = 'aborted';
}
if (status.state === 'aborted') {
return;
}
status.state = 'done';
callback([]);
});
return status;
}
};
};
var ProxyUserDictPredictor = function(){
var userDictPredictor = Predictions();
var nullPredictor = NullPredictions();
var activePredictor;
return {
setDictionary: function(buffer) {
if (buffer === undefined) {
activePredictor = nullPredictor;
} else {
activePredictor = userDictPredictor;
userDictPredictor.setDictionary(buffer);
}
},
setNearbyKeys: function(data) {
userDictPredictor.setNearbyKeys(data);
},
// Directly pass arguments to wrapped predictor
predict: function(/* args */) {
return activePredictor.predict.apply(activePredictor, arguments);
}
};
};
var builtInPredictor = Predictions();
var userDictPredictor = ProxyUserDictPredictor();
// Track our current language so we don't load dictionaries more often
// than we have to.
var currentLanguage;
// The prediction that is currently running, if any. So that it can be cancelled
var pendingBuiltInPrediction;
var pendingUserDictPrediction;
var Commands = {
setLanguage: function setLanguage(language, builtInDict, userDict) {
var _setLanguage = function(predictor, dict, tag) {
try {
predictor.setDictionary(dict);
postMessage({
cmd: 'success',
fn: 'setLanguage/' + tag,
language: language
});
} catch (e) {
postMessage({
cmd: 'error',
message: 'setDictionary/' + tag + ' failed: ' + e
});
}
};
// always set userDict regardless of language change or not
_setLanguage(userDictPredictor, userDict, 'User');
if (language === currentLanguage) {
return;
}
currentLanguage = language;
_setLanguage(builtInPredictor, builtInDict, 'BuiltIn');
},
setUserDictionary: function setUserDictionary(userDict) {
try {
userDictPredictor.setDictionary(userDict);
postMessage({cmd: 'success', fn: 'setUserDictionary'});
}
catch (e) {
postMessage({cmd: 'error', fn: 'setUserDictionary: ' + e.message});
}
},
setNearbyKeys: function setNearbyKeys(nearbyKeys) {
var _setNearbyKeys = function(predictor, tag) {
try {
predictor.setNearbyKeys(nearbyKeys);
postMessage({ cmd: 'success', fn: 'setNearbyKeys/' + tag });
}
catch (e) {
postMessage({
cmd: 'error', message: 'setNearbyKeys/' + tag + ': ' + e.message});
}
};
_setNearbyKeys(builtInPredictor, 'BuiltIn');
_setNearbyKeys(userDictPredictor, 'User');
},
predict: function predict(prefix) {
// Make sure we're not still running a previous one
if (pendingBuiltInPrediction) {
pendingBuiltInPrediction.abort();
}
if (pendingUserDictPrediction) {
pendingUserDictPrediction.abort();
}
// We merge predictions from built-in dictionaries and user dictionarys by:
// [1] For UserDict, ask for 4 predictions with 40 candidates, and
// considering only words with an edit distance of 1 (i.e. make only one
// correction per word)
// [2] For Built-In dict, everything remains the same (50 candidates if
// prefix is short, 24 if not; do a second round:
// [a] if there were results but results were bad; if prefix is long,
// use 50 candidates.
// [b] if there weren't results, use 60 candidates and allow 2
// corrections.
// As before weget 4 predictions.
// [3] Results from [1] and [2] are merged by:
// [a] Results from [1] are not discarded even if quality is low.
// [b] Results from [1] are annotated to come from user dict.
// [c] Results are merged and re-sorted. Duplicated words (case- and
// variants-sensitive) are eliminated by:
// - Keeping the higher priority.
// - Keeping the user dictionary flag.
// The rationale is: latin.js will always show at least one user
// dictionary word; since user specifically define some dict word,
// he probably wants it very much.
// [4] latin.js will always retain at least one user dict prediction (unless
// it decides to drop the prediction because it equals user input)
var BUILT_IN_CANDIDATES_LOW = 24;
var BUILT_IN_CANDIDATES_HIGH = 50;
var BUILT_IN_CANDIDATES_EXTRA = 60;
var USER_DICT_CANDIDATES = 40;
var BUILT_IN_TOO_LOW_THRESHOLD = 4;
var builtInPromise = new Promise(function(resolve, reject){
var success = function(suggestions) {
if (suggestions.length > 0) {
// If the quality of the suggestions is very low, up candidates
if (prefix.length > 4 &&
suggestions[0][1] < BUILT_IN_TOO_LOW_THRESHOLD) {
pendingBuiltInPrediction =
builtInPredictor.predict(
prefix, 4, BUILT_IN_CANDIDATES_HIGH, 1,
function(suggestions){resolve(suggestions);},
reject);
}
else {
resolve(suggestions);
}
}
else {
pendingBuiltInPrediction =
builtInPredictor.predict(
prefix, 4, BUILT_IN_CANDIDATES_EXTRA, 2,
function(suggestions){resolve(suggestions);},
reject);
}
};
var noOfCandidates = prefix.length >= 2 && prefix.length <= 4 ?
BUILT_IN_CANDIDATES_HIGH :
BUILT_IN_CANDIDATES_LOW;
pendingBuiltInPrediction =
builtInPredictor.predict(prefix, 4, noOfCandidates, 1, success, reject);
});
var userDictPromise = new Promise(function(resolve, reject){
var success = function(suggestions) {
suggestions = suggestions.map(
function(suggestion){
return [
suggestion[0],
suggestion[1],
true // coming from user dictionary
];
}
);
resolve(suggestions);
};
pendingUserDictPrediction =
userDictPredictor.predict(prefix, 4, USER_DICT_CANDIDATES, 1,
success, reject);
});
Promise.all([builtInPromise, userDictPromise])
.then(function(suggestions2D){
// we could do a correct merge sort algorithm here, but since the arrays
// are so small (only 4*2 entries), let's just concat and apply sort()
var suggestions =
[].concat(suggestions2D[0]).concat(suggestions2D[1]).sort(
function(suggestionA, suggestionB){
return suggestionB[1] - suggestionA[1];
}
);
// Shortcut on eliminate duplicated entries: "duplicated entries" means
// they're coming from both dictionaries; and since our array is sorted,
// we'll simply the (higher-priority one's) suggestion[2] as true (= from
// user dict) and delete the lower-priority one.
// map from "word" to the index in suggestions
var seenWord = {};
suggestions = suggestions.reduce(function(prev, curr, index){
var word = curr[0];
// we've seen this word. mark the higher-priority one as from user-dict
// and don't push this one to the resulting array.
if (seenWord.hasOwnProperty(word)) {
prev[seenWord[word]][2] = true;
} else {
seenWord[word] = index;
prev.push(curr);
}
return prev;
}, []);
postMessage({
cmd: 'predictions', input: prefix, suggestions: suggestions
});
}).catch(function(e){
log('Error in prediction: ' + e);
});
}
};
// When we receive messages, translate them into function calls to one
// of the functions in the Commands object below.
self.onmessage = function(e) {
Commands[e.data.cmd].apply(null, e.data.args);
};
// Send console messages back to the main thread with this method
function log(msg) {
postMessage({cmd: 'log', message: msg});
}

View file

@ -0,0 +1,242 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* jshint moz:true */
/* jshint unused:true */
/* global InputMethods */
(function() {
'use strict';
var keyboard;
var buffer = '';
var BACKSPACE = 8;
var M = {
consoTT: new RegExp('^(' +
'\u1000|\u1001|\u1002|\u1003|\u1005|\u1006|\u1007|\u1008|' +
'\u1009|\u100A|\u100B|\u100C|\u100D|\u100E|\u100F|\u1010|' +
'\u1011|\u1012|\u1013|\u1014|\u1015|\u1016|\u1017|\u1018|' +
'\u1019|\u101A|\u101B|\u101C|\u101D|\u101E|\u101F|\u1020|' +
'\u1021' + ')$'),
consoSA: new RegExp('^(' + '\u101E' + ')$'),
vowelIA: new RegExp('^(' +
'\u102D|\u102E|\u1032|\u1036|\u102F|\u1030|\u102B|\u102C' + ')$'),
vowelIU: new RegExp('^(' + '\u102D|\u102E|\u102F|\u1030' + ')$'),
vowelSI: new RegExp('^(' + '\u102D|\u102E' + ')$'),
vowelIN: new RegExp('^(' + '\u1032|\u1036' + ')$'),
vowelUU: new RegExp('^(' + '\u102F|\u1030' + ')$'),
vowelAA: new RegExp('^(' + '\u102B|\u102C' + ')$'),
vowelSU: new RegExp('^(' + '\u1025' + ')$'),
vowelDU: new RegExp('^(' + '\u1026' + ')$'),
vowelSO: new RegExp('^(' + '\u1029' + ')$'),
vowelSA: new RegExp('^(' + '\u102C' + ')$'),
vowelDI: new RegExp('^(' + '\u102E' + ')$'),
vowelSE: new RegExp('^(' + '\u1031' + ')$'),
vowelAI: new RegExp('^(' + '\u1032' + ')$'),
vowelAN: new RegExp('^(' + '\u1036' + ')$'),
vowelAU: new RegExp('^(' + '\u1037' + ')$'),
vowelVT: new RegExp('^(' + '\u1038|\u103A' + ')$'),
vowelVS: new RegExp('^(' + '\u1038' + ')$'),
vowelVR: new RegExp('^(' + '\u1039' + ')$'),
vowelAT: new RegExp('^(' + '\u103A' + ')$'),
mediaYH: new RegExp('^(' + '\u103B|\u103C|\u103D|\u103E' + ')$'),
mediaYW: new RegExp('^(' + '\u103B|\u103C|\u103D' + ')$'),
mediaYR: new RegExp('^(' + '\u103B|\u103C' + ')$'),
mediaYA: new RegExp('^(' + '\u103B' + ')$'),
mediaRA: new RegExp('^(' + '\u103C' + ')$'),
mediaWA: new RegExp('^(' + '\u103D' + ')$'),
mediaHA: new RegExp('^(' + '\u103E' + ')$'),
zeroLEN: new RegExp('^(' + '\u200B' + ')$')
};
//==================================================================
// \u103D + \u103E + \u1031 + \u103B => $4 + $1 + $2 + $3
// \u103D + \u103E + \u1031 + \u103C => $4 + $1 + $2 + $3
// \u103D + \u1031 + \u103B => $3 + $1 + $2
// \u103D + \u1031 + \u103C => $3 + $1 + $2
// \u103D + \u103E + \u103B => $3 + $1 + $2
// \u103D + \u103E + \u103C => $3 + $1 + $2
// \u103E + \u1031 + \u103B => $3 + $1 + $2
// \u103E + \u1031 + \u103C => $3 + $1 + $2
// \u103E + \u1031 + \u103D => $3 + $1 + $2
// \u1031 + \u1039 + consoTT[*] => $2 + $3 + $1
// \u200B + \u1031 + consoTT[*] => $3 + $2
// \u1031 + mediaYH[*] => $2 + $1
// \u1036 + \u1032 => $2 +$1
// \u1037 + vowelSI[*] => $2 + $1
// \u1037 + vowelIN[*] => $2 + $1
// \u1037 + vowelAA[*] => $2 + $1
// \u1037 + vowelUU[*] => $2 + $1
// \u1038 + \u1037 => $2 + $1
// \u103A + \u1037 => $2 + $1
// \u103D + \u103B => $2 + $1
// \u103D + \u103C => $2 + $1
// \u103E + \u103B => $2 + $1
// \u103E + \u103C => $2 + $1
// \u103E + \u103D => $2 + $1
// vowelUU[*] + vowelSI[*] => $2 + $1
// vowelIN[*] + vowelUU[*] => $2 + $1
// vowelIN[*] + vowelSI[*] => $2 + $1
//==================================================================
var SWAP_RULE = [
// p1 + p2 + p3 + p4 => p4 + p1 + p2 + p3
{ num: 4, out: 4, t:1, p1: M.mediaWA, p2: M.mediaHA, p3: M.vowelSE,
p4: M.mediaYR },
// p1 + p2 + p3 => p3 + p2
{ num: 3, out: 2, t:1, p1: M.zeroLEN, p2: M.vowelSE, p3: M.consoTT },
// p1 + p2 + p3 => p3 + p1 + p2
{ num: 3, out: 3, t:1, p1: M.mediaWA, p2: M.vowelSE, p3: M.mediaYR },
{ num: 3, out: 3, t:1, p1: M.mediaWA, p2: M.mediaHA, p3: M.mediaYR },
{ num: 3, out: 3, t:1, p1: M.mediaHA, p2: M.vowelSE, p3: M.mediaYW },
// p1 + p2 + p3 => p2 + p3 + p1
{ num: 3, out: 3, t:2, p1: M.vowelSE, p2: M.vowelVR, p3: M.consoTT },
// p1 + p2 => p2 + p1
{ num: 2, out: 2, t:1, p1: M.vowelSE, p2: M.mediaYH },
{ num: 2, out: 2, t:1, p1: M.vowelAN, p2: M.vowelAI },
{ num: 2, out: 2, t:1, p1: M.vowelAU, p2: M.vowelIA },
{ num: 2, out: 2, t:1, p1: M.vowelVT, p2: M.vowelAU },
{ num: 2, out: 2, t:1, p1: M.vowelUU, p2: M.vowelSI },
{ num: 2, out: 2, t:1, p1: M.vowelIN, p2: M.vowelIU },
{ num: 2, out: 2, t:1, p1: M.mediaWA, p2: M.mediaYR },
{ num: 2, out: 2, t:1, p1: M.mediaHA, p2: M.mediaYW }
];
//==================================================================
// \u1025 + \u102E => \u1026
// \u1025 + \u103A => \u1009 + \u103A
// \u101E + \u103C + \u1031 + \u102C + \u103A => \u102A
//==================================================================
var ADD_RULE = [
{ num: 2, out: '\u1026', p1: M.vowelSU, p2: M.vowelDI },
{ num: 2, out: '\u1009\u103A', p1: M.vowelSU, p2: M.vowelAT },
{ num: 5, out: '\u102A', p1: M.consoSA, p2: M.mediaRA, p3: M.vowelSE,
p4: M.vowelSA, p5: M.vowelAT }
];
//==================================================================
// \u1039 + consoTT[*] + \u1031 + < VK_BACK > => \u1039 + $filler + \u1031
// \u200B + consoTT[*] + \u1031 + < VK_BACK > => $filler + \u1031
// mediaYH[*] + \u1031 + < VK_BACK > => \u1031
// \u1039 + consoTT[*] + < VK_BACK > => NULL
// \u200B + \u1031 + < VK_BACK > => NULL
//==================================================================
var DEL_RULE = [
{num: 3, out: '\u1031\u1039', p1: M.vowelVR, p2: M.consoTT, p3: M.vowelSE},
{num: 2, out: '\u200B\u1031', p1: M.consoTT, p2: M.vowelSE},
{num: 2, out: '\u1031', p1: M.mediaYH, p2: M.vowelSE},
{num: 2, out: '', p1: M.vowelVR, p2: M.consoTT},
{num: 2, out: '', p1: M.zeroLEN, p2: M.vowelSE}
];
function myanParser(rule, callback) {
var idx = ['p0', 'p1', 'p2', 'p3', 'p4', 'p5'];
var len = buffer.length;
if (len < 2) {
return null;
}
for (var i = 0; i < rule.length; i++) {
if (len < rule[i].num) {
continue;
}
var c = len - 1;
for (var j = rule[i].num; j > 0; j--) {
if (!buffer[c--].match( rule[i][idx[j]] )) {
break;
}
}
if (j === 0) {
return callback(rule[i]);
}
}
return null;
}
function processBuffer(callback) {
var swap = myanParser(SWAP_RULE, function(entry) {
if (!entry) {
return null;
}
var len = buffer.length;
var tail = entry.t;
var out = entry.out;
var s = {};
s.num = entry.num;
s.str = buffer.substr(len-tail, tail) +
buffer.substr(len-out, out-tail);
return s;
});
// After process swap, check if the string need to be merged.
var adds = myanParser(ADD_RULE, function(entry) {
if (!entry) {
return null;
}
var s = {};
s.num = entry.num;
s.str = entry.out;
return s;
});
return (adds) ? callback(adds) : callback(swap);
}
function doDelete(callback) {
var dels = myanParser(DEL_RULE, function(entry) {
if (!entry) {
return null;
}
var s = {};
s.num = entry.num;
s.str = entry.out;
return s;
});
return (dels) ? callback(dels) : false;
}
function overrideInput(s) {
if(s) {
keyboard.replaceSurroundingText(s.str, -s.num, s.num);
return true;
}
return false;
}
InputMethods.myanmar = {
init: function(interfaceObject) {
keyboard = interfaceObject;
},
click: function(keycode) {
keyboard.setUpperCase({
isUpperCase: false
});
if (keycode == BACKSPACE) {
if(!doDelete(overrideInput)) {
keyboard.sendKey(keycode);
}
}
else {
if (String.fromCharCode(keycode) == '\u1031') {
// Send an extra zero length space on click of vowel sign E.
keyboard.sendKey('\u200B'.charCodeAt(0));
}
keyboard.sendKey(keycode);
}
},
surroundingtextChange: function(detail) {
buffer = detail.beforeString;
processBuffer(overrideInput);
}
};
})();

View file

@ -0,0 +1,423 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* jshint moz:true */
/* jshint unused:true */
/* global InputMethods */
/* global KeyEvent */
// ==================================================================
// WARNING. THIS FUNCTION USES PRECOMPOSED UNICODE CHARACTERS IN
// STRING LITERALS. DO NOT NORMALIZE THIS FILE.
// IF YOU NORMALIZE THIS FILE, THE STRINGS WILL CHANGE AND THE
// PROGRAM WILL BREAK.
//
// The use of precomposed Unicode characters is deliberate. This
// IM outputs precomposed Vietnamese characters rather than
// using combining character sequences because Firefox OS
// has trouble rendering Vietnamese combining character sequences.
//
// I considered using Unicode escape sequences instead of the
// actual Vietnamese characters, but that would have made the code
// much harder to read, understand, and maintain. Furthermore, I
// don't think there's much risk that someone will normalize this
// file.
//
// Existing Javascript standards say that all strings should be
// normalized in NFC format. In practice, no Javascript interpreter
// does that, and nor should they. There is a proposal to remove
// that requirement from the next standard, partly out of consider-
// ation for languages like Vietnamese which usually aren't NFC
// normalized, and partly to reflect actual practice.
//
// http://wiki.ecmascript.org/doku.php?id=strawman:unicode_normalization
//
// ==================================================================
// Like pinyin, Vietnam's writing system (Quốc Ngữ) has fixed rules for
// what makes a valid syllable.
// A syllable consists of:
// optional initial + vowel cluster + optional final
// Not all vowel clusters can occur before all finals.
// The vowel cluster can optionally carry one of 5 tone marks.
// The spelling is fairly regular, but it inherits a few irregularities
// from Portuguese.
// * The /k/ sound can be spelt C or K depending on the
// following vowel. (Or Q before a /w/ glide.)
// * The initial G becomes GH before E or I (or Ê or Y). Similarly, NG
// becomes NGH
// * The /w/ sound at the start of a vowel cluster can be spelt O or U
// depending on the following vowel. However, after a Q, it is always
// spelt U, regardless of the following vowel. Basically, the list of
// valid vowel clusters completely changes after a Q.
// * The vowel cluster IÊ becomes YÊ at the start of a word. Likewise,
// IÊU> becomes YÊU.
(function() {
'use strict';
var QN = {
unmarkedVowels: 'AaĂăÂâEeÊêIiOoÔôƠơUuƯưYy',
// The elements of this array represent the five marked tones of
// Vietnamese. (A sixth tone is unmarked.)
markedVowels: [
'ÁáẮắẤấÉéẾếÍíÓóỐốỚớÚúỨứÝý', // Sắc Tone
'ÀàẰằẦầÈèỀềÌìÒòỒồỜờÙùỪừỲỳ', // Huyền Tone
'ẢảẲẳẨẩẺẻỂểỈỉỎỏỔổỞởỦủỬửỶỷ', // Hỏi Tone
'ÃãẴẵẪẫẼẽỄễĨĩÕõỖỗỠỡŨũỮữỸỹ', // Ngã Tone
'ẠạẶặẬậẸẹỆệỊịỌọỘộỢợỤụỰựỴỵ' // Nặng Tone
],
// All the intials except Q (including the null initial).
// (Any usual Vietnamese syllable can be prefixed with an X
// when transcribing foreign proper nouns.)
initialsNotQ: '(x?(?:b|c|ch|d|đ|g|gh|gi|h|k|kh|l|m|n|' +
'ng|ngh|nh|p|ph|r|s|t|th|tr|v)?)',
// All the initials that start with Q.
initialQ: '(x?q)',
// All the finals
finals: '(c|ch|m|n|ng|nh|p|t)',
// These vowel clusters are valid when there is no final
// (except when the intial is Q)
nucleusOpen: '(a|e|ê|i|y|o|ô|ơ|u|ư|' + // vowel
'ai|ay|ăy|oi|ơi|ôi|ui|ưi|' + // vowel + /j/
'ao|au|âu|eo|êu|iu|ưu|' + // vowel + /w/
'ia|ua|ưa|' + // diphthong
'uơi|ươi|' + // diphthong + /j/
'iêu|yêu|ươu|' + // diphthong + /w/
'oa|oe|uê|uy|uơ|' + // /w/ + vowel
'uya|' + // /w/ + diphthong
'oai|oay|uôi|uây)', // /w/ + vowel + /j/
// These vowel clusters are valid before any final,
// (except when the intial is Q)
nucleusClosed: '(a|ă|â|e|ê|i|o|ô|ơ|u|ư|' + // vowel
'iê|yê|uô|uơ|ươ|' + // diphthong
'oa|oă|uâ|oe|uê|uy|uơ|' + // /w/ + vowel
'uyê|' + // /w/ + diphthong
'oo)', // 'oo' only appears in French loan words
// like 'xoong' (casserole). Some Vietnamese
// textbooks omit it, but it definitely exists.
// These vowel clusters are valid when there is no final
// and the initial is Q.
nucleusOpenAfterQ: '(ua|ue|uê|ui|uy|uơ|' + // /w/ + vowel
'uya|' + // /w/ + diphthong
'uai|uay|uây)', // /w/ + vowel + /j/
// These vowel clusters are valid before any final,
// when the initial is Q.
nucleusClosedAfterQ: '(ua|uă|uâ|ue|uê|ui|uy|uơ|' + // /w/ + vowel
'uyê)' // /w/ + diphthong
};
var vietWordParser = {
p1: new RegExp('^' + QN.initialsNotQ + QN.nucleusOpen + '$'),
p2: new RegExp('^' + QN.initialsNotQ + QN.nucleusClosed + QN.finals + '$'),
p3: new RegExp('^' + QN.initialQ + QN.nucleusOpenAfterQ + '$'),
p4: new RegExp('^' + QN.initialQ + QN.nucleusClosedAfterQ + QN.finals +
'$'),
isValidWord: function(word) {
var w = word.toLowerCase();
var array = w.match(this.p1) || w.match(this.p2) ||
w.match(this.p3) || w.match(this.p4);
if (!array) {
return false;
}
var initialCluster = array[1];
var vowelCluster = array[2];
var finalCluster = array[3] || '';
// G -> GH and NG -> NGH before E/Ê or I/Y
if (initialCluster.match(/^(g|ng)$/) &&
vowelCluster.match(/^(e|ê|i|y)/)) {
return false;
}
if (initialCluster.match(/^(gh|ngh)$/) &&
!vowelCluster.match(/^(e|ê|i|y)/)) {
return false;
}
// GI can't come before I/Y
if (initialCluster === 'gi' && vowelCluster.match(/^(i|y)/)) {
return false;
}
// K before I/Y or E; C otherwise
if (initialCluster === 'k' && !vowelCluster.match(/^(e|ê|i|y)/)) {
return false;
}
if (initialCluster === 'c' && vowelCluster.match(/^(e|ê|i|y)/)) {
return false;
}
// IÊ -> YÊ and IÊU -> YÊU when there's no initial
if (initialCluster === '' && vowelCluster.match(/^iê/)) {
return false;
}
if (initialCluster !== '' && vowelCluster.match(/^yê/)) {
return false;
}
// The vowel clusters UÂ and UYÊ can only come before T or N.
if (vowelCluster.match(/^(uâ|uyê)$/) && !finalCluster.match(/^(t|n)$/)) {
return false;
}
return true;
},
addToneMarkToVowel: function(vowel, tone) {
var vowelIndex = QN.unmarkedVowels.indexOf(vowel);
if (vowelIndex >= 0) {
return QN.markedVowels[tone][vowelIndex];
}
},
findTonePosition: function(word) {
var w = word.toLowerCase();
var array = w.match(this.p1) || w.match(this.p2) ||
w.match(this.p3) || w.match(this.p4);
if (!array) {
return 0;
}
var initialCluster = array[1];
var vowelCluster = array[2];
var finalCluster = array[3] || '';
// When placing the tone mark, the U in QU should be considered
// part of the initial, not part of the vowel cluster.
// It never carries the tone mark.
if (initialCluster == 'q') {
initialCluster = 'qu';
vowelCluster = vowelCluster.substr(1);
}
// Here are the traditional rules for where to place the tone mark:
// * Vowels with diacritics are preferred over vowels without one.
// If that doesn't settle it, use these rules:
// * If the word has three vowels, it goes on the middle one.
// * If the word has two vowels followed by a consonant, it goes on the
// last vowel.
// * If the word ends with two vowels, it goes on the first vowel.
// The only time a word can have more than one diacritic is when it
// contains ươ, which has to be followed by a consonant. By the above
// rules, that means the ơ gets the diacritic, not the ư.
return w.search(/(ơ)/) + 1 ||
w.search(/(ă|â|ê|ô|ư)/) + 1 ||
(vowelCluster.length === 3 ? initialCluster.length + 2 :
finalCluster !== '' ? initialCluster.length + vowelCluster.length :
initialCluster.length + 1);
},
addHat: function(word) {
return word.replace('a', 'â').replace('A', 'Â')
.replace('e', 'ê').replace('E', 'Ê')
.replace('o', 'ô').replace('O', 'Ô');
},
generateCandidates: function(word) {
if (!this.isValidWord(word)) {
return [];
}
// Vietnamese has five tone marks. However, if a word ends
// in P, T, C, or CH, only the SẮC and NẶNG tones can be used.
var stopFinal = !!word.match(/(p|t|c|ch)$/i);
var marks = stopFinal ? [0, 4] : [0, 1, 2, 3, 4];
var tonePos = this.findTonePosition(word);
var candidates = marks.map((mark) => {
return word.substr(0, tonePos - 1) +
this.addToneMarkToVowel(word.charAt(tonePos - 1), mark) +
word.substr(tonePos);
});
return candidates;
}
};
var keyboard, buffer = '';
var capitalize = false;
var capitalizeNext = false;
var tentativeSpace = false;
var BACKSPACE = 8;
var HAT = 94;
function isBufferEmpty() {
return buffer === '';
}
function clearBuffer() {
buffer = '';
}
function addToBuffer(keycode) {
if (keycode == BACKSPACE) {
backspace();
}
buffer = buffer + String.fromCharCode(keycode);
}
function backspace() {
if (!isBufferEmpty()) {
buffer = buffer.substring(0, buffer.length -1);
keyboard.setComposition(buffer);
}
else {
keyboard.sendKey(KeyEvent.DOM_VK_BACK_SPACE);
}
}
function inputDone() {
keyboard.endComposition(buffer);
clearBuffer();
}
InputMethods.vietnamese = {
init: init,
activate: activate,
deactivate: deactivate,
click: click,
select: select
};
function init(interfaceObject) {
keyboard = interfaceObject;
}
function activate(lang, state) {
capitalize = !!state.type.match(/^(text|textarea|search)$/);
tentativeSpace = false;
var cursor = state.selectionStart;
var inputText = state.value;
capitalizeNext = false;
if (capitalize) {
if (cursor === 0) {
capitalizeNext = true;
}
else {
var charBeforeCursor = cursor - 1;
while (charBeforeCursor >= 0 && inputText[charBeforeCursor] == ' ') {
--charBeforeCursor;
}
capitalizeNext = !!inputText[charBeforeCursor].match(/[\!\?\.]/);
}
}
keyboard.setUpperCase(capitalizeNext);
}
function deactivate() {
if (!isBufferEmpty()) {
inputDone();
keyboard.sendCandidates([]);
}
}
function click(keycode) {
var s = String.fromCharCode(keycode);
var wasTentativeSpace = tentativeSpace;
tentativeSpace = false;
var wasCapitalizeNext = capitalizeNext;
capitalizeNext = false;
// Automatically transform E -> Ê after an I or Y. I find this really handy.
// And UO -> UÔ
if (s == 'e' && buffer.match(/(y|i)$/i)) {
keycode = 'ê'.charCodeAt(0);
}
else if (s == 'E' && buffer.match(/(y|i)$/i)) {
keycode = 'Ê'.charCodeAt(0);
} else if (s == 'o' && buffer.match(/u$/i)) {
keycode = 'ô'.charCodeAt(0);
} else if (s == 'O' && buffer.match(/u$/i)) {
keycode = 'Ô'.charCodeAt(0);
}
// Letters
if (s.match(/[A-Za-zĂÂĐÊÔƠUƯ]/i)) {
addToBuffer(keycode);
}
// The special hat key.
else if (keycode == HAT) {
buffer = vietWordParser.addHat(buffer);
}
// Backspace
else if (keycode == BACKSPACE) {
backspace();
}
// Handling tentative space
else if (wasTentativeSpace &&
(s == '.' || s == ',' || s == '!' || s == '?')) {
keyboard.sendKey(KeyEvent.DOM_VK_BACK_SPACE);
keyboard.sendKey(keycode);
keyboard.sendKey(KeyEvent.DOM_VK_SPACE);
if (s == '.' || s == '!' || s == '?') {
capitalizeNext = true;
}
}
// Using spacebar to finish input
else if (s == ' ' && !isBufferEmpty()) {
buffer += s;
tentativeSpace = true;
inputDone();
}
// Punctuation, symbols, other.
else {
if (!isBufferEmpty()) {
inputDone();
}
if (s == '.' || s == '!' || s == '?') {
capitalizeNext = true;
}
if (s == ' ') {
capitalizeNext = wasCapitalizeNext;
}
keyboard.sendKey(keycode);
}
if (!isBufferEmpty()) {
keyboard.setComposition(buffer);
var candidates = vietWordParser.generateCandidates(buffer);
keyboard.sendCandidates(candidates);
} else {
keyboard.sendCandidates([]);
}
keyboard.setUpperCase(capitalizeNext);
}
function select(s) {
buffer = s;
buffer += ' ';
tentativeSpace = true;
inputDone();
keyboard.sendCandidates([]);
}
})();

View file

@ -0,0 +1,5 @@
;'use strict';(function(exports){var AbortablePromiseQueueError=function(currentId,expectedId){this.currentId=currentId;this.expectedId=expectedId;};AbortablePromiseQueueError.prototype.name='AbortablePromiseQueueError';AbortablePromiseQueueError.prototype.message='The current task group ID does not match.';var AbortablePromiseQueue=function AbortablePromiseQueue(){this._started=false;this._taskGroupId=0;this._queuedTasks=null;};AbortablePromiseQueue.prototype.start=function(){if(this._started){throw new Error('AbortablePromiseQueue: Should not be start()\'ed twice.');}
this._started=true;this._queuedTasks=Promise.resolve();};AbortablePromiseQueue.prototype.stop=function(){if(!this._started){throw new Error('AbortablePromiseQueue: '+'Was not start()\'ed but stop() is called.');}
this._started=false;this.abort();this._queuedTasks=null;this._taskGroupId=0;};AbortablePromiseQueue.prototype.run=function(tasks){this.abort();var idCheck=this._getIdCheckFunction();tasks.forEach(function(task){this._queuedTasks=this._queuedTasks.then(idCheck).then(task);},this);this._queuedTasks=this._queuedTasks.catch(function(e){if(e instanceof AbortablePromiseQueueError){return;}
(e!==undefined)&&console.error(e);});return this._queuedTasks;};AbortablePromiseQueue.prototype.abort=function(){this._taskGroupId++;};AbortablePromiseQueue.prototype._getIdCheckFunction=function(){var id=this._taskGroupId;return function __taskGroupIdCheck(value){if(id!==this._taskGroupId){return Promise.reject(new AbortablePromiseQueueError(this._taskGroupId,id));}
return value;}.bind(this);};exports.AbortablePromiseQueue=AbortablePromiseQueue;})(window);

View file

@ -0,0 +1,19 @@
;'use strict';(function(exports){var ActiveTargetsManager=function(app){this.app=app;this.activeTargets=null;this.blockNewUserPress=false;this.blockTargetMovedOut=false;this.userPressManager=null;this.alternativesCharMenuManager=null;this.longPressTimer=undefined;this.doubleTapTimer=undefined;this.doubleTapPreviousTarget=null;};ActiveTargetsManager.prototype.ontargetactivated=null;ActiveTargetsManager.prototype.ontargetlongpressed=null;ActiveTargetsManager.prototype.ontargetmoved=null;ActiveTargetsManager.prototype.ontargetmovedout=null;ActiveTargetsManager.prototype.ontargetmovedin=null;ActiveTargetsManager.prototype.ontargetcommitted=null;ActiveTargetsManager.prototype.ontargetcancelled=null;ActiveTargetsManager.prototype.ontargetdoubletapped=null;ActiveTargetsManager.prototype.onnewtargetwillactivate=null;ActiveTargetsManager.prototype.LONG_PRESS_TIMEOUT=700;ActiveTargetsManager.prototype.DOUBLE_TAP_TIMEOUT=450;ActiveTargetsManager.prototype.start=function(){this.app.console.log('ActiveTargetsManager.start()');this.activeTargets=new Map();var userPressManager=this.userPressManager=new UserPressManager(this.app);userPressManager.onpressstart=this._handlePressStart.bind(this);userPressManager.onpressmove=this._handlePressMove.bind(this);userPressManager.onpressend=this._handlePressEnd.bind(this);userPressManager.start();this.alternativesCharMenuManager=new AlternativesCharMenuManager(this.app);this.alternativesCharMenuManager.start();};ActiveTargetsManager.prototype.stop=function(){this.app.console.log('ActiveTargetsManager.stop()');this.activeTargets=null;this.userPressManager.stop();this.userPressManager=null;this.alternativesCharMenuManager.stop();this.alternativesCharMenuManager=null;clearTimeout(this.longPressTimer);this.doubleTapTimer=undefined;this.doubleTapPreviousTarget=null;};ActiveTargetsManager.prototype.clearAllTargets=function(){this.app.console.log('ActiveTargetsManager.clearAllTargets()');if(this.activeTargets.size){console.warn('ActiveTargetsManager: clear '+
this.activeTargets.size+' active target(s).');}
this.activeTargets.forEach(function(target,id){if(typeof this.ontargetcancelled==='function'){this.ontargetcancelled(target);}},this);this.activeTargets.clear();this.alternativesCharMenuManager.hide();clearTimeout(this.longPressTimer);};ActiveTargetsManager.prototype._handlePressStart=function(press,id){this.app.console.log('ActiveTargetsManager._handlePressStart()');if(this.blockNewUserPress||this.alternativesCharMenuManager.isShown){return;}
if(typeof this.onnewtargetwillactivate==='function'){this.activeTargets.forEach(function(target,id){this.onnewtargetwillactivate(target);},this);}
var target=press.target;this.activeTargets.set(id,target);if(typeof this.ontargetactivated==='function'){this.ontargetactivated(target,press);}
clearTimeout(this.longPressTimer);if(this.activeTargets.size===1){this.longPressTimer=setTimeout(this._handleLongPress.bind(this,press,id),this.LONG_PRESS_TIMEOUT);}};ActiveTargetsManager.prototype._handlePressMove=function(press,id){this.app.console.log('ActiveTargetsManager._handlePressMove()');if(!this.activeTargets.has(id)){return;}
var target=press.target;if(this.alternativesCharMenuManager.isShown&&this.alternativesCharMenuManager.isInMenuArea(press)){target=this.alternativesCharMenuManager.getMenuTarget(press);}
if(!target){return;}
var oldTarget=this.activeTargets.get(id);if(press.moved&&('selection'in oldTarget)){this.activeTargets.delete(id);this.ontargetcancelled(oldTarget);this.alternativesCharMenuManager.hide();clearTimeout(this.longPressTimer);return;}
if(target===oldTarget){if(typeof this.ontargetmoved==='function'){this.ontargetmoved(target,press);}
return;}
if(this.blockTargetMovedOut){return;}
this.activeTargets.set(id,target);if(typeof this.ontargetmovedout==='function'){this.ontargetmovedout(oldTarget,press);}
if(typeof this.ontargetmovedin==='function'){this.ontargetmovedin(target,press);}
if(!this.alternativesCharMenuManager.isMenuTarget(target)&&!this.alternativesCharMenuManager.isInMenuArea(press)){this.alternativesCharMenuManager.hide();}
clearTimeout(this.longPressTimer);if(this.activeTargets.size===1){this.longPressTimer=setTimeout(this._handleLongPress.bind(this,press,id),this.LONG_PRESS_TIMEOUT);}};ActiveTargetsManager.prototype._handleLongPress=function(press,id){this.app.console.log('ActiveTargetsManager._handleLongPress()');if(!this.activeTargets.has(id)){return;}
var target=this.activeTargets.get(id);if(typeof this.ontargetlongpressed==='function'){this.ontargetlongpressed(target);}
this.alternativesCharMenuManager.show(target);if(this.alternativesCharMenuManager.isShown){this._handlePressMove(press,id);}};ActiveTargetsManager.prototype._handlePressEnd=function(press,id){this.app.console.log('ActiveTargetsManager._handlePressEnd()');if(!this.activeTargets.has(id)){return;}
var target=this.activeTargets.get(id);this.activeTargets.delete(id);this.alternativesCharMenuManager.hide();clearTimeout(this.longPressTimer);if(this.doubleTapTimer&&this.doubleTapPreviousTarget===target){window.clearTimeout(this.doubleTapTimer);this.doubleTapTimer=undefined;this.doubleTapPreviousTarget=null;if(typeof this.ontargetdoubletapped==='function'){this.ontargetdoubletapped(target);}}else{window.clearTimeout(this.doubleTapTimer);this.doubleTapTimer=window.setTimeout(function(){this.doubleTapTimer=undefined;this.doubleTapPreviousTarget=null;}.bind(this),this.DOUBLE_TAP_TIMEOUT);this.doubleTapPreviousTarget=target;if(typeof this.ontargetcommitted==='function'){this.ontargetcommitted(target);}}};exports.ActiveTargetsManager=ActiveTargetsManager;})(window);

View file

@ -0,0 +1,8 @@
;'use strict';(function(exports){var AlternativesCharMenuManager=function(app){this.app=app;this.isShown=false;this._originalTarget=null;this._menuAreaTop=this._menuAreaLeft=this._menuAreaRight=this._menuAreaBottom=0;};AlternativesCharMenuManager.prototype.start=function(){this._currentMenuView=null;};AlternativesCharMenuManager.prototype.stop=function(){this._currentMenuView=null;};AlternativesCharMenuManager.prototype.show=function(target){var alternatives=this._getAlternativesForTarget(target);if(!alternatives){return;}
var viewManager=this.app.viewManager;var targetRect=viewManager.getView(target).element.getBoundingClientRect();this._currentMenuView=viewManager.showAlternativesCharMenu(target,alternatives);this.isShown=true;this._originalTarget=target;var menuRect=this._currentMenuView.getBoundingClientRect();this._menuAreaTop=menuRect.top;this._menuAreaLeft=Math.min(targetRect.left,menuRect.left);this._menuAreaLeft-=targetRect.width;this._menuAreaBottom=targetRect.bottom;this._menuAreaRight=Math.max(targetRect.right,menuRect.right);this._menuAreaRight+=targetRect.width;};AlternativesCharMenuManager.prototype._getAlternativesForTarget=function _getAlternativesForTarget(key){var alternatives;var altMap=this.app.layoutManager.currentPage.alt;var origKey=null;if(this.app.upperCaseStateManager.isUpperCaseLocked){origKey=key.uppercaseValue;alternatives=altMap[origKey]&&(altMap[origKey].upperCaseLocked||altMap[origKey]);}else if(this.app.upperCaseStateManager.isUpperCase){origKey=key.uppercaseValue;alternatives=altMap[origKey];}else{origKey=key.lowercaseValue;alternatives=altMap[origKey];}
if(!alternatives||!alternatives.length){return false;}
return[].concat(origKey,alternatives);};AlternativesCharMenuManager.prototype.hide=function(){if(!this.isShown){return;}
this.app.viewManager.hideAlternativesCharMenu();this.isShown=false;this._originalTarget=null;this._menuAreaTop=this._menuAreaLeft=this._menuAreaRight=this._menuAreaBottom=0;this._currentMenuView=null;};AlternativesCharMenuManager.prototype.isMenuTarget=function(target){if(!this._currentMenuView){return false;}
return this._currentMenuView.isMenuTarget(target);};AlternativesCharMenuManager.prototype.getMenuTarget=function(press){if(!this.isShown){throw new Error('AlternativesCharMenuManager: '+'getMenuTarget called but menu is not shown');}
return this._currentMenuView.getMenuTarget(press.clientX,press.clientY);};AlternativesCharMenuManager.prototype.isInMenuArea=function(press){if(!this.isShown){return false;}
return(press.clientY>=this._menuAreaTop&&press.clientY<=this._menuAreaBottom&&press.clientX>=this._menuAreaLeft&&press.clientX<=this._menuAreaRight);};exports.AlternativesCharMenuManager=AlternativesCharMenuManager;})(window);

View file

@ -0,0 +1 @@
;'use strict';(function(exports){var app=new KeyboardApp();app.start();exports.app=app;})(window);

View file

@ -0,0 +1,6 @@
;'use strict';(function(exports){var CandidatePanelScrollingMonitor=function(app){this.app=app;this.scrollTimer=undefined;};CandidatePanelScrollingMonitor.prototype.SCROLL_END_WAIT_MS=200;CandidatePanelScrollingMonitor.prototype.onneedcandidates=null;CandidatePanelScrollingMonitor.prototype.start=function(){};CandidatePanelScrollingMonitor.prototype.stop=function(){clearTimeout(this.scrollTimer);var candidatePanel=this.app.viewManager.candidatePanel;if(candidatePanel){var suggestionsContainer=candidatePanel.querySelector('.suggestions-container');suggestionsContainer.removeEventListener('scroll',this);}};CandidatePanelScrollingMonitor.prototype.handleEvent=function(evt){var panel=evt.target;clearTimeout(this.scrollTimer);if(panel.scrollTop===0||(panel.scrollHeight-panel.clientHeight-panel.scrollTop)>=5){return;}
this.scrollTimer=setTimeout(function(){if(typeof this.onneedcandidates==='function'){this.onneedcandidates();}}.bind(this),this.SCROLL_END_WAIT_MS);};CandidatePanelScrollingMonitor.prototype.startMonitoring=function(){var candidatePanel=this.app.viewManager.candidatePanel;if('truncated'in candidatePanel.dataset){var suggestionsContainer=candidatePanel.querySelector('.suggestions-container');suggestionsContainer.addEventListener('scroll',this);}};CandidatePanelScrollingMonitor.prototype.stopMonitoring=function(){clearTimeout(this.scrollTimer);var suggestionsContainer=this.app.viewManager.candidatePanel.querySelector('.suggestions-container');suggestionsContainer.removeEventListener('scroll',this);};var CandidatePanelManager=function(app){this.app=app;this.currentCandidates=null;this.isFullPanelShown=undefined;this.scrollingMonitor=null;};CandidatePanelManager.prototype.FIRST_PAGE_ROWS=11;CandidatePanelManager.prototype.PAGE_ROWS=12;CandidatePanelManager.prototype.oncandidateschange=null;CandidatePanelManager.prototype.start=function(){this.currentCandidates=[];this.isFullPanelShown=false;this.scrollingMonitor=new CandidatePanelScrollingMonitor(this.app);this.scrollingMonitor.start();this.scrollingMonitor.onneedcandidates=this.showNextCandidatePage.bind(this);};CandidatePanelManager.prototype.stop=function(){this.scrollingMonitor.stop();this.scrollingMonitor=null;this.isFullPanelShown=undefined;};CandidatePanelManager.prototype.showNextCandidatePage=function(){var numberOfCandidatesPerRow=this.app.viewManager.getNumberOfCandidatesPerRow();var candidatePanel=this.app.viewManager.candidatePanel;var candidateIndicator=parseInt(candidatePanel.dataset.candidateIndicator,10);var engine=this.app.inputMethodManager.currentIMEngine;if(typeof engine.getMoreCandidates==='function'){engine.getMoreCandidates(candidateIndicator,this.PAGE_ROWS*numberOfCandidatesPerRow+1,this.app.viewManager.showMoreCandidates.bind(this.app.viewManager,this.PAGE_ROWS));}else{var list=this.currentCandidates.slice(candidateIndicator,candidateIndicator+this.PAGE_ROWS*numberOfCandidatesPerRow+1);this.app.viewManager.showMoreCandidates(this.PAGE_ROWS,list);}};CandidatePanelManager.prototype.toggleFullPanel=function(fullPanel){if(this.isFullPanelShown){this.hideFullPanel();}else{this.showFullPanel();}};CandidatePanelManager.prototype.showFullPanel=function(){if(this.isFullPanelShown){return;}
this.isFullPanelShown=true;var candidatePanel=this.app.viewManager.candidatePanel;if(candidatePanel.dataset.rowCount==1){var numberOfCandidatesPerRow=this.app.viewManager.getNumberOfCandidatesPerRow();var candidateIndicator=parseInt(candidatePanel.dataset.candidateIndicator,10);var engine=this.app.inputMethodManager.currentIMEngine;if(typeof engine.getMoreCandidates==='function'){engine.getMoreCandidates(candidateIndicator,this.FIRST_PAGE_ROWS*numberOfCandidatesPerRow+1,function gotMoreCandidates(list){if(candidatePanel.dataset.rowCount!=1){return;}
this.app.viewManager.showMoreCandidates(this.FIRST_PAGE_ROWS,list);this.scrollingMonitor.startMonitoring();this.app.viewManager.toggleCandidatePanel(true);}.bind(this));}else{var list=this.currentCandidates.slice(candidateIndicator,candidateIndicator+
this.FIRST_PAGE_ROWS*numberOfCandidatesPerRow+1);this.app.viewManager.showMoreCandidates(this.FIRST_PAGE_ROWS,list);this.scrollingMonitor.startMonitoring();this.app.viewManager.toggleCandidatePanel(true);}}else{this.scrollingMonitor.startMonitoring();this.app.viewManager.toggleCandidatePanel(true);}};CandidatePanelManager.prototype.hideFullPanel=function(){if(!this.isFullPanelShown){return;}
this.isFullPanelShown=false;this.scrollingMonitor.stopMonitoring();this.app.viewManager.toggleCandidatePanel(false);};CandidatePanelManager.prototype.reset=function(){this.hideFullPanel();this.currentCandidates=[];};CandidatePanelManager.prototype.updateCandidates=function(candidates){this.currentCandidates=candidates;if(typeof this.oncandidateschange==='function'){this.oncandidateschange();}};exports.CandidatePanelScrollingMonitor=CandidatePanelScrollingMonitor;exports.CandidatePanelManager=CandidatePanelManager;})(window);

View file

@ -0,0 +1,8 @@
;'use strict';(function(exports){var KeyboardConsole=function KeyboardConsole(){this._timers=null;};KeyboardConsole.prototype.start=function(){var timers=this._timers=new Map();timers.set('domLoading',performance.timing.domLoading);this._startTime=Date.now();};KeyboardConsole.prototype.LOG_LEVEL=0;KeyboardConsole.prototype.trace=function(){if(this.LOG_LEVEL<3){return;}
console.trace.apply(console,arguments);};KeyboardConsole.prototype.time=function(timerName){if(this.LOG_LEVEL<2){return;}
console.time(timerName);};KeyboardConsole.prototype.timeEnd=function(timerName){if(this.LOG_LEVEL<2){return;}
if(this._timers.has(timerName)){console.log(timerName+': '+
(Date.now()-this._timers.get(timerName))+'ms');return;}
console.timeEnd(timerName);};KeyboardConsole.prototype.log=function(){if(this.LOG_LEVEL<2){return;}
console.log.apply(console,arguments);};KeyboardConsole.prototype.info=function(){if(this.LOG_LEVEL<1){return;}
console.info.apply(console,arguments);};exports.KeyboardConsole=KeyboardConsole;})(window);

View file

@ -0,0 +1,6 @@
;'use strict';(function(exports){var VibrationFeedback=function(app){this.app=app;this.settings=null;};VibrationFeedback.prototype.VIBRATE_MS=50;VibrationFeedback.prototype.start=function(){var settings=this.settings=new VibrationFeedbackSettings();settings.promiseManager=this.app.settingsPromiseManager;settings.initSettings().catch(function rejected(){console.warn('VibrationFeedback: Failed to get initial settings.');});};VibrationFeedback.prototype.stop=function(){this.settings=null;};VibrationFeedback.prototype.triggerFeedback=function(){if(!this.settings.initialized){console.warn('VibrationFeedback: '+'Sound feedback needed but settings is not available yet.');return;}
if(typeof window.navigator.vibrate!=='function'){console.warn('VibrationFeedback: '+'No navigator.vibrate() on this platform.');return;}
var vibrationFeedbackSettingsValues=this.settings.getSettingsSync();if(!vibrationFeedbackSettingsValues.vibrationEnabled){return;}
window.navigator.vibrate(this.VIBRATE_MS);};var SoundFeedback=function(app){this.app=app;this.activated=false;this.settings=null;this.clicker=null;this.specialClicker=null;};SoundFeedback.prototype.start=function(){var settings=this.settings=new SoundFeedbackSettings();settings.promiseManager=this.app.settingsPromiseManager;settings.onsettingchange=this._handleSettingsChange.bind(this);settings.initSettings().then(this._handleSettingsChange.bind(this),function rejected(){console.warn('SoundFeedback: Failed to get initial settings.');});};SoundFeedback.prototype.stop=function(){this.settings=null;this.player=null;};SoundFeedback.prototype.activate=function(){this.activated=true;if(this.player){this.player.activate();}};SoundFeedback.prototype.deactivate=function(){this.activated=false;if(this.player){this.player.deactivate();}};SoundFeedback.prototype._handleSettingsChange=function(settings){if(settings.clickEnabled&&!!settings.isSoundEnabled){this.player=new SoundFeedbackPlayer();this.player.prepare();if(this.activated){this.player.activate();}}else{this.player=null;}};SoundFeedback.prototype.triggerFeedback=function(target){if(!this.settings.initialized){console.warn('SoundFeedback: '+'Sound feedback needed but settings is not available yet.');return;}
if(!this.player){return;}
this.player.play(target.isSpecialKey);};var FeedbackManager=function(app){this.app=app;this.vibrationFeedback=null;this.soundFeedback=null;};FeedbackManager.prototype.start=function(){this.vibrationFeedback=new VibrationFeedback(this.app);this.vibrationFeedback.start();this.soundFeedback=new SoundFeedback(this.app);this.soundFeedback.start();};FeedbackManager.prototype.stop=function(){this.settings=null;this.vibrationFeedback.stop();this.soundFeedback.stop();this.vibrationFeedback=null;this.soundFeedback=null;};FeedbackManager.prototype.activate=function(){this.soundFeedback.activate();};FeedbackManager.prototype.deactivate=function(){this.soundFeedback.deactivate();};FeedbackManager.prototype.triggerFeedback=function(target){this.vibrationFeedback.triggerFeedback(target);this.soundFeedback.triggerFeedback(target);};exports.VibrationFeedback=VibrationFeedback;exports.SoundFeedback=SoundFeedback;exports.FeedbackManager=FeedbackManager;})(window);

View file

@ -0,0 +1,5 @@
;'use strict';(function(exports){var HandwritingPadsManager=function(app){this._started=false;this._timeOutId=undefined;this._strokeWidth=5;this._responseTime=200;this._strokePoints=[];this._currentTarget=null;this._cleared=false;this.app=app;};HandwritingPadsManager.prototype.MAX_RESPONSE_TIME=600;HandwritingPadsManager.prototype.start=function(){if(this._started){throw new Error('HandwritingPadsManager: '+'Instance should not be start()\'ed twice.');}
this.handwritingPadSettings=new HandwritingPadSettings();this.handwritingPadSettings.promiseManager=this.app.settingsPromiseManager;this.handwritingPadSettings.onsettingchange=this._handleSettingsChange.bind(this);this.handwritingPadSettings.initSettings().then(this._handleSettingsChange.bind(this),function rejected(){console.error('Fatal Error! Failed to get initial '+'handwriting pad settings.');});this._started=true;};HandwritingPadsManager.prototype.stop=function(){if(!this._started){throw new Error('HandwritingPadsManager: '+'Instance was never start()\'ed but stop() is called.');}
this.handwritingPadSettings=null;this._started=false;};HandwritingPadsManager.prototype._handleSettingsChange=function(values){this._strokeWidth=values.strokeWidth;this._responseTime=values.responseTime;};HandwritingPadsManager.prototype.handlePressStart=function(press){clearTimeout(this._timeOutId);if(!this._currentTarget){this._currentTarget=press.target;}else if(this._currentTarget!=press.target&&!this._cleared){this.app.layoutRenderingManager.clearHandwritingPad(this._currentTarget);this._strokePoints=[];this._currentTarget=press.target;}
this._cleared=false;var point=this.app.layoutRenderingManager.drawHandwritingPad(press,true,this._strokeWidth);this._strokePoints.push(point.posX,point.posY);};HandwritingPadsManager.prototype.handlePressMove=function(press){var point=this.app.layoutRenderingManager.drawHandwritingPad(press,false,this._strokeWidth);this._strokePoints.push(point.posX,point.posY);};HandwritingPadsManager.prototype.handlePressEnd=function(){this._timeOutId=setTimeout(this._sendStrokePoints.bind(this),this.MAX_RESPONSE_TIME-this._responseTime);this._strokePoints.push(-1,0);};HandwritingPadsManager.prototype._sendStrokePoints=function(){if(this._strokePoints.length<=1){return;}
var ime=this.app.inputMethodManager.currentIMEngine;if(ime.sendStrokePoints){ime.sendStrokePoints(this._strokePoints);}};HandwritingPadsManager.prototype.clear=function(){this.app.layoutRenderingManager.clearHandwritingPad(this._currentTarget);this._strokePoints=[];this._cleared=true;};exports.HandwritingPadsManager=HandwritingPadsManager;})(window);

View file

@ -0,0 +1,7 @@
;'use strict';(function(exports){var InputMethodDatabaseConfig=function(){this._configPromise=null;};InputMethodDatabaseConfig.prototype.CONFIG_FILE_PATH='./js/settings/layouts.json';InputMethodDatabaseConfig.prototype.start=function(){this._getConfig();};InputMethodDatabaseConfig.prototype.stop=function(){this._configPromise=null;};InputMethodDatabaseConfig.prototype.isDataPreloaded=function(imEngineName,dataPath){return this._configPromise.then(function(layouts){if(!layouts){return true;}
var layout=layouts.find(function(layout){return(layout.dictFilePath===dataPath&&layout.imEngineId===imEngineName);});if(!layout){console.warn('InputMethodDatabaseConfig: '+'Ask for isDataPreloaded for data unlisted in config','imEngineName=',imEngineName,'dataPath=',dataPath);return true;}
return layout.preloaded;});};InputMethodDatabaseConfig.prototype.isAllDataPreloaded=function(){return this._configPromise.then(function(layouts){if(!layouts){return true;}
return layouts.every(function(layout){return layout.preloaded;});});};InputMethodDatabaseConfig.prototype._getConfig=function(){this._configPromise=new Promise(function(resolve,reject){var xhr=new XMLHttpRequest();xhr.open('GET',this.CONFIG_FILE_PATH);xhr.responseType='json';xhr.onload=function(){if(xhr.response){resolve(xhr.response);}else{resolve(null);}};xhr.onerror=function(){reject();};xhr.send();}.bind(this)).catch(function(e){e&&console.error(e);return null;});};var InputMethodDatabaseLoader=function InputMethodDatabaseLoader(){this.config=null;this._loadDBStorePromise=null;this.dbStore=null;};InputMethodDatabaseLoader.prototype.DATABASE_NAME='imEngineData';InputMethodDatabaseLoader.prototype.SOURCE_DIR='./js/imes/';InputMethodDatabaseLoader.prototype.start=function(){this.config=new InputMethodDatabaseConfig();this.config.start();this._loadDBStorePromise=this.config.isAllDataPreloaded().then(function(allDataPreloaded){if(allDataPreloaded){return;}
this.dbStore=new PromiseStorage(this.DATABASE_NAME);this.dbStore.start();}.bind(this)).catch(function(e){e&&console.error(e);});};InputMethodDatabaseLoader.prototype.stop=function(){this.config.stop();this.config=null;return this._loadDBStorePromise.then(function(){if(this.dbStore){this.dbStore.stop();this.dbStore=null;}
this._loadDBStorePromise=null;}.bind(this));};InputMethodDatabaseLoader.prototype.load=function(imEngineName,dataPath){var p=this.config.isDataPreloaded(imEngineName,dataPath).then(function(isDataPreloaded){if(isDataPreloaded){var url=this.SOURCE_DIR+imEngineName+'/'+dataPath;return this._loadPreloadData(url);}else{var databaseId=imEngineName+'/'+dataPath;return this._loadDBStoreData(databaseId);}}.bind(this)).catch(function(e){e&&console.error('InputMethodDatabaseLoader: Failed to load data.','imEngineName=',imEngineName,'dataPath=',dataPath,'error=',e);throw e;});return p;};InputMethodDatabaseLoader.prototype._loadPreloadData=function(url){return new Promise(function(resolve,reject){var xhr=new XMLHttpRequest();xhr.open('GET',url,true);xhr.responseType='arraybuffer';xhr.onload=function(){if(xhr.status!==404&&xhr.response&&xhr.response.byteLength){resolve(xhr.response);}else{reject(xhr.statusText);}};xhr.send();}.bind(this));};InputMethodDatabaseLoader.prototype._loadDBStoreData=function(databaseId){return this._loadDBStorePromise.then(function(){if(!this.dbStore){console.error('InputMethodDatabaseLoader:'+'Asked to load data from IndexedDB but build config indicates'+' otherwise.');throw undefined;}
return this.dbStore.getItem(databaseId);}.bind(this));};exports.InputMethodDatabaseConfig=InputMethodDatabaseConfig;exports.InputMethodDatabaseLoader=InputMethodDatabaseLoader;})(window);

View file

@ -0,0 +1,16 @@
;'use strict';(function(exports){var InputMethods={};InputMethods['default']={init:function(glue){this._glue=glue;},click:function(keyCode,isRepeat){return this._glue.sendKey(keyCode,isRepeat);},handleKey:function(dict){return this._glue.sendKey(dict);},displaysCandidates:function(){return false;}};var InputMethodGlue=function InputMethodGlue(){this.app=null;};InputMethodGlue.prototype.SOURCE_DIR='./js/imes/';InputMethodGlue.prototype.init=function(app,imEngineName){this.app=app;this.imEngineName=imEngineName;this.path=this.SOURCE_DIR+imEngineName;};InputMethodGlue.prototype.sendCandidates=function(candidates){this.app.console.trace();if(!this.app.inputContext){console.warn('InputMethodGlue: call sendCandidates() when '+'inputContext does not exist.');return;}
this.app.candidatePanelManager.updateCandidates(candidates);};InputMethodGlue.prototype.setComposition=function(symbols,cursor){this.app.console.trace();if(!this.app.inputContext){console.warn('InputMethodGlue: call setComposition() when '+'inputContext does not exist.');return;}
cursor=cursor||symbols.length;this.app.console.info('inputContext.setComposition()');return this.app.inputContext.setComposition(symbols,cursor).catch(function(e){console.warn('InputMethodGlue: setComposition() rejected with error',e);this.app.console.log(symbols,cursor);return Promise.reject(e);}.bind(this));};InputMethodGlue.prototype.endComposition=function(text){this.app.console.trace();if(!this.app.inputContext){console.warn('InputMethodGlue: call endComposition() when '+'inputContext does not exist.');return;}
text=text||'';this.app.console.info('inputContext.endComposition()');return this.app.inputContext.endComposition(text).catch(function(e){console.warn('InputMethodGlue: endComposition() rejected with error',e);this.app.console.log(text);return Promise.reject(e);}.bind(this));};InputMethodGlue.prototype.sendKey=function(keyCodeOrDict,isRepeat){this.app.console.trace();if(!this.app.inputContext){console.warn('InputMethodGlue: call sendKey() when '+'inputContext does not exist.');return Promise.reject();}
var promise;if(typeof keyCodeOrDict==='object'){this.app.console.info('inputContext.sendKey(), dict:',keyCodeOrDict);promise=this.app.inputContext.sendKey(keyCodeOrDict);}else{this.app.console.info('inputContext.sendKey(), code:'+keyCodeOrDict);switch(keyCodeOrDict){case KeyEvent.DOM_VK_BACK_SPACE:promise=this.app.inputContext.sendKey(keyCodeOrDict,0,0,isRepeat);break;case KeyEvent.DOM_VK_RETURN:promise=this.app.inputContext.sendKey(keyCodeOrDict,0,0);break;default:promise=this.app.inputContext.sendKey(0,keyCodeOrDict,0);break;}}
return promise.catch(function(e){console.warn('InputMethodGlue: sendKey() rejected with error',e);this.app.console.log(keyCodeOrDict,isRepeat);return Promise.reject(e);}.bind(this));};InputMethodGlue.prototype.sendString=function(str){this.app.console.trace();for(var i=0;i<str.length;i++){this.sendKey(str.charCodeAt(i));}};InputMethodGlue.prototype.setLayoutPage=function(newpage){this.app.console.trace();if(!this.app.inputContext){console.warn('InputMethodGlue: call setLayoutPage() when '+'inputContext does not exist.');return;}
if(newpage!==this.app.layoutManager.PAGE_INDEX_DEFAULT){throw new Error('InputMethodGlue: '+'imEngine is only allowed to switch to default page');}
this.app.setLayoutPage(newpage);};InputMethodGlue.prototype.setUpperCase=function(state){this.app.console.trace();if(!this.app.inputContext){console.warn('InputMethodGlue: call setUpperCase() when '+'inputContext does not exist.');return;}
this.app.upperCaseStateManager.switchUpperCaseState(state);};InputMethodGlue.prototype.replaceSurroundingText=function(text,offset,length){this.app.console.trace();if(!this.app.inputContext){console.warn('InputMethodGlue: call replaceSurroundingText() when '+'inputContext does not exist.');return Promise.reject();}
this.app.console.info('inputContext.replaceSurroundingText()');var p=this.app.inputContext.replaceSurroundingText(text,offset,length);p.catch(function(e){console.warn('InputMethodGlue: '+'replaceSurroundingText() rejected with error',e);this.app.console.log(text,offset,length);return Promise.reject(e);}.bind(this));return p;};InputMethodGlue.prototype.getNumberOfCandidatesPerRow=function(){return this.app.viewManager.getNumberOfCandidatesPerRow();};InputMethodGlue.prototype.getData=function(dataPath){return this.app.inputMethodDatabaseLoader.load(this.imEngineName,dataPath);};var InputMethodLoader=function(app){this.app=app;};InputMethodLoader.prototype.SOURCE_DIR='./js/imes/';InputMethodLoader.prototype.start=function(){this._initializedIMEngines={};this._imEnginesPromises={};this.initPreloadedInputMethod();};InputMethodLoader.prototype.initPreloadedInputMethod=function(){var imEngineName;var InputMethods=exports.InputMethods;for(imEngineName in InputMethods){this.initInputMethod(imEngineName);this._imEnginesPromises[imEngineName]=Promise.resolve(this._initializedIMEngines[imEngineName]);}};InputMethodLoader.prototype.getInputMethod=function(imEngineName){return this._initializedIMEngines[imEngineName];};InputMethodLoader.prototype.getInputMethodAsync=function(imEngineName){if(this._imEnginesPromises[imEngineName]){return this._imEnginesPromises[imEngineName];}
var p=new Promise(function(resolve,reject){var script=document.createElement('script');script.onload=resolve;script.onerror=function(){this._imEnginesPromises[imEngineName]=null;console.error('InputMethodLoader: unable to load '+imEngineName+'.');reject();}.bind(this);script.src=this.SOURCE_DIR+imEngineName+'/'+imEngineName+'.js';document.body.appendChild(script);}.bind(this)).then(function(){return this.initInputMethod(imEngineName);}.bind(this)).then(function(){return this._initializedIMEngines[imEngineName];}.bind(this));this._imEnginesPromises[imEngineName]=p;return p;};InputMethodLoader.prototype.initInputMethod=function(imEngineName){var InputMethods=exports.InputMethods;if(!(imEngineName in InputMethods)){throw new Error('InputMethodLoader: '+imEngineName+' did not expose itself correctly.');}
var imEngine=InputMethods[imEngineName];var glue=new InputMethodGlue();glue.init(this.app,imEngineName);this._initializedIMEngines[imEngineName]=InputMethods[imEngineName];InputMethods[imEngineName]=null;return imEngine.init(glue);};var InputMethodManager=function InputMethodManager(app){this.currentIMEngine=null;this.app=app;};InputMethodManager.prototype.start=function(){this.loader=new InputMethodLoader(this.app);this.loader.start();this.imEngineSettings=new IMEngineSettings();this.imEngineSettings.promiseManager=this.app.settingsPromiseManager;this.imEngineSettings.initSettings().catch(function rejected(){console.error('Fatal Error! Failed to get initial imEngine settings.');});this.currentIMEngine=this.loader.getInputMethod('default');};InputMethodManager.prototype.activateIMEngine=function(imEngineName){this.app.console.log('InputMethodManager.activateIMEngine()',imEngineName);var loaderPromise=this.loader.getInputMethodAsync(imEngineName);var settingsPromise=this.imEngineSettings.initSettings();var p=Promise.all([loaderPromise,settingsPromise]).then(function(values){var imEngine=values[0];if(typeof imEngine.activate==='function'){var settingsValues=values[1];var currentPage=this.app.layoutManager.currentPage;var lang=this.app.layoutManager.currentPage.autoCorrectLanguage||this.app.layoutManager.currentPage.handwritingLanguage;var correctPunctuation='autoCorrectPunctuation'in currentPage?currentPage.autoCorrectPunctuation:true;var inputContext=this.app.inputContext;this.app.console.log('InputMethodManager::currentIMEngine.activate()');imEngine.activate(lang,{type:inputContext.inputType,inputmode:inputContext.inputMode,selectionStart:inputContext.selectionStart,selectionEnd:inputContext.selectionEnd,text:inputContext.text},{suggest:settingsValues.suggestionsEnabled,correct:settingsValues.correctionsEnabled,correctPunctuation:correctPunctuation});}
if(typeof imEngine.stateChange==='function'){this.app.inputContext.addEventListener('selectionchange',this);this.app.inputContext.addEventListener('surroundingtextchange',this);}
this.currentIMEngine=imEngine;}.bind(this));return p;};InputMethodManager.prototype.deactivateIMEngine=function(){if(this.currentIMEngine&&this.currentIMEngine.deactivate){this.app.console.log('InputMethodManager::currentIMEngine.deactivate()');this.currentIMEngine.deactivate();}
if(this.app.inputContext){this.app.inputContext.removeEventListener('selectionchange',this);this.app.inputContext.removeEventListener('surroundingtextchange',this);}
this.currentIMEngine=this.loader.getInputMethod('default');};InputMethodManager.prototype.handleEvent=function(evt){this.app.console.info('InputMethodManager.handleEvent()',evt);var inputContext=this.app.inputContext;var inputContextStates={ownAction:evt.detail.ownAction,type:inputContext.inputType,inputmode:inputContext.inputMode,selectionStart:inputContext.selectionStart,selectionEnd:inputContext.selectionEnd,text:inputContext.text};this.app.console.log('InputMethodManager::currentIMEngine.stateChange()',inputContextStates);this.currentIMEngine.stateChange(inputContextStates);};exports.InputMethods=InputMethods;exports.InputMethodGlue=InputMethodGlue;exports.InputMethodLoader=InputMethodLoader;exports.InputMethodManager=InputMethodManager;})(window);

View file

@ -0,0 +1,3 @@
;'use strict';(function(exports){var KeyboardApp=function(){this.console=null;this.inputMethodManager=null;this.inputMethodDatabaseLoader=null;this.layoutManager=null;this.settingsPromiseManager=null;this.l10nLoader=null;this.targetHandlersManager=null;this.handwritingPadsManager=null;this.feedbackManager=null;this.visualHighlightManager=null;this.candidatePanelManager=null;this.upperCaseStateManager=null;this.layoutRenderingManager=null;this.stateManager=null;this.viewManager=null;this.inputContext=null;};KeyboardApp.prototype.CONATINER_ELEMENT_ID='keyboard';KeyboardApp.prototype.start=function(){this._startComponents();};KeyboardApp.prototype._startComponents=function(){this.console=new KeyboardConsole();this.console.start();this.console.log('KeyboardApp._startComponents()');this.console.trace();this.console.time('KeyboardApp._startComponents()');this.settingsPromiseManager=new SettingsPromiseManager();this.inputMethodManager=new InputMethodManager(this);this.inputMethodManager.start();this.inputMethodDatabaseLoader=new InputMethodDatabaseLoader(this);this.inputMethodDatabaseLoader.start();this.layoutManager=new LayoutManager(this);this.layoutManager.start();this.l10nLoader=new L10nLoader();this.targetHandlersManager=new TargetHandlersManager(this);this.targetHandlersManager.start();this.handwritingPadsManager=new HandwritingPadsManager(this);this.handwritingPadsManager.start();this.feedbackManager=new FeedbackManager(this);this.feedbackManager.start();this.visualHighlightManager=new VisualHighlightManager(this);this.visualHighlightManager.start();this.viewManager=new ViewManager(this);this.viewManager.start();var renderingManager=this.layoutRenderingManager=new LayoutRenderingManager(this);renderingManager.start();this.upperCaseStateManager=new UpperCaseStateManager();this.upperCaseStateManager.onstatechange=renderingManager.updateUpperCaseRendering.bind(renderingManager);this.upperCaseStateManager.start();this.candidatePanelManager=new CandidatePanelManager(this);this.candidatePanelManager.oncandidateschange=renderingManager.updateCandidatesRendering.bind(renderingManager);this.candidatePanelManager.start();this.stateManager=new StateManager(this);this.stateManager.start();this.console.timeEnd('KeyboardApp._startComponents()');};KeyboardApp.prototype.stop=function(){this.console.log('KeyboardApp.stop()');this._stopComponents();this.inputContext=null;};KeyboardApp.prototype._stopComponents=function(){this.console=null;this.inputMethodManager=null;this.inputMethodDatabaseLoader.stop();this.inputMethodDatabaseLoader=null;this.layoutManager=null;this.settingsPromiseManager=null;this.l10nLoader=null;this.targetHandlersManager.stop();this.targetHandlersManager=null;this.handwritingPadsManager.stop();this.handwritingPadsManager=null;this.feedbackManager.stop();this.feedbackManager=null;this.visualHighlightManager.stop();this.visualHighlightManager=null;this.candidatePanelManager.stop();this.candidatePanelManager=null;this.upperCaseStateManager.onstatechange=null;this.upperCaseStateManager.stop();this.upperCaseStateManager=null;this.layoutRenderingManager.stop();this.layoutRenderingManager=null;this.stateManager.stop();this.stateManager=null;this.viewManager.stop();this.viewManager=null;};KeyboardApp.prototype.getContainer=function(){return document.getElementById(this.CONATINER_ELEMENT_ID);};KeyboardApp.prototype.setInputContext=function(inputContext){this.console.log('KeyboardApp.setInputContext()',inputContext);this.inputContext=inputContext;};KeyboardApp.prototype.getBasicInputType=function(){if(!this.inputContext){return'text';}
var type=this.inputContext.inputType;switch(type){case'url':case'tel':case'email':case'text':case'search':break;case'password':default:type='text';break;case'number':case'range':type='number';break;}
return type;};KeyboardApp.prototype.supportsSwitching=function(){return navigator.mozInputMethod.mgmt.supportsSwitching();};KeyboardApp.prototype.setLayoutPage=function setLayoutPage(page){this.console.log('KeyboardApp.setLayoutPage()',page);this.layoutManager.updateLayoutPage(page);this.layoutRenderingManager.updateLayoutRendering();var engine=this.inputMethodManager.currentIMEngine;if(typeof engine.setLayoutPage==='function'){engine.setLayoutPage(this.layoutManager.currentPageIndex);}};exports.KeyboardApp=KeyboardApp;})(window);

View file

@ -0,0 +1,2 @@
;'use strict';(function(exports){var L10nLoader=function(){this.loadStarted=false;};L10nLoader.prototype.SCRIPT_URL='/shared/js/l10n.js';L10nLoader.prototype.load=function(){if(this.loadStarted){return;}
this.loadStarted=true;document.documentElement.lang='x-untranslated';var script=document.createElement('script');script.src=this.SCRIPT_URL;document.body.appendChild(script);};exports.L10nLoader=L10nLoader;})(window);

View file

@ -0,0 +1,3 @@
;'use strict';(function(exports){var Keyboards={};Keyboards.defaultLayout={pages:[{},{alt:{'1':['¹'],'2':['²'],'3':['³'],'4':['⁴'],'5':['⁵'],'6':['⁶'],'7':['⁷'],'8':['⁸'],'9':['⁹'],'0':['⁰','º'],'$':['€','£','¢','¥'],'"':['“','”'],'\'':['‘','’'],'?':['¿'],'!':['¡'],'+':['-','×','÷','±']},keys:[[{value:'1'},{value:'2'},{value:'3'},{value:'4'},{value:'5'},{value:'6'},{value:'7'},{value:'8'},{value:'9'},{value:'0'}],[{value:'@'},{value:'#'},{value:'$',className:'alternate-indicator'},{value:'&'},{value:'*'},{value:'-'},{value:'_'},{value:'/'},{value:'('},{value:')'}],[{value:'Alt',ratio:1.5,keyCode:KeyboardEvent.DOM_VK_ALT,className:'page-switch-key',targetPage:2},{value:'+',supportsSwitching:{value:','}},{value:':'},{value:';'},{value:'"'},{value:'\''},{value:'!'},{value:'?'},{value:'⌫',ratio:1.5,keyCode:KeyboardEvent.DOM_VK_BACK_SPACE}],[{value:'&nbsp',ratio:8,keyCode:KeyboardEvent.DOM_VK_SPACE},{value:'↵',ratio:2,keyCode:KeyboardEvent.DOM_VK_RETURN}]]},{alt:{'+':['-','×','÷','±'],'®':['™']},keys:[[{value:'€'},{value:'£'},{value:'¢'},{value:'¥'},{value:'%'},{value:'©'},{value:'®'},{value:'·'},{value:'|'},{value:'\\'}],[{value:'~'},{value:'℃'},{value:'℉'},{value:'°'},{value:'<'},{value:'>'},{value:'['},{value:']'},{value:'{'},{value:'}'}],[{value:'Alt',ratio:1.5,keyCode:KeyboardEvent.DOM_VK_ALT,className:'page-switch-key',targetPage:1},{value:'+'},{value:'='},{value:'`'},{value:'^'},{value:'§'},{value:'«'},{value:'»'},{value:'⌫',ratio:1.5,keyCode:KeyboardEvent.DOM_VK_BACK_SPACE}],[{value:'&nbsp',ratio:8,keyCode:KeyboardEvent.DOM_VK_SPACE},{value:'↵',ratio:2,keyCode:KeyboardEvent.DOM_VK_RETURN}]]}]};Keyboards.numberLayout={width:3,keyClassName:'big-key special-key',keys:[[{value:'1'},{value:'2'},{value:'3'}],[{value:'4'},{value:'5'},{value:'6'}],[{value:'7'},{value:'8'},{value:'9'}],[{value:'.',longPressValue:','},{value:'0',longPressValue:'-'},{value:'⌫',keyCode:KeyboardEvent.DOM_VK_BACK_SPACE}]]};Keyboards.pinLayout={width:3,keyClassName:'big-key special-key bottom-symbol',keys:[[{value:'1'},{value:'2'},{value:'3'}],[{value:'4'},{value:'5'},{value:'6'}],[{value:'7'},{value:'8'},{value:'9'}],[{value:''},{value:'0'},{value:'⌫',keyCode:KeyboardEvent.DOM_VK_BACK_SPACE}]]};Keyboards.telLayout={width:3,keyClassName:'big-key special-key bottom-symbol',keys:[[{value:'1',longPressValue:'('},{value:'2',longPressValue:')'},{value:'3',longPressValue:'/'}],[{value:'4',longPressValue:'-'},{value:'5',longPressValue:'_'},{value:'6',longPressValue:','}],[{value:'7',longPressValue:':'},{value:'8',longPressValue:'.'},{value:'9',longPressValue:';'}],[{value:'*',longPressValue:'#'},{value:'0',longPressValue:'+'},{value:'⌫',keyCode:KeyboardEvent.DOM_VK_BACK_SPACE}]]};var LayoutLoader=function(app){this.app=app;};LayoutLoader.prototype.SOURCE_DIR='./js/layouts/';LayoutLoader.prototype.start=function(){this._initializedLayouts={};this._layoutsPromises={};this.initLayouts();};LayoutLoader.prototype.initLayouts=function(){var Keyboards=exports.Keyboards;exports.Keyboards={};var layoutName;for(layoutName in Keyboards){if(this._initializedLayouts[layoutName]){console.warn('LayoutLoader: '+layoutName+' is overwritten.');}
var layoutNormalizer=new LayoutNormalizer(Keyboards[layoutName]);layoutNormalizer.normalize();this._initializedLayouts[layoutName]=layoutNormalizer.normalizedLayout;if(!this._layoutsPromises[layoutName]){this._layoutsPromises[layoutName]=Promise.resolve(this._initializedLayouts[layoutName]);}}};LayoutLoader.prototype.getLayout=function(layoutName){return this._initializedLayouts[layoutName];};LayoutLoader.prototype.getLayoutAsync=function(layoutName){if(this._layoutsPromises[layoutName]){return this._layoutsPromises[layoutName];}
var p=new Promise(function(resolve,reject){var script=document.createElement('script');script.onload=function(){this.initLayouts();resolve(this._initializedLayouts[layoutName]);}.bind(this);script.onerror=function(){this._layoutsPromises[layoutName]=null;console.error('LayoutLoader: unable to load '+layoutName+'.');reject();}.bind(this);script.src=this.SOURCE_DIR+layoutName+'.js';document.body.appendChild(script);}.bind(this));this._layoutsPromises[layoutName]=p;return p;};exports.Keyboards=Keyboards;exports.LayoutLoader=LayoutLoader;})(window);

View file

@ -0,0 +1,23 @@
;'use strict';(function(exports){var LayoutManager=function(app){this.app=app;this._typeGenericLayoutName=undefined;this.currentPage=null;this.currentPageIndex=this.PAGE_INDEX_DEFAULT;};LayoutManager.prototype.start=function(){this.loader=new LayoutLoader();this.loader.start();};LayoutManager.prototype.KEYCODE_SWITCH_KEYBOARD=-3;LayoutManager.prototype.KEYCODE_TOGGLE_CANDIDATE_PANEL=-4;LayoutManager.prototype.DEFAULT_LAYOUT_NAME='defaultLayout';LayoutManager.prototype.PAGE_INDEX_DEFAULT=0;LayoutManager.prototype.switchCurrentLayout=function(layoutName){var loaderPromise=this.loader.getLayoutAsync(layoutName);var p=loaderPromise.then(function(layout){this._typeGenericLayoutName=layoutName;this.currentPageIndex=this.PAGE_INDEX_DEFAULT;this._updateCurrentPage();}.bind(this));return p;};LayoutManager.prototype.updateLayoutPage=function(page){this.currentPageIndex=page;this._updateCurrentPage();};LayoutManager.prototype._updateCurrentPage=function(){if(!this.app.inputContext||!this._typeGenericLayoutName){console.warn('LayoutManager: '+'calling _updateCurrentPage() when there is no '+'inputContext or _typeGenericLayoutName.');this.currentPage=null;return;}
var inputMode=this.app.inputContext.inputMode;var basicInputType=this.app.getBasicInputType();var supportsSwitching=this.app.supportsSwitching();var typeSpecificLayoutName=this._typeSpecificLayoutName(basicInputType,inputMode);var layout=this.loader.getLayout(typeSpecificLayoutName||this._typeGenericLayoutName);if(!layout){console.error('LayoutManager: Can\'t load the layout.','typeSpecificLayoutName=',typeSpecificLayoutName,'typeGenericLayoutName=',this._typeGenericLayoutName,'currentPageIndex=',this.currentPageIndex);this.currentPage=null;return;}
var page=layout.pages[this.currentPageIndex];if(!page){var defaultLayout=this.loader.getLayout(this.DEFAULT_LAYOUT_NAME);page=defaultLayout.pages[this.currentPageIndex];}
if(!page){console.error('LayoutManager: Can\'t load the page from layout.','typeSpecificLayoutName=',typeSpecificLayoutName,'typeGenericLayoutName=',this._typeGenericLayoutName,'currentPageIndex=',this.currentPageIndex);this.currentPage=null;return;}
page=this.currentPage=Object.create(page);var keyNormalizer=new LayoutKeyNormalizer(page);['imEngine','autoCorrectLanguage','autoCorrectPunctuation','needsCandidatePanel','lang'].forEach(function(prop){if(prop in layout){page[prop]=layout[prop];}});page.layoutName=typeSpecificLayoutName||this._typeGenericLayoutName;page.pageIndex=this.currentPageIndex;var spaceKeyFindResult=this._findKey(page,KeyboardEvent.DOM_VK_SPACE);var spaceKeyRowCount=spaceKeyFindResult.keyRowCount;var spaceKeyCount=spaceKeyFindResult.keyCount;if(!spaceKeyFindResult.keyFound){console.warn('LayoutManager:'+'No space key found. No special keys will be added.');return;}
page.keys=[].concat(page.keys);var copiedRows=[];var spaceKeyRow=page.keys[spaceKeyRowCount]=[].concat(page.keys[spaceKeyRowCount]);copiedRows.push(spaceKeyRowCount);var spaceKeyObject=page.keys[spaceKeyRowCount][spaceKeyCount]=Object.create(page.keys[spaceKeyRowCount][spaceKeyCount]);var enterKeyFindResult=this._findKey(page,KeyboardEvent.DOM_VK_RETURN);var enterKeyCount=enterKeyFindResult.keyCount;var enterKeyObject=page.keys[spaceKeyRowCount][enterKeyCount]=Object.create(page.keys[spaceKeyRowCount][enterKeyCount]);var pageSwitchingKeyObject=null;if(!layout.disableAlternateLayout){spaceKeyObject.ratio-=2;pageSwitchingKeyObject={keyCode:KeyboardEvent.DOM_VK_ALT,ratio:2,className:'page-switch-key'};if(this.currentPageIndex===this.PAGE_INDEX_DEFAULT){Object.assign(pageSwitchingKeyObject,{value:layout.alternateLayoutKey||'12&',ariaLabel:'alternateLayoutKey2',targetPage:1});}else{Object.assign(pageSwitchingKeyObject,{value:layout.basicLayoutKey||'ABC',ariaLabel:'basicLayoutKey2',targetPage:this.PAGE_INDEX_DEFAULT});}
pageSwitchingKeyObject=keyNormalizer.normalizeKey(pageSwitchingKeyObject,false);spaceKeyRow.splice(spaceKeyCount,0,pageSwitchingKeyObject);spaceKeyCount++;}
var needsSwitchingKey=supportsSwitching&&!layout.hidesSwitchKey;if(needsSwitchingKey){var imeSwitchKey={value:'&#x1f310;',uppercaseValue:'&#x1f310;',keyCode:this.KEYCODE_SWITCH_KEYBOARD,className:'switch-key',isSpecialKey:true};if(layout.shortLabel){imeSwitchKey.value=layout.shortLabel;imeSwitchKey.uppercaseValue=layout.shortLabel;imeSwitchKey.className+=' alternate-indicator';}
spaceKeyObject.ratio-=1;spaceKeyRow.splice(spaceKeyCount,0,imeSwitchKey);spaceKeyCount++;var r=page.keys.length,c,row,key;while(r--){row=page.keys[r];c=row.length;while(c--){key=row[c];if(key.supportsSwitching){if(copiedRows.indexOf(r)===-1){page.keys[r]=[].concat(page.keys[r]);copiedRows.push(r);}
page.keys[r][c]=Object.create(key.supportsSwitching);}}}}
if(!page.typeInsensitive){var periodKey=keyNormalizer.normalizeKey({value:'.'},!!(page.alt&&page.alt['.']));var modifyType='default';if(this.currentPageIndex===this.PAGE_INDEX_DEFAULT){switch(basicInputType){case'url':modifyType='url';break;case'email':modifyType='email';break;case'text':modifyType='default';break;case'search':modifyType='search';break;}}else{if('search'===basicInputType){modifyType='search';}else{modifyType='default';}}
switch(modifyType){case'url':spaceKeyObject.ratio-=2.0;spaceKeyRow.splice(spaceKeyCount,0,keyNormalizer.normalizeKey({value:'/'},false));spaceKeyCount++;spaceKeyRow.splice(spaceKeyCount+1,0,periodKey);break;case'email':spaceKeyObject.ratio-=2;spaceKeyRow.splice(spaceKeyCount,0,keyNormalizer.normalizeKey({value:'@'},false));spaceKeyCount++;spaceKeyRow.splice(spaceKeyCount+1,0,periodKey);break;case'search':if(enterKeyObject){enterKeyObject.className='search-icon';}
case'default':var overwrites=page.textLayoutOverwrite||{};if(overwrites[',']!==false&&(!needsSwitchingKey||page.needsCommaKey)){var commaKey;if(overwrites[',']){commaKey=overwrites[','];}else{commaKey=keyNormalizer.normalizeKey({value:','},!!(page.alt&&page.alt[',']));}
spaceKeyObject.ratio-=1;spaceKeyRow.splice(spaceKeyCount,0,commaKey);spaceKeyCount++;}
if(overwrites['.']!==false){if(overwrites['.']){periodKey=overwrites['.'];}
spaceKeyObject.ratio-=1;spaceKeyRow.splice(spaceKeyCount+1,0,periodKey);}
break;}}
var keyCount=page.width?page.width:10;if(!layout.disableAlternateLayout){if(spaceKeyCount==3&&keyCount==10){if(enterKeyObject){enterKeyObject.ratio=2.5;}
pageSwitchingKeyObject.ratio=1.5;}}};LayoutManager.prototype._typeSpecificLayoutName=function(basicInputType,inputMode){switch(basicInputType){case'tel':return'telLayout';case'number':switch(inputMode){case'digit':return'pinLayout';default:return'numberLayout';}
break;case'text':switch(inputMode){case'digit':return'pinLayout';case'numeric':return'numberLayout';case'-moz-sms':var smsLayoutName=this._typeGenericLayoutName+'-sms';if(this.loader.getLayout(smsLayoutName)){return smsLayoutName;}}
break;}
return'';};LayoutManager.prototype._findKey=function(page,keyCode){var r=page.keys.length,c,row,key;while(r--){row=page.keys[r];c=row.length;while(c--){key=row[c];if(key.keyCode==keyCode){return{keyFound:true,keyRowCount:r,keyCount:c};}}}
return{keyFound:false,keyRowCount:-1,keyCount:-1};};exports.SWITCH_KEYBOARD=LayoutManager.prototype.KEYCODE_SWITCH_KEYBOARD;exports.TOGGLE_CANDIDATE_PANEL=LayoutManager.prototype.KEYCODE_TOGGLE_CANDIDATE_PANEL;exports.PAGE_INDEX_DEFAULT=LayoutManager.prototype.PAGE_INDEX_DEFAULT;exports.LayoutManager=LayoutManager;})(window);

View file

@ -0,0 +1,12 @@
;'use strict';(function(exports){var LayoutKeyNormalizer=function(page){this._page=page;};LayoutKeyNormalizer.prototype._isSpecialKey=function(key){var SPECIAL_CODES=[KeyEvent.DOM_VK_BACK_SPACE,KeyEvent.DOM_VK_CAPS_LOCK,KeyEvent.DOM_VK_RETURN,KeyEvent.DOM_VK_ALT];var hasSpecialCode=key.keyCode&&(SPECIAL_CODES.indexOf(key.keyCode)!==-1);return hasSpecialCode||key.keyCode<=0;};LayoutKeyNormalizer.prototype._isButton=function(key){var SPECIAL_BUTTONS=[KeyEvent.DOM_VK_RETURN];return this._isSpecialKey(key)&&SPECIAL_BUTTONS.indexOf(key.keyCode)!==-1;};LayoutKeyNormalizer.prototype._getUpperCaseValue=function(key){if(KeyEvent.DOM_VK_SPACE===key.keyCode||this._isSpecialKey(key)||key.compositeKey){return key.value;}
var upperCase=this._page.upperCase||{};return upperCase[key.value]||key.value.toUpperCase();};LayoutKeyNormalizer.prototype.normalizeKey=function(key,showAlternatesIndicator){var keyChar=key.value;var upperCaseKeyChar=this._getUpperCaseValue(key);var code=key.keyCode||keyChar.charCodeAt(0);var upperCode=key.keyCode||upperCaseKeyChar.charCodeAt(0);key.keyCode=code;key.keyCodeUpper=upperCode;key.lowercaseValue=keyChar;key.uppercaseValue=upperCaseKeyChar;key.isSpecialKey=this._isSpecialKey(key);key.isButton=this._isButton(key);if(showAlternatesIndicator){key.className='alternate-indicator';}
if(key.longPressValue){var longPressKeyCode=key.longPressKeyCode||key.longPressValue.charCodeAt(0);key.longPressKeyCode=longPressKeyCode;}
if(key.supportsSwitching){this.normalizeKey(key.supportsSwitching,false);}
if(KeyboardEvent.DOM_VK_ALT===code&&!('targetPage'in key)){console.error('LayoutNormalizer: no targetPage for switching key.');}
return key;};var LayoutNormalizer=function(layout){this._layout=layout;this._normalizedLayout=null;};LayoutNormalizer.prototype._hasAlternativeKeys=function(key,page){var alt=page.alt||{};return key in alt;};LayoutNormalizer.prototype._normalizePageKeys=function(page){var keyRows=page.keys||[];var keyNormalizer=new LayoutKeyNormalizer(page);page.keys=keyRows.map(function(keyRow){return keyRow.map(function(key){return keyNormalizer.normalizeKey(key,false);},this);},this);var overwrites=page.textLayoutOverwrite||{};page.textLayoutOverwrite=Object.keys(overwrites).reduce(function(result,overwrittenKey){if(false===overwrites[overwrittenKey]){result[overwrittenKey]=false;}else{var hasAlternativeKeys=this._hasAlternativeKeys(overwrites[overwrittenKey],page);result[overwrittenKey]=keyNormalizer.normalizeKey({value:overwrites[overwrittenKey]},hasAlternativeKeys);}
return result;}.bind(this),{});};LayoutNormalizer.prototype._normalizePageAltKeys=function(page){var alt=page.alt=page.alt||{};var upperCase=page.upperCase=page.upperCase||{};var altKeys=Object.keys(alt);altKeys.forEach(function(key){var alternatives=alt[key];if(!Array.isArray(alternatives)){if(alternatives.indexOf(' ')!==-1){alternatives=alternatives.split(' ');if(alternatives.length===2&&alternatives[1]===''){alternatives.pop();}}else{alternatives=alternatives.split('');}}
alt[key]=alternatives;var upperCaseKey=upperCase[key]||key.toUpperCase();if(!alt[upperCaseKey]){var needDifferentUpperCaseLockedAlternatives=false;alt[upperCaseKey]=alternatives.map(function(key){if(key.length===1){return key.toUpperCase();}
needDifferentUpperCaseLockedAlternatives=needDifferentUpperCaseLockedAlternatives||(key.substr(1).toUpperCase()!==key.substr(1));return key[0].toUpperCase()+key.substr(1);});if(needDifferentUpperCaseLockedAlternatives){alt[upperCaseKey].upperCaseLocked=alternatives.map(function(key){return key.toUpperCase();});}}},this);};LayoutNormalizer.prototype.normalize=function(){var pages;if('pages'in this._layout){pages=this._layout.pages;}else{pages=this._layout.pages=[];}
if(!pages[0]){pages[0]={};['alt','keys','upperCase','width','keyClassName','typeInsensitive','textLayoutOverwrite','needsCommaKey','secondLayout','specificCssRule'].forEach(function(prop){if(this._layout[prop]){pages[0][prop]=this._layout[prop];delete this._layout[prop];}},this);}
pages.forEach(function(page){this._normalizePageKeys(page);this._normalizePageAltKeys(page);},this);this._normalizedLayout=this._layout;};Object.defineProperty(LayoutNormalizer.prototype,'normalizedLayout',{configurable:true,get:function ln_getNormalizedLayout(){if(!this._normalizedLayout){throw Error('Tried to get normalized layout before calling normalize()');}
return this._normalizedLayout;}});exports.LayoutKeyNormalizer=LayoutKeyNormalizer;exports.LayoutNormalizer=LayoutNormalizer;})(window);

View file

@ -0,0 +1,9 @@
;'use strict';(function(exports){var LayoutRenderingManager=function(app){this.app=app;this._currentRenderingPage=null;this._resizeListenerTimer=undefined;this.domObjectMap=null;};LayoutRenderingManager.prototype.start=function(){this.app.console.log('LayoutRenderingManager.start()');this._resizeListenerTimer=setTimeout(function attachResizeListener(){this.app.console.log('LayoutRenderingManager.attachResizeListener()');window.addEventListener('resize',this);}.bind(this),2000);this.domObjectMap=new WeakMap();};LayoutRenderingManager.prototype.stop=function(){clearTimeout(this._resizeListenerTimer);this._resizeListenerTimer=undefined;window.removeEventListener('resize',this);this.domObjectMap=null;};LayoutRenderingManager.prototype.handleEvent=function(){this.app.console.log('LayoutRenderingManager.handleEvent()');if(document.hidden){this.app.console.log('LayoutRenderingManager: Ignore resizing call since '+'document is hidden.');return;}
if(this._currentRenderingPage!==this.app.layoutManager.currentPage){this.app.console.log('LayoutRenderingManager: Ignore resizing call since '+'layout is not ready yet.');return;}
this.app.viewManager.resize();this._updateHeight();this._updateLayoutParams();};LayoutRenderingManager.prototype.updateCandidatesRendering=function(){if(this._currentRenderingPage!==this.app.layoutManager.currentPage){this.app.console.log('LayoutRenderingManager: Ignore updateCandidatesRendering() call since '+'layout is not ready yet.');return;}
this.app.viewManager.showCandidates(this.app.candidatePanelManager.currentCandidates);};LayoutRenderingManager.prototype.updateUpperCaseRendering=function(){this.app.console.log('LayoutRenderingManager.updateUpperCaseRendering()');if(this._currentRenderingPage!==this.app.layoutManager.currentPage){this.app.console.log('LayoutRenderingManager: Ignore updateUpperCaseRendering() call since '+'layout is not ready yet.');return;}
window.requestAnimationFrame(function(){this.app.console.log('LayoutRenderingManager.updateUpperCaseRendering()::'+'requestAnimationFrame');this.app.viewManager.setUpperCaseLock(this.app.upperCaseStateManager);}.bind(this));};LayoutRenderingManager.prototype.updateLayoutRendering=function(){this.app.console.log('LayoutRenderingManager.updateLayoutRendering()');this.app.console.time('LayoutRenderingManager.updateLayoutRendering()');var currentPage=this._currentRenderingPage=this.app.layoutManager.currentPage;var currentIMEngine=this.app.inputMethodManager.currentIMEngine;this.app.console.log('needsCandidatePanel',currentPage.autoCorrectLanguage,currentPage.needsCandidatePanel,typeof currentIMEngine.displaysCandidates!=='function',(currentIMEngine.displaysCandidates&&currentIMEngine.displaysCandidates()));var needsCandidatePanel=!!((currentPage.autoCorrectLanguage||currentPage.needsCandidatePanel)&&((typeof currentIMEngine.displaysCandidates!=='function')||currentIMEngine.displaysCandidates()));if(currentPage.updateByIMEngine){if(typeof currentIMEngine.updatePageKeys!=='function'){throw new Error('LayoutRenderingManager: unable to update '+'page keys by IMEngine');}
currentIMEngine.updatePageKeys(currentPage);}
var p=new Promise(function(resolve){this.app.viewManager.render(currentPage,{uppercase:this.app.upperCaseStateManager.isUpperCase,inputType:this.app.getBasicInputType(),showCandidatePanel:needsCandidatePanel},resolve);}.bind(this)).then(this._afterRenderDrew.bind(this));p.catch(function(e){console.error(e);});this._updateHeight();this.app.console.timeEnd('LayoutRenderingManager.updateLayoutRendering()');return p;};LayoutRenderingManager.prototype.drawHandwritingPad=function(press,start,strokeWidth){return this.app.viewManager.drawHandwritingPad(press,start,strokeWidth);};LayoutRenderingManager.prototype.clearHandwritingPad=function(target){this.app.viewManager.clearHandwritingPad(target);};LayoutRenderingManager.prototype._afterRenderDrew=function(){this.app.console.log('LayoutRenderingManager._afterRenderDrew()');this.app.console.time('LayoutRenderingManager._afterRenderDrew()');this.app.viewManager.setUpperCaseLock(this.app.upperCaseStateManager);this.app.viewManager.showCandidates(this.app.candidatePanelManager.currentCandidates);this._updateLayoutParams();this.app.console.timeEnd('LayoutRenderingManager._afterRenderDrew()');};LayoutRenderingManager.prototype._updateLayoutParams=function(){this.app.console.log('LayoutRenderingManager._updateLayoutParams()');var currentIMEngine=this.app.inputMethodManager.currentIMEngine;var layoutManager=this.app.layoutManager;if((typeof currentIMEngine.setLayoutParams!=='function')||layoutManager.currentPageIndex!==layoutManager.PAGE_INDEX_DEFAULT){return;}
var candidatePanel=this.app.viewManager.candidatePanel;var yBias=candidatePanel?candidatePanel.clientHeight:0;currentIMEngine.setLayoutParams({keyboardWidth:this.app.viewManager.getWidth(),keyboardHeight:(this.app.viewManager.getHeight()-yBias),keyArray:this.app.viewManager.getKeyArray(),keyWidth:this.app.viewManager.getKeyWidth(),keyHeight:this.app.viewManager.getKeyHeight()});};LayoutRenderingManager.prototype._updateHeight=function(){this.app.console.log('LayoutRenderingManager._updateHeight()');this.app.console.time('LayoutRenderingManager._updateHeight()');var imeHeight=this.app.viewManager.getHeight();var imeWidth=this.app.viewManager.getWidth();imeHeight=Math.floor(imeHeight*window.devicePixelRatio)/window.devicePixelRatio;this.app.console.timeEnd('LayoutRenderingManager._updateHeight()');this.app.console.timeEnd('activate');this.app.console.timeEnd('domLoading');window.resizeTo(imeWidth,imeHeight);};LayoutRenderingManager.prototype.getTargetObject=function(elem){this.app.console.log('LayoutRenderingManager.getTargetObject()',elem);if(!elem){return{};}
var target=this.domObjectMap.get(elem);this.app.console.log('target=',target,'prototype=',target&&Object.getPrototypeOf(target));return target||{};};exports.LayoutRenderingManager=LayoutRenderingManager;})(window);

View file

@ -0,0 +1,11 @@
;;'use strict';(function(exports){var SettingsPromiseManager=function SettingsPromiseManager(){this._readLock=null;this._writeLock=null;};SettingsPromiseManager.prototype._cleanLock=function(type){var propName;switch(type){case'read':propName='_readLock';break;case'write':propName='_writeLock';break;default:throw new Error('SettingsPromiseManager: Not such type.');}
if(this[propName]&&this[propName].closed){this[propName]=null;}};SettingsPromiseManager.prototype._getLock=function(type){var propName;switch(type){case'read':propName='_readLock';break;case'write':propName='_writeLock';break;default:throw new Error('SettingsPromiseManager: Not such type.');}
if(this[propName]&&!this[propName].closed){return this[propName];}
var settings=window.navigator.mozSettings;this[propName]=settings.createLock();return this[propName];};SettingsPromiseManager.prototype._getReadLock=function(){return this._getLock('read');};SettingsPromiseManager.prototype._getWriteLock=function(){return this._getLock('write');};SettingsPromiseManager.prototype.get=function(obj){if(typeof obj==='string'){return this.getOne(obj);}
if(typeof obj!=='object'){throw new Error('SettingsPromiseManager.get: '+'require object, array, or string.');}
var arr=Array.isArray(obj)?obj:Object.keys(obj);var promise=Promise.all(arr.map(function(key){return this.getOne(key);},this));return promise;};SettingsPromiseManager.prototype.getOne=function(key){var promise=new Promise(function(resolve,reject){var req=this._getReadLock().get(key);req.onsuccess=function(){this._cleanLock('read');resolve(req.result[key]);}.bind(this);req.onerror=function(){this._cleanLock('read');reject();}.bind(this);}.bind(this));return promise;};SettingsPromiseManager.prototype.set=function(obj,value){if(typeof obj==='string'){return this.setOne(obj,value);}
if(typeof obj!=='object'){throw new Error('SettingsPromiseManager.set: require object.');}
var promise=new Promise(function(resolve,reject){var req=this._getWriteLock().set(obj);req.onsuccess=function(){this._cleanLock('write');resolve();}.bind(this);req.onerror=function(){this._cleanLock('write');reject();}.bind(this);}.bind(this));return promise;};SettingsPromiseManager.prototype.setOne=function(key,value){var obj={};obj[key]=value;return this.set(obj);};SettingsPromiseManager.prototype.updateOne=function(key,callback){var promise=new Promise(function(resolve,reject){var lock=this._getWriteLock();var req=lock.get(key);req.onsuccess=function(){var newValue=callback(req.result[key]);var obj={};obj[key]=newValue;resolve(lock.set(obj));}.bind(this);req.onerror=function(){reject(req.error);}.bind(this);}.bind(this)).then(function(){this._cleanLock('write');}.bind(this),function(e){this._cleanLock('write');throw e;}.bind(this));return promise;};var SettingsManagerBase=function(){this.initialized=false;this._callbacks=null;this._values={};this._initPromise=null;};SettingsManagerBase.prototype.onsettingchange=null;SettingsManagerBase.prototype.KEYS=[];SettingsManagerBase.prototype.PROPERTIES=[];SettingsManagerBase.prototype.getSettingsSync=function(){return this._values;};SettingsManagerBase.prototype.initSettings=function(){if(this._initPromise){return this._initPromise;}
var promise=this.promiseManager.get(this.KEYS).then(function(results){results.forEach(function(value,i){this._values[this.PROPERTIES[i]]=value;},this);this.startObserve();this.initialized=true;return this._values;}.bind(this),function(error){this._initPromise=null;return Promise.reject(error);}.bind(this));this._initPromise=promise;return promise;};SettingsManagerBase.prototype.startObserve=function(){if(this._callbacks){return;}
var callbacks=this._callbacks=[];this.KEYS.forEach(function(key,i){var callback=function(e){this._values[this.PROPERTIES[i]]=e.settingValue;if(typeof this.onsettingchange==='function'){this.onsettingchange(this._values);}}.bind(this);navigator.mozSettings.addObserver(key,callback);callbacks.push(callback);},this);};SettingsManagerBase.prototype.stopObserve=function(){if(!this._callbacks){return;}
var callbacks=this._callbacks;this.KEYS.forEach(function(key,i){navigator.mozSettings.removeObserver(key,callbacks[i]);},this);this._callbacks=null;};var SoundFeedbackSettings=function(){};SoundFeedbackSettings.prototype=new SettingsManagerBase();SoundFeedbackSettings.prototype.KEYS=['keyboard.clicksound','audio.volume.notification'];SoundFeedbackSettings.prototype.PROPERTIES=['clickEnabled','isSoundEnabled'];var VibrationFeedbackSettings=function(){};VibrationFeedbackSettings.prototype=new SettingsManagerBase();VibrationFeedbackSettings.prototype.KEYS=['keyboard.vibration'];VibrationFeedbackSettings.prototype.PROPERTIES=['vibrationEnabled'];var IMEngineSettings=function(){};IMEngineSettings.prototype=new SettingsManagerBase();IMEngineSettings.prototype.KEYS=['keyboard.wordsuggestion','keyboard.autocorrect'];IMEngineSettings.prototype.PROPERTIES=['suggestionsEnabled','correctionsEnabled'];var HandwritingPadSettings=function(){};HandwritingPadSettings.prototype=new SettingsManagerBase();HandwritingPadSettings.prototype.KEYS=['keyboard.handwriting.strokeWidth','keyboard.handwriting.responseTime'];HandwritingPadSettings.prototype.PROPERTIES=['strokeWidth','responseTime'];var UserPressManagerSettings=function(){};UserPressManagerSettings.prototype=new SettingsManagerBase();UserPressManagerSettings.prototype.KEYS=['deviceinfo.hardware','deviceinfo.product_model'];UserPressManagerSettings.prototype.PROPERTIES=['deviceinfoHardware','deviceinfoProductModel'];exports.SettingsPromiseManager=SettingsPromiseManager;exports.SettingsManagerBase=SettingsManagerBase;exports.SoundFeedbackSettings=SoundFeedbackSettings;exports.VibrationFeedbackSettings=VibrationFeedbackSettings;exports.IMEngineSettings=IMEngineSettings;exports.HandwritingPadSettings=HandwritingPadSettings;exports.UserPressManagerSettings=UserPressManagerSettings;})(window);

View file

@ -0,0 +1,6 @@
;'use strict';(function(exports){var SoundFeedbackPlayer=function(){this._audioCtx=null;this._clickerAudioBuf=null;this._specialClickerAudioBuf=null;};SoundFeedbackPlayer.prototype.CLICK_SOUND_URL='./resources/sounds/key.wav';SoundFeedbackPlayer.prototype.SPECIAL_SOUND_URL='./resources/sounds/special.wav';SoundFeedbackPlayer.prototype.activate=function(){if(this._audioCtx){return;}
this._audioCtx=new AudioContext('system');};SoundFeedbackPlayer.prototype.deactivate=function(){this._audioCtx=null;};SoundFeedbackPlayer.prototype.prepare=function(){if(typeof AudioContext==='undefined'||typeof OfflineAudioContext==='undefined'){console.error('SoundFeedbackPlayer: No Web Audio API on this platform.');return;}
var clickerPromise=this._getAudioFileAsArrayBuffer(this.CLICK_SOUND_URL).then(this._decodeAudioData.bind(this)).then(function(audioBuffer){this._clickerAudioBuf=audioBuffer;}.bind(this));var specialClickerPromise=this._getAudioFileAsArrayBuffer(this.SPECIAL_SOUND_URL).then(this._decodeAudioData.bind(this)).then(function(audioBuffer){this._specialClickerAudioBuf=audioBuffer;}.bind(this));return Promise.all([clickerPromise,specialClickerPromise]).catch(function(e){console.error(e);throw e;});};SoundFeedbackPlayer.prototype._getAudioFileAsArrayBuffer=function(url){return new Promise(function(resolve,reject){var xhr=new XMLHttpRequest();xhr.open('GET',url);xhr.responseType='arraybuffer';xhr.onload=function(){if(!xhr.response){reject('SoundFeedbackPlayer: Cannot load file: '+url);return;}
resolve(xhr.response);};xhr.send();});};SoundFeedbackPlayer.prototype._decodeAudioData=function(arrayBuffer){return new Promise(function(resolve,reject){var ctx=new OfflineAudioContext(2,1,44100);ctx.decodeAudioData(arrayBuffer,function(audioBuffer){resolve(audioBuffer);},function(){reject('SoundFeedbackPlayer: decodeAudioData failed.');});}.bind(this));};SoundFeedbackPlayer.prototype.play=function(isSpecialKey){if(!this._clickerAudioBuf||!this._specialClickerAudioBuf){console.warn('SoundFeedbackPlayer: '+'Sound feedback needed but audio buffer is not available yet.');return;}
if(!this._audioCtx){console.error('SoundFeedbackPlayer: play() is called but not activated?');return;}
var ctx=this._audioCtx;var source=ctx.createBufferSource();source.buffer=isSpecialKey?this._specialClickerAudioBuf:this._clickerAudioBuf;source.connect(ctx.destination);source.start(0);};exports.SoundFeedbackPlayer=SoundFeedbackPlayer;})(window);

View file

@ -0,0 +1,8 @@
;'use strict';(function(exports){var StateManager=function(app){this.app=app;this._started=false;this._isActive=undefined;this._layoutName=undefined;};StateManager.prototype.start=function(){this.app.console.log('StateManager.start()');if(this._started){throw new Error('StateManager: Should not be start()\'ed twice.');}
this._started=true;this._isActive=false;this._queue=new AbortablePromiseQueue();this._queue.start();window.addEventListener('hashchange',this);window.addEventListener('visibilitychange',this);navigator.mozInputMethod.addEventListener('inputcontextchange',this);this.app.setInputContext(navigator.mozInputMethod.inputcontext);this._layoutName=window.location.hash.substr(1);var active=(!document.hidden&&!!this.app.inputContext);if(!active){this._queue.run([this._preloadLayout.bind(this),this._preloadInputMethod.bind(this),this.app.l10nLoader.load.bind(this.app.l10nLoader)]);}
this._updateActiveState(active);};StateManager.prototype.stop=function(){this.app.console.log('StateManager.stop()');if(!this._started){throw new Error('StateManager: Was not start()\'ed but stop() is called.');}
this._started=false;this._queue.stop();this._queue=null;window.removeEventListener('hashchange',this);window.removeEventListener('visibilitychange',this);navigator.mozInputMethod.removeEventListener('inputcontextchange',this);this._isActive=undefined;this._layoutName=undefined;};StateManager.prototype.handleEvent=function(evt){var active=(!document.hidden&&!!navigator.mozInputMethod.inputcontext);this.app.console.info('StateManager.handleEvent()',evt,active);switch(evt.type){case'hashchange':this._layoutName=window.location.hash.substr(1);if(!active){this._queue.run([this._preloadLayout.bind(this),this._preloadInputMethod.bind(this)]);}
break;case'visibilitychange':break;case'inputcontextchange':this.app.setInputContext(navigator.mozInputMethod.inputcontext);break;}
this._updateActiveState(active);};StateManager.prototype._updateActiveState=function(active){this.app.console.log('StateManager._updateActiveState()',active);if(active){this.app.console.time('activate');this._queue.run([function(){this.app.candidatePanelManager.hideFullPanel();this.app.candidatePanelManager.updateCandidates([]);this.app.inputMethodManager.deactivateIMEngine();this.app.feedbackManager.activate();}.bind(this),this.app.layoutManager.switchCurrentLayout.bind(this.app.layoutManager,this._layoutName),this._activateIMEngineForCurrentPage.bind(this),this.app.layoutRenderingManager.updateLayoutRendering.bind(this.app.layoutRenderingManager),this.app.l10nLoader.load.bind(this.app.l10nLoader)]);}else{if(active===this._isActive){return;}
this._queue.run([function(){this.app.candidatePanelManager.hideFullPanel();this.app.candidatePanelManager.updateCandidates([]);this.app.targetHandlersManager.activeTargetsManager.clearAllTargets();this.app.feedbackManager.deactivate();}.bind(this),this.app.inputMethodManager.deactivateIMEngine.bind(this.app.inputMethodManager)]);}
this._isActive=active;};StateManager.prototype._preloadLayout=function(){this.app.console.log('StateManager._preloadLayout()');var layoutLoader=this.app.layoutManager.loader;return layoutLoader.getLayoutAsync(this._layoutName);};StateManager.prototype._preloadInputMethod=function(layout){this.app.console.log('StateManager._preloadInputMethod()');var imEngineName=layout.imEngine;var imEngineLoader=this.app.inputMethodManager.loader;if(imEngineName){var p=imEngineLoader.getInputMethodAsync(imEngineName);return p;}};StateManager.prototype._activateIMEngineForCurrentPage=function(){this.app.console.log('StateManager._activateIMEngineForCurrentPage()');var page=this.app.layoutManager.currentPage;var imEngineName=page.imEngine||'default';this.app.upperCaseStateManager.reset();this.app.candidatePanelManager.reset();var p=this.app.inputMethodManager.activateIMEngine(imEngineName);return p;};exports.StateManager=StateManager;})(window);

View file

@ -0,0 +1,14 @@
;'use strict';(function(exports){var DefaultTargetHandler=function(target,app){this.target=target;this.app=app;this.ignoreCommitActions=false;};DefaultTargetHandler.prototype.activate=function(){this.app.console.log('DefaultTargetHandler.activate()');this.app.feedbackManager.triggerFeedback(this.target);this.app.visualHighlightManager.show(this.target);};DefaultTargetHandler.prototype.longPress=function(){this.app.console.log('DefaultTargetHandler.longPress()');if(!('longPressValue'in this.target)){return;}
this.ignoreCommitActions=true;var keyCode=this.target.longPressKeyCode;var promise=Promise.resolve(this.app.inputMethodManager.currentIMEngine.click(keyCode));this.app.visualHighlightManager.hide(this.target);return promise;};DefaultTargetHandler.prototype.moveOut=function(){this.app.console.log('DefaultTargetHandler.moveOut()');this.app.visualHighlightManager.hide(this.target);};DefaultTargetHandler.prototype.moveIn=function(){this.app.console.log('DefaultTargetHandler.moveIn()');this.app.visualHighlightManager.show(this.target);};DefaultTargetHandler.prototype.commit=function(){this.app.console.log('DefaultTargetHandler.commit()');if(this.ignoreCommitActions){this.app.console.log('DefaultTargetHandler.commit()::return early');return;}
var keyCode=this.target.keyCode;var keyCodeUpper=this.target.keyCodeUpper;var engine=this.app.inputMethodManager.currentIMEngine;var code=this.app.upperCaseStateManager.isUpperCase?keyCodeUpper:keyCode;this.app.console.log('DefaultTargetHandler.commit()::engine.click',code);var promise=Promise.resolve(engine.click(code));this.app.visualHighlightManager.hide(this.target);return promise;};DefaultTargetHandler.prototype.cancel=function(){this.app.console.log('DefaultTargetHandler.cancel()');this.app.visualHighlightManager.hide(this.target);};DefaultTargetHandler.prototype.doubleTap=function(){this.app.console.log('DefaultTargetHandler.doubleTap()');return this.commit();};DefaultTargetHandler.prototype.newTargetActivate=function(){this.commit();this.ignoreCommitActions=true;};DefaultTargetHandler.prototype.move=function(){};var NullTargetHandler=function(target,app){DefaultTargetHandler.apply(this,arguments);};NullTargetHandler.prototype=Object.create(DefaultTargetHandler.prototype);NullTargetHandler.prototype.activate=NullTargetHandler.prototype.moveIn=NullTargetHandler.prototype.moveOut=NullTargetHandler.prototype.commit=NullTargetHandler.prototype.cancel=NullTargetHandler.prototype.doubleTap=function(){};var SpaceKeyTargetHandler=function(target,app){DefaultTargetHandler.apply(this,arguments);};SpaceKeyTargetHandler.prototype=Object.create(DefaultTargetHandler.prototype);SpaceKeyTargetHandler.prototype.longPress=function(){this.app.targetHandlersManager.activeTargetsManager.clearAllTargets();navigator.mozInputMethod.mgmt.hide();this.app.visualHighlightManager.hide(this.target);};var CandidateSelectionTargetHandler=function(target,app){DefaultTargetHandler.apply(this,arguments);};CandidateSelectionTargetHandler.prototype=Object.create(DefaultTargetHandler.prototype);CandidateSelectionTargetHandler.prototype.commit=function(){if(this.ignoreCommitActions){this.app.console.log('CandidateSelectionTargetHandler.commit()::return early');return;}
this.app.candidatePanelManager.hideFullPanel();var engine=this.app.inputMethodManager.currentIMEngine;if(typeof engine.select==='function'){engine.select(this.target.text,this.target.data);}
this.app.visualHighlightManager.hide(this.target);};var BackspaceTargetHandler=function(target,app){DefaultTargetHandler.apply(this,arguments);this.deleteTimeout=undefined;this.deleteInterval=undefined;this.ignoreCommitActions=false;};BackspaceTargetHandler.prototype=Object.create(DefaultTargetHandler.prototype);BackspaceTargetHandler.prototype.REPEAT_RATE=50;BackspaceTargetHandler.prototype.REPEAT_TIMEOUT=500;BackspaceTargetHandler.prototype._sendDelete=function(isRepeat){var engine=this.app.inputMethodManager.currentIMEngine;engine.click(KeyEvent.DOM_VK_BACK_SPACE,null,isRepeat);};BackspaceTargetHandler.prototype.activate=function(){this.app.feedbackManager.triggerFeedback(this.target);this.app.visualHighlightManager.show(this.target);this.deleteTimeout=setTimeout(function(){this._sendDelete(true);this.deleteInterval=setInterval(function(){this._sendDelete(true);}.bind(this),this.REPEAT_RATE);}.bind(this),this.REPEAT_TIMEOUT);};BackspaceTargetHandler.prototype.moveOut=function(){this.app.visualHighlightManager.hide(this.target);clearTimeout(this.deleteTimeout);clearInterval(this.deleteInterval);};BackspaceTargetHandler.prototype.moveIn=function(){this.ignoreCommitActions=true;};BackspaceTargetHandler.prototype.commit=function(){if(this.ignoreCommitActions){this.app.console.log('BackspaceTargetHandler.commit()::return early');return;}
clearTimeout(this.deleteTimeout);clearInterval(this.deleteInterval);this._sendDelete(false);this.app.visualHighlightManager.hide(this.target);};BackspaceTargetHandler.prototype.cancel=function(){clearTimeout(this.deleteTimeout);clearInterval(this.deleteInterval);this.app.visualHighlightManager.hide(this.target);};var CompositeTargetHandler=function(target,app){DefaultTargetHandler.apply(this,arguments);};CompositeTargetHandler.prototype=Object.create(DefaultTargetHandler.prototype);CompositeTargetHandler.prototype.commit=function(){if(this.ignoreCommitActions){this.app.console.log('CompositeTargetHandler.commit()::return early');return;}
var compositeString=this.target.compositeKey;var promise;var engine=this.app.inputMethodManager.currentIMEngine;if(engine.handleKey){promise=engine.handleKey({key:compositeString,printable:true});}else{promise=Promise.resolve();compositeString.split('').forEach(function(chr){promise=promise.then(function(){return engine.click(chr.charCodeAt(0));},function(e){console.error(e);return engine.click(chr.charCodeAt(0));});});}
this.app.visualHighlightManager.hide(this.target);return promise;};var PageSwitchingTargetHandler=function(target,app){DefaultTargetHandler.apply(this,arguments);};PageSwitchingTargetHandler.prototype=Object.create(DefaultTargetHandler.prototype);PageSwitchingTargetHandler.prototype.commit=function(){if(this.ignoreCommitActions){this.app.console.log('PageSwitchingTargetHandler.commit()::return early');return;}
var page=this.target.targetPage;this.app.setLayoutPage(page);this.app.visualHighlightManager.hide(this.target);var currentIMEngine=this.app.inputMethodManager.currentIMEngine;if(typeof currentIMEngine.empty==='function'){currentIMEngine.empty();}};var CapsLockTargetHandler=function(target,app){DefaultTargetHandler.apply(this,arguments);this.isPreviouslyUpperCase=undefined;};CapsLockTargetHandler.prototype=Object.create(DefaultTargetHandler.prototype);CapsLockTargetHandler.prototype.isNewTargetActivated=false;CapsLockTargetHandler.prototype.activate=function(){this.isPreviouslyUpperCase=this.app.upperCaseStateManager.isUpperCase;this.app.upperCaseStateManager.switchUpperCaseState({isUpperCaseLocked:true});this.app.feedbackManager.triggerFeedback(this.target);this.app.visualHighlightManager.show(this.target);};CapsLockTargetHandler.prototype.commit=function(){if(this.isNewTargetActivated){this.app.upperCaseStateManager.switchUpperCaseState({isUpperCase:false,isUpperCaseLocked:false});}else{this.app.upperCaseStateManager.switchUpperCaseState({isUpperCase:!this.isPreviouslyUpperCase,isUpperCaseLocked:false});}
this.app.visualHighlightManager.hide(this.target);};CapsLockTargetHandler.prototype.doubleTap=function(){this.app.upperCaseStateManager.switchUpperCaseState({isUpperCaseLocked:true});this.app.visualHighlightManager.hide(this.target);};CapsLockTargetHandler.prototype.newTargetActivate=function(){this.isNewTargetActivated=true;};var SwitchKeyboardTargetHandler=function(target,app){DefaultTargetHandler.apply(this,arguments);};SwitchKeyboardTargetHandler.prototype=Object.create(DefaultTargetHandler.prototype);SwitchKeyboardTargetHandler.prototype.longPress=function(){this.ignoreCommitActions=true;this.app.targetHandlersManager.activeTargetsManager.clearAllTargets();navigator.mozInputMethod.mgmt.showAll();this.app.visualHighlightManager.hide(this.target);};SwitchKeyboardTargetHandler.prototype.commit=function(){if(this.ignoreCommitActions){return;}
this.app.targetHandlersManager.activeTargetsManager.clearAllTargets();navigator.mozInputMethod.mgmt.next();this.app.visualHighlightManager.hide(this.target);};var ToggleCandidatePanelTargetHandler=function(target,app){DefaultTargetHandler.apply(this,arguments);};ToggleCandidatePanelTargetHandler.prototype=Object.create(DefaultTargetHandler.prototype);ToggleCandidatePanelTargetHandler.prototype.commit=function(){if(this.ignoreCommitActions){this.app.console.log('ToggleCandidatePanelTargetHandler.commit()::return early');return;}
this.app.candidatePanelManager.toggleFullPanel();this.app.visualHighlightManager.hide(this.target);};var DismissSuggestionsTargetHandler=function(target,app){DefaultTargetHandler.apply(this,arguments);};DismissSuggestionsTargetHandler.prototype=Object.create(DefaultTargetHandler.prototype);DismissSuggestionsTargetHandler.prototype.commit=function(){if(this.ignoreCommitActions){this.app.console.log('DismissSuggestionsTargetHandler.commit()::return early');return;}
var engine=this.app.inputMethodManager.currentIMEngine;if(typeof engine.dismissSuggestions==='function'){engine.dismissSuggestions();}
this.app.visualHighlightManager.hide(this.target);};var HandwritingPadTargetHandler=function(target,app){DefaultTargetHandler.apply(this,arguments);};HandwritingPadTargetHandler.prototype=Object.create(DefaultTargetHandler.prototype);HandwritingPadTargetHandler.prototype.activate=function(press){this.app.handwritingPadsManager.handlePressStart(press);};HandwritingPadTargetHandler.prototype.move=function(press){this.app.handwritingPadsManager.handlePressMove(press);};HandwritingPadTargetHandler.prototype.moveOut=function(press){};HandwritingPadTargetHandler.prototype.moveIn=function(press){this.app.handwritingPadsManager.handlePressStart(press);};HandwritingPadTargetHandler.prototype.commit=function(){this.app.handwritingPadsManager.handlePressEnd();};HandwritingPadTargetHandler.prototype.newTargetActivate=function(){};exports.DefaultTargetHandler=DefaultTargetHandler;exports.NullTargetHandler=NullTargetHandler;exports.SpaceKeyTargetHandler=SpaceKeyTargetHandler;exports.CandidateSelectionTargetHandler=CandidateSelectionTargetHandler;exports.BackspaceTargetHandler=BackspaceTargetHandler;exports.CompositeTargetHandler=CompositeTargetHandler;exports.PageSwitchingTargetHandler=PageSwitchingTargetHandler;exports.CapsLockTargetHandler=CapsLockTargetHandler;exports.SwitchKeyboardTargetHandler=SwitchKeyboardTargetHandler;exports.ToggleCandidatePanelTargetHandler=ToggleCandidatePanelTargetHandler;exports.DismissSuggestionsTargetHandler=DismissSuggestionsTargetHandler;exports.HandwritingPadTargetHandler=HandwritingPadTargetHandler;})(window);

View file

@ -0,0 +1,7 @@
;'use strict';(function(exports){var TargetHandlersManager=function(app){this.handlers=undefined;this.activeTargetsManager=null;this.app=app;this.promiseQueue=Promise.resolve();};TargetHandlersManager.prototype.start=function(){this.app.console.log('TargetHandlersManager.start()');this.handlers=new WeakMap();var activeTargetsManager=this.activeTargetsManager=new ActiveTargetsManager(this.app);activeTargetsManager.ontargetactivated=this._callTargetAction.bind(this,'activate',true,false);activeTargetsManager.ontargetlongpressed=this._callTargetAction.bind(this,'longPress',false,false);activeTargetsManager.ontargetmoved=this._callTargetAction.bind(this,'move',false,false);activeTargetsManager.ontargetmovedout=this._callTargetAction.bind(this,'moveOut',false,true);activeTargetsManager.ontargetmovedin=this._callTargetAction.bind(this,'moveIn',true,false);activeTargetsManager.ontargetcommitted=this._callTargetAction.bind(this,'commit',false,true);activeTargetsManager.ontargetcancelled=this._callTargetAction.bind(this,'cancel',false,true);activeTargetsManager.ontargetdoubletapped=this._callTargetAction.bind(this,'doubleTap',false,true);activeTargetsManager.onnewtargetwillactivate=this._callTargetAction.bind(this,'newTargetActivate',false,false);activeTargetsManager.start();};TargetHandlersManager.prototype.stop=function(){this.app.console.log('TargetHandlersManager.stop()');this.handlers=null;this.activeTargetsManager.stop();this.activeTargetsManager=null;};TargetHandlersManager.prototype._callTargetAction=function(action,setHandler,deleteHandler,target,press){this.app.console.log('TargetHandlersManager._callTargetAction()',action,setHandler,deleteHandler,target);this._preprocessActions(action,target);var handler;if(this.handlers.has(target)){handler=this.handlers.get(target);if(setHandler){console.warn('TargetHandlersManager: '+'calling targetHandler.'+action+'() on existing handler.');}
if(deleteHandler){this.handlers.delete(target);}}else{handler=this._createHandlerForTarget(target);if(!setHandler){console.warn('TargetHandlersManager: '+'calling targetHandler.'+action+'() on non-existing handler.');}
if(!deleteHandler){this.handlers.set(target,handler);}}
this.promiseQueue=this.promiseQueue.then(function(){return handler[action](press);}).catch(function(e){console.warn('TargetHandlersManager: '+'Error occurred for '+action+': ',e);});};TargetHandlersManager.prototype._createHandlerForTarget=function(target){this.app.console.log('TargetHandlersManager._createHandlerForTarget()');var handler;if('isDismissSuggestionsButton'in target){handler=new DismissSuggestionsTargetHandler(target,this.app);}else if('suggestion'in target){handler=new CandidateSelectionTargetHandler(target,this.app);}else if('compositeKey'in target){handler=new CompositeTargetHandler(target,this.app);}else if(target.isHandwritingPad){handler=new HandwritingPadTargetHandler(target,this.app);}else if('keyCode'in target){switch(target.keyCode){case KeyEvent.DOM_VK_BACK_SPACE:handler=new BackspaceTargetHandler(target,this.app);break;case KeyEvent.DOM_VK_SPACE:handler=new SpaceKeyTargetHandler(target,this.app);break;case KeyEvent.DOM_VK_ALT:handler=new PageSwitchingTargetHandler(target,this.app);break;case this.app.layoutManager.KEYCODE_SWITCH_KEYBOARD:handler=new SwitchKeyboardTargetHandler(target,this.app);break;case this.app.layoutManager.KEYCODE_TOGGLE_CANDIDATE_PANEL:handler=new ToggleCandidatePanelTargetHandler(target,this.app);break;case KeyEvent.DOM_VK_CAPS_LOCK:handler=new CapsLockTargetHandler(target,this.app);break;default:handler=new DefaultTargetHandler(target,this.app);break;}}else{handler=new NullTargetHandler(target,this.app);}
return handler;};TargetHandlersManager.prototype._preprocessActions=function(action,target){switch(action){case'activate':case'moveIn':if(target.isHandwritingPad){this.activeTargetsManager.blockNewUserPress=true;this.activeTargetsManager.blockTargetMovedOut=true;}
break;case'commit':case'doubleTap':if(target.isHandwritingPad){this.activeTargetsManager.blockNewUserPress=false;this.activeTargetsManager.blockTargetMovedOut=false;}
break;}};exports.TargetHandlersManager=TargetHandlersManager;})(window);

View file

@ -0,0 +1,4 @@
;'use strict';(function(exports){var UpperCaseStateManager=function(){this.isUpperCase=undefined;this.isUpperCaseLocked=undefined;};UpperCaseStateManager.prototype.onstatechange=null;UpperCaseStateManager.prototype.start=UpperCaseStateManager.prototype.reset=function(){this.isUpperCase=false;this.isUpperCaseLocked=false;};UpperCaseStateManager.prototype.stop=function(){this.isUpperCase=undefined;this.isUpperCaseLocked=undefined;};UpperCaseStateManager.prototype.switchUpperCaseState=function(state){if(!state){return;}
var newIsUpperCase=(typeof state.isUpperCase==='boolean')?state.isUpperCase:this.isUpperCase;var newIsUpperCaseLocked=(typeof state.isUpperCaseLocked==='boolean')?state.isUpperCaseLocked:this.isUpperCaseLocked;if(newIsUpperCaseLocked){newIsUpperCase=true;}
var statechanged=(this.isUpperCase!==newIsUpperCase)||(this.isUpperCaseLocked!==newIsUpperCaseLocked);if(!statechanged){return;}
this.isUpperCase=newIsUpperCase;this.isUpperCaseLocked=newIsUpperCaseLocked;if(typeof this.onstatechange==='function'){this.onstatechange();}};exports.UpperCaseStateManager=UpperCaseStateManager;})(window);

View file

@ -0,0 +1,19 @@
;'use strict';(function(exports){var UserPress=function(obj,coords){this.target=obj;this.updateCoords(coords,false);this.startTime=Date.now();this.startCoords=coords;this.startTarget=obj;};UserPress.prototype.updateCoords=function(coords,moved){this.moved=moved;this.clientX=coords.clientX;this.clientY=coords.clientY;this.endTime=Date.now();};var UserPressManager=function(app){this._started=false;this._ignoreMouseEvents=false;this.presses=new Map();this.touchstartCounts=new WeakMap();this.app=app;};UserPressManager.prototype.onpressstart=null;UserPressManager.prototype.onpressmove=null;UserPressManager.prototype.onpressend=null;UserPressManager.prototype.MOVE_LIMIT=5;UserPressManager.prototype.MIN_BOGUS_EVENT_DISTANCE=20;UserPressManager.prototype.MIN_BOGUS_EVENT_VELOCITY=0.3;UserPressManager.prototype.start=function(){this.app.console.log('UserPressManager.start()');if(this._started){throw new Error('UserPressManager: '+'Instance should not be start()\'ed twice.');}
this._started=true;this._container=this.app.getContainer();this._container.addEventListener('touchstart',this);this._container.addEventListener('mousedown',this);this._container.addEventListener('contextmenu',this);this._isLowEndDevice=false;this.settings=new UserPressManagerSettings();this.settings.promiseManager=this.app.settingsPromiseManager;this.settings.onsettingchange=this._handleSettingsChange.bind(this);this.settings.initSettings().then(this._handleSettingsChange.bind(this),function rejected(err){console.error('Fatal Error! Failed to get initial '+'targetHandlersManager settings.',err);});};UserPressManager.prototype.stop=function(){this.app.console.log('UserPressManager.stop()');if(!this._started){throw new Error('UserPressManager: '+'Instance was never start()\'ed but stop() is called.');}
this._started=false;this._container.removeEventListener('touchstart',this);this._container.removeEventListener('mousedown',this);this._container.removeEventListener('mousemove',this);this._container.removeEventListener('mouseup',this);this._container.removeEventListener('mouseleave',this);this._container.removeEventListener('contextmenu',this);this.settings=null;};UserPressManager.prototype.handleEvent=function(evt){var touch,touchId,el,i,touchstartCount;switch(evt.type){case'contextmenu':evt.preventDefault();break;case'touchstart':this._ignoreMouseEvents=true;touchstartCount=this.touchstartCounts.get(evt.target)||0;touchstartCount++;this.touchstartCounts.set(evt.target,touchstartCount);evt.target.addEventListener('touchmove',this);evt.target.addEventListener('touchend',this);evt.target.addEventListener('touchcancel',this);for(i=0;i<evt.changedTouches.length;i++){touch=evt.changedTouches[i];touchId=touch.identifier;el=touch.target;this._handleNewPress(el,touch,touchId);}
break;case'touchmove':for(i=0;i<evt.changedTouches.length;i++){touch=evt.changedTouches[i];touchId=touch.identifier;if(!this._distanceReachesLimit(touchId,touch)){continue;}
el=document.elementFromPoint(touch.clientX,touch.clientY);this._handleChangedPress(el,touch,touchId);}
break;case'touchend':case'touchcancel':touchstartCount=this.touchstartCounts.get(evt.target);touchstartCount--;if(touchstartCount){this.touchstartCounts.set(evt.target,touchstartCount);}else{evt.target.removeEventListener('touchmove',this);evt.target.removeEventListener('touchend',this);evt.target.removeEventListener('touchcancel',this);this.touchstartCounts.delete(evt.target);}
if(!this._started){return;}
for(i=0;i<evt.changedTouches.length;i++){touch=evt.changedTouches[i];touchId=touch.identifier;el=document.elementFromPoint(touch.clientX,touch.clientY);this._handleFinishPress(el,touch,touchId);}
break;case'mousedown':evt.preventDefault();if(this._ignoreMouseEvents){return;}
this._container.addEventListener('mousemove',this);this._container.addEventListener('mouseup',this);this._container.addEventListener('mouseleave',this);this._handleNewPress(evt.target,evt,'_mouse');break;case'mousemove':if(!this._distanceReachesLimit('_mouse',evt)){return;}
this._handleChangedPress(evt.target,evt,'_mouse');break;case'mouseup':case'mouseleave':this._container.removeEventListener('mousemove',this);this._container.removeEventListener('mouseup',this);this._container.removeEventListener('mouseleave',this);this._handleFinishPress(evt.target,evt,'_mouse');break;}};UserPressManager.prototype._handleNewPress=function(el,coords,id){this.app.console.info('UserPressManager._handleNewPress()');var press=new UserPress(this.app.layoutRenderingManager.getTargetObject(el),coords);this.presses.set(id,press);if(typeof this.onpressstart==='function'){this.onpressstart(press,id);}};UserPressManager.prototype._handleChangedPress=function(el,coords,id){this.app.console.info('UserPressManager._handleChangedPress()');var press=this.presses.get(id);press.target=this.app.layoutRenderingManager.getTargetObject(el);press.updateCoords(coords,true);if(typeof this.onpressmove==='function'){this.onpressmove(press,id);}};UserPressManager.prototype._handleFinishPress=function(el,coords,id){this.app.console.info('UserPressManager._handleFinishPress()');if(this._isLowEndDevice){this._handleLowEndDeviceFinishPress(el,coords,id);return;}
var press=this.presses.get(id);press.target=this.app.layoutRenderingManager.getTargetObject(el);press.updateCoords(coords,press.moved||this._distanceReachesLimit(id,coords));if(typeof this.onpressend==='function'){this.onpressend(press,id);}
this.presses.delete(id);};UserPressManager.prototype._handleLowEndDeviceFinishPress=function(el,coords,id){this.app.console.info('UserPressManager._handleLowEndDeviceFinishPress()');var press=this.presses.get(id);press.target=this.app.layoutRenderingManager.getTargetObject(el);press.updateCoords(coords,press.moved||this._distanceReachesLimit(id,coords));if(this._exceedSpeedLimit(press)&&press.target.keyCode!==press.startTarget.keyCode){var currentTargetObject=press.target;press.target=press.startTarget;press.updateCoords(press.startCoords,true);if(typeof this.onpressmove==='function'){this.onpressmove(press,id);}
if(typeof this.onpressend==='function'){this.onpressend(press,id);}
this.presses.delete(id);var syntheticPress=new UserPress(currentTargetObject,coords);if(typeof this.onpressstart==='function'){this.onpressstart(syntheticPress,id);}
syntheticPress.updateCoords(coords,false);if(typeof this.onpressend==='function'){this.onpressend(syntheticPress,id);}}else{if(typeof this.onpressend==='function'){this.onpressend(press,id);}
this.presses.delete(id);}};UserPressManager.prototype._exceedSpeedLimit=function(press){var dx=press.startCoords.clientX-press.clientX;var dy=press.startCoords.clientY-press.clientY;if(dx+dy===0){return false;}
var time=press.endTime-press.startTime;var distance=Math.sqrt(dx*dx+dy*dy);if(distance<this.MIN_BOGUS_EVENT_DISTANCE){return false;}
return(distance/time>this.MIN_BOGUS_EVENT_VELOCITY);};UserPressManager.prototype._distanceReachesLimit=function(id,newCoord){var press=this.presses.get(id);var dx=press.clientX-newCoord.clientX;var dy=press.clientY-newCoord.clientY;var limit=this.MOVE_LIMIT;return(dx>=limit||dx<=-limit||dy>=limit||dy<=-limit);};UserPressManager.prototype._handleSettingsChange=function(values){this._isLowEndDevice=values.deviceinfoHardware==='sp8810'||values.deviceinfoHardware==='roamer2'||values.deviceinfoProductModel==='GP-KEON'||values.deviceinfoProductModel==='GoFox F15';};exports.UserPress=UserPress;exports.UserPressManager=UserPressManager;})(window);

View file

@ -0,0 +1,24 @@
;'use strict';(function(exports){function ViewManager(app){this.app=app;this.viewMap=new WeakMap();this.currentPageView=null;this.pageViews=new Map();this.alternativesCharMenu=null;this.columnCount=10;}
ViewManager.prototype={get candidatePanel(){if(!this.currentPageView||!this.currentPageView.candidatePanel){return;}
return this.currentPageView.candidatePanel.element;}};ViewManager.prototype.start=function(){this.container=document.getElementById('keyboard');this.cachedWindowHeight=window.innerHeight||window.screen.height;this.cachedWindowWidth=window.innerWidth||window.screen.width;window.addEventListener('resize',this);};ViewManager.prototype.stop=function(){this.container=null;this.viewMap=null;this.currentPageView=null;this.pageViews=null;window.removeEventListener('resize',this);};ViewManager.prototype.handleEvent=function(evt){if(evt.type!=='resize'){return;}
this.cachedWindowHeight=window.innerHeight||window.screen.height;this.cachedWindowWidth=window.innerWidth||window.screen.width;};ViewManager.prototype.setUpperCaseLock=function(state){if(!this.currentPageView){console.error('No current page view!');return;}
this.currentPageView.setUpperCaseLock(state);};ViewManager.prototype.render=function(layout,flags,callback){this.app.console.log('ViewManager.render()');this.app.console.time('ViewManager.render()');flags=flags||{};this.columnCount=layout.width||10;var supportsSwitching='mozInputMethod'in navigator?navigator.mozInputMethod.mgmt.supportsSwitching():false;var pageId=[layout.layoutName,layout.pageIndex,(''+flags.inputType).substr(0,1),(''+flags.showCandidatePanel).substr(0,1),supportsSwitching].join('-');var pageView=this.pageViews.get(pageId);if(!pageView){var options={classNames:['keyboard-type-container'],totalWidth:this.container.clientWidth,showCandidatePanel:flags.showCandidatePanel};pageView=this._createPageView(layout,options);if(!layout.updateByIMEngine){this.pageViews.set(pageId,pageView);}
pageView.render();this.container.appendChild(pageView.element);if(flags.showCandidatePanel){this.showCandidates([]);}}
pageView.setUpperCaseLock({isUpperCase:flags.uppercase,isUpperCaseLocked:false});if(this.currentPageView!==pageView){if(this.currentPageView){this.currentPageView.hide();}
if(this.currentPageView&&this.currentPageView.layout.updateByIMEngine){this.currentPageView.destroy();}
pageView.show();this.currentPageView=pageView;this.resize(callback);}else if((this.container.classList.contains('landscape')&&this.screenInPortraitMode())||(this.container.classList.contains('portrait')&&!this.screenInPortraitMode())){this.resize(callback);}
else{if(callback){window.requestAnimationFrame(callback);}}
this.app.console.timeEnd('ViewManager.render()');};ViewManager.prototype.drawHandwritingPad=function(press,start,strokeWidth){var handwritingPadView=this.viewMap.get(press.target);return handwritingPadView.drawHandwritingPad(press,start,strokeWidth);};ViewManager.prototype.clearHandwritingPad=function(target){var handwritingPadView=this.viewMap.get(target);return handwritingPadView.clearHandwritingPad();};ViewManager.prototype.highlightKey=function(target){if(!this.currentPageView){console.error('No current page view!');return;}
this.currentPageView.highlightKey(target);};ViewManager.prototype.unHighlightKey=function(target){if(!this.currentPageView){console.error('ViewManager: No current page view!');return;}
this.currentPageView.unHighlightKey(target);};ViewManager.prototype.toggleCandidatePanel=function(expand){if(!this.currentPageView){console.error('ViewManager: No current page view!');return;}
this.currentPageView.resetCandidatePanel();this._toggleCandidatePanelWithoutResetScroll(expand);};ViewManager.prototype._toggleCandidatePanelWithoutResetScroll=function(expand){if(expand){this.container.classList.remove('candidate-panel');this.container.classList.add('full-candidate-panel');}else{this.container.classList.remove('full-candidate-panel');this.container.classList.add('candidate-panel');}};ViewManager.prototype.showAlternativesCharMenu=function(key,altChars){var options={keyWidth:(this.cachedWindowWidth/this.columnCount)|0,screenInPortraitMode:this.screenInPortraitMode};var alternativesCharMenu=new AlternativesCharMenuView(this.currentPageView.element,altChars,options,this);var keyElement=this.viewMap.get(key).element;alternativesCharMenu.show(keyElement);this.alternativesCharMenu=alternativesCharMenu;return alternativesCharMenu;};ViewManager.prototype.hideAlternativesCharMenu=function(){if(!this.alternativesCharMenu){console.error('No alternative char menu to hide!');return;}
this.alternativesCharMenu.hide();};ViewManager.prototype.resize=function(callback){var changeScale;if(this.screenInPortraitMode()){changeScale=this.cachedWindowWidth/32;document.documentElement.style.fontSize=changeScale+'px';this.container.classList.remove('landscape');this.container.classList.add('portrait');}else{changeScale=this.cachedWindowWidth/64;document.documentElement.style.fontSize=changeScale+'px';this.container.classList.remove('portrait');this.container.classList.add('landscape');}
if(!this.currentPageView){return;}
this.currentPageView.resize(this.cachedWindowWidth);if(callback){window.requestAnimationFrame(callback);}};ViewManager.prototype.getWidth=function(){if(!this.currentPageView){return 0;}
return this.cachedWindowWidth;};ViewManager.prototype.getHeight=function(){if(!this.currentPageView){return 0;}
return this.currentPageView.getHeight()|0;};ViewManager.prototype.showCandidates=function(candidates){if(!this.currentPageView){return;}
this._toggleCandidatePanelWithoutResetScroll(false);this.currentPageView.showCandidates(candidates);};ViewManager.prototype.showMoreCandidates=function(rowLimit,candidates){if(!this.currentPageView){return;}
this.currentPageView.showMoreCandidates(rowLimit,candidates);};ViewManager.prototype.getNumberOfCandidatesPerRow=function(){if(!this.currentPageView){return;}
return this.currentPageView.getNumberOfCandidatesPerRow();};ViewManager.prototype.getKeyArray=function(){return this.currentPageView.getVisualData();};ViewManager.prototype.getKeyWidth=function(){return Math.ceil(this.cachedWindowWidth/this.columnCount);};ViewManager.prototype.getKeyHeight=function(){if(!this.currentPageView){return 0;}
return this.currentPageView.getKeyHeight();};ViewManager.prototype.registerView=function(target,view){this.app.layoutRenderingManager.domObjectMap.set(view.element,target);this.viewMap.set(target,view);};ViewManager.prototype.screenInPortraitMode=function(){return this.cachedWindowWidth<=this.cachedWindowHeight;};ViewManager.prototype.getRemToPx=function(){return this.screenInPortraitMode()?this.cachedWindowWidth/32:this.cachedWindowWidth/64;};ViewManager.prototype.getView=function(target){return this.viewMap.get(target);};ViewManager.prototype._createPageView=function(layout,options){var pageView;if(layout.panelKeys){pageView=new SwipeablePageView(layout,options,this);}else{pageView=new LayoutPageView(layout,options,this);}
return pageView;};exports.ViewManager=ViewManager;})(window);

View file

@ -0,0 +1,2 @@
;'use strict';(function(exports){var VisualHighlightManager=function(app){this.app=app;this.highlightDelayTimers=new Map();};VisualHighlightManager.prototype.HIGHTLIGHT_DELAY_MS=85;VisualHighlightManager.prototype.start=function(){};VisualHighlightManager.prototype.stop=function(){};VisualHighlightManager.prototype.show=function(target){this.highlightDelayTimers.forEach(function(timer,target){clearTimeout(timer);this.highlightDelayTimers.delete(target);this.app.viewManager.unHighlightKey(target);},this);this.app.viewManager.highlightKey(target);};VisualHighlightManager.prototype.hide=function(target){if(this.highlightDelayTimers.has(target)){clearTimeout(this.highlightDelayTimers.get(target));}
var timer=setTimeout(function(){this.highlightDelayTimers.delete(target);this.app.viewManager.unHighlightKey(target);}.bind(this),this.HIGHTLIGHT_DELAY_MS);this.highlightDelayTimers.set(target,timer);};exports.VisualHighlightManager=VisualHighlightManager;})(window);

View file

@ -0,0 +1,89 @@
Keyboards.af = {
label: 'Afrikaans',
shortLabel: 'Afr.',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'af',
menuLabel: 'Afrikaans',
pages: [ { // default page
alt: {
a: 'áàäâåãæ',
c: 'ç',
e: 'ëêéè€',
i: 'ïíî',
o: 'ôóòöõø',
u: 'üûú',
s: 'ßš$',
S: 'Š$',
n: ['\'n', 'ñ'],
l: '£',
y: 'ýÿ¥',
'.': ',?!\'-;:…'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' }, { value: 'r' },
{ value: 't' }, { value: 'y' }, { value: 'u' }, { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
}, { // symbol page 1
alt: {
'1': ['1ste'],
'2': ['2de'],
'3': ['3de'],
'4': ['4de'],
'5': ['5de'],
'6': ['6de'],
'7': ['7de'],
'8': ['8ste'],
'9': ['9de'],
'$': ['€', '£', '¢', '¥'],
'"': ['“', '”', '„'],
'\'': ['‘', '’', '’n'],
'?': ['¿'],
'!': ['¡'],
'+': ['-', '×', '÷', '±']
},
keys: [
[
{ value: '1' }, { value: '2' }, { value: '3' }, { value: '4' },
{ value: '5' }, { value: '6' }, { value: '7' }, { value: '8' },
{ value: '9' }, { value: '0' }
], [
{ value: '@' }, { value: '#' },
{ value: '$', className: 'alternate-indicator' }, { value: '&' },
{ value: '*' }, { value: '-' }, { value: '_' }, { value: '/' },
{ value: '(' }, { value: ')' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '+',
supportsSwitching: {
value: ','
}
}, { value: ':' }, { value: ';' }, { value: '"' },
{ value: '\'' }, { value: '!' }, { value: '?' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
}]
};

View file

@ -0,0 +1,73 @@
Keyboards.ar = {
label: 'Arabic',
shortLabel: 'Ar',
menuLabel: 'العربية',
secondLayout: true,
specificCssRule: true,
types: ['text', 'url', 'email'],
alternateLayoutKey: '123',
basicLayoutKey: 'أ ب ج',
width: 11,
lang: 'ar',
alt : {
'غ': 'إ آ',
'ا': 'أ ء',
'ى': 'ئ',
'و': 'ؤ',
'ط': 'ظ'
},
keys: [
[
{ value: 'ض' }, { value: 'ص' }, { value: 'ث' }, { value: 'ق' },
{ value: 'ف' }, { value: 'غ' } , { value: 'ع' }, { value: 'ه' },
{ value: 'خ' }, { value: 'ح' }, { value: 'ج' }
], [
{ value: 'ش' }, { value: 'س' }, { value: 'ي' }, { value: 'ب' },
{ value: 'ل' } , { value: 'ا' }, { value: 'ت' }, { value: 'ن' },
{ value: 'م' }, { value: 'ك' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'ذ' }, { value: 'د' }, { value: 'ر' }, { value: 'ى' },
{ value: 'ة' }, { value: 'و' }, { value: 'ز' }, { value: 'ط' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 9, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
upperCase: {
ض: 'َ',
ص: 'ً',
ث: 'ُ',
ق: 'ٌ',
ف: 'ْ',
غ: 'ّ',
ع: 'ِ',
ه: 'ٍ',
خ: '’',
ح: ',',
ج: '؛',
ش: '\\',
س: ']',
ي: '[',
ب: 'ـ',
ل: 'إ',
ا: 'أ',
ت: 'آ',
ن: '،',
م: '/',
ك: ':',
ة: '\"',
ء: 'ئ',
ظ: 'ؤ',
ط: '؟',
ذ: '=',
د: '-',
ز: '×',
ر: '÷',
و: '+'
},
textLayoutOverwrite: {
',': '،'
}
};

View file

@ -0,0 +1,33 @@
Keyboards['bg-BDS'] = {
label: 'Bulgarian (BDS)',
shortLabel: 'Bg',
menuLabel: 'Български (БДС)',
types: ['text', 'url', 'email'],
imEngine: 'latin',
autoCorrectLanguage: 'bg',
basicLayoutKey: 'AБB',
width: 11,
lang: 'bg',
alt: {
'и': 'ѝ'
},
keys: [
[
{ value: 'у' }, { value: 'е' }, { value: 'и' }, { value: 'ш' },
{ value: 'щ' }, { value: 'к' }, { value: 'с' }, { value: 'д' },
{ value: 'з' }, { value: 'ц' }, { value: 'б' }
], [
{ value: 'ь' }, { value: 'я' }, { value: 'а' }, { value: 'о' },
{ value: 'ж' }, { value: 'г' }, { value: 'т' }, { value: 'н' },
{ value: 'в' }, { value: 'м' }, { value: 'ч' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'ю' }, { value: 'й' }, { value: 'ъ' }, { value: 'ф' },
{ value: 'х' }, { value: 'п' }, { value: 'р' }, { value: 'л' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 9, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
};

View file

@ -0,0 +1,33 @@
Keyboards['bg-Pho-Ban'] = {
label: 'Bulgarian (New)',
shortLabel: 'Bg',
menuLabel: 'Български (БАН)',
types: ['text', 'url', 'email', 'password'],
imEngine: 'latin',
autoCorrectLanguage: 'bg',
basicLayoutKey: 'AБB',
width: 11,
lang: 'bg',
alt: {
'и': 'ѝ'
},
keys: [
[
{ value: 'ч' }, { value: 'ш' }, { value: 'е' }, { value: 'р' },
{ value: 'т' }, { value: 'ъ' }, { value: 'у' }, { value: 'и' },
{ value: 'о' }, { value: 'п' }, { value: 'я' }
], [
{ value: 'а' }, { value: 'с' }, { value: 'д' }, { value: 'ф' },
{ value: 'г' }, { value: 'х' }, { value: 'й' }, { value: 'к' },
{ value: 'л' }, { value: 'щ' }, { value: 'ь' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'з' }, { value: 'ж' }, { value: 'ц' }, { value: 'в' },
{ value: 'б' }, { value: 'н' }, { value: 'м' }, { value: 'ю' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 9, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
};

View file

@ -0,0 +1,33 @@
Keyboards['bg-Pho-Trad'] = {
label: 'Bulgarian (Phonetic)',
shortLabel: 'Bg',
menuLabel: 'Български (Фонетична)',
types: ['text', 'url', 'email', 'password'],
imEngine: 'latin',
autoCorrectLanguage: 'bg',
basicLayoutKey: 'AБB',
width: 11,
lang: 'bg',
alt: {
'и': 'ѝ'
},
keys: [
[
{ value: 'я' }, { value: 'в' }, { value: 'е' }, { value: 'р' },
{ value: 'т' }, { value: 'ъ' }, { value: 'у' }, { value: 'и' },
{ value: 'о' }, { value: 'п' }, { value: 'ч' }
], [
{ value: 'а' }, { value: 'с' }, { value: 'д' }, { value: 'ф' },
{ value: 'г' }, { value: 'х' }, { value: 'й' }, { value: 'к' },
{ value: 'л' }, { value: 'ш' }, { value: 'щ' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'з' }, { value: 'ь' }, { value: 'ц' }, { value: 'ж' },
{ value: 'б' }, { value: 'н' }, { value: 'м' }, { value: 'ю' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 9, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
};

View file

@ -0,0 +1,108 @@
Keyboards['bn-Avro'] = {
label: 'Bangla - Avro',
shortLabel: 'Bn',
imEngine: 'jsavrophonetic',
menuLabel: 'বাংলা - অভ্র',
alternateLayoutKey: '?১২৩',
basicLayoutKey: 'কখগ',
types: ['text', 'url'],
lang: 'bn',
alt: {
a: 'A',
b: 'B',
c: 'C',
d: 'D',
e: 'E',
f: 'F',
g: 'H',
i: 'I',
j: 'J',
k: 'K',
l: 'L',
m: 'M',
n: 'N',
o: 'O',
p: 'P',
q: 'Q',
r: 'R',
s: 'S',
t: 'T',
u: 'U',
v: 'V',
w: 'W',
x: 'X',
y: 'Y',
z: 'Z',
'.': ',?!;:…'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' } , { value: 'r' },
{ value: 't' }, { value: 'y' }, { value: 'u' } , { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }, { value: 'ঁ' }
], [
{ value: '⇪', ratio: 1.25, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: '`', ratio: 0.85 }, { value: 'z', ratio: 0.95 }, { value: 'x', ratio: 0.95 },
{ value: 'c', ratio: 0.95 }, { value: 'v', ratio: 0.95 }, { value: 'b', ratio: 0.95 },
{ value: 'n', ratio: 0.95 }, { value: 'm', ratio: 0.95 },
{ value: '⌫', ratio: 1.25, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 7, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '।' },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
pages: [undefined, {
alt: {
'০': ['º'],
'১': ['1'],
'২': ['2'],
'৩': ['3'],
'৪': ['4'],
'৫': ['5'],
'৬': ['6'],
'৭': ['7'],
'৮': ['8'],
'৯': ['9'],
'৳': ['₹', '$', '€', '£', '¢', '¥'],
'"': ['“', '”'],
'\'':['‘', '’'],
'?': ['¿'],
'!': ['¡'],
'+': ['-', '×', '÷', '±']
},
// These are based on the en layout, with top row modifed, $ localized and & replaced.
keys: [
[
{ value: '১' }, { value: '২' }, { value: '৩' }, { value: '৪' },
{ value: '৫' }, { value: '৬' }, { value: '৭' }, { value: '৮' },
{ value: '৯' }, { value: '০' }
], [
{ value: '@' }, { value: '#' },
{ value: '৳', className: 'alternate-indicator' }, { value: 'ঃ' },
{ value: '*' }, { value: '-' }, { value: '_' }, { value: '/' },
{ value: '(' }, { value: ')' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '+',
supportsSwitching: {
value: ','
}
}, { value: ':' }, { value: ';' }, { value: '"' },
{ value: '\'' }, { value: '!' }, { value: '?' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,114 @@
Keyboards['bn-Probhat'] = {
label: 'Bangla - Probhat',
shortLabel: 'Bn',
menuLabel: 'বাংলা - প্রভাত',
alternateLayoutKey: '?১২',
basicLayoutKey: 'কখগ',
specificCssRule: true,
types: ['text', 'url', 'email'],
lang: 'bn',
keys: [
[
{ value: 'দ' }, { value: 'ূ' }, { value: 'ী' } , { value: 'র' },
{ value: 'ট' } , { value: 'এ' }, { value: 'ু' } , { value: 'ি' },
{ value: 'ও' }, { value: 'প' }
], [
{ value: 'া' }, { value: 'স' }, { value: 'ড' }, { value: 'ত' },
{ value: 'গ' } , { value: 'হ' }, { value: 'জ' }, { value: 'ক' },
{ value: 'ল' }, { value: 'ে' }
], [
{ value: '্' }, { value: 'য়', ratio: 0.9 }, { value: 'শ', ratio: 0.9 }, { value: 'চ', ratio: 0.9 }, { value: 'আ', ratio: 1.1 },
{ value: 'ব', ratio: 0.9 }, { value: 'ন', ratio: 0.9 }, { value: 'ম', ratio: 0.9 }, { value: 'ো', ratio: 1.15 },
{ value: '⌫', ratio: 1.35, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 7, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '।' },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
alt: {
'দ': 'ধ',
'ূ': 'ঊ',
'ী': 'ঈ',
'র': 'ড়',
'ট': 'ঠ',
'এ': 'ঐ',
'ু': 'উ',
'ি': 'ই',
'ও': 'ঔ',
'প': 'ফ',
'া': 'অ',
'স': 'ষ',
'ড': 'ঢ',
'ত': 'থ ৎ',
'গ': 'ঘ',
'হ': 'ঃ',
'জ': 'ঝ',
'ক': 'খ',
'ল': 'ং ঞ',
'য়': 'য',
'শ': 'ঢ়',
'চ': 'ছ',
'আ': 'ৃ ঋ',
'ব': 'ভ',
'ন': 'ণ',
'ম': 'ঙ ঞ',
'ে': 'ৈ',
'ো': 'ৌ',
'্': 'ঁ',
'।': '॥',
'ঞ': 'ঋ',
'.': ',?!;:…'
},
pages: [undefined, {
alt: {
'০': ['0', 'º'],
'১': ['১ম', '1'],
'২': ['২য়', '2'],
'৩': ['৩য়', '3'],
'৪': ['৪র্থ', '4'],
'৫': ['৫ম', '5'],
'৬': ['৬ষ্ঠ', '6'],
'৭': ['৭ম', '7'],
'৮': ['৮ম', '8'],
'৯': ['৯ম', '9'],
'৳': ['₹', '$', '€', '£', '¢', '¥'],
'"': ['“', '”'],
'\'':['‘', '’'],
'?': ['¿'],
'!': ['¡'],
'+': ['-', '×', '÷', '±']
},
// These are based on the en layout, with top row modifed and $ localized.
keys: [
[
{ value: '১' }, { value: '২' }, { value: '৩' }, { value: '৪' },
{ value: '৫' }, { value: '৬' }, { value: '৭' }, { value: '৮' },
{ value: '৯' }, { value: '০' }
], [
{ value: '@' }, { value: '#' },
{ value: '৳', className: 'alternate-indicator' }, { value: '&' },
{ value: '*' }, { value: '-' }, { value: '_' }, { value: '/' },
{ value: '(' }, { value: ')' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '+',
supportsSwitching: {
value: ','
}
}, { value: ':' }, { value: ';' }, { value: '"' },
{ value: '\'' }, { value: '!' }, { value: '?' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,39 @@
Keyboards.bs = {
label: 'Bosnian',
shortLabel: 'Bs',
imEngine: 'latin',
types: ['text', 'url', 'email'],
autoCorrectLanguage: 'bs',
menuLabel: 'Bosanski',
lang: 'bs',
alt: {
c: 'čć',
d: 'đ',
e: 'ë€',
i: 'íîïì',
o: 'ó',
u: 'ú',
s: 'šş',
z: 'ž',
'.': ',?!;:'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' } , { value: 'r' },
{ value: 't' } , { value: 'z' }, { value: 'u' } , { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' } , { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'y' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
};

View file

@ -0,0 +1,98 @@
Keyboards.ca = {
label: 'Catalan',
shortLabel: 'Ca',
menuLabel: 'Català',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'ca',
lang: 'ca',
alt: {
a: 'àáâäåãāæª@',
c: 'çćč',
e: 'èéêëēę€ɛ',
i: 'íïìîīį',
o: 'òóöôōœøɵº',
u: 'úüùûū',
s: 'ßśš$',
S: 'ŚŠŞ',
n: 'ñń',
l: 'l·l ł £',
y: 'ÿ¥',
z: 'žźż',
'?': '!¿¡',
'.': ',;:·…',
"'": '"«»',
'-': '—_'
},
width: 11,
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' } , { value: 'r' },
{ value: 't' } , { value: 'y' }, { value: 'u' } , { value: 'i' },
{ value: 'o' }, { value: 'p' }, { value: '?' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' } , { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }, { value: 'ç' },
{ value: "'", keyCode: 39 }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' }, { value: '-' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 9, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
pages: [undefined, {
alt: {
'0': ['º'],
'1': ['1r', '1a'],
'2': ['2n', '2a'],
'3': ['3r', '3a'],
'4': ['4t', '4a'],
'5': ['5è', '5a', '5é'],
'6': ['6è', '6a', '6é'],
'7': ['7è', '7a', '7é'],
'8': ['8è', '8a', '8é'],
'9': ['9è', '9a', '9é'],
'€': ['$', '£', '¢', '¥'],
'"': ['“', '”', '«', '»'],
'\'':['‘', '’'],
'?': ['¿'],
'!': ['¡'],
'+': ['-', '×', '÷', '±'],
'.': ['·']
},
// These are based on the en layout, with $ localized.
keys: [
[
{ value: '1' }, { value: '2' }, { value: '3' }, { value: '4' },
{ value: '5' }, { value: '6' }, { value: '7' }, { value: '8' },
{ value: '9' }, { value: '0' }
], [
{ value: '@' }, { value: '#' },
{ value: '€', className: 'alternate-indicator' }, { value: '&' },
{ value: '*' }, { value: '-' }, { value: '_' }, { value: '/' },
{ value: '(' }, { value: ')' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '+',
supportsSwitching: {
value: ','
}
}, { value: ':' }, { value: ';' }, { value: '"' },
{ value: '\'' }, { value: '!' }, { value: '?' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,44 @@
Keyboards['cs-qwerty'] = {
label: 'Czech (QWERTY)',
shortLabel: 'Cs',
menuLabel: 'Česká (QWERTY)',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'cs',
lang: 'cs',
alt: {
a: 'á',
c: 'č',
d: 'ď',
e: 'éě',
i: 'í',
n: 'ň',
o: 'ó',
r: 'ř',
s: 'š',
t: 'ť',
u: 'úů',
y: 'ý',
z: 'ž',
'.': ',?!;:…'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' }, { value: 'r' },
{ value: 't' }, { value: 'y' }, { value: 'u' } , { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }
], [
{ value: '&#8682;', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '&#9003;', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '&#8629;', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
};

View file

@ -0,0 +1,44 @@
Keyboards.cs = {
label: 'Czech',
shortLabel: 'Cs',
menuLabel: 'Česká',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'cs',
lang: 'cs',
alt: {
a: 'á',
c: 'č',
d: 'ď',
e: 'éě',
i: 'í',
n: 'ň',
o: 'ó',
r: 'ř',
s: 'š',
t: 'ť',
u: 'úů',
y: 'ý',
z: 'ž',
'.': ',?!;:…'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' }, { value: 'r' },
{ value: 't' }, { value: 'z' }, { value: 'u' } , { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }
], [
{ value: '&#8682;', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'y' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '&#9003;', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '&#8629;', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
};

View file

@ -0,0 +1,45 @@
Keyboards.cy = {
label: 'Welsh',
shortLabel: 'Cy',
menuLabel: 'Cymraeg',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'cy',
//autoCorrectPunctuation: false,
lang: 'fr',
alt: {
a: 'âäáàåãāæ',
c: 'çćč',
e: 'êëéèēę€ɛ',
i: 'îïíìīį',
o: 'ôöóòõōœøɵ',
u: 'ûüúùū',
s: 'ßśš$',
S: 'ŚŠ$',
n: 'ñń',
l: 'ł£',
w: 'ŵẅẃẁ',
y: 'ŷÿýỳ¥',
z: 'žźż',
'.': ',?!-;:'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' }, { value: 'r' },
{ value: 't' }, { value: 'y' }, { value: 'u' }, { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }, { value: "'", keyCode: 39 }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
};

View file

@ -0,0 +1,46 @@
Keyboards.da = {
label: 'Danish',
shortLabel: 'Da',
menuLabel: 'Dansk',
imEngine: 'latin',
autoCorrectLanguage: 'da',
types: ['text', 'url', 'email', 'password'],
lang: 'da',
alt: {
a: 'äáàâąã',
e: 'éèêëę€',
i: 'íìîï',
o: 'öóòôõ',
u: 'üúùûū',
s: 'śšşß',
S: 'ŚŠŞ',
n: 'ńñň',
c: 'çćč',
d: 'ðď',
r: 'ř',
t: 'ťþ',
z: 'źžż',
l: 'ł',
v: 'w'
},
width: 11,
keys: [
[
{ value: 'q' },{ value: 'w' },{ value: 'e' },{ value: 'r' },
{ value: 't' },{ value: 'y' },{ value: 'u' },{ value: 'i' },
{ value: 'o' },{ value: 'p' },{ value: 'å' }
], [
{ value: 'a' },{ value: 's' },{ value: 'd' },{ value: 'f' },
{ value: 'g' },{ value: 'h' },{ value: 'j' },{ value: 'k' },
{ value: 'l' },{ value: 'æ' },{ value: 'ø' }
], [
{ value: '⇪', ratio: 2, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' },{ value: 'x' },{ value: 'c' },{ value: 'v' },
{ value: 'b' },{ value: 'n' },{ value: 'm' },
{ value: '⌫', ratio: 2, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 9, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
};

View file

@ -0,0 +1,119 @@
Keyboards['de-Neo'] = {
label: 'German - Neo',
shortLabel: 'De',
menuLabel: 'Deutsch - Neo',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'de',
lang: 'de',
alt: {
a: 'äáàâåãāæ',
c: 'çćč',
e: 'éèêëēę€ɛ',
i: 'ïíìîīį',
o: 'öóòôōœøɵ',
u: 'üúùûū',
s: 'ßśš$',
S: 'ŚŠ$',
n: 'ñń',
l: 'ł£',
y: 'ÿ¥',
z: 'žźż',
'.': ',?!;:…'
},
keys: [
[
{ value: 'x' }, { value: 'v' }, { value: 'l' } , { value: 'c' },
{ value: 'w' }, { value: 'k' }, { value: 'h' } , { value: 'g' },
{ value: 'f' }, { value: 'q' }
], [
{ value: 'u' }, { value: 'i', }, { value: 'a' }, { value: 'e' },
{ value: 'o' }, { value: 's', }, { value: 'n' }, { value: 'r' },
{ value: 't' }, { value: 'd', }
], [
{ value: '⇪', ratio: 2, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'p' }, { value: 'z' }, { value: 'b' },
{ value: 'm' }, { value: 'j' }, { value: 'y' },
{ value: '⌫', ratio: 2, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
pages: [undefined, {
needsCommaKey: true,
alt: {
'1': ['¹', '1.'],
'2': ['²', '2.'],
'3': ['³', '3.'],
'4': ['⁴', '4.'],
'5': ['⁵', '5.'],
'6': ['⁶', '6.'],
'7': ['⁷', '7.'],
'8': ['⁸', '8.'],
'9': ['⁹', '9.'],
'0': ['⁰', 'º'],
'$': [ '€', '£', '¢', '¥'],
'"': ['“', '”'],
'\'':['‘', '’'],
'?': ['¿'],
'!': ['¡'],
'+': ['-', '×', '÷', '±'],
'/': '\\'
},
keys: [
[
{ value: ':' }, { value: '&' },
{ value: '#' }, { value: '$' }, { value: '!' },
{ value: '7' }, { value: '8' }, { value: '9' },
{ value: '/' }, { value: '*' }
], [
{ value: ';' }, { value: '@' },
{ value: '(' }, { value: ')' }, { value: '?' },
{ value: '4' }, { value: '5' }, { value: '6' },
{ value: '+' }, { value: '-' }
], [
{ value: 'Alt', ratio: 2,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '%' }, { value: '"' }, { value: "'" },
{ value: '1' }, { value: '2' }, { value: '3' },
{ value: '⌫', ratio: 2, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
}, {
alt: {
'®': ['™']
},
needsCommaKey: true,
keys: [
[
{ value: '§' }, { value: '_' }, { value: '[' }, { value: ']' },
{ value: '^' }, { value: '<' }, { value: '>' }, { value: '=' },
{ value: '¥' }, { value: '€' }
], [
{ value: '©' }, { value: '®' }, { value: '{' }, { value: '}' },
{ value: '`' }, { value: '«' }, { value: '»' }, { value: '±' },
{ value: '£' }, { value: '$' }
],
[
{ value: 'Alt', ratio: 2,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 1
},
{ value: '|' }, { value: '~' }, { value: 'º' },
{ value: '¹' }, { value: '²' }, { value: '³' },
{ value: '⌫', ratio: 2, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,40 @@
Keyboards.de = {
label: 'German',
shortLabel: 'De',
menuLabel: 'Deutsch',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'de',
lang: 'de',
alt: {
a: 'äàáâãåāæ',
c: 'çćč',
e: 'èéêëē€',
i: 'ìíîïī',
o: 'öòóôõōœø',
u: 'üùúûū',
s: 'ßśšş',
S: 'ŚŠŞ',
n: 'ńñň',
'.': ',?!;:'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' }, { value: 'r' },
{ value: 't' }, { value: 'z' }, { value: 'u' }, { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'y' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
};

View file

@ -0,0 +1,130 @@
Keyboards['dz-BT'] = {
label: 'Dzongkha',
shortLabel: 'Dz',
menuLabel: 'རྫོང་ཁ',
alternateLayoutKey: '༡༢༣',
specificCssRule: true,
basicLayoutKey: 'ཀཁག',
types: ['text', 'url', 'email'],
width: 12,
lang: 'dz',
keys: [
[
{ value: 'ཀ' }, { value: 'ཁ' }, { value: 'ག' } , { value: 'ང' },
{ value: 'ི' } , { value: 'ུ' }, { value: 'ེ' } , { value: 'ོ' },
{ value: 'ཅ' }, { value: 'ཆ' }, { value: 'ཇ' }, { value: 'ཉ' }
], [
{ value: 'ཏ' }, { value: 'ཐ' }, { value: 'ད' }, { value: 'ན' },
{ value: 'པ' } , { value: 'ཕ' }, { value: 'བ' }, { value: 'མ' },
{ value: 'ཙ' }, { value: 'ཚ'}, { value: 'ཛ' }, { value: 'ཝ' },
], [
{ value: 'ཞ' }, { value: 'ཟ' }, { value: 'འ' }, { value: 'ཡ' }, { value: 'ར' },
{ value: 'ལ' }, { value: 'ཤ' }, { value: 'ས' }, { value: 'ཧ' }, { value: 'ཨ' },
{ value: '⌫', ratio: 2, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 7, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '་', ratio: 2 }, { value: '།' },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
alt: {
'ཀ': 'ྐ',
'ཁ': 'ྑ',
'ག': 'ྒ',
'ང': 'ྔ',
'ི': 'ྀ',
'ུ': '྄',
'ེ': 'ཻ',
'ོ': 'ཽ',
'ཅ': 'ྕ',
'ཆ': 'ྖ',
'ཇ': 'ྗ',
'ཉ': 'ྙ ཨ྅',
'ཏ': 'ྟ ཊ ྚ',
'ཐ': 'ྠ ཋ ྛ',
'ད': 'ྡ ཌ ྜ',
'ན': 'ྣ ཎ ྞ',
'པ': 'ྤ',
'ཕ': 'ྥ',
'བ': 'ྦ',
'མ': 'ྨ ཨཾ ཨྃ ༷ ༵',
'ཙ': 'ྩ ༹',
'ཚ': 'ྪ',
'ཛ': 'ྫ',
'ཝ': 'ྭ ྺ',
'ཞ': 'ྮ',
'ཟ': 'ྯ',
'འ': 'ཱ',
'ཡ': 'ྱ',
'ར': 'ྲ ཪ',
'ལ': 'ླ',
'ཤ': 'ྴ ཥ',
'ས': 'ྶ',
'ཧ': 'ྷ',
'ཨ': 'ྸ ༁',
'་': '࿒',
'།': '༎'
},
pages: [undefined, {
needsCommaKey: true,
specificCssRule: true,
alt: {
'༡': ['1'],
'༢': ['2'],
'༣': ['3'],
'༤': ['4'],
'༥': ['5'],
'༦': ['6'],
'༧': ['7'],
'༨': ['8'],
'༩': ['9'],
'༠': ['0'],
'༆': ['༄ ', '༅', '@'],
'༉': ['࿑', '༊', '࿐', '#'],
'༈': ['-', '_'],
'₨': ['$', '€', '£', '¢', '¥'],
'༴': ['྾', '%'],
'ཿ': ['&'],
'༷': [ '༵', '*'],
'༔': ['+'],
'༼': ['('],
'༽': [')'],
'༃': ['༂ ', '!'],
'༑': ['༏', '༐', '\''],
'྅': ['ྊ', 'ྋ', '"'],
'ྈ': [':'],
'ྉ': [';'],
'࿙': ['/'],
'྿': ['?']
},
keys: [
[
{ value: '༡' }, { value: '༢' }, { value: '༣' }, { value: '༤' },
{ value: '༥' }, { value: '༦' }, { value: '༧' }, { value: '༨' },
{ value: '༩' }, { value: '༠' }
], [
{ value: '༆'}, { value: '༉' }, { value: '༈' },
{ value: '₨', className: 'alternate-indicator' }, { value: '༴' },
{ value: 'ཿ' }, { value: '༷' },
{ value: '༔' }, { value: '༼' }, { value: '༽' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '༃' }, { value: '༑' }, { value: '྅' }, { value: 'ྈ' },
{ value: 'ྉ' }, { value: '࿙' }, { value: '྿' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,85 @@
Keyboards.el = {
label: 'Greek',
shortLabel: 'El',
menuLabel: 'Ελληνικό',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
basicLayoutKey: 'ABΓ',
autoCorrectLanguage: 'el',
lang: 'el',
upperCase: {
'ς': 'ς'
},
alt: {
α: 'ά',
ε: 'έ€',
ω: 'ώ',
ο: 'ό',
Υ: 'ΎΫ',
υ: 'ύϋΰ',
Ι: 'ΊΪ',
ι: 'ίϊΐ',
η: 'ή',
'.': ',?!;:'
},
keys: [
[
{ value: ';' }, { value: 'ς' }, { value: 'ε' } , { value: 'ρ' },
{ value: 'τ' } , { value: 'υ' }, { value: 'θ' } , { value: 'ι' },
{ value: 'ο' }, { value: 'π' }
], [
{ value: 'α' }, { value: 'σ' }, { value: 'δ' }, { value: 'φ' },
{ value: 'γ' } , { value: 'η' }, { value: 'ξ' }, { value: 'κ' },
{ value: 'λ' }, { value: "'", keyCode: 39 }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'ζ' }, { value: 'χ' }, { value: 'ψ' }, { value: 'ω' },
{ value: 'β' }, { value: 'ν' }, { value: 'μ' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
};
// This special layout is used when composing SMS messages in Greek, so that
// it would allow 160 characters in one message
Keyboards['el-sms'] = {
label: 'Greek SMS',
menuLabel: 'Ελληνικό για SMS',
imEngine: 'latin',
// No autocorrect for this layout
// autoCorrectLanguage: undefined,
alt: {
'.': ',?!;:'
},
keys: [
[
{ value: ';' }, { value: 'Ε', keyCode: 0x45 /* ASCII E */ } ,
{ value: 'Ρ', keyCode: 0x50 /* ASCII P */ },
{ value: 'Τ', keyCode: 0x54 /* ASCII T */ },
{ value: 'Υ', keyCode: 0x59 /* ASCII Y */ },
{ value: 'Θ' }, { value: 'Ι', keyCode: 0x49 /* ASCII I */},
{ value: 'Ο', keyCode: 0x4F /* ASCII O */ }, { value: 'Π' }
], [
{ value: 'Α', keyCode: 0x41 /* ASCII A */ }, { value: 'Σ' },
{ value: 'Δ' }, { value: 'Φ'},
{ value: 'Γ' }, { value: 'Η', keyCode: 0x48 /* ASCII H */ },
{ value: 'Ξ' }, { value: 'Κ', keyCode: 0x4B /* ASCII K */ },
{ value: 'Λ' }, { value: "'"}
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK,
disabled: true },
{ value: 'Ζ', keyCode: 0x5A /* ASCII Z */ },
{ value: 'Χ', keyCode: 0x58 /* ASCII X */ }, { value: 'Ψ' },
{ value: 'Ω' }, { value: 'Β', keyCode: 0x42 /* ASCII B */ },
{ value: 'Ν', keyCode: 0x4E /* ASCII N */ },
{ value: 'Μ', keyCode: 0x4D /* ASCII M */ },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
};

View file

@ -0,0 +1,687 @@
Keyboards.emoji = {
label: 'Emoji',
types: ['text', 'url', 'email'],
menuLabelL10nId: 'emoji',
imEngine: 'emoji',
menuLabel: 'Emoji',
pages: [{
updateByIMEngine: true,
panelKeys: [ /* To be filled by emoji.js */ ],
keys: [
[
{
value: '',
keyCode: -3,
className: 'emoji-ime-switch'
},
{
value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-recent active',
targetPage: 0
},
{
value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-people',
targetPage: 1
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-nature',
targetPage: 2
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-object',
targetPage: 3
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-place',
targetPage: 4
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-symbol',
targetPage: 5
},
{ value: '⌫', keyCode: KeyEvent.DOM_VK_BACK_SPACE }
]
]}, { // Page 0 - People
panelKeys: [{ compositeKey: '🌂', type: 'emoji' }, { compositeKey: '🌟', type: 'emoji' },
{ compositeKey: '🎀', type: 'emoji' }, { compositeKey: '🎔', type: 'emoji' },
{ compositeKey: '🎩', type: 'emoji' }, { compositeKey: '🎽', type: 'emoji' },
{ compositeKey: '🏃', type: 'emoji' }, { compositeKey: '👀', type: 'emoji' },
{ compositeKey: '👁', type: 'emoji' }, { compositeKey: '👂', type: 'emoji' },
{ compositeKey: '👃', type: 'emoji' }, { compositeKey: '👄', type: 'emoji' },
{ compositeKey: '👅', type: 'emoji' }, { compositeKey: '👆', type: 'emoji' },
{ compositeKey: '👇', type: 'emoji' }, { compositeKey: '👈', type: 'emoji' },
{ compositeKey: '👉', type: 'emoji' }, { compositeKey: '👊', type: 'emoji' },
{ compositeKey: '👋', type: 'emoji' }, { compositeKey: '👌', type: 'emoji' },
{ compositeKey: '👍', type: 'emoji' }, { compositeKey: '👎', type: 'emoji' },
{ compositeKey: '👏', type: 'emoji' }, { compositeKey: '👐', type: 'emoji' },
{ compositeKey: '👑', type: 'emoji' }, { compositeKey: '👒', type: 'emoji' },
{ compositeKey: '👓', type: 'emoji' }, { compositeKey: '👔', type: 'emoji' },
{ compositeKey: '👕', type: 'emoji' }, { compositeKey: '👖', type: 'emoji' },
{ compositeKey: '👗', type: 'emoji' }, { compositeKey: '👘', type: 'emoji' },
{ compositeKey: '👙', type: 'emoji' }, { compositeKey: '👚', type: 'emoji' },
{ compositeKey: '👛', type: 'emoji' }, { compositeKey: '👜', type: 'emoji' },
{ compositeKey: '👝', type: 'emoji' }, { compositeKey: '👞', type: 'emoji' },
{ compositeKey: '👟', type: 'emoji' }, { compositeKey: '👠', type: 'emoji' },
{ compositeKey: '👡', type: 'emoji' }, { compositeKey: '👢', type: 'emoji' },
{ compositeKey: '👣', type: 'emoji' }, { compositeKey: '👤', type: 'emoji' },
{ compositeKey: '👥', type: 'emoji' }, { compositeKey: '👦', type: 'emoji' },
{ compositeKey: '👧', type: 'emoji' }, { compositeKey: '👨', type: 'emoji' },
{ compositeKey: '👩', type: 'emoji' }, { compositeKey: '👪', type: 'emoji' },
{ compositeKey: '👫', type: 'emoji' }, { compositeKey: '👬', type: 'emoji' },
{ compositeKey: '👭', type: 'emoji' }, { compositeKey: '👮', type: 'emoji' },
{ compositeKey: '👯', type: 'emoji' }, { compositeKey: '👰', type: 'emoji' },
{ compositeKey: '👱', type: 'emoji' }, { compositeKey: '👲', type: 'emoji' },
{ compositeKey: '👳', type: 'emoji' }, { compositeKey: '👴', type: 'emoji' },
{ compositeKey: '👵', type: 'emoji' }, { compositeKey: '👶', type: 'emoji' },
{ compositeKey: '👷', type: 'emoji' }, { compositeKey: '👸', type: 'emoji' },
{ compositeKey: '👹', type: 'emoji' }, { compositeKey: '👺', type: 'emoji' },
{ compositeKey: '👼', type: 'emoji' }, { compositeKey: '👽', type: 'emoji' },
{ compositeKey: '👿', type: 'emoji' }, { compositeKey: '💀', type: 'emoji' },
{ compositeKey: '💁', type: 'emoji' }, { compositeKey: '💂', type: 'emoji' },
{ compositeKey: '💃', type: 'emoji' }, { compositeKey: '💄', type: 'emoji' },
{ compositeKey: '💅', type: 'emoji' }, { compositeKey: '💆', type: 'emoji' },
{ compositeKey: '💇', type: 'emoji' }, { compositeKey: '💋', type: 'emoji' },
{ compositeKey: '💌', type: 'emoji' }, { compositeKey: '💍', type: 'emoji' },
{ compositeKey: '💎', type: 'emoji' }, { compositeKey: '💏', type: 'emoji' },
{ compositeKey: '💑', type: 'emoji' }, { compositeKey: '💓', type: 'emoji' },
{ compositeKey: '💔', type: 'emoji' }, { compositeKey: '💕', type: 'emoji' },
{ compositeKey: '💖', type: 'emoji' }, { compositeKey: '💗', type: 'emoji' },
{ compositeKey: '💘', type: 'emoji' }, { compositeKey: '💙', type: 'emoji' },
{ compositeKey: '💚', type: 'emoji' }, { compositeKey: '💛', type: 'emoji' },
{ compositeKey: '💜', type: 'emoji' }, { compositeKey: '💞', type: 'emoji' },
{ compositeKey: '💢', type: 'emoji' }, { compositeKey: '💤', type: 'emoji' },
{ compositeKey: '💥', type: 'emoji' }, { compositeKey: '💦', type: 'emoji' },
{ compositeKey: '💧', type: 'emoji' }, { compositeKey: '💨', type: 'emoji' },
{ compositeKey: '💩', type: 'emoji' }, { compositeKey: '💪', type: 'emoji' },
{ compositeKey: '💫', type: 'emoji' }, { compositeKey: '💬', type: 'emoji' },
{ compositeKey: '💭', type: 'emoji' }, { compositeKey: '💼', type: 'emoji' },
{ compositeKey: '😀', type: 'emoji' }, { compositeKey: '😁', type: 'emoji' },
{ compositeKey: '😂', type: 'emoji' }, { compositeKey: '😃', type: 'emoji' },
{ compositeKey: '😄', type: 'emoji' }, { compositeKey: '😅', type: 'emoji' },
{ compositeKey: '😆', type: 'emoji' }, { compositeKey: '😇', type: 'emoji' },
{ compositeKey: '😈', type: 'emoji' }, { compositeKey: '😉', type: 'emoji' },
{ compositeKey: '😊', type: 'emoji' }, { compositeKey: '😋', type: 'emoji' },
{ compositeKey: '😌', type: 'emoji' }, { compositeKey: '😍', type: 'emoji' },
{ compositeKey: '😎', type: 'emoji' }, { compositeKey: '😏', type: 'emoji' },
{ compositeKey: '😐', type: 'emoji' }, { compositeKey: '😑', type: 'emoji' },
{ compositeKey: '😒', type: 'emoji' }, { compositeKey: '😓', type: 'emoji' },
{ compositeKey: '😔', type: 'emoji' }, { compositeKey: '😕', type: 'emoji' },
{ compositeKey: '😖', type: 'emoji' }, { compositeKey: '😗', type: 'emoji' },
{ compositeKey: '😘', type: 'emoji' }, { compositeKey: '😙', type: 'emoji' },
{ compositeKey: '😚', type: 'emoji' }, { compositeKey: '😛', type: 'emoji' },
{ compositeKey: '😜', type: 'emoji' }, { compositeKey: '😝', type: 'emoji' },
{ compositeKey: '😞', type: 'emoji' }, { compositeKey: '😟', type: 'emoji' },
{ compositeKey: '😠', type: 'emoji' }, { compositeKey: '😡', type: 'emoji' },
{ compositeKey: '😢', type: 'emoji' }, { compositeKey: '😣', type: 'emoji' },
{ compositeKey: '😤', type: 'emoji' }, { compositeKey: '😥', type: 'emoji' },
{ compositeKey: '😦', type: 'emoji' }, { compositeKey: '😧', type: 'emoji' },
{ compositeKey: '😨', type: 'emoji' }, { compositeKey: '😩', type: 'emoji' },
{ compositeKey: '😪', type: 'emoji' }, { compositeKey: '😫', type: 'emoji' },
{ compositeKey: '😬', type: 'emoji' }, { compositeKey: '😭', type: 'emoji' },
{ compositeKey: '😮', type: 'emoji' }, { compositeKey: '😯', type: 'emoji' },
{ compositeKey: '😰', type: 'emoji' }, { compositeKey: '😱', type: 'emoji' },
{ compositeKey: '😲', type: 'emoji' }, { compositeKey: '😳', type: 'emoji' },
{ compositeKey: '😴', type: 'emoji' }, { compositeKey: '😵', type: 'emoji' },
{ compositeKey: '😶', type: 'emoji' }, { compositeKey: '😷', type: 'emoji' },
{ compositeKey: '😸', type: 'emoji' }, { compositeKey: '😹', type: 'emoji' },
{ compositeKey: '😺', type: 'emoji' }, { compositeKey: '😻', type: 'emoji' },
{ compositeKey: '😼', type: 'emoji' }, { compositeKey: '😽', type: 'emoji' },
{ compositeKey: '😾', type: 'emoji' }, { compositeKey: '😿', type: 'emoji' },
{ compositeKey: '🙀', type: 'emoji' }, { compositeKey: '🙁', type: 'emoji' },
{ compositeKey: '🙂', type: 'emoji' }, { compositeKey: '🙅', type: 'emoji' },
{ compositeKey: '🙆', type: 'emoji' }, { compositeKey: '🙇', type: 'emoji' },
{ compositeKey: '🙈', type: 'emoji' }, { compositeKey: '🙉', type: 'emoji' },
{ compositeKey: '🙊', type: 'emoji' }, { compositeKey: '🙋', type: 'emoji' },
{ compositeKey: '🙌', type: 'emoji' }, { compositeKey: '🙍', type: 'emoji' },
{ compositeKey: '🙎', type: 'emoji' }, { compositeKey: '🙏', type: 'emoji' },
{ compositeKey: '🚶', type: 'emoji' }, { compositeKey: '\u261d\ufe0f', type: 'emoji' },
{ compositeKey: '\u263a\ufe0f', type: 'emoji' }, { compositeKey: '\u263b\ufe0f', type: 'emoji' },
{ compositeKey: '\u270a\ufe0f', type: 'emoji' }, { compositeKey: '\u270b\ufe0f', type: 'emoji' },
{ compositeKey: '\u270c\ufe0f', type: 'emoji' }, { compositeKey: '\u2728\ufe0f', type: 'emoji' },
{ compositeKey: '\u2764\ufe0f', type: 'emoji' }
],
keys: [
[
{
value: '',
keyCode: -3,
className: 'emoji-ime-switch'
},
{
value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-recent',
targetPage: 0
},
{
value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-people active',
targetPage: 1
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-nature',
targetPage: 2
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-object',
targetPage: 3
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-place',
targetPage: 4
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-symbol',
targetPage: 5
},
{ value: '⌫', keyCode: KeyEvent.DOM_VK_BACK_SPACE }
]
]}, { // Page 1 - Nature
panelKeys: [{ compositeKey: '🌀', type: 'emoji' }, { compositeKey: '🌁', type: 'emoji' },
{ compositeKey: '🌈', type: 'emoji' }, { compositeKey: '🌊', type: 'emoji' },
{ compositeKey: '🌋', type: 'emoji' }, { compositeKey: '🌌', type: 'emoji' },
{ compositeKey: '🌍', type: 'emoji' }, { compositeKey: '🌎', type: 'emoji' },
{ compositeKey: '🌏', type: 'emoji' }, { compositeKey: '🌐', type: 'emoji' },
{ compositeKey: '🌑', type: 'emoji' }, { compositeKey: '🌒', type: 'emoji' },
{ compositeKey: '🌓', type: 'emoji' }, { compositeKey: '🌔', type: 'emoji' },
{ compositeKey: '🌕', type: 'emoji' }, { compositeKey: '🌖', type: 'emoji' },
{ compositeKey: '🌗', type: 'emoji' }, { compositeKey: '🌘', type: 'emoji' },
{ compositeKey: '🌙', type: 'emoji' }, { compositeKey: '🌚', type: 'emoji' },
{ compositeKey: '🌛', type: 'emoji' }, { compositeKey: '🌜', type: 'emoji' },
{ compositeKey: '🌝', type: 'emoji' }, { compositeKey: '🌞', type: 'emoji' },
{ compositeKey: '🌠', type: 'emoji' }, { compositeKey: '🌰', type: 'emoji' },
{ compositeKey: '🌱', type: 'emoji' }, { compositeKey: '🌲', type: 'emoji' },
{ compositeKey: '🌳', type: 'emoji' }, { compositeKey: '🌴', type: 'emoji' },
{ compositeKey: '🌵', type: 'emoji' }, { compositeKey: '🌷', type: 'emoji' },
{ compositeKey: '🌸', type: 'emoji' }, { compositeKey: '🌹', type: 'emoji' },
{ compositeKey: '🌺', type: 'emoji' }, { compositeKey: '🌻', type: 'emoji' },
{ compositeKey: '🌼', type: 'emoji' }, { compositeKey: '🌾', type: 'emoji' },
{ compositeKey: '🌿', type: 'emoji' }, { compositeKey: '🍀', type: 'emoji' },
{ compositeKey: '🍁', type: 'emoji' }, { compositeKey: '🍂', type: 'emoji' },
{ compositeKey: '🍃', type: 'emoji' }, { compositeKey: '🍄', type: 'emoji' },
{ compositeKey: '🍣', type: 'emoji' }, { compositeKey: '🐀', type: 'emoji' },
{ compositeKey: '🐁', type: 'emoji' }, { compositeKey: '🐂', type: 'emoji' },
{ compositeKey: '🐃', type: 'emoji' }, { compositeKey: '🐄', type: 'emoji' },
{ compositeKey: '🐅', type: 'emoji' }, { compositeKey: '🐆', type: 'emoji' },
{ compositeKey: '🐇', type: 'emoji' }, { compositeKey: '🐈', type: 'emoji' },
{ compositeKey: '🐉', type: 'emoji' }, { compositeKey: '🐊', type: 'emoji' },
{ compositeKey: '🐋', type: 'emoji' }, { compositeKey: '🐌', type: 'emoji' },
{ compositeKey: '🐍', type: 'emoji' }, { compositeKey: '🐎', type: 'emoji' },
{ compositeKey: '🐏', type: 'emoji' }, { compositeKey: '🐐', type: 'emoji' },
{ compositeKey: '🐑', type: 'emoji' }, { compositeKey: '🐒', type: 'emoji' },
{ compositeKey: '🐓', type: 'emoji' }, { compositeKey: '🐔', type: 'emoji' },
{ compositeKey: '🐕', type: 'emoji' }, { compositeKey: '🐖', type: 'emoji' },
{ compositeKey: '🐗', type: 'emoji' }, { compositeKey: '🐘', type: 'emoji' },
{ compositeKey: '🐙', type: 'emoji' }, { compositeKey: '🐚', type: 'emoji' },
{ compositeKey: '🐛', type: 'emoji' }, { compositeKey: '🐜', type: 'emoji' },
{ compositeKey: '🐝', type: 'emoji' }, { compositeKey: '🐞', type: 'emoji' },
{ compositeKey: '🐟', type: 'emoji' }, { compositeKey: '🐠', type: 'emoji' },
{ compositeKey: '🐡', type: 'emoji' }, { compositeKey: '🐢', type: 'emoji' },
{ compositeKey: '🐣', type: 'emoji' }, { compositeKey: '🐤', type: 'emoji' },
{ compositeKey: '🐥', type: 'emoji' }, { compositeKey: '🐦', type: 'emoji' },
{ compositeKey: '🐧', type: 'emoji' }, { compositeKey: '🐨', type: 'emoji' },
{ compositeKey: '🐩', type: 'emoji' }, { compositeKey: '🐪', type: 'emoji' },
{ compositeKey: '🐫', type: 'emoji' }, { compositeKey: '🐬', type: 'emoji' },
{ compositeKey: '🐭', type: 'emoji' }, { compositeKey: '🐮', type: 'emoji' },
{ compositeKey: '🐯', type: 'emoji' }, { compositeKey: '🐰', type: 'emoji' },
{ compositeKey: '🐱', type: 'emoji' }, { compositeKey: '🐲', type: 'emoji' },
{ compositeKey: '🐳', type: 'emoji' }, { compositeKey: '🐴', type: 'emoji' },
{ compositeKey: '🐵', type: 'emoji' }, { compositeKey: '🐶', type: 'emoji' },
{ compositeKey: '🐷', type: 'emoji' }, { compositeKey: '🐸', type: 'emoji' },
{ compositeKey: '🐹', type: 'emoji' }, { compositeKey: '🐺', type: 'emoji' },
{ compositeKey: '🐻', type: 'emoji' }, { compositeKey: '🐼', type: 'emoji' },
{ compositeKey: '🐽', type: 'emoji' }, { compositeKey: '🐾', type: 'emoji' },
{ compositeKey: '💐', type: 'emoji' }, { compositeKey: '🔥', type: 'emoji' },
{ compositeKey: '\u2600\ufe0f', type: 'emoji' }, { compositeKey: '\u2601\ufe0f', type: 'emoji' },
{ compositeKey: '\u2606\ufe0f', type: 'emoji' }, { compositeKey: '\u2614\ufe0f', type: 'emoji' },
{ compositeKey: '\u26a1\ufe0f', type: 'emoji' }, { compositeKey: '\u26c4\ufe0f', type: 'emoji' },
{ compositeKey: '\u26c5\ufe0f', type: 'emoji' }, { compositeKey: '\u2744\ufe0f', type: 'emoji' },
{ compositeKey: '\u2b50\ufe0f', type: 'emoji' }
],
keys: [
[
{
value: '',
keyCode: -3,
className: 'emoji-ime-switch'
},
{
value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-recent',
targetPage: 0
},
{
value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-people',
targetPage: 1
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-nature active',
targetPage: 2
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-object',
targetPage: 3
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-place',
targetPage: 4
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-symbol',
targetPage: 5
},
{ value: '⌫', keyCode: KeyEvent.DOM_VK_BACK_SPACE }
]
]}, { // Page 2 - Object
panelKeys: [{ compositeKey: '🀄\ufe0f', type: 'emoji' }, { compositeKey: '🃏', type: 'emoji' },
{ compositeKey: '🌽', type: 'emoji' }, { compositeKey: '🍅', type: 'emoji' },
{ compositeKey: '🍆', type: 'emoji' }, { compositeKey: '🍇', type: 'emoji' },
{ compositeKey: '🍈', type: 'emoji' }, { compositeKey: '🍉', type: 'emoji' },
{ compositeKey: '🍊', type: 'emoji' }, { compositeKey: '🍋', type: 'emoji' },
{ compositeKey: '🍌', type: 'emoji' }, { compositeKey: '🍍', type: 'emoji' },
{ compositeKey: '🍎', type: 'emoji' }, { compositeKey: '🍏', type: 'emoji' },
{ compositeKey: '🍐', type: 'emoji' }, { compositeKey: '🍑', type: 'emoji' },
{ compositeKey: '🍒', type: 'emoji' }, { compositeKey: '🍓', type: 'emoji' },
{ compositeKey: '🍔', type: 'emoji' }, { compositeKey: '🍕', type: 'emoji' },
{ compositeKey: '🍖', type: 'emoji' }, { compositeKey: '🍗', type: 'emoji' },
{ compositeKey: '🍘', type: 'emoji' }, { compositeKey: '🍙', type: 'emoji' },
{ compositeKey: '🍚', type: 'emoji' }, { compositeKey: '🍛', type: 'emoji' },
{ compositeKey: '🍜', type: 'emoji' }, { compositeKey: '🍝', type: 'emoji' },
{ compositeKey: '🍞', type: 'emoji' }, { compositeKey: '🍟', type: 'emoji' },
{ compositeKey: '🍠', type: 'emoji' }, { compositeKey: '🍡', type: 'emoji' },
{ compositeKey: '🍢', type: 'emoji' }, { compositeKey: '🍤', type: 'emoji' },
{ compositeKey: '🍥', type: 'emoji' }, { compositeKey: '🍦', type: 'emoji' },
{ compositeKey: '🍧', type: 'emoji' }, { compositeKey: '🍨', type: 'emoji' },
{ compositeKey: '🍩', type: 'emoji' }, { compositeKey: '🍪', type: 'emoji' },
{ compositeKey: '🍫', type: 'emoji' }, { compositeKey: '🍬', type: 'emoji' },
{ compositeKey: '🍭', type: 'emoji' }, { compositeKey: '🍮', type: 'emoji' },
{ compositeKey: '🍯', type: 'emoji' }, { compositeKey: '🍰', type: 'emoji' },
{ compositeKey: '🍱', type: 'emoji' }, { compositeKey: '🍲', type: 'emoji' },
{ compositeKey: '🍳', type: 'emoji' }, { compositeKey: '🍴', type: 'emoji' },
{ compositeKey: '🍵', type: 'emoji' }, { compositeKey: '🍶', type: 'emoji' },
{ compositeKey: '🍷', type: 'emoji' }, { compositeKey: '🍸', type: 'emoji' },
{ compositeKey: '🍹', type: 'emoji' }, { compositeKey: '🍺', type: 'emoji' },
{ compositeKey: '🍻', type: 'emoji' }, { compositeKey: '🍼', type: 'emoji' },
{ compositeKey: '🎁', type: 'emoji' }, { compositeKey: '🎂', type: 'emoji' },
{ compositeKey: '🎃', type: 'emoji' }, { compositeKey: '🎄', type: 'emoji' },
{ compositeKey: '🎅', type: 'emoji' }, { compositeKey: '🎆', type: 'emoji' },
{ compositeKey: '🎇', type: 'emoji' }, { compositeKey: '🎈', type: 'emoji' },
{ compositeKey: '🎉', type: 'emoji' }, { compositeKey: '🎊', type: 'emoji' },
{ compositeKey: '🎋', type: 'emoji' }, { compositeKey: '🎌', type: 'emoji' },
{ compositeKey: '🎍', type: 'emoji' }, { compositeKey: '🎎', type: 'emoji' },
{ compositeKey: '🎏', type: 'emoji' }, { compositeKey: '🎐', type: 'emoji' },
{ compositeKey: '🎑', type: 'emoji' }, { compositeKey: '🎒', type: 'emoji' },
{ compositeKey: '🎓', type: 'emoji' }, { compositeKey: '🎣', type: 'emoji' },
{ compositeKey: '🎤', type: 'emoji' }, { compositeKey: '🎥', type: 'emoji' },
{ compositeKey: '🎧', type: 'emoji' }, { compositeKey: '🎨', type: 'emoji' },
{ compositeKey: '🎬', type: 'emoji' }, { compositeKey: '🎮', type: 'emoji' },
{ compositeKey: '🎯', type: 'emoji' }, { compositeKey: '🎱', type: 'emoji' },
{ compositeKey: '🎲', type: 'emoji' }, { compositeKey: '🎳', type: 'emoji' },
{ compositeKey: '🎴', type: 'emoji' }, { compositeKey: '🎵', type: 'emoji' },
{ compositeKey: '🎶', type: 'emoji' }, { compositeKey: '🎷', type: 'emoji' },
{ compositeKey: '🎸', type: 'emoji' }, { compositeKey: '🎹', type: 'emoji' },
{ compositeKey: '🎺', type: 'emoji' }, { compositeKey: '🎻', type: 'emoji' },
{ compositeKey: '🎼', type: 'emoji' }, { compositeKey: '🎾', type: 'emoji' },
{ compositeKey: '🎿', type: 'emoji' }, { compositeKey: '🏀', type: 'emoji' },
{ compositeKey: '🏂', type: 'emoji' }, { compositeKey: '🏄', type: 'emoji' },
{ compositeKey: '🏆', type: 'emoji' }, { compositeKey: '🏇', type: 'emoji' },
{ compositeKey: '🏈', type: 'emoji' }, { compositeKey: '🏉', type: 'emoji' },
{ compositeKey: '🏊', type: 'emoji' }, { compositeKey: '👔', type: 'emoji' },
{ compositeKey: '👻', type: 'emoji' }, { compositeKey: '👾', type: 'emoji' },
{ compositeKey: '💉', type: 'emoji' }, { compositeKey: '💊', type: 'emoji' },
{ compositeKey: '💝', type: 'emoji' }, { compositeKey: '💡', type: 'emoji' },
{ compositeKey: '💣', type: 'emoji' }, { compositeKey: '💰', type: 'emoji' },
{ compositeKey: '💳', type: 'emoji' }, { compositeKey: '💴', type: 'emoji' },
{ compositeKey: '💵', type: 'emoji' }, { compositeKey: '💶', type: 'emoji' },
{ compositeKey: '💷', type: 'emoji' }, { compositeKey: '💸', type: 'emoji' },
{ compositeKey: '💻', type: 'emoji' }, { compositeKey: '💽', type: 'emoji' },
{ compositeKey: '💾', type: 'emoji' }, { compositeKey: '💿', type: 'emoji' },
{ compositeKey: '📀', type: 'emoji' }, { compositeKey: '📁', type: 'emoji' },
{ compositeKey: '📂', type: 'emoji' }, { compositeKey: '📃', type: 'emoji' },
{ compositeKey: '📄', type: 'emoji' }, { compositeKey: '📅', type: 'emoji' },
{ compositeKey: '📆', type: 'emoji' }, { compositeKey: '📇', type: 'emoji' },
{ compositeKey: '📈', type: 'emoji' }, { compositeKey: '📉', type: 'emoji' },
{ compositeKey: '📊', type: 'emoji' }, { compositeKey: '📋', type: 'emoji' },
{ compositeKey: '📌', type: 'emoji' }, { compositeKey: '📎', type: 'emoji' },
{ compositeKey: '📏', type: 'emoji' }, { compositeKey: '📐', type: 'emoji' },
{ compositeKey: '📑', type: 'emoji' }, { compositeKey: '📒', type: 'emoji' },
{ compositeKey: '📓', type: 'emoji' }, { compositeKey: '📔', type: 'emoji' },
{ compositeKey: '📕', type: 'emoji' }, { compositeKey: '📖', type: 'emoji' },
{ compositeKey: '📗', type: 'emoji' }, { compositeKey: '📘', type: 'emoji' },
{ compositeKey: '📙', type: 'emoji' }, { compositeKey: '📚', type: 'emoji' },
{ compositeKey: '📛', type: 'emoji' }, { compositeKey: '📜', type: 'emoji' },
{ compositeKey: '📝', type: 'emoji' }, { compositeKey: '📞', type: 'emoji' },
{ compositeKey: '📟', type: 'emoji' }, { compositeKey: '📠', type: 'emoji' },
{ compositeKey: '📡', type: 'emoji' }, { compositeKey: '📢', type: 'emoji' },
{ compositeKey: '📣', type: 'emoji' }, { compositeKey: '📤', type: 'emoji' },
{ compositeKey: '📥', type: 'emoji' }, { compositeKey: '📦', type: 'emoji' },
{ compositeKey: '📧', type: 'emoji' }, { compositeKey: '📨', type: 'emoji' },
{ compositeKey: '📩', type: 'emoji' }, { compositeKey: '📪', type: 'emoji' },
{ compositeKey: '📫', type: 'emoji' }, { compositeKey: '📬', type: 'emoji' },
{ compositeKey: '📭', type: 'emoji' }, { compositeKey: '📮', type: 'emoji' },
{ compositeKey: '📯', type: 'emoji' }, { compositeKey: '📰', type: 'emoji' },
{ compositeKey: '📱', type: 'emoji' }, { compositeKey: '📲', type: 'emoji' },
{ compositeKey: '📷', type: 'emoji' }, { compositeKey: '📹', type: 'emoji' },
{ compositeKey: '📺', type: 'emoji' }, { compositeKey: '📻', type: 'emoji' },
{ compositeKey: '📼', type: 'emoji' }, { compositeKey: '🔅', type: 'emoji' },
{ compositeKey: '🔆', type: 'emoji' }, { compositeKey: '🔇', type: 'emoji' },
{ compositeKey: '🔈', type: 'emoji' }, { compositeKey: '🔉', type: 'emoji' },
{ compositeKey: '🔊', type: 'emoji' }, { compositeKey: '🔋', type: 'emoji' },
{ compositeKey: '🔌', type: 'emoji' }, { compositeKey: '🔍', type: 'emoji' },
{ compositeKey: '🔎', type: 'emoji' }, { compositeKey: '🔏', type: 'emoji' },
{ compositeKey: '🔐', type: 'emoji' }, { compositeKey: '🔑', type: 'emoji' },
{ compositeKey: '🔒', type: 'emoji' }, { compositeKey: '🔓', type: 'emoji' },
{ compositeKey: '🔔', type: 'emoji' }, { compositeKey: '🔕', type: 'emoji' },
{ compositeKey: '🔖', type: 'emoji' }, { compositeKey: '🔦', type: 'emoji' },
{ compositeKey: '🔧', type: 'emoji' }, { compositeKey: '🔨', type: 'emoji' },
{ compositeKey: '🔩', type: 'emoji' }, { compositeKey: '🔪', type: 'emoji' },
{ compositeKey: '🔫', type: 'emoji' }, { compositeKey: '🔬', type: 'emoji' },
{ compositeKey: '🔭', type: 'emoji' }, { compositeKey: '🔮', type: 'emoji' },
{ compositeKey: '🕻', type: 'emoji' }, { compositeKey: '🕿', type: 'emoji' },
{ compositeKey: '🖪', type: 'emoji' }, { compositeKey: '🚪', type: 'emoji' },
{ compositeKey: '🚬', type: 'emoji' }, { compositeKey: '🚴', type: 'emoji' },
{ compositeKey: '🚽', type: 'emoji' }, { compositeKey: '🚿', type: 'emoji' },
{ compositeKey: '🛀', type: 'emoji' }, { compositeKey: '🛁', type: 'emoji' },
{ compositeKey: '\u231a\ufe0f', type: 'emoji' }, { compositeKey: '\u231b\ufe0f', type: 'emoji' },
{ compositeKey: '\u23f3\ufe0f', type: 'emoji' }, { compositeKey: '\u260e\ufe0f', type: 'emoji' },
{ compositeKey: '\u2615\ufe0f', type: 'emoji' }, { compositeKey: '\u26bd\ufe0f', type: 'emoji' },
{ compositeKey: '\u26be\ufe0f', type: 'emoji' }, { compositeKey: '\u26f3\ufe0f', type: 'emoji' },
{ compositeKey: '\u2702\ufe0f', type: 'emoji' }, { compositeKey: '\u2709\ufe0f', type: 'emoji' },
{ compositeKey: '\u270f\ufe0f', type: 'emoji' }, { compositeKey: '\u2712\ufe0f', type: 'emoji' }
],
keys: [
[
{
value: '',
keyCode: -3,
className: 'emoji-ime-switch'
},
{
value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-recent',
targetPage: 0
},
{
value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-people',
targetPage: 1
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-nature',
targetPage: 2
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-object active',
targetPage: 3
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-place',
targetPage: 4
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-symbol',
targetPage: 5
},
{ value: '⌫', keyCode: KeyEvent.DOM_VK_BACK_SPACE }
]
]
}, { // Page 3 - Places
panelKeys: [{ compositeKey: '🇨🇳', type: 'emoji' }, { compositeKey: '🇫🇷', type: 'emoji' },
{ compositeKey: '🇬🇧', type: 'emoji' }, { compositeKey: '🇮🇹', type: 'emoji' },
{ compositeKey: '🇯🇵', type: 'emoji' }, { compositeKey: '🇰🇷', type: 'emoji' },
{ compositeKey: '🇷🇺', type: 'emoji' }, { compositeKey: '🇪🇸', type: 'emoji' },
{ compositeKey: '🇺🇸', type: 'emoji' }, { compositeKey: '🌃', type: 'emoji' },
{ compositeKey: '🌄', type: 'emoji' }, { compositeKey: '🌅', type: 'emoji' },
{ compositeKey: '🌆', type: 'emoji' }, { compositeKey: '🌇', type: 'emoji' },
{ compositeKey: '🌉', type: 'emoji' }, { compositeKey: '🎠', type: 'emoji' },
{ compositeKey: '🎡', type: 'emoji' }, { compositeKey: '🎢', type: 'emoji' },
{ compositeKey: '🎪', type: 'emoji' }, { compositeKey: '🎫', type: 'emoji' },
{ compositeKey: '🎭', type: 'emoji' }, { compositeKey: '🎰', type: 'emoji' },
{ compositeKey: '🏠', type: 'emoji' }, { compositeKey: '🏡', type: 'emoji' },
{ compositeKey: '🏢', type: 'emoji' }, { compositeKey: '🏣', type: 'emoji' },
{ compositeKey: '🏤', type: 'emoji' }, { compositeKey: '🏥', type: 'emoji' },
{ compositeKey: '🏦', type: 'emoji' }, { compositeKey: '🏨', type: 'emoji' },
{ compositeKey: '🏩', type: 'emoji' }, { compositeKey: '🏪', type: 'emoji' },
{ compositeKey: '🏫', type: 'emoji' }, { compositeKey: '🏬', type: 'emoji' },
{ compositeKey: '🏭', type: 'emoji' }, { compositeKey: '🏮', type: 'emoji' },
{ compositeKey: '🏯', type: 'emoji' }, { compositeKey: '🏰', type: 'emoji' },
{ compositeKey: '💈', type: 'emoji' }, { compositeKey: '💒', type: 'emoji' },
{ compositeKey: '💺', type: 'emoji' }, { compositeKey: '📍', type: 'emoji' },
{ compositeKey: '🔰', type: 'emoji' }, { compositeKey: '🗻', type: 'emoji' },
{ compositeKey: '🗼', type: 'emoji' }, { compositeKey: '🗽', type: 'emoji' },
{ compositeKey: '🗾', type: 'emoji' }, { compositeKey: '🗿', type: 'emoji' },
{ compositeKey: '🚀', type: 'emoji' }, { compositeKey: '🚁', type: 'emoji' },
{ compositeKey: '🚂', type: 'emoji' }, { compositeKey: '🚃', type: 'emoji' },
{ compositeKey: '🚄', type: 'emoji' }, { compositeKey: '🚅', type: 'emoji' },
{ compositeKey: '🚆', type: 'emoji' }, { compositeKey: '🚇', type: 'emoji' },
{ compositeKey: '🚈', type: 'emoji' }, { compositeKey: '🚉', type: 'emoji' },
{ compositeKey: '🚊', type: 'emoji' }, { compositeKey: '🚋', type: 'emoji' },
{ compositeKey: '🚌', type: 'emoji' }, { compositeKey: '🚍', type: 'emoji' },
{ compositeKey: '🚎', type: 'emoji' }, { compositeKey: '🚏', type: 'emoji' },
{ compositeKey: '🚐', type: 'emoji' }, { compositeKey: '🚑', type: 'emoji' },
{ compositeKey: '🚒', type: 'emoji' }, { compositeKey: '🚓', type: 'emoji' },
{ compositeKey: '🚔', type: 'emoji' }, { compositeKey: '🚕', type: 'emoji' },
{ compositeKey: '🚖', type: 'emoji' }, { compositeKey: '🚗', type: 'emoji' },
{ compositeKey: '🚘', type: 'emoji' }, { compositeKey: '🚙', type: 'emoji' },
{ compositeKey: '🚚', type: 'emoji' }, { compositeKey: '🚛', type: 'emoji' },
{ compositeKey: '🚜', type: 'emoji' }, { compositeKey: '🚝', type: 'emoji' },
{ compositeKey: '🚞', type: 'emoji' }, { compositeKey: '🚟', type: 'emoji' },
{ compositeKey: '🚠', type: 'emoji' }, { compositeKey: '🚡', type: 'emoji' },
{ compositeKey: '🚢', type: 'emoji' }, { compositeKey: '🚣', type: 'emoji' },
{ compositeKey: '🚤', type: 'emoji' }, { compositeKey: '🚥', type: 'emoji' },
{ compositeKey: '🚦', type: 'emoji' }, { compositeKey: '🚧', type: 'emoji' },
{ compositeKey: '🚨', type: 'emoji' }, { compositeKey: '🚩', type: 'emoji' },
{ compositeKey: '🚲', type: 'emoji' }, { compositeKey: '\u2668\ufe0f', type: 'emoji' },
{ compositeKey: '\u2693\ufe0f', type: 'emoji' }, { compositeKey: '\u26a0\ufe0f', type: 'emoji' },
{ compositeKey: '\u26ea\ufe0f', type: 'emoji' }, { compositeKey: '\u26f2\ufe0f', type: 'emoji' },
{ compositeKey: '\u26f5\ufe0f', type: 'emoji' }, { compositeKey: '\u26fa\ufe0f', type: 'emoji' },
{ compositeKey: '\u26fd\ufe0f', type: 'emoji' }, { compositeKey: '\u2708\ufe0f', type: 'emoji' }
],
keys: [
[
{
value: '',
keyCode: -3,
className: 'emoji-ime-switch'
},
{
value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-recent',
targetPage: 0
},
{
value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-people',
targetPage: 1
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-nature',
targetPage: 2
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-object',
targetPage: 3
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-place active',
targetPage: 4
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-symbol',
targetPage: 5
},
{ value: '⌫', keyCode: KeyEvent.DOM_VK_BACK_SPACE }
]
]
}, { // Page 4 - Symbols
panelKeys: [{ compositeKey: '🅰\ufe0f', type: 'emoji' }, { compositeKey: '🅱\ufe0f', type: 'emoji' },
{ compositeKey: '🅾\ufe0f', type: 'emoji' }, { compositeKey: '🅿\ufe0f', type: 'emoji' },
{ compositeKey: '🆎', type: 'emoji' }, { compositeKey: '🆑', type: 'emoji' },
{ compositeKey: '🆒', type: 'emoji' }, { compositeKey: '🆓', type: 'emoji' },
{ compositeKey: '🆔', type: 'emoji' }, { compositeKey: '🆕', type: 'emoji' },
{ compositeKey: '🆖', type: 'emoji' }, { compositeKey: '🆗', type: 'emoji' },
{ compositeKey: '🆘', type: 'emoji' }, { compositeKey: '🆙', type: 'emoji' },
{ compositeKey: '🆚', type: 'emoji' }, { compositeKey: '🈁', type: 'emoji' },
{ compositeKey: '🈂\ufe0f', type: 'emoji' }, { compositeKey: '🈚\ufe0f', type: 'emoji' },
{ compositeKey: '🈯\ufe0f', type: 'emoji' }, { compositeKey: '🈲\ufe0f', type: 'emoji' },
{ compositeKey: '🈳\ufe0f', type: 'emoji' }, { compositeKey: '🈴\ufe0f', type: 'emoji' },
{ compositeKey: '🈵\ufe0f', type: 'emoji' }, { compositeKey: '🈶\ufe0f', type: 'emoji' },
{ compositeKey: '🈷\ufe0f', type: 'emoji' }, { compositeKey: '🈸\ufe0f', type: 'emoji' },
{ compositeKey: '🈹', type: 'emoji' }, { compositeKey: '🈺', type: 'emoji' },
{ compositeKey: '🉐', type: 'emoji' }, { compositeKey: '🉑', type: 'emoji' },
{ compositeKey: '🎦', type: 'emoji' }, { compositeKey: '🏧', type: 'emoji' },
{ compositeKey: '💟', type: 'emoji' }, { compositeKey: '💠', type: 'emoji' },
{ compositeKey: '💮', type: 'emoji' }, { compositeKey: '💯', type: 'emoji' },
{ compositeKey: '💱', type: 'emoji' }, { compositeKey: '💲', type: 'emoji' },
{ compositeKey: '💹', type: 'emoji' }, { compositeKey: '📳', type: 'emoji' },
{ compositeKey: '📴', type: 'emoji' }, { compositeKey: '📵', type: 'emoji' },
{ compositeKey: '📶', type: 'emoji' }, { compositeKey: '🔀', type: 'emoji' },
{ compositeKey: '🔁', type: 'emoji' }, { compositeKey: '🔂', type: 'emoji' },
{ compositeKey: '🔃', type: 'emoji' }, { compositeKey: '🔄', type: 'emoji' },
{ compositeKey: '🔗', type: 'emoji' }, { compositeKey: '🔘', type: 'emoji' },
{ compositeKey: '🔙', type: 'emoji' }, { compositeKey: '🔚', type: 'emoji' },
{ compositeKey: '🔛', type: 'emoji' }, { compositeKey: '🔜', type: 'emoji' },
{ compositeKey: '🔝', type: 'emoji' }, { compositeKey: '🔞', type: 'emoji' },
{ compositeKey: '🔟', type: 'emoji' }, { compositeKey: '🔠', type: 'emoji' },
{ compositeKey: '🔡', type: 'emoji' }, { compositeKey: '🔢', type: 'emoji' },
{ compositeKey: '🔣', type: 'emoji' }, { compositeKey: '🔤', type: 'emoji' },
{ compositeKey: '🔯', type: 'emoji' }, { compositeKey: '🔱', type: 'emoji' },
{ compositeKey: '🔲', type: 'emoji' }, { compositeKey: '🔳', type: 'emoji' },
{ compositeKey: '🔴', type: 'emoji' }, { compositeKey: '🔵', type: 'emoji' },
{ compositeKey: '🔶', type: 'emoji' }, { compositeKey: '🔷', type: 'emoji' },
{ compositeKey: '🔸', type: 'emoji' }, { compositeKey: '🔹', type: 'emoji' },
{ compositeKey: '🔺', type: 'emoji' }, { compositeKey: '🔻', type: 'emoji' },
{ compositeKey: '🔼', type: 'emoji' }, { compositeKey: '🔽', type: 'emoji' },
{ compositeKey: '🕐', type: 'emoji' }, { compositeKey: '🕑', type: 'emoji' },
{ compositeKey: '🕒', type: 'emoji' }, { compositeKey: '🕓', type: 'emoji' },
{ compositeKey: '🕕', type: 'emoji' }, { compositeKey: '🕖', type: 'emoji' },
{ compositeKey: '🕛', type: 'emoji' }, { compositeKey: '🕜', type: 'emoji' },
{ compositeKey: '🕝', type: 'emoji' }, { compositeKey: '🕞', type: 'emoji' },
{ compositeKey: '🕟', type: 'emoji' }, { compositeKey: '🕠', type: 'emoji' },
{ compositeKey: '🕡', type: 'emoji' }, { compositeKey: '🕧', type: 'emoji' },
{ compositeKey: '🚫', type: 'emoji' }, { compositeKey: '🚭', type: 'emoji' },
{ compositeKey: '🚮', type: 'emoji' }, { compositeKey: '🚯', type: 'emoji' },
{ compositeKey: '🚰', type: 'emoji' }, { compositeKey: '🚱', type: 'emoji' },
{ compositeKey: '🚳', type: 'emoji' }, { compositeKey: '🚷', type: 'emoji' },
{ compositeKey: '🚸', type: 'emoji' }, { compositeKey: '🚹', type: 'emoji' },
{ compositeKey: '🚺', type: 'emoji' }, { compositeKey: '🚻', type: 'emoji' },
{ compositeKey: '🚼', type: 'emoji' }, { compositeKey: '🚾', type: 'emoji' },
{ compositeKey: '🛂', type: 'emoji' }, { compositeKey: '🛃', type: 'emoji' },
{ compositeKey: '🛄', type: 'emoji' }, { compositeKey: '🛅', type: 'emoji' },
{ compositeKey: '\u203c\ufe0f', type: 'emoji' }, { compositeKey: '\u2049\ufe0f', type: 'emoji' },
{ compositeKey: '\u2139\ufe0f', type: 'emoji' }, { compositeKey: '\u2194\ufe0f', type: 'emoji' },
{ compositeKey: '\u2195\ufe0f', type: 'emoji' }, { compositeKey: '\u2196\ufe0f', type: 'emoji' },
{ compositeKey: '\u2197\ufe0f', type: 'emoji' }, { compositeKey: '\u2198\ufe0f', type: 'emoji' },
{ compositeKey: '\u21a9\ufe0f', type: 'emoji' }, { compositeKey: '\u21aa\ufe0f', type: 'emoji' },
{ compositeKey: '\u23e9\ufe0f', type: 'emoji' }, { compositeKey: '\u23ea\ufe0f', type: 'emoji' },
{ compositeKey: '\u23eb\ufe0f', type: 'emoji' }, { compositeKey: '\u23ec\ufe0f', type: 'emoji' },
{ compositeKey: '\u23f0\ufe0f', type: 'emoji' }, { compositeKey: '\u24c2\ufe0f', type: 'emoji' },
{ compositeKey: '\u25aa\ufe0f', type: 'emoji' }, { compositeKey: '\u25ab\ufe0f', type: 'emoji' },
{ compositeKey: '\u25b6\ufe0f', type: 'emoji' }, { compositeKey: '\u25c0\ufe0f', type: 'emoji' },
{ compositeKey: '\u25fb\ufe0f', type: 'emoji' }, { compositeKey: '\u25fc\ufe0f', type: 'emoji' },
{ compositeKey: '\u25fd\ufe0f', type: 'emoji' }, { compositeKey: '\u25fe\ufe0f', type: 'emoji' },
{ compositeKey: '\u2611\ufe0f', type: 'emoji' }, { compositeKey: '\u2648\ufe0f', type: 'emoji' },
{ compositeKey: '\u2649\ufe0f', type: 'emoji' }, { compositeKey: '\u264a\ufe0f', type: 'emoji' },
{ compositeKey: '\u264b\ufe0f', type: 'emoji' }, { compositeKey: '\u264c\ufe0f', type: 'emoji' },
{ compositeKey: '\u264d\ufe0f', type: 'emoji' }, { compositeKey: '\u264e\ufe0f', type: 'emoji' },
{ compositeKey: '\u264f\ufe0f', type: 'emoji' }, { compositeKey: '\u2650\ufe0f', type: 'emoji' },
{ compositeKey: '\u2651\ufe0f', type: 'emoji' }, { compositeKey: '\u2652\ufe0f', type: 'emoji' },
{ compositeKey: '\u2653\ufe0f', type: 'emoji' }, { compositeKey: '\u2660\ufe0f', type: 'emoji' },
{ compositeKey: '\u2663\ufe0f', type: 'emoji' }, { compositeKey: '\u2665\ufe0f', type: 'emoji' },
{ compositeKey: '\u2666\ufe0f', type: 'emoji' }, { compositeKey: '\u267b\ufe0f', type: 'emoji' },
{ compositeKey: '\u267f\ufe0f', type: 'emoji' }, { compositeKey: '\u26aa\ufe0f', type: 'emoji' },
{ compositeKey: '\u26ab\ufe0f', type: 'emoji' }, { compositeKey: '\u26ce\ufe0f', type: 'emoji' },
{ compositeKey: '\u26d4\ufe0f', type: 'emoji' }, { compositeKey: '\u2705\ufe0f', type: 'emoji' },
{ compositeKey: '\u2714\ufe0f', type: 'emoji' }, { compositeKey: '\u2716\ufe0f', type: 'emoji' },
{ compositeKey: '\u2733\ufe0f', type: 'emoji' }, { compositeKey: '\u2734\ufe0f', type: 'emoji' },
{ compositeKey: '\u2748\ufe0f', type: 'emoji' }, { compositeKey: '\u274c\ufe0f', type: 'emoji' },
{ compositeKey: '\u274e\ufe0f', type: 'emoji' }, { compositeKey: '\u2753\ufe0f', type: 'emoji' },
{ compositeKey: '\u2754\ufe0f', type: 'emoji' }, { compositeKey: '\u2755\ufe0f', type: 'emoji' },
{ compositeKey: '\u2757\ufe0f', type: 'emoji' }, { compositeKey: '\u2795\ufe0f', type: 'emoji' },
{ compositeKey: '\u2796\ufe0f', type: 'emoji' }, { compositeKey: '\u2797\ufe0f', type: 'emoji' },
{ compositeKey: '\u27a1\ufe0f', type: 'emoji' }, { compositeKey: '\u27b0\ufe0f', type: 'emoji' },
{ compositeKey: '\u27bf\ufe0f', type: 'emoji' }, { compositeKey: '\u2934\ufe0f', type: 'emoji' },
{ compositeKey: '\u2935\ufe0f', type: 'emoji' }, { compositeKey: '\u2b05\ufe0f', type: 'emoji' },
{ compositeKey: '\u2b1b\ufe0f', type: 'emoji' }, { compositeKey: '\u2b1c\ufe0f', type: 'emoji' },
{ compositeKey: '\u2b55\ufe0f', type: 'emoji' }, { compositeKey: '\u3030\ufe0f', type: 'emoji' },
{ compositeKey: '\u303d\ufe0f', type: 'emoji' }, { compositeKey: '\u3297\ufe0f', type: 'emoji' },
{ compositeKey: '\u3299\ufe0f', type: 'emoji' }
],
keys: [
[
{
value: '',
keyCode: -3,
className: 'emoji-ime-switch'
},
{
value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-recent',
targetPage: 0
},
{
value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-people',
targetPage: 1
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-nature',
targetPage: 2
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-object',
targetPage: 3
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-place',
targetPage: 4
},
{ value: '',
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'emoji-symbol active',
targetPage: 5
},
{ value: '⌫', keyCode: KeyEvent.DOM_VK_BACK_SPACE }
]
]
}
]
};

View file

@ -0,0 +1,92 @@
Keyboards['en-Africa'] = {
label: 'English (Africa)',
shortLabel: 'En',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'en_gb',
menuLabel: 'English (Africa)',
lang: 'en-GB',
pages: [ {
alt: {
a: 'áàâäåãāæ',
c: 'çćč',
e: 'éèêëēę€ɛ',
i: 'ïíìîīį',
o: 'öõóòôōœøɵ',
u: 'üúùûū',
s: 'ßśš$',
S: 'ŚŠ$',
n: 'ñń',
l: 'ł£',
y: 'ÿ¥',
z: 'žźż',
'.': ',?!;:…'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' }, { value: 'r' },
{ value: 't' }, { value: 'y' }, { value: 'u' }, { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
}, {
alt: {
'1': ['¹', '1st'],
'2': ['²', '2nd'],
'3': ['³', '3rd'],
'4': ['⁴', '4th'],
'5': ['⁵', '5th'],
'6': ['⁶', '6th'],
'7': ['⁷', '7th'],
'8': ['⁸', '8th'],
'9': ['⁹', '9th'],
'0': ['⁰', 'º'],
'$': [ '€', '£', '¢', '¥'],
'"': ['“', '”'],
'\'':['‘', '’'],
'?': ['¿'],
'!': ['¡'],
'+': ['-', '×', '÷', '±']
},
keys: [
[
{ value: '1' }, { value: '2' }, { value: '3' }, { value: '4' },
{ value: '5' }, { value: '6' }, { value: '7' }, { value: '8' },
{ value: '9' }, { value: '0' }
], [
{ value: '@' }, { value: '#' },
{ value: '$', className: 'alternate-indicator' }, { value: '&' },
{ value: '*' }, { value: '-' }, { value: '_' }, { value: '/' },
{ value: '(' }, { value: ')' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '+',
supportsSwitching: {
value: ','
}
}, { value: ':' }, { value: ';' }, { value: '"' },
{ value: '\'' }, { value: '!' }, { value: '?' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,44 @@
Keyboards['en-Colemak'] = {
label: 'English - Colemak',
shortLabel: 'En',
menuLabel: 'Colemak',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'en_us',
lang: 'en-US',
alt: {
a: 'áàâäåãāæ',
c: 'çćč',
e: 'éèêëēę€ɛ',
i: 'ïíìîīį',
o: 'öóòôōőœøɵ',
u: 'üúùûűū',
s: 'ßśš$',
S: 'ŚŠ$',
n: 'ñń',
l: 'ł£',
y: 'ÿ¥',
z: 'žźż',
'.': ',?!:)(…'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'f' } , { value: 'p' },
{ value: 'g' } , { value: 'j' }, { value: 'l' } , { value: 'u' },
{ value: 'y' }, { value: ';' }
], [
{ value: 'a' }, { value: 'r' }, { value: 's' }, { value: 't' },
{ value: 'd' } , { value: 'h' }, { value: 'n' }, { value: 'e' },
{ value: 'i' },
{ value: 'o',}
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'k' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
};

View file

@ -0,0 +1,43 @@
Keyboards['en-Dvorak'] = {
label: 'English - Dvorak',
shortLabel: 'En',
menuLabel: 'Dvorak',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'en_us',
lang: 'en-US',
alt: {
a: 'àáâãäåāæ',
c: 'çćč',
e: 'èéêëē€',
i: 'ìíîïī',
o: 'òóôõöōœø',
u: 'ùúûüū',
s: 'śšşß',
S: 'ŚŠŞ',
n: 'ńñň'
},
textLayoutOverwrite: {
',': "'",
'.': false
},
keys: [
[
{ value: ',' }, { value: '.' } , { value: 'p' }, { value: 'y' },
{ value: 'f' }, { value: 'g' } , { value: 'c' }, { value: 'r' },
{ value: 'l' }, { value: '⌫', keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: 'a' }, { value: 'o' }, { value: 'e' }, { value: 'u' },
{ value: 'i' } , { value: 'd' }, { value: 'h' }, { value: 't' },
{ value: 'n' }, { value: 's' }
], [
{ value: '⇪', ratio: 1, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'q' }, { value: 'j' }, { value: 'k' }, { value: 'x' },
{ value: 'b' }, { value: 'm' }, { value: 'w' }, { value: 'v' },
{ value: 'z' }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
};

View file

@ -0,0 +1,92 @@
Keyboards['en-GB'] = {
label: 'English (UK)',
shortLabel: 'En',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'en_gb',
menuLabel: 'English (UK)',
lang: 'en-GB',
pages: [ {
alt: {
a: 'áàâäåãāæ',
c: 'çćč',
e: 'éèêëēę€ɛ',
i: 'ïíìîīį',
o: 'öõóòôōœøɵ',
u: 'üúùûū',
s: 'ßśš$',
S: 'ŚŠ$',
n: 'ñń',
l: 'ł£',
y: 'ÿ¥',
z: 'žźż',
'.': ',?!;:…'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' }, { value: 'r' },
{ value: 't' }, { value: 'y' }, { value: 'u' }, { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
}, {
alt: {
'1': ['¹', '1st'],
'2': ['²', '2nd'],
'3': ['³', '3rd'],
'4': ['⁴', '4th'],
'5': ['⁵', '5th'],
'6': ['⁶', '6th'],
'7': ['⁷', '7th'],
'8': ['⁸', '8th'],
'9': ['⁹', '9th'],
'0': ['⁰', 'º'],
'£': [ '€', '$', '¢', '¥'],
'"': ['“', '”'],
'\'':['‘', '’'],
'?': ['¿'],
'!': ['¡'],
'+': ['-', '×', '÷', '±']
},
keys: [
[
{ value: '1' }, { value: '2' }, { value: '3' }, { value: '4' },
{ value: '5' }, { value: '6' }, { value: '7' }, { value: '8' },
{ value: '9' }, { value: '0' }
], [
{ value: '@' }, { value: '#' },
{ value: '£', className: 'alternate-indicator' }, { value: '&' },
{ value: '*' }, { value: '-' }, { value: '_' }, { value: '/' },
{ value: '(' }, { value: ')' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '+',
supportsSwitching: {
value: ','
}
}, { value: ':' }, { value: ';' }, { value: '"' },
{ value: '\'' }, { value: '!' }, { value: '?' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,119 @@
Keyboards['en-Neo'] = {
label: 'English - Neo',
shortLabel: 'En',
menuLabel: 'English - Neo',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'en_us',
lang: 'en-US',
alt: {
a: 'áàâäåãāæ',
c: 'çćč',
e: 'éèêëēę€ɛ',
i: 'ïíìîīį',
o: 'öóòôōœøɵ',
u: 'üúùûū',
s: 'ßśš$',
S: 'ŚŠ$',
n: 'ñń',
l: 'ł£',
y: 'ÿ¥',
z: 'žźż',
'.': ',?!;:…'
},
keys: [
[
{ value: 'x' }, { value: 'v' }, { value: 'l' } , { value: 'c' },
{ value: 'w' }, { value: 'k' }, { value: 'h' } , { value: 'g' },
{ value: 'f' }, { value: 'q' }
], [
{ value: 'u' }, { value: 'i', }, { value: 'a' }, { value: 'e' },
{ value: 'o' }, { value: 's', }, { value: 'n' }, { value: 'r' },
{ value: 't' }, { value: 'd', }
], [
{ value: '⇪', ratio: 2, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'p' }, { value: 'z' }, { value: 'b' },
{ value: 'm' }, { value: 'j' }, { value: 'y' },
{ value: '⌫', ratio: 2, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
pages: [undefined, {
needsCommaKey: true,
alt: {
'1': ['¹', '1st'],
'2': ['²', '2nd'],
'3': ['³', '3rd'],
'4': ['⁴', '4th'],
'5': ['⁵', '5th'],
'6': ['⁶', '6th'],
'7': ['⁷', '7th'],
'8': ['⁸', '8th'],
'9': ['⁹', '9th'],
'0': ['⁰', 'º'],
'$': [ '€', '£', '¢', '¥'],
'"': ['“', '”'],
'\'':['‘', '’'],
'?': ['¿'],
'!': ['¡'],
'+': ['-', '×', '÷', '±'],
'/': '\\'
},
keys: [
[
{ value: ':' }, { value: '&' },
{ value: '#' }, { value: '$' }, { value: '!' },
{ value: '7' }, { value: '8' }, { value: '9' },
{ value: '/' }, { value: '*' }
], [
{ value: ';' }, { value: '@' },
{ value: '(' }, { value: ')' }, { value: '?' },
{ value: '4' }, { value: '5' }, { value: '6' },
{ value: '+' }, { value: '-' }
], [
{ value: 'Alt', ratio: 2,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '%' }, { value: '"' }, { value: "'" },
{ value: '1' }, { value: '2' }, { value: '3' },
{ value: '⌫', ratio: 2, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
}, {
alt: {
'®': ['™']
},
needsCommaKey: true,
keys: [
[
{ value: '§' }, { value: '_' }, { value: '[' }, { value: ']' },
{ value: '^' }, { value: '<' }, { value: '>' }, { value: '=' },
{ value: '¥' }, { value: '€' }
], [
{ value: '©' }, { value: '®' }, { value: '{' }, { value: '}' },
{ value: '`' }, { value: '«' }, { value: '»' }, { value: '±' },
{ value: '£' }, { value: '$' }
],
[
{ value: 'Alt', ratio: 2,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 1
},
{ value: '|' }, { value: '~' }, { value: 'º' },
{ value: '¹' }, { value: '²' }, { value: '³' },
{ value: '⌫', ratio: 2, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,91 @@
Keyboards.en = {
label: 'English',
shortLabel: 'En',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'en_us',
menuLabel: 'English',
lang: 'en',
alt: {
a: 'áàâäåãāæ',
c: 'çćč',
e: 'éèêëēę€ɛ',
i: 'ïíìîīį',
o: 'öõóòôōœøɵ',
u: 'üúùûū',
s: 'ßśš$',
S: 'ŚŠ$',
n: 'ñń',
l: 'ł£',
y: 'ÿ¥',
z: 'žźż',
'.': ',?!;:…'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' }, { value: 'r' },
{ value: 't' }, { value: 'y' }, { value: 'u' }, { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
pages: [undefined, {
alt: {
'1': ['¹', '1st'],
'2': ['²', '2nd'],
'3': ['³', '3rd'],
'4': ['⁴', '4th'],
'5': ['⁵', '5th'],
'6': ['⁶', '6th'],
'7': ['⁷', '7th'],
'8': ['⁸', '8th'],
'9': ['⁹', '9th'],
'0': ['⁰', 'º'],
'$': [ '€', '£', '¢', '¥'],
'"': ['“', '”'],
'\'':['‘', '’'],
'?': ['¿'],
'!': ['¡'],
'+': ['-', '×', '÷', '±']
},
keys: [
[
{ value: '1' }, { value: '2' }, { value: '3' }, { value: '4' },
{ value: '5' }, { value: '6' }, { value: '7' }, { value: '8' },
{ value: '9' }, { value: '0' }
], [
{ value: '@' }, { value: '#' },
{ value: '$', className: 'alternate-indicator' }, { value: '&' },
{ value: '*' }, { value: '-' }, { value: '_' }, { value: '/' },
{ value: '(' }, { value: ')' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '+',
supportsSwitching: {
value: ','
}
}, { value: ':' }, { value: ';' }, { value: '"' },
{ value: '\'' }, { value: '!' }, { value: '?' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,51 @@
Keyboards.eo = {
label: 'Esperanto',
menuLabel: 'Esperanto',
shortLabel: 'Eo',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
lang: 'eo',
alt: {
a: 'àáâãäåæāăą',
c: 'çćċč',
d: 'ðďđ',
e: 'èéêëēėęě',
g: 'ğġģ',
h: 'ĥħ',
i: 'ìíîïĩīįıij',
k: 'ķĸ',
l: 'ĺļľŀł',
n: 'ñńņňʼnŋ',
o: 'òóôõöøōőœ',
'ŝ': 'q',
r: 'ŕŗř',
s: 'śşšșß',
S: 'ŚŞŠȘ',
t: 'þţťŧț',
u: 'ùúûüũūůűų',
'ĝ': 'wŵ',
'ĉ': 'x',
'ŭ': 'yýÿŷ',
z: 'źżž',
'.': ',?!;:…'
},
keys: [
[
{ value: 'ŝ' }, { value: 'ĝ' }, { value: 'e' } , { value: 'r' },
{ value: 't' }, { value: 'ŭ' }, { value: 'u' } , { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }, { value: 'ĵ' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'ĉ' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
};

View file

@ -0,0 +1,117 @@
Keyboards['es-Americas'] = {
label: 'Spanish (Latin America)',
shortLabel: 'Es',
menuLabel: 'Español (Latinoamérica)',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'es',
lang: 'es',
alt: {
a: 'áªàâäåãāæ',
c: 'ç',
e: 'é€èêëēęɛ',
i: 'íïìîīį',
o: 'óºöòôōœøɵ',
u: 'úüùûū',
s: '$ßš',
S: '$Š',
l: '£ l·l',
n: 'ń',
y: '¥',
'.': ',¿?¡!;:·',
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' } , { value: 'r' },
{ value: 't' }, { value: 'y' }, { value: 'u' } , { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }, { value: 'ñ' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
pages: [undefined, {
alt: {
'$': ['€', '£', '¢', '¥'],
'0': ['º'],
'1': ['1º', '1ª'],
'2': ['2º', '2ª'],
'3': ['3º', '3ª'],
'4': ['4º', '4ª'],
'5': ['5º', '5ª'],
'6': ['6º', '6ª'],
'7': ['7º', '7ª'],
'8': ['8º', '8ª'],
'9': ['9º', '9ª'],
'.': ['·'],
'"': ['“', '”'],
'\'':['‘', '’'],
},
// These are based on the es layout.
keys: [
[
{ value: '1' }, { value: '2' }, { value: '3' }, { value: '4' },
{ value: '5' }, { value: '6' }, { value: '7' }, { value: '8' },
{ value: '9' }, { value: '0' }
], [
{ value: '-' }, { value: '/' }, { value: ':' }, { value: ';' },
{ value: '(' }, { value: ')' }, { value: '$', className: 'alternate-indicator' },
{ value: '&' }, { value: '@' }, { value: '%' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '*',
supportsSwitching: {
value: ','
}
},
{ value: '¿' }, { value: '?' }, { value: '¡' }, { value: '!' },
{ value: '"' }, { value: '\'' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
}, {
alt: {
'+': ['-', '×', '÷', '±']
},
keys: [
[
{ value: '[' }, { value: ']' }, { value: '{' }, { value: '}' },
{ value: '#' }, { value: '%' }, { value: '^' }, { value: '+' },
{ value: '=' }, { value: '°' }
], [
{ value: '_' }, { value: '\\' }, { value: '|' }, { value: '~' },
{ value: '<' }, { value: '>' }, { value: '€' }, { value: '£' },
{ value: '¥' }, { value: '•' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 1
},
{value: '*' }, { value: '¿' }, { value: '?' },
{ value: '¡' }, { value: '!' },
{ value: '"' }, { value: '\'' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,120 @@
Keyboards.es = {
label: 'Spanish',
shortLabel: 'Es',
menuLabel: 'Español',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'es',
lang: 'es',
alt: {
a: 'áªàâäåãāæ',
c: 'ç',
e: 'é€èêëēęɛ',
i: 'íïìîīį',
o: 'óºöòôōœøɵ',
u: 'úüùûū',
s: '$ßš',
S: '$Š',
l: '£ l·l',
n: 'ń',
y: '¥',
'.': ',¿?¡!;:·',
':)': ':) :D :( ;D :* :/'
/* '.com': '.es .org .eu' XXX: commented to avoid overflows for the demo */
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' }, { value: 'r' },
{ value: 't' }, { value: 'y' }, { value: 'u' }, { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }, { value: 'ñ' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
// { value: ':)', compositeKey:':)', ratio: 2 },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
pages: [undefined, {
alt: {
'€': ['$', '£', '¢', '¥'],
'0': ['º'],
'1': ['1º', '1ª'],
'2': ['2º', '2ª'],
'3': ['3º', '3ª'],
'4': ['4º', '4ª'],
'5': ['5º', '5ª'],
'6': ['6º', '6ª'],
'7': ['7º', '7ª'],
'8': ['8º', '8ª'],
'9': ['9º', '9ª'],
'.': ['·'],
'"': ['“', '”'],
'\'':['‘', '’'],
},
keys: [
[
{ value: '1' }, { value: '2' }, { value: '3' }, { value: '4' },
{ value: '5' }, { value: '6' }, { value: '7' }, { value: '8' },
{ value: '9' }, { value: '0' }
], [
{ value: '-' }, { value: '/' }, { value: ':' }, { value: ';' },
{ value: '(' }, { value: ')' }, { value: '€', className: 'alternate-indicator' },
{ value: '&' }, { value: '@' }, { value: '%' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '*',
supportsSwitching: {
value: ','
}
},
{ value: '¿' }, { value: '?' }, { value: '¡' },
{ value: '!' }, { value: '"' }, { value: '\'' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
}, {
alt: {
'+': ['-', '×', '÷', '±']
},
keys: [
[
{ value: '[' }, { value: ']' }, { value: '{' }, { value: '}' },
{ value: '#' }, { value: '%' }, { value: '^' }, { value: '+' },
{ value: '=' }, { value: '°' }
], [
{ value: '_' }, { value: '\\' }, { value: '|' }, { value: '~' },
{ value: '<' }, { value: '>' }, { value: '$' }, { value: '£' },
{ value: '¥' }, { value: '•' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 1
},
{value: '*' }, { value: '¿' }, { value: '?' },
{ value: '¡' }, { value: '!' },
{ value: '"' }, { value: '\'' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,109 @@
Keyboards.eu = {
label: 'Basque',
shortLabel: 'Eu',
menuLabel: 'Euskara',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'eu',
lang: 'eu',
alt: {
a: 'áªàâäåãāæ',
c: 'ç',
e: 'é€èêëēęɛ',
i: 'íïìîīį',
o: 'óºöòôōœøɵ',
u: 'úüùûū',
s: '$ßš',
S: '$Š',
l: '£ l·l',
n: 'ń',
y: '¥',
'.': ',¿?¡!;:·',
':)': ':) :D :( ;D :* :/'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' }, { value: 'r' },
{ value: 't' }, { value: 'y' }, { value: 'u' }, { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }, { value: 'ñ' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
pages: [undefined, {
alt: {
'€': ['$', '£', '¢', '¥'],
'0': ['º'],
'.': ['·'],
'"': ['“', '”'],
'\'':['‘', '’'],
},
keys: [
[
{ value: '1' }, { value: '2' }, { value: '3' }, { value: '4' },
{ value: '5' }, { value: '6' }, { value: '7' }, { value: '8' },
{ value: '9' }, { value: '0' }
], [
{ value: '-' }, { value: '/' }, { value: ':' }, { value: ';' },
{ value: '(' }, { value: ')' }, { value: '€', className: 'alternate-indicator' },
{ value: '&' }, { value: '@' }, { value: '%' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '*',
supportsSwitching: {
value: ','
}
},
{ value: '¿' }, { value: '?' }, { value: '¡' },
{ value: '!' }, { value: '"' }, { value: '\'' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
}, {
alt: {
'+': ['-', '×', '÷', '±']
},
keys: [
[
{ value: '[' }, { value: ']' }, { value: '{' }, { value: '}' },
{ value: '#' }, { value: '%' }, { value: '^' }, { value: '+' },
{ value: '=' }, { value: '°' }
], [
{ value: '_' }, { value: '\\' }, { value: '|' }, { value: '~' },
{ value: '<' }, { value: '>' }, { value: '$' }, { value: '£' },
{ value: '¥' }, { value: '•' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 1
},
{value: '*' }, { value: '¿' }, { value: '?' },
{ value: '¡' }, { value: '!' },
{ value: '"' }, { value: '\'' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,100 @@
Keyboards.fa = {
label: 'Persian',
shortLabel: 'فا',
menuLabel: 'فارسی',
secondLayout: true,
types: ['text', 'url', 'email'],
alternateLayoutKey: '۱۲۳',
basicLayoutKey: 'اب‌پ',
lang: 'fa',
pages: [ { // Default Page
width: 11,
specificCssRule: true,
needsCommaKey: true,
alt : {
'ض': ['۱', '1'],
'ص': ['۲', '2'],
'ث': ['۳', '3'],
'ق': ['۴', '4'],
'ف': ['۵', '5'],
'غ': ['۶', '6'],
'ع': ['۷', '7'],
'ه': ['ۀ', 'ة', '۸', '8'],
'خ': ['۹', '9'],
'ح': ['۰', '0'],
'ا': ['آ', 'أ', 'ء'],
'ی': ['ئ','ي'],
'ت': 'ة',
'ک': 'ك',
'.': 'ًٌٍَُِّْءٔٓ',
'،': ':!؟؛-«»'
},
textLayoutOverwrite: {
',': '،'
},
keys: [
[
{ value: 'ض' }, { value: 'ص' }, { value: 'ث' }, { value: 'ق' },
{ value: 'ف' }, { value: 'غ' }, { value: 'ع' }, { value: 'ه' },
{ value: 'خ' }, { value: 'ح' }, { value: 'ج' }
], [
{ value: 'ش' }, { value: 'س' }, { value: 'ی' }, { value: 'ب' },
{ value: 'ل' }, { value: 'ا' }, { value: 'ت' }, { value: 'ن' },
{ value: 'م' }, { value: 'ک' }, { value: 'گ' }
], [
{ value: 'ظ' }, { value: 'ط' }, { value: 'ژ' }, { value: 'ز' },
{ value: 'ر' }, { value: 'ذ' }, { value: 'د' }, { value: 'پ' },
{ value: 'و' }, { value: 'چ' }, { value: '⌫', ratio: 1, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '\u25C2\u2507\u25B8', ratio: 1, keyCode: '8204', ariaLabel: 'نیم‌فاصله' },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
}, { // Symbols Page
specificCssRule: true,
alt: {
'۱': ['1', '¹'],
'۲': ['2', '²'],
'۳': ['3', '³'],
'۴': ['4', '⁴'],
'۵': ['5', '⁵'],
'۶': ['6', '⁶'],
'۷': ['7', '⁷'],
'۸': ['8', '⁸'],
'۹': ['9', '⁹'],
'۰': ['0', '⁰'],
'﷼': ['$', '€', '£', '¢', '¥'],
'»': ['"', '“', '”'],
'«': ['\'', '‘', '’'],
'؟': ['?', '¿'],
'!': ['¡'],
'+': ['-', '×', '÷', '±'],
'؛': [';'],
'.': 'ًٌٍَُِّْءٔٓ'
},
keys: [
[
{ value: '۱' }, { value: '۲' }, { value: '۳' }, { value: '۴' },
{ value: '۵' }, { value: '۶' }, { value: '۷' }, { value: '۸' },
{ value: '۹' }, { value: '۰' },
], [
{ value: '@' }, { value: '#' }, { value: '﷼', className: 'alternate-indicator' },
{ value: '+' }, { value: '%' }, { value: '*' }, { value: '-' },
{ value: '/' }, { value: '(' }, { value: ')' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '&' }, { value: ':' }, { value: '؛' }, { value: '«' },
{ value: '»' }, { value: '!' }, { value: '؟' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 7, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '_' }, { value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,44 @@
Keyboards.ff = {
label: 'Fulah',
shortLabel: 'Ff',
menuLabel: 'Pulaar-Fulfulde',
imEngine: 'latin',
autoCorrectLanguage: 'ff',
types: ['text', 'url', 'email', 'password'],
lang: 'ff',
alt: {
a: 'àâæáãäåā',
c: 'çćč',
e: 'éèêë€ē',
i: 'îïìíī',
o: 'ôœòóõöōø',
u: 'ùûüúū',
s: 'śšşß',
S: 'ŚŠŞ',
n: 'ñńň',
ɗ: 'z',
ƴ: 'x',
ŋ: 'q',
ɓ: 'v',
'.': ',?!-;:'
},
keys: [
[
{ value: 'a' }, { value: 'ɗ' }, { value: 'e' }, { value: 'r' },
{ value: 't' } , { value: 'y' }, { value: 'u' }, { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'ŋ' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' } , { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }, { value: 'm' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'w' }, { value: 'ƴ' }, { value: 'c' }, { value: 'ɓ' },
{ value: 'b' }, { value: 'n' }, { value: "'", keyCode: 39 },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
};

View file

@ -0,0 +1,92 @@
Keyboards['fr-CA'] = {
label: 'French (Canadian)',
shortLabel: 'Fr',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'fr',
autoCorrectPunctuation: false,
menuLabel: 'Français (Canadien)',
lang: 'fr-CA',
alt: {
a: 'áàâäåãāæ',
c: 'çćč',
e: 'éèêëēę€ɛ',
i: 'ïíìîīį',
o: 'öõóòôōœøɵ',
u: 'üúùûū',
s: 'ßśš$',
S: 'ŚŠ$',
n: 'ñń',
l: 'ł£',
y: 'ÿ¥',
z: 'žźż',
'.': ',?!;:…'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' }, { value: 'r' },
{ value: 't' }, { value: 'y' }, { value: 'u' }, { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
pages: [undefined, {
alt: {
'1': ['¹', '1st'],
'2': ['²', '2nd'],
'3': ['³', '3rd'],
'4': ['⁴', '4th'],
'5': ['⁵', '5th'],
'6': ['⁶', '6th'],
'7': ['⁷', '7th'],
'8': ['⁸', '8th'],
'9': ['⁹', '9th'],
'0': ['⁰', 'º'],
'$': [ '€', '£', '¢', '¥'],
'"': ['“', '”'],
'\'':['‘', '’'],
'?': ['¿'],
'!': ['¡'],
'+': ['-', '×', '÷', '±']
},
keys: [
[
{ value: '1' }, { value: '2' }, { value: '3' }, { value: '4' },
{ value: '5' }, { value: '6' }, { value: '7' }, { value: '8' },
{ value: '9' }, { value: '0' }
], [
{ value: '@' }, { value: '#' },
{ value: '$', className: 'alternate-indicator' }, { value: '&' },
{ value: '*' }, { value: '-' }, { value: '_' }, { value: '/' },
{ value: '(' }, { value: ')' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '+',
supportsSwitching: {
value: ','
}
}, { value: ':' }, { value: ';' }, { value: '"' },
{ value: '\'' }, { value: '!' }, { value: '?' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,40 @@
Keyboards['fr-CH'] = {
label: 'French (Switzerland)',
shortLabel: 'Fr',
menuLabel: 'Français (Suisse)',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'fr',
autoCorrectPunctuation: false,
lang: 'fr',
alt: {
a: 'àâæáãäåā',
c: 'çćč',
e: 'éèêë€ē',
i: 'îïìíī',
o: 'ôœöòóõōø',
u: 'ùûüúū',
s: 'ßśšş',
S: 'ŚŠŞ',
n: 'ñńň'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' }, { value: 'r' },
{ value: 't' } , { value: 'z' }, { value: 'u' } , { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' } , { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }, { value: "'", keyCode: 39 }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'y' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
};

View file

@ -0,0 +1,41 @@
Keyboards['fr-Dvorak-bepo'] = {
label: 'French - Bépo',
shortLabel: 'Fr',
menuLabel: 'Bépo',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'fr',
autoCorrectPunctuation: false,
lang: 'fr',
alt: {
a: 'àâæáãäåā',
c: 'çćč',
e: 'éèêë€ē',
i: 'îïìíī',
o: 'ôœòóõöōø',
u: 'ùûüúū',
s: 'śšşß',
S: 'ŚŠŞ',
n: 'ńñň',
'.': ',?!-;:…'
},
keys: [
[
{ value: 'b' }, { value: 'é' }, { value: 'p' }, { value: 'o' },
{ value: 'v' }, { value: 'd' }, { value: 'l' }, { value: 'j' },
{ value: 'z' }, { value: 'w' }
], [
{ value: 'a' }, { value: 'u' }, { value: 'i' }, { value: 'e' },
{ value: 'c' }, { value: 't' }, { value: 's' }, { value: 'r' },
{ value: 'n' }, { value: 'm' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'y' }, { value: 'x' }, { value: 'k' }, { value: 'q' },
{ value: 'g' }, { value: 'h' }, { value: 'f' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
};

View file

@ -0,0 +1,41 @@
Keyboards.fr = {
label: 'French',
shortLabel: 'Fr',
menuLabel: 'Français',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'fr',
autoCorrectPunctuation: false,
lang: 'fr',
alt: {
a: 'àâæáãäåā',
c: 'çćč',
e: 'éèêë€ē',
i: 'îïìíī',
o: 'ôœòóõöōø',
u: 'ùûüúū',
s: 'śšşß',
S: 'ŚŠŞ',
n: 'ńñň',
'.': ',?!-;:…'
},
keys: [
[
{ value: 'a' }, { value: 'z' }, { value: 'e' }, { value: 'r' },
{ value: 't' } , { value: 'y' }, { value: 'u' }, { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'q' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' } , { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }, { value: 'm' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'w' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: "'", keyCode: 39 },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
};

View file

@ -0,0 +1,42 @@
Keyboards.fy = {
label: 'Frisian',
shortLabel: 'Fy',
menuLabel: 'Frysk',
imEngine: 'latin',
autoCorrectLanguage: 'fy',
types: ['text', 'url', 'email', 'password'],
lang: 'fy',
pages: [ { // default page
alt: {
a: 'âäáàæãåā',
e: 'êéëèęėē€',
i: 'íïìîįīij',
o: 'ôóöòõœøō',
u: 'ûúüùū',
s: '$',
n: 'ñń',
l: '£',
y: 'ýij¥',
'.': ',?!;:…'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' }, { value: 'r' },
{ value: 't' }, { value: 'y' }, { value: 'u' }, { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
}]
};

View file

@ -0,0 +1,99 @@
Keyboards.ga = {
label: 'Irish',
shortLabel: 'Ga',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'ga',
menuLabel: 'Gaeilge',
lang: 'ga',
alt: {
a: 'áàâäåãāæ',
b: 'ḃ',
c: 'ċçćč',
d: 'ḋ',
e: 'éèêëēęɛ€',
f: 'ḟ',
g: 'ġ',
i: 'íìïîīį',
m: 'ṁ',
o: 'óòöôōœøɵ',
p: 'ṗ',
u: 'úùüûū',
s: 'ṡßśš$',
S: 'ṠŚŠ$',
t: 'ṫ',
n: 'ñń',
l: '£ł',
w: 'ŵ',
y: 'ŷÿ¥',
z: 'žźż',
'.': '-\',?!;:…'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' }, { value: 'r' },
{ value: 't' }, { value: 'y' }, { value: 'u' }, { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
pages: [undefined, {
alt: {
'0': ['º'],
'1': ['1ú'],
'2': ['2ú'],
'3': ['3ú'],
'4': ['4ú'],
'5': ['5ú'],
'6': ['6ú'],
'7': ['7ú'],
'8': ['8ú'],
'9': ['9ú'],
'€': ['£', '$', '¢', '¥'],
'"': ['“', '”'],
'\'':['‘', '’'],
'?': ['¿'],
'!': ['¡'],
'+': ['-', '×', '÷', '±']
},
keys: [
[
{ value: '1' }, { value: '2' }, { value: '3' }, { value: '4' },
{ value: '5' }, { value: '6' }, { value: '7' }, { value: '8' },
{ value: '9' }, { value: '0' }
], [
{ value: '@' }, { value: '#' },
{ value: '€', className: 'alternate-indicator' }, { value: '&' },
{ value: '*' }, { value: '-' }, { value: '_' }, { value: '/' },
{ value: '(' }, { value: ')' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '+',
supportsSwitching: {
value: ','
}
}, { value: ':' }, { value: ';' }, { value: '"' },
{ value: '\'' }, { value: '!' }, { value: '?' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,100 @@
Keyboards.gd = {
label: 'Scottish Gaelic',
shortLabel: 'Gd',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'gd',
lang: 'gd',
menuLabel: 'Gàidhlig',
alt: {
a: 'àáâäåãāæ',
b: 'ḃ',
c: 'ċçćč',
d: 'ḋ',
e: 'èéêëēęɛ€',
f: 'ḟ',
g: 'ġ',
i: 'ìíïîīį',
m: 'ṁ',
o: 'òóöôōœøɵ',
p: 'ṗ',
u: 'ùúüûū',
s: 'ṡßśš$',
S: 'ṠŚŠ$',
t: 'ṫ',
n: 'ñń',
l: '£ł',
w: 'ŵ',
y: 'ŷÿ¥',
z: 'žźż',
'.': '-\',?!;:…'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' }, { value: 'r' },
{ value: 't' }, { value: 'y' }, { value: 'u' }, { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
pages: [undefined, {
alt: {
'0': ['º'],
'1': ['1d'],
'2': ['2na'],
'3': ['3as'],
'4': ['4mh'],
'5': ['5mh'],
'6': ['6mh'],
'7': ['7mh'],
'8': ['8mh'],
'9': ['9mh'],
'&': ['⁊'],
'£': ['€', '$', '¢', '¥'],
'"': ['“', '”'],
'\'':['‘', '’'],
'?': ['¿'],
'!': ['¡'],
'+': ['-', '×', '÷', '±']
},
keys: [
[
{ value: '1' }, { value: '2' }, { value: '3' }, { value: '4' },
{ value: '5' }, { value: '6' }, { value: '7' }, { value: '8' },
{ value: '9' }, { value: '0' }
], [
{ value: '@' }, { value: '#' },
{ value: '£', className: 'alternate-indicator' }, { value: '&' },
{ value: '*' }, { value: '-' }, { value: '_' }, { value: '/' },
{ value: '(' }, { value: ')' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '+',
supportsSwitching: {
value: ','
}
}, { value: ':' }, { value: ';' }, { value: '"' },
{ value: '\'' }, { value: '!' }, { value: '?' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,117 @@
Keyboards.gl = {
label: ' Galician',
shortLabel: 'Gl',
menuLabel: 'Galego',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'gl',
lang: 'gl',
pages: [ { // default page
alt: {
a: 'áªàâäåãāæ',
c: 'ç',
e: 'é€èêëēęɛ',
i: 'íïìîīį',
o: 'óºöòôōœøɵ',
u: 'úüùûū',
s: '$ßš',
S: '$Š',
l: '£ l·l',
n: 'ń',
y: '¥',
'.': ',¿?¡!;:·'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' }, { value: 'r' },
{ value: 't' }, { value: 'y' }, { value: 'u' }, { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }, { value: 'ñ' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
}, { // symbol page 1
alt: {
'€': ['$', '£', '¢', '¥'],
'0': ['º'],
'1': ['1º', '1ª'],
'2': ['2º', '2ª'],
'3': ['3º', '3ª'],
'4': ['4º', '4ª'],
'5': ['5º', '5ª'],
'6': ['6º', '6ª'],
'7': ['7º', '7ª'],
'8': ['8º', '8ª'],
'9': ['9º', '9ª'],
'.': ['·'],
'"': ['“', '”'],
'\'':['‘', '’'],
},
keys: [
[
{ value: '1' }, { value: '2' }, { value: '3' }, { value: '4' },
{ value: '5' }, { value: '6' }, { value: '7' }, { value: '8' },
{ value: '9' }, { value: '0' }
], [
{ value: '-' }, { value: '/' }, { value: ':' }, { value: ';' },
{ value: '(' }, { value: ')' }, { value: '€', className: 'alternate-indicator' },
{ value: '&' }, { value: '@' }, { value: '%' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '*',
supportsSwitching: {
value: ','
}
},
{ value: '¿' }, { value: '?' }, { value: '¡' },
{ value: '!' }, { value: '"' }, { value: '\'' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
}, { // symbol page 2
alt: {
'+': ['-', '×', '÷', '±']
},
keys: [
[
{ value: '[' }, { value: ']' }, { value: '{' }, { value: '}' },
{ value: '#' }, { value: '%' }, { value: '^' }, { value: '+' },
{ value: '=' }, { value: '°' }
], [
{ value: '_' }, { value: '\\' }, { value: '|' }, { value: '~' },
{ value: '<' }, { value: '>' }, { value: '$' }, { value: '£' },
{ value: '¥' }, { value: '•' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 1
},
{value: '*' }, { value: '¿' }, { value: '?' },
{ value: '¡' }, { value: '!' },
{ value: '"' }, { value: '\'' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,100 @@
Keyboards.gv = {
label: 'Manx Gaelic',
shortLabel: 'Gv',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'gv',
lang: 'gv',
menuLabel: 'Gaelg',
alt: {
a: 'àáâäåãāæ',
b: 'ḃ',
c: 'ċçćč',
d: 'ḋ',
e: 'èéêëēęɛ€',
f: 'ḟ',
g: 'ġ',
i: 'ìíïîīį',
m: 'ṁ',
o: 'òóöôōœøɵ',
p: 'ṗ',
u: 'ùúüûū',
s: 'ṡßśš$',
S: 'ṠŚŠ$',
t: 'ṫ',
n: 'ñń',
l: '£ł',
w: 'ŵ',
y: 'ŷÿ¥',
z: 'žźż',
'.': '-\',?!;:…'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' }, { value: 'r' },
{ value: 't' }, { value: 'y' }, { value: 'u' }, { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
pages: [undefined, {
alt: {
'0': ['º'],
'1': ['1d'],
'2': ['2h'],
'3': ['3ss'],
'4': ['4oo'],
'5': ['5oo'],
'6': ['6oo'],
'7': ['7oo'],
'8': ['8oo'],
'9': ['9oo'],
'&': ['⁊'],
'£': ['€', '$', '¢', '¥'],
'"': ['“', '”'],
'\'':['‘', '’'],
'?': ['¿'],
'!': ['¡'],
'+': ['-', '×', '÷', '±']
},
keys: [
[
{ value: '1' }, { value: '2' }, { value: '3' }, { value: '4' },
{ value: '5' }, { value: '6' }, { value: '7' }, { value: '8' },
{ value: '9' }, { value: '0' }
], [
{ value: '@' }, { value: '#' },
{ value: '£', className: 'alternate-indicator' }, { value: '&' },
{ value: '*' }, { value: '-' }, { value: '_' }, { value: '/' },
{ value: '(' }, { value: ')' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '+',
supportsSwitching: {
value: ','
}
}, { value: ':' }, { value: ';' }, { value: '"' },
{ value: '\'' }, { value: '!' }, { value: '?' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,29 @@
Keyboards.he = {
label: 'Hebrew',
shortLabel: 'He',
types: ['text', 'url', 'email'],
menuLabel: 'עִבְרִית',
basicLayoutKey: 'אבג',
lang: 'he',
alt: {
// incomplete
},
keys: [
[
{ value: 'ק' }, { value: 'ר' }, { value: 'א' }, { value: 'ט' },
{ value: 'ו' }, { value: 'ן' }, { value: 'ם' }, { value: 'פ' },
{ value: '⌫', ratio: 2, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: 'ש' }, { value: 'ד' }, { value: 'ג' }, { value: 'כ' },
{ value: 'ע' }, { value: 'י' }, { value: 'ח' }, { value: 'ל' },
{ value: 'ך' }, { value: 'ף' }
], [
{ value: 'ז' }, { value: 'ס' }, { value: 'ב' }, { value: 'ה' },
{ value: 'נ' }, { value: 'מ' }, { value: 'צ' }, { value: 'ת' },
{ value: 'ץ' }, { value: '?' }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
};

View file

@ -0,0 +1,127 @@
Keyboards.hi = {
label: 'Hindi',
shortLabel: 'Hi',
imEngine: 'india',
menuLabel: 'हिन्दी',
secondLayout: true,
specificCssRule: true,
alternateLayoutKey: '?१२३',
basicLayoutKey: 'कखग',
types: ['text', 'url', 'email'],
width: 11,
lang: 'hi',
alt: {
'र': 'ॠऋ',
'म': 'ॐ',
'न': 'ङ',
'ल': 'ऌॡ',
'य': 'य़',
'ओ': 'ऒ',
'ए': 'ऍऎ',
'ळ': 'ऴ',
'ृ': 'ॄ'
},
upperCase: {
'ौ':'औ',
'ै':'ऐ',
'ा':'आ',
'ी':'ई',
'ू':'ऊ',
'ब':'भ',
'ह':'ः',
'ग':'घ',
'द':'ध',
'ज':'झ',
'ड':'ढ',
'ो':'ओ',
'े':'ए',
'्':'अ',
'ि':'इ',
'ु':'उ',
'प':'फ',
'र':'ऱ',
'क':'ख',
'त':'थ',
'च':'छ',
'ट':'ठ',
'ॉ':'ऑ',
'ं':'ँ',
'म':'ण',
'न':'ऩ',
'व':'ळ',
'ल':'श',
'स':'ष',
'य':'ृ',
'़':'ञ'
},
keys: [
[
{ value: 'ौ' }, { value: 'ै' }, { value: 'ा' }, { value: 'ी' },
{ value: 'ू' }, { value: 'ब' }, { value: 'ह' }, { value: 'ग' },
{ value: 'द' }, { value: 'ज' }, { value: 'ड' }
], [
{ value: 'ो' }, { value: 'े' }, { value: '्' }, { value: 'ि' },
{ value: 'ु' }, { value: 'प' }, { value: 'र' }, { value: 'क' },
{ value: 'त' }, { value: 'च' }, { value: 'ट' }
], [
{ value: '⇪', keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'ॉ' }, { value: 'ं' }, { value: 'म' }, { value: 'न' },
{ value: 'व' }, { value: 'ल' }, { value: 'स' }, { value: 'य' },
{ value: '़' }, { value: '⌫', keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 9, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
pages: [undefined, {
alt: {
'१': ['1'],
'२': ['2'],
'३': ['3'],
'४': ['4'],
'५': ['5'],
'६': ['6'],
'७': ['7'],
'८': ['8'],
'९': ['9'],
'०': ['0'],
'₹': ['$', '€', '£', '¢', '¥', '৳'],
'"': ['“', '”'],
'\'':['‘', '’'],
'?': ['¿'],
'!': ['¡'],
'+': ['-', '×', '÷', '±']
},
// These are based on the en layout, with top row modifed and $ localized.
keys: [
[
{ value: '१' }, { value: '२' }, { value: '३' }, { value: '४' },
{ value: '५' }, { value: '६' }, { value: '७' }, { value: '८' },
{ value: '९' }, { value: '०' }
], [
{ value: '@' }, { value: '#' },
{ value: '₹', className: 'alternate-indicator' }, { value: '&' },
{ value: '*' }, { value: '-' }, { value: '_' }, { value: '/' },
{ value: '(' }, { value: ')' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '+',
supportsSwitching: {
value: ','
}
}, { value: ':' }, { value: ';' }, { value: '"' },
{ value: '\'' }, { value: '!' }, { value: '?'},
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,39 @@
Keyboards.hr = {
label: 'Croatian',
shortLabel: 'Hr',
menuLabel: 'Hrvatski',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'hr',
lang: 'hr',
alt: {
c: 'čćç',
d: 'đ',
s: 'šśß$',
S: 'ŠŚ$',
n: 'ñń',
l: '£',
y: '¥',
z: 'žźż',
'.': ',?!;:'
},
keys: [ // qwertz
[
{ value: 'q' }, { value: 'w' }, { value: 'e' } , { value: 'r' },
{ value: 't' } , { value: 'z' }, { value: 'u' } , { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' } , { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }, { value: "'", keyCode: 39 }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'y' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
};

View file

@ -0,0 +1,83 @@
Keyboards.hu = {
label: 'Hungarian',
shortLabel: 'Hu',
menuLabel: 'Magyar',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'hu',
lang: 'hu',
alt: {
a: 'áàâäåãāæª',
c: 'çćč',
e: 'éèêëēę€ɛ',
i: 'íïìîīį',
o: 'óöőòôōœøɵ',
u: 'úüűùûū',
s: '$ßśš',
S: 'ŚŠŞ',
n: 'ñń',
l: '£ł',
y: '¥ÿ',
z: 'žźż',
'.': ',?!;:()/…'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' } , { value: 'r' },
{ value: 't' } , { value: 'z' }, { value: 'u' } , { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' } , { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }, { value: "'", keyCode: 39 }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'y' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
pages: [undefined, {
alt: {
'0': ['º'],
'$': [ '€', '£', '¢', '¥'],
'"': ['„', '“', '”'],
'\'':['‘', '’'],
'?': ['¿'],
'!': ['.', '¡'],
'+': ['-', '×', '÷', '±']
},
// These are based on the en layout.
keys: [
[
{ value: '1' }, { value: '2' }, { value: '3' }, { value: '4' },
{ value: '5' }, { value: '6' }, { value: '7' }, { value: '8' },
{ value: '9' }, { value: '0' }
], [
{ value: '@' }, { value: '#' },
{ value: '$', className: 'alternate-indicator' }, { value: '&' },
{ value: '*' }, { value: '-' }, { value: '_' }, { value: '/' },
{ value: '(' }, { value: ')' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '+',
supportsSwitching: {
value: ','
}
}, { value: ':' }, { value: ';' }, { value: '"' },
{ value: '\'' }, { value: '!' }, { value: '?' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,36 @@
Keyboards.ig = {
label: 'Igbo',
shortLabel: 'Ig',
menuLabel: 'Asụsụ Igbo',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
lang: 'ig',
pages: [ { // default page
alt: {
i: 'ị',
n: 'ṅ',
o: 'ọ',
u: 'ụ',
'.': ',?!;:…'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' }, { value: 'r' },
{ value: 't' }, { value: 'y' }, { value: 'u' }, { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,92 @@
Keyboards.it = {
label: 'Italian',
shortLabel: 'It',
menuLabel: 'Italiano',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'it',
lang: 'it',
alt: {
a: 'à@',
c: 'ç',
e: 'èéê€',
i: 'ì',
o: 'òó',
u: 'ù',
s: '$',
l: '£',
y: '¥',
'.': ',;:\'?!…',
"'": '"«»',
'-': '—_'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' } , { value: 'r' },
{ value: 't' }, { value: 'y' }, { value: 'u' } , { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
pages: [undefined, {
alt: {
'0': ['º'],
'1': ['1°', '1ª'],
'2': ['2°', '2ª'],
'3': ['3°', '3ª'],
'4': ['4°', '4ª'],
'5': ['5°', '5ª'],
'6': ['6°', '6ª'],
'7': ['7°', '7ª'],
'8': ['8°', '8ª'],
'9': ['9°', '9ª'],
'€': [ '$', '£', '¢', '¥'],
'"': ['“', '”'],
'\'':['‘', '’'],
'?': ['¿'],
'!': ['¡'],
'+': ['-', '×', '÷', '±'],
'.': '·'
},
// These are based on the en layout with $ localized.
keys: [
[
{ value: '1' }, { value: '2' }, { value: '3' }, { value: '4' },
{ value: '5' }, { value: '6' }, { value: '7' }, { value: '8' },
{ value: '9' }, { value: '0' }
], [
{ value: '@' }, { value: '#' },
{ value: '€', className: 'alternate-indicator' }, { value: '&' },
{ value: '*' }, { value: '-' }, { value: '_' }, { value: '/' },
{ value: '(' }, { value: ')' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '+',
supportsSwitching: {
value: ','
}
}, { value: ':' }, { value: ';' }, { value: '"' },
{ value: '\'' }, { value: '!' }, { value: '?' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,38 @@
Keyboards.ko = {
label: 'Korean',
shortLabel: 'Ko',
secondLayout: true,
basicLayoutKey: 'ㄱㄴㄷ',
imEngine: 'jshangul',
types: ['text', 'url', 'email'],
menuLabel: '한국어',
lang: 'ko',
upperCase: {
'ㅂ': 'ㅃ',
'ㅈ': 'ㅉ',
'ㄷ': 'ㄸ',
'ㄱ': 'ㄲ',
'ㅅ': 'ㅆ',
'ㅐ': 'ㅒ',
'ㅔ': 'ㅖ'
},
keys: [
[
{ value: 'ㅂ' } , { value: 'ㅈ' } , { value: 'ㄷ' } , { value: 'ㄱ' } ,
{ value: 'ㅅ' } , { value: 'ㅛ' } , { value: 'ㅕ' } , { value: 'ㅑ' } ,
{ value: 'ㅐ' } , { value: 'ㅔ' }
], [
{ value: 'ㅁ' } , { value: 'ㄴ' } , { value: 'ㅇ' } , { value: 'ㄹ' } ,
{ value: 'ㅎ' } , { value: 'ㅗ' } , { value: 'ㅓ' } , { value: 'ㅏ' } ,
{ value: 'ㅣ' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'ㅋ' } , { value: 'ㅌ' } , { value: 'ㅊ' } , { value: 'ㅍ' } ,
{ value: 'ㅠ' } , { value: 'ㅜ' } , { value: 'ㅡ' } ,
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
};

View file

@ -0,0 +1,80 @@
Keyboards.lt = {
label: 'Lithuanian',
shortLabel: 'Lt',
menuLabel: 'Lietuvių',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'lt',
lang: 'lt',
alt: {
a: 'ą',
c: 'č',
e: 'ęė€',
i: 'į',
u: 'ųū',
s: 'š$',
l: '£',
y: '¥',
z: 'ž',
'.': ',–?!;:„“…'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' } , { value: 'r' },
{ value: 't' } , { value: 'y' }, { value: 'u' } , { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' } , { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
],
pages: [undefined, {
alt: {
'-': '–',
'$': [ '€', '£', '¢', '¥'],
'"': ['„', '“', '”'],
'\'':['‘', '’'],
'?': ['¿'],
'!': ['¡'],
'+': ['-', '×', '÷', '±']
},
// These are based on the en layout.
keys: [
[
{ value: '1' }, { value: '2' }, { value: '3' }, { value: '4' },
{ value: '5' }, { value: '6' }, { value: '7' }, { value: '8' },
{ value: '9' }, { value: '0' }
], [
{ value: '@' }, { value: '#' },
{ value: '$', className: 'alternate-indicator' }, { value: '&' },
{ value: '*' }, { value: '-' }, { value: '_' }, { value: '/' },
{ value: '(' }, { value: ')' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '+',
supportsSwitching: {
value: ','
}
}, { value: ':' }, { value: ';' }, { value: '"' },
{ value: '\'' }, { value: '!' }, { value: '?' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,106 @@
Keyboards.lv = {
label: 'Latvian',
shortLabel: 'Lv',
menuLabel: 'Latviešu',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
autoCorrectLanguage: 'lv',
lang: 'lv',
pages: [ { // default page
alt: {
a: 'ā',
c: 'č',
e: 'ē',
g: 'ģ',
i: 'ī',
k: 'ķ',
l: 'ļ',
n: 'ņ',
s: 'š',
u: 'ū',
z: 'ž',
'.': ',?!;:…'
},
keys: [
[
{ value: 'q' }, { value: 'w' }, { value: 'e' }, { value: 'r' },
{ value: 't' }, { value: 'y' }, { value: 'u' }, { value: 'i' },
{ value: 'o' }, { value: 'p' }
], [
{ value: 'a' }, { value: 's' }, { value: 'd' }, { value: 'f' },
{ value: 'g' }, { value: 'h' }, { value: 'j' }, { value: 'k' },
{ value: 'l' }
], [
{ value: '⇪', ratio: 1.5, keyCode: KeyEvent.DOM_VK_CAPS_LOCK },
{ value: 'z' }, { value: 'x' }, { value: 'c' }, { value: 'v' },
{ value: 'b' }, { value: 'n' }, { value: 'm' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
}, { // symbol page 1
alt: {
'€': [ '$', '£', '¢', '¥'],
'-': '–',
'"': ['„', '“', '”'],
'\'':['‘', '’']
},
keys: [
[
{ value: '1' }, { value: '2' }, { value: '3' }, { value: '4' },
{ value: '5' }, { value: '6' }, { value: '7' }, { value: '8' },
{ value: '9' }, { value: '0' }
], [
{ value: '-' }, { value: '/' }, { value: ':' }, { value: ';' },
{ value: '(' }, { value: ')' }, { value: '€', className: 'alternate-indicator' },
{ value: '&' }, { value: '@' }, { value: '%' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 2
},
{ value: '*',
supportsSwitching: {
value: ','
}
},
{ value: ':' }, { value: ';' }, { value: '"' },
{ value: '\'' }, { value: '!' }, { value: '?' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
}, { // symbol page 2
alt: {
'+': ['-', '×', '÷', '±']
},
keys: [
[
{ value: '[' }, { value: ']' }, { value: '{' }, { value: '}' },
{ value: '#' }, { value: '%' }, { value: '^' }, { value: '+' },
{ value: '=' }, { value: '°' }
], [
{ value: '_' }, { value: '\\' }, { value: '|' }, { value: '~' },
{ value: '<' }, { value: '>' }, { value: '$' }, { value: '£' },
{ value: '¥' }, { value: '•' }
], [
{ value: 'Alt', ratio: 1.5,
keyCode: KeyboardEvent.DOM_VK_ALT,
className: 'page-switch-key',
targetPage: 1
},
{ value: '*' }, { value: ':' }, { value: '"' },
{ value: '\'' }, { value: '!' }, { value: '?' },
{ value: '⌫', ratio: 1.5, keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 8, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
} ]
};

View file

@ -0,0 +1,33 @@
Keyboards.mk = {
label: 'Macedonian',
shortLabel: 'Mk',
menuLabel: 'Македонски',
imEngine: 'latin',
types: ['text', 'url', 'email', 'password'],
basicLayoutKey: 'АБВ',
lang: 'mk',
alt: {
'е': 'ѐ',
'и': 'ѝ'
},
width: 11,
keys: [
[
{ value: 'љ' }, { value: 'њ' }, { value: 'е' }, { value: 'р' },
{ value: 'т' }, { value: 'ѕ' }, { value: 'у' }, { value: 'и' },
{ value: 'о' }, { value: 'п' }, { value: 'ш' }
], [
{ value: 'а' }, { value: 'с' }, { value: 'д' }, { value: 'ф' },
{ value: 'г' }, { value: 'х' }, { value: 'ј' }, { value: 'к' },
{ value: 'л' }, { value: 'ч' }, { value: 'ќ' }
], [
{ value: '⇪', keyCode: KeyEvent.DOM_VK_CAPS_LOCK }, { value: 'з' },
{ value: 'џ' }, { value: 'ц' }, { value: 'в' }, { value: 'б' },
{ value: 'н' }, { value: 'м' }, { value: 'ѓ' }, { value: 'ж' },
{ value: '⌫', keyCode: KeyEvent.DOM_VK_BACK_SPACE }
], [
{ value: '&nbsp', ratio: 9, keyCode: KeyboardEvent.DOM_VK_SPACE },
{ value: '↵', ratio: 2, keyCode: KeyEvent.DOM_VK_RETURN }
]
]
};

Some files were not shown because too many files have changed in this diff Show more