mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-20 04:47:42 +00:00
Merge pull request #661 from keymanapp/web-530-testing-cleanup
Testing section cleanup
This commit is contained in:
commit
5cd58405de
46 changed files with 512 additions and 1853 deletions
|
|
@ -1,111 +0,0 @@
|
|||
// JavaScript Document samplehdr.js: Keyboard management for KeymanWeb demonstration pages
|
||||
|
||||
/*
|
||||
The keyboard name and/or BCP-47 code must be specified for each keyboard that is to be available.
|
||||
If the same keyboard is used for several languages, it must be listed for each
|
||||
language, but the keyboard itself will only be loaded once.
|
||||
If two (or more) keyboards are to be available for a given language, both must be listed.
|
||||
Any number of keyboards may be specified in one or more calls.
|
||||
Keyboard paths may be absolute (with respect to the server root) or relative to the keyboards option path.
|
||||
The actual keyboard object will be downloaded asynchronously when first selected for use.
|
||||
|
||||
Each argument to addKeyboards() is a string, for example:
|
||||
european2 loads the current version of the Eurolatin 2 keyboard (for its default language)
|
||||
european2@fr loads the current version of the Eurolatin 2 keyboard for French
|
||||
european2@fr@1.2 loads version 1.2 of the Eurolatin 2 keyboard for French
|
||||
|
||||
Argument syntax also supports the following extensions:
|
||||
@fr load the current version of the default keyboard for French
|
||||
@fr$ load all available keyboards (current version) for French
|
||||
|
||||
Each call to addKeyboards() requires a single call to the remote server,
|
||||
(unless all keyboards listed are local and fully specified) so it is better
|
||||
to use multiple arguments rather than separate function calls.
|
||||
|
||||
Calling addKeyboards() with no arguments returns a list of *all* available keyboards.
|
||||
The Toolbar (desktop browser) UI is best suited for allowing users to select
|
||||
the appropriate language and keyboard in this case.
|
||||
|
||||
Keyboards may also be specified by language name using addKeyboardsForLanguage()
|
||||
for example:
|
||||
keymanweb.addKeyboardsForLanguage('Burmese');
|
||||
|
||||
Appending $ to the language name will again cause all available keyboards for that
|
||||
language to be loaded rather than the default keyboard.
|
||||
|
||||
The first call to addKeyboardsForLanguage() makes an additional call to the
|
||||
keyman API to load the current list of keyboard/language associations.
|
||||
|
||||
In this example, the following function loads the indicated keyboards,
|
||||
and is called when the page loads.
|
||||
*/
|
||||
|
||||
function loadKeyboards()
|
||||
{
|
||||
var kmw=tavultesoft.keymanweb;
|
||||
|
||||
// The first keyboard added will be the default keyboard for touch devices.
|
||||
// For faster loading, it may be best for the default keyboard to be
|
||||
// locally sourced.
|
||||
kmw.addKeyboards({id:'us',name:'English',language:{id:'en',name:'English'},
|
||||
filename:'../us-1.0.js'});
|
||||
|
||||
// Add more keyboards to the language menu, by keyboard name,
|
||||
// keyboard name and language code, or just the BCP-47 language code.
|
||||
kmw.addKeyboards('french','european2@sv','european2@sv','european2@sv','european2@sv','european2@sv','european2@sv','european2@no','@he');
|
||||
kmw.addKeyboards('@he');
|
||||
kmw.addKeyboards('@he');
|
||||
|
||||
// Add a keyboard by language name. Note that the name must be spelled
|
||||
// correctly, or the keyboard will not be found. (Using BCP-47 codes is
|
||||
// usually easier.)
|
||||
kmw.addKeyboardsForLanguage('Dzongkha');
|
||||
|
||||
// Add a fully-specified, locally-sourced, keyboard with custom font
|
||||
kmw.addKeyboards({id:'lao_2008_basic',name:'Lao Basic',
|
||||
language:{
|
||||
id:'lo',name:'Lao',region:'Asia',
|
||||
font:{family:'LaoWeb',source:['../font/saysettha_web.ttf','../font/saysettha_web.woff','../font/saysettha_web.eot']}
|
||||
},
|
||||
filename:'../lao_2008_basic.js'
|
||||
});
|
||||
|
||||
// The following two optional calls should be delayed until language menus are fully loaded:
|
||||
// (a) a specific mapped input element input is focused, to ensure that the OSK appears
|
||||
// (b) a specific keyboard is loaded, rather than the keyboard last used.
|
||||
//window.setTimeout(function(){kmw.setActiveElement('ta1',true);},2500);
|
||||
//window.setTimeout(function(){kmw.setActiveKeyboard('Keyboard_french','fr');},3000);
|
||||
|
||||
// Note that locally specified keyboards will be listed before keyboards
|
||||
// requested from the remote server by user interfaces that do not order
|
||||
// keyboards alphabetically by language.
|
||||
}
|
||||
|
||||
// Script to allow a user to add any keyboard to the keyboard menu
|
||||
function addKeyboard(n)
|
||||
{
|
||||
var sKbd,kmw=tavultesoft.keymanweb;
|
||||
switch(n)
|
||||
{
|
||||
case 1:
|
||||
sKbd=document.getElementById('kbd_id1').value;
|
||||
kmw.addKeyboards(sKbd);
|
||||
break;
|
||||
case 2:
|
||||
sKbd=document.getElementById('kbd_id2').value.toLowerCase();
|
||||
kmw.addKeyboards('@'+sKbd);
|
||||
break;
|
||||
case 3:
|
||||
sKbd=document.getElementById('kbd_id3').value;
|
||||
kmw.addKeyboardsForLanguage(sKbd);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Add keyboard on Enter (as well as pressing button)
|
||||
function clickOnEnter(e,id)
|
||||
{
|
||||
e = e || window.event;
|
||||
if(e.keyCode == 13) addKeyboard(id);
|
||||
}
|
||||
|
||||
|
|
@ -62,8 +62,10 @@
|
|||
// Add a fully-specified, locally-sourced, keyboard with custom font
|
||||
kmw.addKeyboards({id:'lao_2008_basic',name:'Lao Basic',
|
||||
languages:{
|
||||
id:'lo',name:'Lao',region:'Asia',
|
||||
font:{family:'LaoWeb',source:['../font/saysettha_web.ttf','../font/saysettha_web.woff','../font/saysettha_web.eot']}
|
||||
id:'lo',name:'Lao',region:'Asia',
|
||||
// A font can be specified here if its files are available.
|
||||
// Example:
|
||||
//font:{family:'LaoWeb',source:['../font/saysettha_web.ttf','../font/saysettha_web.woff','../font/saysettha_web.eot']}
|
||||
},
|
||||
filename:'./lao_2008_basic.js'
|
||||
});
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
</style>
|
||||
|
||||
<!-- Insert unminified KeymanWeb source scripts -->
|
||||
<script src="../intermediate/keymanweb.js" type="application/javascript"></script>
|
||||
<script src="../release/unminified/web/keymanweb.js" type="application/javascript"></script>
|
||||
|
||||
<!--
|
||||
For desktop browsers, a script for the user interface must be inserted here.
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
The toolbar UI is best for any page designed to support keyboards for
|
||||
a large number of languages.
|
||||
-->
|
||||
<script src="../intermediate/kmwuitoggle.js"></script>
|
||||
<script src="../release/unminified/web/kmwuitoggle.js"></script>
|
||||
|
||||
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
</style>
|
||||
|
||||
<!-- Insert uncompiled KeymanWeb source scripts -->
|
||||
<script src="../../intermediate/keymanweb.js" type="application/javascript"></script>
|
||||
<script src="../../release/unminified/web/keymanweb.js" type="application/javascript"></script>
|
||||
|
||||
<!--
|
||||
For desktop browsers, a script for the user interface must be inserted here.
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
The toolbar UI is best for any page designed to support keyboards for
|
||||
a large number of languages.
|
||||
-->
|
||||
<script src="../../intermediate/kmwuitoggle.js"></script>
|
||||
<script src="../../release/unminified/web/kmwuitoggle.js"></script>
|
||||
|
||||
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
|
||||
<script>
|
||||
|
|
@ -58,6 +58,7 @@
|
|||
</script>
|
||||
|
||||
<!-- Add keyboard management script for local selection of keyboards to use -->
|
||||
<script src="../commonHeader.js"></script>
|
||||
<script src="./utilities.js"></script>
|
||||
|
||||
<script>
|
||||
|
|
@ -66,7 +67,7 @@
|
|||
</head>
|
||||
|
||||
<!-- Sample page HTML -->
|
||||
<body onload='loadKeyboards();'>
|
||||
<body onload='loadKeyboards(1);'>
|
||||
<h2>KeymanWeb Sample Page - Attachment API Testing</h2>
|
||||
<p>This page is designed to stress-test the new attachment/enablement API model and its functions.</p>
|
||||
<p id="modeSelect">You are currently testing under the <em id="mode"> </em> attachment mode. Two other modes are available:
|
||||
|
|
|
|||
|
|
@ -1,226 +1,197 @@
|
|||
function loadKeyboards()
|
||||
{
|
||||
var kmw=keyman;
|
||||
|
||||
// The first keyboard added will be the default keyboard for touch devices.
|
||||
// For faster loading, it may be best for the default keyboard to be
|
||||
// locally sourced.
|
||||
kmw.addKeyboards({id:'us',name:'English',languages:{id:'en',name:'English'},
|
||||
filename:'../us-1.0.js'});
|
||||
|
||||
// Add more keyboards to the language menu, by keyboard name,
|
||||
// keyboard name and language code, or just the BCP-47 language code.
|
||||
kmw.addKeyboards('french','european2@sv','european2@no','@he');
|
||||
|
||||
// Add a keyboard by language name. Note that the name must be spelled
|
||||
// correctly, or the keyboard will not be found. (Using BCP-47 codes is
|
||||
// usually easier.)
|
||||
kmw.addKeyboardsForLanguage('Dzongkha');
|
||||
|
||||
// Add a fully-specified, locally-sourced, keyboard with custom font
|
||||
kmw.addKeyboards({id:'lao_2008_basic',name:'Lao Basic',
|
||||
languages:{
|
||||
id:'lo',name:'Lao',region:'Asia',
|
||||
font:{family:'LaoWeb',source:['../font/saysettha_web.ttf','../font/saysettha_web.woff','../font/saysettha_web.eot']}
|
||||
},
|
||||
filename:'../lao_2008_basic.js'
|
||||
});
|
||||
// Page-global variable definitions.
|
||||
{
|
||||
var inputCounter = 0;
|
||||
}
|
||||
|
||||
// Page-global variable definitions.
|
||||
{
|
||||
var inputCounter = 0;
|
||||
}
|
||||
|
||||
function generateDiagnosticDiv(elem) {
|
||||
var div = document.createElement("div");
|
||||
div.style.border = "1px solid black";
|
||||
div.style.borderRadius = "5px";
|
||||
//div.style.mozBorder
|
||||
div.style.paddingTop = "5px";
|
||||
div.style.paddingLeft = "5px";
|
||||
div.style.paddingRight = "5px";
|
||||
div.style.paddingBottom = "5px";
|
||||
div.appendChild(elem);
|
||||
div.appendChild(document.createElement("p"));
|
||||
|
||||
var elemId = elem.id;
|
||||
|
||||
// Attachment button
|
||||
var attachBtn = document.createElement("input");
|
||||
attachBtn.type = 'button';
|
||||
attachBtn.id = 'attach_' + elemId;
|
||||
attachBtn.onclick = function() {
|
||||
kmw.attachToControl(document.getElementById(elemId));
|
||||
var attached = kmw.isAttached(elem);
|
||||
document.getElementById('attachment_' + elemId).textContent = " Currently " + (attached ? "attached." : "detached.");
|
||||
if(elem.tagName.toLowerCase() != "iframe") {
|
||||
document.getElementById("independence_" + elemId).textContent = attached ? " Using globally-selected keyboard." : '';
|
||||
}
|
||||
};
|
||||
attachBtn.value = 'Attach';
|
||||
div.appendChild(attachBtn);
|
||||
|
||||
// Detachment button
|
||||
var detachBtn = document.createElement("input");
|
||||
detachBtn.type = 'button';
|
||||
detachBtn.id = 'detach_' + elemId;
|
||||
detachBtn.onclick = function() {
|
||||
kmw.detachFromControl(document.getElementById(elemId));
|
||||
var attached = kmw.isAttached(elem);
|
||||
document.getElementById('attachment_' + elemId).textContent = " Currently " + (attached ? "attached." : "detached.");
|
||||
if(!attached) {
|
||||
document.getElementById('independence_' + elemId).textContent = "";
|
||||
}
|
||||
};
|
||||
detachBtn.value = 'Detach';
|
||||
div.appendChild(detachBtn);
|
||||
|
||||
// We need some extra space to properly detect iframe attachment.
|
||||
var attachTimer = elem.tagName.toLowerCase() == "iframe" ? 50 : 1;
|
||||
|
||||
var attachLabel = document.createElement("a");
|
||||
attachLabel.id = 'attachment_' + elemId;
|
||||
window.setTimeout(function() {
|
||||
attachLabel.textContent = " Currently " + (kmw.isAttached(elem) ? "attached." : "detached.");
|
||||
}, attachTimer);
|
||||
div.appendChild(attachLabel);
|
||||
|
||||
div.appendChild(document.createElement("p"));
|
||||
|
||||
// Enablement button
|
||||
var enableBtn = document.createElement("input");
|
||||
enableBtn.type = 'button';
|
||||
enableBtn.id = 'enable_' + elemId;
|
||||
enableBtn.onclick = function() {
|
||||
kmw.enableControl(document.getElementById(elemId));
|
||||
};
|
||||
enableBtn.value = 'Enable';
|
||||
div.appendChild(enableBtn);
|
||||
|
||||
// Disablement button
|
||||
var disableBtn = document.createElement("input");
|
||||
disableBtn.type = 'button';
|
||||
disableBtn.id = 'disable_' + elemId;
|
||||
disableBtn.onclick = function() {
|
||||
kmw.disableControl(document.getElementById(elemId));
|
||||
};
|
||||
disableBtn.value = 'Disable';
|
||||
div.appendChild(disableBtn);
|
||||
|
||||
var enabledLabel = document.createElement("a");
|
||||
enabledLabel.id = 'enablement_' + elemId;
|
||||
enabledLabel.textContent = " Currently enabled.";
|
||||
|
||||
// We must rely on MutationObservers to stay current about enablement.
|
||||
var observationTarget = elem;
|
||||
var observationConfig = {attributes: true, attributeFilter: ['class']};
|
||||
|
||||
var enablementObserver = new MutationObserver(function(mutations) {
|
||||
var isDisabled = mutations[0].target.className.indexOf('kmw-disabled') >= 0;
|
||||
enabledLabel.textContent = (isDisabled ? " Currently disabled." : " Currently enabled.");
|
||||
});
|
||||
enablementObserver.observe(observationTarget, observationConfig);
|
||||
|
||||
div.appendChild(enabledLabel);
|
||||
div.appendChild(document.createElement("p"));
|
||||
|
||||
if(elem.tagName.toLowerCase() != "iframe") {
|
||||
// Set Keyboard button
|
||||
var setBtn = document.createElement("input");
|
||||
setBtn.type = 'button';
|
||||
setBtn.id = 'set_' + elemId;
|
||||
setBtn.onclick = function() {
|
||||
kmw.setKeyboardForControl(document.getElementById(elemId), 'dzongkha', 'dzo');
|
||||
|
||||
if(kmw.isAttached(elem)) {
|
||||
kbdLabel.textContent = " Using independently-tracked keyboard.";
|
||||
}
|
||||
};
|
||||
setBtn.value = 'Set to Dzongkha';
|
||||
div.appendChild(setBtn);
|
||||
|
||||
// Clear Keyboard button
|
||||
var clearBtn = document.createElement("input");
|
||||
clearBtn.type = 'button';
|
||||
clearBtn.id = 'clear_' + elemId;
|
||||
clearBtn.onclick = function() {
|
||||
kmw.setKeyboardForControl(document.getElementById(elemId), null, null);
|
||||
|
||||
if(kmw.isAttached(elem)) {
|
||||
kbdLabel.textContent = " Using globally-selected keyboard.";
|
||||
}
|
||||
};
|
||||
clearBtn.value = 'Clear Keyboard';
|
||||
div.appendChild(clearBtn);
|
||||
|
||||
var kbdLabel = document.createElement("a");
|
||||
kbdLabel.id = 'independence_' + elemId;
|
||||
window.setTimeout(function () {
|
||||
if(kmw.isAttached(elem)) {
|
||||
var attached = kmw.isAttached(elem);
|
||||
kbdLabel.textContent = attached ? " Using globally-selected keyboard." : '';
|
||||
}
|
||||
}, 1);
|
||||
div.appendChild(kbdLabel);
|
||||
|
||||
function generateDiagnosticDiv(elem) {
|
||||
var div = document.createElement("div");
|
||||
div.style.border = "1px solid black";
|
||||
div.style.borderRadius = "5px";
|
||||
//div.style.mozBorder
|
||||
div.style.paddingTop = "5px";
|
||||
div.style.paddingLeft = "5px";
|
||||
div.style.paddingRight = "5px";
|
||||
div.style.paddingBottom = "5px";
|
||||
div.appendChild(elem);
|
||||
div.appendChild(document.createElement("p"));
|
||||
|
||||
var elemId = elem.id;
|
||||
|
||||
// Attachment button
|
||||
var attachBtn = document.createElement("input");
|
||||
attachBtn.type = 'button';
|
||||
attachBtn.id = 'attach_' + elemId;
|
||||
attachBtn.onclick = function() {
|
||||
kmw.attachToControl(document.getElementById(elemId));
|
||||
var attached = kmw.isAttached(elem);
|
||||
document.getElementById('attachment_' + elemId).textContent = " Currently " + (attached ? "attached." : "detached.");
|
||||
if(elem.tagName.toLowerCase() != "iframe") {
|
||||
document.getElementById("independence_" + elemId).textContent = attached ? " Using globally-selected keyboard." : '';
|
||||
}
|
||||
|
||||
return div;
|
||||
}
|
||||
|
||||
function addInput() {
|
||||
var masterDiv = document.getElementById('DynamicInputs');
|
||||
var newInput = document.createElement("input");
|
||||
var i = inputCounter++;
|
||||
|
||||
newInput.id = 'input' + i;
|
||||
newInput.className = 'test';
|
||||
newInput.placeholder = "Dynamic area #" + i + "!";
|
||||
|
||||
var newDiv = generateDiagnosticDiv(newInput);
|
||||
|
||||
masterDiv.appendChild(newDiv);
|
||||
}
|
||||
|
||||
function addText() {
|
||||
var masterDiv = document.getElementById('DynamicTextareas');
|
||||
var newTextArea = document.createElement("textarea");
|
||||
var i = inputCounter++;
|
||||
|
||||
newTextArea.id = 'textarea' + i;
|
||||
newTextArea.className = 'test';
|
||||
newTextArea.placeholder = "Dynamic area #" + i + "!";
|
||||
|
||||
var newDiv = generateDiagnosticDiv(newTextArea);
|
||||
|
||||
masterDiv.appendChild(newDiv);
|
||||
}
|
||||
|
||||
function addIFrame() {
|
||||
var masterDiv = document.getElementById('DynamicIFrames');
|
||||
var frame = document.createElement("iframe");
|
||||
var i = inputCounter++;
|
||||
|
||||
frame.height = "100";
|
||||
frame.src = "iframe.html";
|
||||
frame.id = 'iframe' + i;
|
||||
|
||||
var newDiv = generateDiagnosticDiv(frame);
|
||||
masterDiv.appendChild(newDiv);
|
||||
}
|
||||
|
||||
function addEditable() {
|
||||
var masterDiv = document.getElementById('DynamicEditables');
|
||||
var editable = document.createElement("div");
|
||||
var i = inputCounter++;
|
||||
|
||||
editable.contentEditable = true;
|
||||
editable.textContent = "Edit me!";
|
||||
editable.id = 'editable' + i;
|
||||
editable.style.width="500px";
|
||||
|
||||
var newDiv = generateDiagnosticDiv(editable);
|
||||
|
||||
masterDiv.appendChild(newDiv);
|
||||
};
|
||||
attachBtn.value = 'Attach';
|
||||
div.appendChild(attachBtn);
|
||||
|
||||
// Detachment button
|
||||
var detachBtn = document.createElement("input");
|
||||
detachBtn.type = 'button';
|
||||
detachBtn.id = 'detach_' + elemId;
|
||||
detachBtn.onclick = function() {
|
||||
kmw.detachFromControl(document.getElementById(elemId));
|
||||
var attached = kmw.isAttached(elem);
|
||||
document.getElementById('attachment_' + elemId).textContent = " Currently " + (attached ? "attached." : "detached.");
|
||||
if(!attached) {
|
||||
document.getElementById('independence_' + elemId).textContent = "";
|
||||
}
|
||||
};
|
||||
detachBtn.value = 'Detach';
|
||||
div.appendChild(detachBtn);
|
||||
|
||||
// We need some extra space to properly detect iframe attachment.
|
||||
var attachTimer = elem.tagName.toLowerCase() == "iframe" ? 50 : 1;
|
||||
|
||||
var attachLabel = document.createElement("a");
|
||||
attachLabel.id = 'attachment_' + elemId;
|
||||
window.setTimeout(function() {
|
||||
attachLabel.textContent = " Currently " + (kmw.isAttached(elem) ? "attached." : "detached.");
|
||||
}, attachTimer);
|
||||
div.appendChild(attachLabel);
|
||||
|
||||
div.appendChild(document.createElement("p"));
|
||||
|
||||
// Enablement button
|
||||
var enableBtn = document.createElement("input");
|
||||
enableBtn.type = 'button';
|
||||
enableBtn.id = 'enable_' + elemId;
|
||||
enableBtn.onclick = function() {
|
||||
kmw.enableControl(document.getElementById(elemId));
|
||||
};
|
||||
enableBtn.value = 'Enable';
|
||||
div.appendChild(enableBtn);
|
||||
|
||||
// Disablement button
|
||||
var disableBtn = document.createElement("input");
|
||||
disableBtn.type = 'button';
|
||||
disableBtn.id = 'disable_' + elemId;
|
||||
disableBtn.onclick = function() {
|
||||
kmw.disableControl(document.getElementById(elemId));
|
||||
};
|
||||
disableBtn.value = 'Disable';
|
||||
div.appendChild(disableBtn);
|
||||
|
||||
var enabledLabel = document.createElement("a");
|
||||
enabledLabel.id = 'enablement_' + elemId;
|
||||
enabledLabel.textContent = " Currently enabled.";
|
||||
|
||||
// We must rely on MutationObservers to stay current about enablement.
|
||||
var observationTarget = elem;
|
||||
var observationConfig = {attributes: true, attributeFilter: ['class']};
|
||||
|
||||
var enablementObserver = new MutationObserver(function(mutations) {
|
||||
var isDisabled = mutations[0].target.className.indexOf('kmw-disabled') >= 0;
|
||||
enabledLabel.textContent = (isDisabled ? " Currently disabled." : " Currently enabled.");
|
||||
});
|
||||
enablementObserver.observe(observationTarget, observationConfig);
|
||||
|
||||
div.appendChild(enabledLabel);
|
||||
div.appendChild(document.createElement("p"));
|
||||
|
||||
if(elem.tagName.toLowerCase() != "iframe") {
|
||||
// Set Keyboard button
|
||||
var setBtn = document.createElement("input");
|
||||
setBtn.type = 'button';
|
||||
setBtn.id = 'set_' + elemId;
|
||||
setBtn.onclick = function() {
|
||||
kmw.setKeyboardForControl(document.getElementById(elemId), 'dzongkha', 'dzo');
|
||||
|
||||
if(kmw.isAttached(elem)) {
|
||||
kbdLabel.textContent = " Using independently-tracked keyboard.";
|
||||
}
|
||||
};
|
||||
setBtn.value = 'Set to Dzongkha';
|
||||
div.appendChild(setBtn);
|
||||
|
||||
// Clear Keyboard button
|
||||
var clearBtn = document.createElement("input");
|
||||
clearBtn.type = 'button';
|
||||
clearBtn.id = 'clear_' + elemId;
|
||||
clearBtn.onclick = function() {
|
||||
kmw.setKeyboardForControl(document.getElementById(elemId), null, null);
|
||||
|
||||
if(kmw.isAttached(elem)) {
|
||||
kbdLabel.textContent = " Using globally-selected keyboard.";
|
||||
}
|
||||
};
|
||||
clearBtn.value = 'Clear Keyboard';
|
||||
div.appendChild(clearBtn);
|
||||
|
||||
var kbdLabel = document.createElement("a");
|
||||
kbdLabel.id = 'independence_' + elemId;
|
||||
window.setTimeout(function () {
|
||||
if(kmw.isAttached(elem)) {
|
||||
var attached = kmw.isAttached(elem);
|
||||
kbdLabel.textContent = attached ? " Using globally-selected keyboard." : '';
|
||||
}
|
||||
}, 1);
|
||||
div.appendChild(kbdLabel);
|
||||
}
|
||||
|
||||
return div;
|
||||
}
|
||||
|
||||
function addInput() {
|
||||
var masterDiv = document.getElementById('DynamicInputs');
|
||||
var newInput = document.createElement("input");
|
||||
var i = inputCounter++;
|
||||
|
||||
newInput.id = 'input' + i;
|
||||
newInput.className = 'test';
|
||||
newInput.placeholder = "Dynamic area #" + i + "!";
|
||||
|
||||
var newDiv = generateDiagnosticDiv(newInput);
|
||||
|
||||
masterDiv.appendChild(newDiv);
|
||||
}
|
||||
|
||||
function addText() {
|
||||
var masterDiv = document.getElementById('DynamicTextareas');
|
||||
var newTextArea = document.createElement("textarea");
|
||||
var i = inputCounter++;
|
||||
|
||||
newTextArea.id = 'textarea' + i;
|
||||
newTextArea.className = 'test';
|
||||
newTextArea.placeholder = "Dynamic area #" + i + "!";
|
||||
|
||||
var newDiv = generateDiagnosticDiv(newTextArea);
|
||||
|
||||
masterDiv.appendChild(newDiv);
|
||||
}
|
||||
|
||||
function addIFrame() {
|
||||
var masterDiv = document.getElementById('DynamicIFrames');
|
||||
var frame = document.createElement("iframe");
|
||||
var i = inputCounter++;
|
||||
|
||||
frame.height = "100";
|
||||
frame.src = "iframe.html";
|
||||
frame.id = 'iframe' + i;
|
||||
|
||||
var newDiv = generateDiagnosticDiv(frame);
|
||||
masterDiv.appendChild(newDiv);
|
||||
}
|
||||
|
||||
function addEditable() {
|
||||
var masterDiv = document.getElementById('DynamicEditables');
|
||||
var editable = document.createElement("div");
|
||||
var i = inputCounter++;
|
||||
|
||||
editable.contentEditable = true;
|
||||
editable.textContent = "Edit me!";
|
||||
editable.id = 'editable' + i;
|
||||
editable.style.width="500px";
|
||||
|
||||
var newDiv = generateDiagnosticDiv(editable);
|
||||
|
||||
masterDiv.appendChild(newDiv);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
</style>
|
||||
|
||||
<!-- Insert uncompiled KeymanWeb source scripts -->
|
||||
<script src="../../intermediate/keymanweb.js" type="application/javascript"></script>
|
||||
<script src="../../release/unminified/web/keymanweb.js" type="application/javascript"></script>
|
||||
|
||||
<!--
|
||||
For desktop browsers, a script for the user interface must be inserted here.
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
The toolbar UI is best for any page designed to support keyboards for
|
||||
a large number of languages.
|
||||
-->
|
||||
<script src="../../intermediate/kmwuitoggle.js"></script>
|
||||
<script src="../../release/unminified/web/kmwuitoggle.js"></script>
|
||||
|
||||
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
|
||||
<script>
|
||||
|
|
@ -42,12 +42,12 @@
|
|||
</script>
|
||||
|
||||
<!-- Add keyboard management script for local selection of keyboards to use -->
|
||||
<script src="./script.js"></script>
|
||||
<script src="../commonHeader.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<!-- Sample page HTML -->
|
||||
<body onload='loadKeyboards();'>
|
||||
<body onload='loadKeyboards(1);'>
|
||||
<h2>KeymanWeb: Test IFrame connectivity</h2>
|
||||
|
||||
<div id='DynamicTextboxes'>
|
||||
|
|
|
|||
|
|
@ -1,80 +0,0 @@
|
|||
// JavaScript Document samplehdr.js: Keyboard management for KeymanWeb demonstration pages
|
||||
|
||||
/*
|
||||
The keyboard name and/or BCP-47 language code must be specified for each keyboard that is to be available.
|
||||
If the same keyboard is used for several languages, it must be listed for each
|
||||
language, but the keyboard itself will only be loaded once.
|
||||
If two (or more) keyboards are to be available for a given language, both must be listed.
|
||||
Any number of keyboards may be specified in one or more calls.
|
||||
Keyboard paths may be absolute (with respect to the server root) or relative to the keyboards option path.
|
||||
The actual keyboard object will be downloaded asynchronously when first selected for use.
|
||||
|
||||
Each argument to addKeyboards() is a string, for example:
|
||||
european2 loads the current version of the Eurolatin 2 keyboard (for its default language)
|
||||
european2@fr loads the current version of the Eurolatin 2 keyboard for French
|
||||
european2@fr@1.2 loads version 1.2 of the Eurolatin 2 keyboard for French
|
||||
|
||||
Argument syntax also supports the following extensions:
|
||||
@fr load the current version of the default keyboard for French
|
||||
@fr$ load all available keyboards (current version) for French
|
||||
|
||||
Each call to addKeyboards() requires a single call to the remote server,
|
||||
(unless all keyboards listed are local and fully specified) so it is better
|
||||
to use multiple arguments rather than separate function calls.
|
||||
|
||||
Calling addKeyboards() with no arguments returns a list of *all* available keyboards.
|
||||
The Toolbar (desktop browser) UI is best suited for allowing users to select
|
||||
the appropriate language and keyboard in this case.
|
||||
|
||||
Keyboards may also be specified by language name using addKeyboardsForLanguage()
|
||||
for example:
|
||||
keymanweb.addKeyboardsForLanguage('Burmese');
|
||||
|
||||
Appending $ to the language name will again cause all available keyboards for that
|
||||
language to be loaded rather than the default keyboard.
|
||||
|
||||
The first call to addKeyboardsForLanguage() makes an additional call to the
|
||||
keyman API to load the current list of keyboard/language associations.
|
||||
|
||||
In this example, the following function loads the indicated keyboards,
|
||||
and is called when the page loads.
|
||||
*/
|
||||
|
||||
function loadKeyboards()
|
||||
{
|
||||
var kmw=keyman;
|
||||
|
||||
// The first keyboard added will be the default keyboard for touch devices.
|
||||
// For faster loading, it may be best for the default keyboard to be
|
||||
// locally sourced.
|
||||
kmw.addKeyboards({id:'us',name:'English',languages:{id:'en',name:'English'},
|
||||
filename:'../us-1.0.js'});
|
||||
|
||||
// Add more keyboards to the language menu, by keyboard name,
|
||||
// keyboard name and language code, or just the BCP-47 language code.
|
||||
kmw.addKeyboards('french','european2@sv','european2@no','@he');
|
||||
|
||||
// Add a keyboard by language name. Note that the name must be spelled
|
||||
// correctly, or the keyboard will not be found. (Using BCP-47 codes is
|
||||
// usually easier.)
|
||||
kmw.addKeyboardsForLanguage('Dzongkha');
|
||||
|
||||
// Add a fully-specified, locally-sourced, keyboard with custom font
|
||||
kmw.addKeyboards({id:'lao_2008_basic',name:'Lao Basic',
|
||||
languages:{
|
||||
id:'lo',name:'Lao',region:'Asia',
|
||||
font:{family:'LaoWeb',source:['../font/saysettha_web.ttf','../font/saysettha_web.woff','../font/saysettha_web.eot']}
|
||||
},
|
||||
filename:'../lao_2008_basic.js'
|
||||
});
|
||||
|
||||
// The following two optional calls should be delayed until language menus are fully loaded:
|
||||
// (a) a specific mapped input element input is focused, to ensure that the OSK appears
|
||||
// (b) a specific keyboard is loaded, rather than the keyboard last used.
|
||||
//window.setTimeout(function(){kmw.setActiveElement('ta1',true);},2500);
|
||||
//window.setTimeout(function(){kmw.setActiveKeyboard('Keyboard_french','fr');},3000);
|
||||
|
||||
// Note that locally specified keyboards will be listed before keyboards
|
||||
// requested from the remote server by user interfaces that do not order
|
||||
// keyboards alphabetically by language.
|
||||
}
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
</style>
|
||||
|
||||
<!-- Insert uncompiled KeymanWeb source scripts -->
|
||||
<script src="../../intermediate/keymanweb.js" type="application/javascript"></script>
|
||||
<script src="../../release/unminified/web/keymanweb.js" type="application/javascript"></script>
|
||||
|
||||
<!--
|
||||
For desktop browsers, a script for the user interface must be inserted here.
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
The toolbar UI is best for any page designed to support keyboards for
|
||||
a large number of languages.
|
||||
-->
|
||||
<script src="../../intermediate/kmwuitoggle.js"></script>
|
||||
<script src="../../release/unminified/web/kmwuitoggle.js"></script>
|
||||
|
||||
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -40,15 +40,25 @@
|
|||
and is called when the page loads.
|
||||
*/
|
||||
|
||||
function loadKeyboards()
|
||||
function loadKeyboards(nestLevel)
|
||||
{
|
||||
var kmw=keyman;
|
||||
|
||||
var base_prefix = '../';
|
||||
var prefix = './'; // The default - when prefix == 0.
|
||||
|
||||
if(nestLevel !== undefined && nestLevel > 0) {
|
||||
prefix = '';
|
||||
for(var i=0; i < nestLevel; i++) {
|
||||
prefix = prefix + base_prefix;
|
||||
}
|
||||
}
|
||||
|
||||
// The first keyboard added will be the default keyboard for touch devices.
|
||||
// For faster loading, it may be best for the default keyboard to be
|
||||
// locally sourced.
|
||||
kmw.addKeyboards({id:'us',name:'English',languages:{id:'en',name:'English'},
|
||||
filename:'./us-1.0.js'});
|
||||
filename:(prefix + 'us-1.0.js')});
|
||||
|
||||
// Add more keyboards to the language menu, by keyboard name,
|
||||
// keyboard name and language code, or just the BCP-47 language code.
|
||||
|
|
@ -63,11 +73,10 @@
|
|||
|
||||
// Add a fully-specified, locally-sourced, keyboard with custom font
|
||||
kmw.addKeyboards({id:'lao_2008_basic',name:'Lao Basic',
|
||||
languages:{
|
||||
id:'lo',name:'Lao',region:'Asia',
|
||||
font:{family:'LaoWeb',source:['../font/saysettha_web.ttf','../font/saysettha_web.woff','../font/saysettha_web.eot']}
|
||||
languages: {
|
||||
id:'lo',name:'Lao',region:'Asia',
|
||||
},
|
||||
filename:'./lao_2008_basic.js'
|
||||
filename:(prefix + 'lao_2008_basic.js')
|
||||
});
|
||||
|
||||
// The following two optional calls should be delayed until language menus are fully loaded:
|
||||
|
|
@ -32,6 +32,7 @@
|
|||
<h1>Issue Testing</h1>
|
||||
<h2><a href="./issue005">'Test case' for proper implementation of the removeKeyboards API function.</a></h2>
|
||||
<h2><a href="./issue53">Tests layering transitions for keyboards with variable layer sizes.</a></h2>
|
||||
<h2><a href="./issue103/">Tests keyboard loading with repeated requests</a></h2>
|
||||
<h2><a href="./issue115/">Long-press on numeric and symbolic layer testing</a></h2>
|
||||
<h2><a href="./issue116/">Next-layer processing testing</a></h2>
|
||||
<h2><a href="./issue160/">Uxxxx code testing</a></h2>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
<!-- Enable IE9 Standards mode -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
|
||||
<title>KeymanWeb Sample Page - Uncompiled Source</title>
|
||||
<title>KeymanWeb Sample Page - Keyboard Stub + Registration Decoupling</title>
|
||||
|
||||
<!-- Your page CSS -->
|
||||
<style type='text/css'>
|
||||
|
|
@ -23,15 +23,7 @@
|
|||
</style>
|
||||
|
||||
<!-- Insert uncompiled KeymanWeb source scripts -->
|
||||
<script src="../../source/kmwstring.js" type="application/javascript"></script>
|
||||
<script src="../../source/kmwbase.js" type="application/javascript"></script>
|
||||
<script src="../../source/keymanweb.js" type="application/javascript"></script>
|
||||
<script src="../../source/kmwosk.js" type="application/javascript"></script>
|
||||
<script src="../../source/kmwnative.js" type="application/javascript"></script>
|
||||
<script src="../../source/kmwcallback.js" type="application/javascript"></script>
|
||||
<script src="../../source/kmwkeymaps.js" type="application/javascript"></script>
|
||||
<script src="../../source/kmwlayout.js" type="application/javascript"></script>
|
||||
<script src="../../source/kmwinit.js" type="application/javascript"></script>
|
||||
<script src="../../release/unminified/web/keymanweb.js" type="application/javascript"></script>
|
||||
|
||||
<!--
|
||||
For desktop browsers, a script for the user interface must be inserted here.
|
||||
|
|
@ -40,14 +32,14 @@
|
|||
The toolbar UI is best for any page designed to support keyboards for
|
||||
a large number of languages.
|
||||
-->
|
||||
<script src="../../source/kmwuitoggle.js"></script>
|
||||
<script src="../../release/unminified/web/kmwuitoggle.js"></script>
|
||||
|
||||
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
|
||||
<script>
|
||||
var kmw=window.tavultesoft.keymanweb;
|
||||
var kmw=window.keyman;
|
||||
kmw.init({
|
||||
attachType:'auto',
|
||||
resources:'resources'
|
||||
resources:''
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
@ -58,7 +50,11 @@
|
|||
|
||||
<!-- Sample page HTML -->
|
||||
<body onload='loadKeyboards();'>
|
||||
<h2>KeymanWeb Sample Page - Uncompiled Source</h2>
|
||||
<h2>KeymanWeb Sample Page - Keyboard Registration Check</h2>
|
||||
<p>
|
||||
This page is designed to test KeymanWeb's behavior when being told to load a keyboard multiple times, both via
|
||||
stub and registration. If this has been performed correctly, each entry should only be listed once by the UI element.
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<!--
|
||||
|
|
@ -88,7 +84,7 @@
|
|||
<input type='button' id='btn3' onclick='addKeyboard(3);' value='Add' />
|
||||
|
||||
|
||||
<h3><a href="../samples/index.html">Return to testing home page</a></h3>
|
||||
<h3><a href="../index.html">Return to testing home page</a></h3>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
70
web/testing/issue103/samplehdr.js
Normal file
70
web/testing/issue103/samplehdr.js
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
// Modified version of commonHeader - contains repeated requests for the same language.
|
||||
|
||||
function loadKeyboards()
|
||||
{
|
||||
var kmw=keyman;
|
||||
|
||||
// The first keyboard added will be the default keyboard for touch devices.
|
||||
// For faster loading, it may be best for the default keyboard to be
|
||||
// locally sourced.
|
||||
kmw.addKeyboards({id:'us',name:'English',languages:{id:'en',name:'English'},
|
||||
filename:'../us-1.0.js'});
|
||||
|
||||
// Add more keyboards to the language menu, by keyboard name,
|
||||
// keyboard name and language code, or just the BCP-47 language code.
|
||||
kmw.addKeyboards('french','european2@sv','european2@sv','european2@sv','european2@sv','european2@sv','european2@sv','european2@no','@he');
|
||||
kmw.addKeyboards('@he');
|
||||
kmw.addKeyboards('@he');
|
||||
|
||||
// Add a keyboard by language name. Note that the name must be spelled
|
||||
// correctly, or the keyboard will not be found. (Using BCP-47 codes is
|
||||
// usually easier.)
|
||||
kmw.addKeyboardsForLanguage('Dzongkha');
|
||||
|
||||
// Add a fully-specified, locally-sourced, keyboard with custom font
|
||||
kmw.addKeyboards({id:'lao_2008_basic',name:'Lao Basic',
|
||||
languages:{
|
||||
id:'lo',name:'Lao',region:'Asia'
|
||||
},
|
||||
filename:'../lao_2008_basic.js'
|
||||
});
|
||||
|
||||
// The following two optional calls should be delayed until language menus are fully loaded:
|
||||
// (a) a specific mapped input element input is focused, to ensure that the OSK appears
|
||||
// (b) a specific keyboard is loaded, rather than the keyboard last used.
|
||||
//window.setTimeout(function(){kmw.setActiveElement('ta1',true);},2500);
|
||||
//window.setTimeout(function(){kmw.setActiveKeyboard('Keyboard_french','fr');},3000);
|
||||
|
||||
// Note that locally specified keyboards will be listed before keyboards
|
||||
// requested from the remote server by user interfaces that do not order
|
||||
// keyboards alphabetically by language.
|
||||
}
|
||||
|
||||
// Script to allow a user to add any keyboard to the keyboard menu
|
||||
function addKeyboard(n)
|
||||
{
|
||||
var sKbd,kmw=keyman;
|
||||
switch(n)
|
||||
{
|
||||
case 1:
|
||||
sKbd=document.getElementById('kbd_id1').value;
|
||||
kmw.addKeyboards(sKbd);
|
||||
break;
|
||||
case 2:
|
||||
sKbd=document.getElementById('kbd_id2').value.toLowerCase();
|
||||
kmw.addKeyboards('@'+sKbd);
|
||||
break;
|
||||
case 3:
|
||||
sKbd=document.getElementById('kbd_id3').value;
|
||||
kmw.addKeyboardsForLanguage(sKbd);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Add keyboard on Enter (as well as pressing button)
|
||||
function clickOnEnter(e,id)
|
||||
{
|
||||
e = e || window.event;
|
||||
if(e.keyCode == 13) addKeyboard(id);
|
||||
}
|
||||
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
</style>
|
||||
|
||||
<!-- Insert uncompiled KeymanWeb source scripts -->
|
||||
<script src="../../intermediate/keymanweb.js" type="application/javascript"></script>
|
||||
<script src="../../release/unminified/web/keymanweb.js" type="application/javascript"></script>
|
||||
|
||||
<!--
|
||||
For desktop browsers, a script for the user interface must be inserted here.
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
The toolbar UI is best for any page designed to support keyboards for
|
||||
a large number of languages.
|
||||
-->
|
||||
<script src="../../intermediate/kmwuitoggle.js"></script>
|
||||
<script src="../../release/unminified/web/kmwuitoggle.js"></script>
|
||||
|
||||
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
|
||||
<script>
|
||||
|
|
@ -41,7 +41,7 @@
|
|||
attachType:'auto'
|
||||
});
|
||||
kmw.addKeyboards({id:'issue115a',name:'Issue 115',languages:{id:'en',name:'English'},
|
||||
filename:'./issue115a-1.0.js'});
|
||||
filename:'./issue115a.js'});
|
||||
</script>
|
||||
|
||||
|
||||
|
|
|
|||
Binary file not shown.
1
web/testing/issue115/issue115a.js
Normal file
1
web/testing/issue115/issue115a.js
Normal file
File diff suppressed because one or more lines are too long
BIN
web/testing/issue115/issue115a.kmx
Normal file
BIN
web/testing/issue115/issue115a.kmx
Normal file
Binary file not shown.
BIN
web/testing/issue115/issue115a.kvk
Normal file
BIN
web/testing/issue115/issue115a.kvk
Normal file
Binary file not shown.
|
|
@ -23,7 +23,7 @@
|
|||
</style>
|
||||
|
||||
<!-- Insert uncompiled KeymanWeb source scripts -->
|
||||
<script src="../../intermediate/keymanweb.js" type="application/javascript"></script>
|
||||
<script src="../../release/unminified/web/keymanweb.js" type="application/javascript"></script>
|
||||
|
||||
<!--
|
||||
For desktop browsers, a script for the user interface must be inserted here.
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
The toolbar UI is best for any page designed to support keyboards for
|
||||
a large number of languages.
|
||||
-->
|
||||
<script src="../../intermediate/kmwuitoggle.js"></script>
|
||||
<script src="../../release/unminified/web/kmwuitoggle.js"></script>
|
||||
|
||||
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
|
||||
<script>
|
||||
|
|
@ -41,7 +41,7 @@
|
|||
attachType:'auto'
|
||||
});
|
||||
kmw.addKeyboards({id:'next_layer_tests',name:'Issue 116',languages:{id:'en',name:'English'},
|
||||
filename:'./next_layer_tests-1.0.js'});
|
||||
filename:'./next_layer_tests.js'});
|
||||
</script>
|
||||
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"options" : {
|
||||
"device" : "any",
|
||||
"keyboardBaseUri" : "http://your-host-here/keyboard-path/",
|
||||
"fontBaseUri" : "http://your-host-here/font-path/"
|
||||
},
|
||||
"keyboard" : {
|
||||
"id" : "next_layer_tests",
|
||||
"name" : "Issue 116",
|
||||
"filename" : "next_layer_tests-1.0.js",
|
||||
"version" : "1.0",
|
||||
"lastModified" : "2017-09-15T08:13:57.822+07:00",
|
||||
"languages" : [
|
||||
{
|
||||
"id" : "eng",
|
||||
"name" : "English"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
KeymanWeb.KRS(new Stub_Keyboard_next_layer_tests()); function Stub_Keyboard_next_layer_tests() {this.KF="next_layer_tests-1.0.js";this.KI="Keyboard_next_layer_tests";this.KN="Issue 116";}
|
||||
1
web/testing/issue116/next_layer_tests.js
Normal file
1
web/testing/issue116/next_layer_tests.js
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -23,7 +23,7 @@
|
|||
</style>
|
||||
|
||||
<!-- Insert uncompiled KeymanWeb source scripts -->
|
||||
<script src="../../intermediate/keymanweb.js" type="application/javascript"></script>
|
||||
<script src="../../release/unminified/web/keymanweb.js" type="application/javascript"></script>
|
||||
|
||||
<!--
|
||||
For desktop browsers, a script for the user interface must be inserted here.
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
The toolbar UI is best for any page designed to support keyboards for
|
||||
a large number of languages.
|
||||
-->
|
||||
<script src="../../intermediate/kmwuitoggle.js"></script>
|
||||
<script src="../../release/unminified/web/kmwuitoggle.js"></script>
|
||||
|
||||
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
|
||||
<script>
|
||||
|
|
@ -41,8 +41,7 @@
|
|||
attachType:'auto'
|
||||
});
|
||||
kmw.addKeyboards(
|
||||
{id:'issue160',name:'Issue 160',languages:{id:'en',name:'English'}, filename:'./issue160-1.0.js'},
|
||||
{id:'tchaduni',name:'tchaduni',languages:{id:'fr',name:'TChad'}, filename:'./tchaduni-3.1.js'}
|
||||
{id:'issue160',name:'Issue 160',languages:{id:'en',name:'English'}, filename:'./issue160.js'}
|
||||
);
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,733 +0,0 @@
|
|||
KeymanWeb.KR(new Keyboard_issue160());
|
||||
function Keyboard_issue160()
|
||||
{
|
||||
this.KI="Keyboard_issue160";
|
||||
this.KN="#160 VKDictionary conflict(web/touch)";
|
||||
this.KV=null;
|
||||
this.KH='';
|
||||
this.KM=0;
|
||||
this.KBVER="1.0";
|
||||
this.KVKD="T_A_Hook T_A_Candrabindu T_A_Blah U_0104 T_A_305";
|
||||
this.KVKL={
|
||||
"tablet": {
|
||||
"font": "Tahoma",
|
||||
"layer": [
|
||||
{
|
||||
"id": "default",
|
||||
"row": [
|
||||
{
|
||||
"id": 1,
|
||||
"key": [
|
||||
{
|
||||
"id": "K_Q",
|
||||
"text": "q"
|
||||
},
|
||||
{
|
||||
"id": "K_W",
|
||||
"text": "w"
|
||||
},
|
||||
{
|
||||
"id": "K_E",
|
||||
"text": "e"
|
||||
},
|
||||
{
|
||||
"id": "K_R",
|
||||
"text": "r"
|
||||
},
|
||||
{
|
||||
"id": "K_T",
|
||||
"text": "t"
|
||||
},
|
||||
{
|
||||
"id": "K_Y",
|
||||
"text": "y"
|
||||
},
|
||||
{
|
||||
"id": "K_U",
|
||||
"text": "u"
|
||||
},
|
||||
{
|
||||
"id": "K_I",
|
||||
"text": "i"
|
||||
},
|
||||
{
|
||||
"id": "K_O",
|
||||
"text": "o"
|
||||
},
|
||||
{
|
||||
"id": "K_P",
|
||||
"text": "p"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"key": [
|
||||
{
|
||||
"id": "K_A",
|
||||
"text": "a",
|
||||
"pad": 70
|
||||
},
|
||||
{
|
||||
"id": "U_0101",
|
||||
"text": "ā"
|
||||
},
|
||||
{
|
||||
"id": "T_A_Hook",
|
||||
"text": "a̧"
|
||||
},
|
||||
{
|
||||
"id": "T_A_Candrabindu",
|
||||
"text": "a̐"
|
||||
},
|
||||
{
|
||||
"id": "U_0104",
|
||||
"text": "Ą"
|
||||
},
|
||||
{
|
||||
"id": "K_H",
|
||||
"text": "h",
|
||||
"sk": [
|
||||
{
|
||||
"text": "ă",
|
||||
"id": "U_0103"
|
||||
},
|
||||
{
|
||||
"text": "a̅",
|
||||
"id": "T_A_305"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "K_J",
|
||||
"text": "j"
|
||||
},
|
||||
{
|
||||
"id": "K_K",
|
||||
"text": "k"
|
||||
},
|
||||
{
|
||||
"id": "K_L",
|
||||
"text": "l"
|
||||
},
|
||||
{
|
||||
"id": "T_new_20",
|
||||
"text": "",
|
||||
"width": "10",
|
||||
"sp": "10"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"key": [
|
||||
{
|
||||
"id": "K_SHIFT",
|
||||
"text": "*Shift*",
|
||||
"width": "110",
|
||||
"sp": "1",
|
||||
"nextlayer": "shift"
|
||||
},
|
||||
{
|
||||
"id": "K_Z",
|
||||
"text": "z"
|
||||
},
|
||||
{
|
||||
"id": "K_X",
|
||||
"text": "x"
|
||||
},
|
||||
{
|
||||
"id": "K_C",
|
||||
"text": "c"
|
||||
},
|
||||
{
|
||||
"id": "K_V",
|
||||
"text": "v"
|
||||
},
|
||||
{
|
||||
"id": "K_B",
|
||||
"text": "b"
|
||||
},
|
||||
{
|
||||
"id": "K_N",
|
||||
"text": "n"
|
||||
},
|
||||
{
|
||||
"id": "K_M",
|
||||
"text": "m"
|
||||
},
|
||||
{
|
||||
"id": "K_PERIOD",
|
||||
"text": ".",
|
||||
"sk": [
|
||||
{
|
||||
"text": ",",
|
||||
"id": "K_COMMA"
|
||||
},
|
||||
{
|
||||
"text": "!",
|
||||
"id": "K_1",
|
||||
"layer": "shift"
|
||||
},
|
||||
{
|
||||
"text": "?",
|
||||
"id": "K_SLASH",
|
||||
"layer": "shift"
|
||||
},
|
||||
{
|
||||
"text": "'",
|
||||
"id": "K_QUOTE"
|
||||
},
|
||||
{
|
||||
"text": "\"",
|
||||
"id": "K_QUOTE",
|
||||
"layer": "shift"
|
||||
},
|
||||
{
|
||||
"text": "\\",
|
||||
"id": "K_BKSLASH"
|
||||
},
|
||||
{
|
||||
"text": ":",
|
||||
"id": "K_COLON",
|
||||
"layer": "shift"
|
||||
},
|
||||
{
|
||||
"text": ";",
|
||||
"id": "K_COLON"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "K_BKSP",
|
||||
"text": "*BkSp*",
|
||||
"width": "90",
|
||||
"sp": "1"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"key": [
|
||||
{
|
||||
"id": "K_NUMLOCK",
|
||||
"text": "*123*",
|
||||
"width": "140",
|
||||
"sp": "1",
|
||||
"nextlayer": "numeric"
|
||||
},
|
||||
{
|
||||
"id": "K_LOPT",
|
||||
"text": "*Menu*",
|
||||
"width": "120",
|
||||
"sp": "1"
|
||||
},
|
||||
{
|
||||
"id": "K_SPACE",
|
||||
"text": "",
|
||||
"width": "630",
|
||||
"sp": "0"
|
||||
},
|
||||
{
|
||||
"id": "K_ENTER",
|
||||
"text": "*Enter*",
|
||||
"width": "140",
|
||||
"sp": "1"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "shift",
|
||||
"row": [
|
||||
{
|
||||
"id": 1,
|
||||
"key": [
|
||||
{
|
||||
"id": "K_Q",
|
||||
"text": "Q"
|
||||
},
|
||||
{
|
||||
"id": "K_W",
|
||||
"text": "W"
|
||||
},
|
||||
{
|
||||
"id": "K_E",
|
||||
"text": "E"
|
||||
},
|
||||
{
|
||||
"id": "K_R",
|
||||
"text": "R"
|
||||
},
|
||||
{
|
||||
"id": "K_T",
|
||||
"text": "T"
|
||||
},
|
||||
{
|
||||
"id": "K_Y",
|
||||
"text": "Y"
|
||||
},
|
||||
{
|
||||
"id": "K_U",
|
||||
"text": "U"
|
||||
},
|
||||
{
|
||||
"id": "K_I",
|
||||
"text": "I"
|
||||
},
|
||||
{
|
||||
"id": "K_O",
|
||||
"text": "O"
|
||||
},
|
||||
{
|
||||
"id": "K_P",
|
||||
"text": "P"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"key": [
|
||||
{
|
||||
"id": "K_A",
|
||||
"text": "A",
|
||||
"pad": 70
|
||||
},
|
||||
{
|
||||
"id": "U_0101",
|
||||
"text": "ā"
|
||||
},
|
||||
{
|
||||
"id": "T_A_Hook",
|
||||
"text": "a̧"
|
||||
},
|
||||
{
|
||||
"id": "T_A_Candrabindu",
|
||||
"text": "a̐"
|
||||
},
|
||||
{
|
||||
"id": "U_0104",
|
||||
"text": "Ą"
|
||||
},
|
||||
{
|
||||
"id": "K_H",
|
||||
"text": "h",
|
||||
"sk": [
|
||||
{
|
||||
"text": "ă",
|
||||
"id": "U_0103"
|
||||
},
|
||||
{
|
||||
"text": "a̅",
|
||||
"id": "T_A_305"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "K_J",
|
||||
"text": "J"
|
||||
},
|
||||
{
|
||||
"id": "K_K",
|
||||
"text": "K"
|
||||
},
|
||||
{
|
||||
"id": "K_L",
|
||||
"text": "L"
|
||||
},
|
||||
{
|
||||
"id": "T_new_54",
|
||||
"text": "",
|
||||
"width": "10",
|
||||
"sp": "10"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"key": [
|
||||
{
|
||||
"id": "K_SHIFT",
|
||||
"text": "*Shift*",
|
||||
"width": "110",
|
||||
"sp": "2",
|
||||
"nextlayer": "default"
|
||||
},
|
||||
{
|
||||
"id": "K_Z",
|
||||
"text": "Z"
|
||||
},
|
||||
{
|
||||
"id": "K_X",
|
||||
"text": "X"
|
||||
},
|
||||
{
|
||||
"id": "K_C",
|
||||
"text": "C"
|
||||
},
|
||||
{
|
||||
"id": "K_V",
|
||||
"text": "V"
|
||||
},
|
||||
{
|
||||
"id": "K_B",
|
||||
"text": "B"
|
||||
},
|
||||
{
|
||||
"id": "K_N",
|
||||
"text": "N"
|
||||
},
|
||||
{
|
||||
"id": "K_M",
|
||||
"text": "M"
|
||||
},
|
||||
{
|
||||
"id": "K_PERIOD",
|
||||
"text": ".",
|
||||
"sk": [
|
||||
{
|
||||
"text": ",",
|
||||
"id": "K_COMMA",
|
||||
"layer": "default"
|
||||
},
|
||||
{
|
||||
"text": "!",
|
||||
"id": "K_1",
|
||||
"layer": "shift"
|
||||
},
|
||||
{
|
||||
"text": "?",
|
||||
"id": "K_SLASH",
|
||||
"layer": "shift"
|
||||
},
|
||||
{
|
||||
"text": "'",
|
||||
"id": "K_QUOTE",
|
||||
"layer": "default"
|
||||
},
|
||||
{
|
||||
"text": "\"",
|
||||
"id": "K_QUOTE",
|
||||
"layer": "shift"
|
||||
},
|
||||
{
|
||||
"text": "\\",
|
||||
"id": "K_BKSLASH",
|
||||
"layer": "default"
|
||||
},
|
||||
{
|
||||
"text": ":",
|
||||
"id": "K_COLON"
|
||||
},
|
||||
{
|
||||
"text": ";",
|
||||
"id": "K_COLON",
|
||||
"layer": "default"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "K_BKSP",
|
||||
"text": "*BkSp*",
|
||||
"width": "90",
|
||||
"sp": "1"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"key": [
|
||||
{
|
||||
"id": "K_NUMLOCK",
|
||||
"text": "*123*",
|
||||
"width": "140",
|
||||
"sp": "1",
|
||||
"nextlayer": "numeric"
|
||||
},
|
||||
{
|
||||
"id": "K_LOPT",
|
||||
"text": "*Menu*",
|
||||
"width": "120",
|
||||
"sp": "1"
|
||||
},
|
||||
{
|
||||
"id": "K_SPACE",
|
||||
"text": "",
|
||||
"width": "630",
|
||||
"sp": "0"
|
||||
},
|
||||
{
|
||||
"id": "K_ENTER",
|
||||
"text": "*Enter*",
|
||||
"width": "140",
|
||||
"sp": "1"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "numeric",
|
||||
"row": [
|
||||
{
|
||||
"id": 1,
|
||||
"key": [
|
||||
{
|
||||
"id": "K_1",
|
||||
"text": "1"
|
||||
},
|
||||
{
|
||||
"id": "K_2",
|
||||
"text": "2"
|
||||
},
|
||||
{
|
||||
"id": "K_3",
|
||||
"text": "3"
|
||||
},
|
||||
{
|
||||
"id": "K_4",
|
||||
"text": "4"
|
||||
},
|
||||
{
|
||||
"id": "K_5",
|
||||
"text": "5"
|
||||
},
|
||||
{
|
||||
"id": "K_6",
|
||||
"text": "6"
|
||||
},
|
||||
{
|
||||
"id": "K_7",
|
||||
"text": "7"
|
||||
},
|
||||
{
|
||||
"id": "K_8",
|
||||
"text": "8"
|
||||
},
|
||||
{
|
||||
"id": "K_9",
|
||||
"text": "9"
|
||||
},
|
||||
{
|
||||
"id": "K_0",
|
||||
"text": "0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"key": [
|
||||
{
|
||||
"id": "K_4",
|
||||
"layer": "shift",
|
||||
"pad": 70,
|
||||
"text": "$"
|
||||
},
|
||||
{
|
||||
"id": "K_2",
|
||||
"layer": "shift",
|
||||
"text": "@"
|
||||
},
|
||||
{
|
||||
"id": "K_3",
|
||||
"layer": "shift",
|
||||
"text": "#"
|
||||
},
|
||||
{
|
||||
"id": "K_5",
|
||||
"layer": "shift",
|
||||
"text": "%"
|
||||
},
|
||||
{
|
||||
"id": "K_7",
|
||||
"layer": "shift",
|
||||
"text": "&"
|
||||
},
|
||||
{
|
||||
"id": "K_HYPHEN",
|
||||
"layer": "shift",
|
||||
"text": "_"
|
||||
},
|
||||
{
|
||||
"id": "K_EQUAL",
|
||||
"layer": "default",
|
||||
"text": "="
|
||||
},
|
||||
{
|
||||
"id": "K_BKSLASH",
|
||||
"layer": "shift",
|
||||
"text": "|"
|
||||
},
|
||||
{
|
||||
"id": "K_BKSLASH",
|
||||
"layer": "default",
|
||||
"text": "\\"
|
||||
},
|
||||
{
|
||||
"text": "",
|
||||
"width": "10",
|
||||
"sp": "10"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"key": [
|
||||
{
|
||||
"id": "K_SHIFT",
|
||||
"text": "*Shift*",
|
||||
"width": "110",
|
||||
"sp": "1"
|
||||
},
|
||||
{
|
||||
"id": "K_LBRKT",
|
||||
"sk": [
|
||||
{
|
||||
"id": "U_00AB",
|
||||
"text": "«"
|
||||
},
|
||||
{
|
||||
"id": "K_COMMA",
|
||||
"text": "<",
|
||||
"layer": "shift"
|
||||
},
|
||||
{
|
||||
"id": "K_LBRKT",
|
||||
"text": "{",
|
||||
"layer": "shift"
|
||||
}
|
||||
],
|
||||
"text": "["
|
||||
},
|
||||
{
|
||||
"id": "K_9",
|
||||
"layer": "shift",
|
||||
"text": "("
|
||||
},
|
||||
{
|
||||
"id": "K_0",
|
||||
"layer": "shift",
|
||||
"text": ")"
|
||||
},
|
||||
{
|
||||
"id": "K_RBRKT",
|
||||
"sk": [
|
||||
{
|
||||
"id": "U_00BB",
|
||||
"text": "»"
|
||||
},
|
||||
{
|
||||
"id": "K_PERIOD",
|
||||
"text": ">",
|
||||
"layer": "shift"
|
||||
},
|
||||
{
|
||||
"id": "K_RBRKT",
|
||||
"text": "}",
|
||||
"layer": "shift"
|
||||
}
|
||||
],
|
||||
"text": "]"
|
||||
},
|
||||
{
|
||||
"id": "K_EQUAL",
|
||||
"layer": "shift",
|
||||
"text": "+"
|
||||
},
|
||||
{
|
||||
"id": "K_HYPHEN",
|
||||
"layer": "default",
|
||||
"text": "-"
|
||||
},
|
||||
{
|
||||
"id": "K_8",
|
||||
"layer": "shift",
|
||||
"text": "*"
|
||||
},
|
||||
{
|
||||
"id": "K_SLASH",
|
||||
"layer": "default",
|
||||
"text": "/"
|
||||
},
|
||||
{
|
||||
"id": "K_BKSP",
|
||||
"text": "*BkSp*",
|
||||
"width": "90",
|
||||
"sp": "1"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"key": [
|
||||
{
|
||||
"id": "K_LOWER",
|
||||
"text": "*abc*",
|
||||
"width": "140",
|
||||
"sp": "1",
|
||||
"nextlayer": "default"
|
||||
},
|
||||
{
|
||||
"id": "K_LOPT",
|
||||
"text": "*Menu*",
|
||||
"width": "120",
|
||||
"sp": "1"
|
||||
},
|
||||
{
|
||||
"id": "K_SPACE",
|
||||
"width": "630",
|
||||
"sp": "0",
|
||||
"text": ""
|
||||
},
|
||||
{
|
||||
"id": "K_ENTER",
|
||||
"text": "*Enter*",
|
||||
"width": "140",
|
||||
"sp": "1"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
;
|
||||
this.KVER="10.0.920.0";
|
||||
this.gs=function(t,e) {
|
||||
return this.g_main(t,e);
|
||||
};
|
||||
this.g_main=function(t,e) {
|
||||
var k=KeymanWeb,r=0,m=0;
|
||||
if(k.KKM(e,16384,259)&&k.KCM(1,t,"c",1)) { // Line 23
|
||||
r=m=1;
|
||||
k.KO(1,t,"?");
|
||||
}
|
||||
else if(k.KKM(e,16384,256)) { // Line 17
|
||||
r=m=1;
|
||||
k.KO(0,t,"a̧");
|
||||
}
|
||||
else if(k.KKM(e,16384,257)) { // Line 18
|
||||
r=m=1;
|
||||
k.KO(0,t,"a̐");
|
||||
}
|
||||
else if(k.KKM(e,16400,256)) { // Line 19
|
||||
r=m=1;
|
||||
k.KO(0,t,"SHIFT a̧");
|
||||
}
|
||||
else if(k.KKM(e,16400,257)) { // Line 20
|
||||
r=m=1;
|
||||
k.KO(0,t,"SHIFT a̐");
|
||||
}
|
||||
else if(k.KKM(e,16384,258)) { // Line 21
|
||||
r=m=1;
|
||||
k.KO(0,t,"nothing");
|
||||
}
|
||||
else if(k.KKM(e,16384,260)) { // Line 24
|
||||
r=m=1;
|
||||
k.KO(0,t,"a̅");
|
||||
}
|
||||
return r;
|
||||
};
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"options" : {
|
||||
"device" : "any",
|
||||
"keyboardBaseUri" : "http://your-host-here/keyboard-path/",
|
||||
"fontBaseUri" : "http://your-host-here/font-path/"
|
||||
},
|
||||
"keyboard" : {
|
||||
"id" : "issue160",
|
||||
"name" : "#160 VKDictionary conflict(web/touch)",
|
||||
"filename" : "issue160-1.0.js",
|
||||
"version" : "1.0",
|
||||
"lastModified" : "2017-08-18T13:57:07.816+07:00",
|
||||
"languages" : [
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
KeymanWeb.KRS(new Stub_Keyboard_issue160()); function Stub_Keyboard_issue160() {this.KF="issue160-1.0.js";this.KI="Keyboard_issue160";this.KN="#160 VKDictionary conflict(web/touch)";}
|
||||
1
web/testing/issue160/issue160.js
Normal file
1
web/testing/issue160/issue160.js
Normal file
File diff suppressed because one or more lines are too long
Binary file not shown.
|
|
@ -1,118 +1,7 @@
|
|||
// JavaScript Document samplehdr.js: Keyboard management for KeymanWeb demonstration pages
|
||||
function setActiveKeyboard() {
|
||||
var kmw=window['keyman'] ? keyman : tavultesoft.keymanweb;
|
||||
|
||||
/*
|
||||
The keyboard name and/or BCP-47 code must be specified for each keyboard that is to be available.
|
||||
If the same keyboard is used for several languages, it must be listed for each
|
||||
language, but the keyboard itself will only be loaded once.
|
||||
If two (or more) keyboards are to be available for a given language, both must be listed.
|
||||
Any number of keyboards may be specified in one or more calls.
|
||||
Keyboard paths may be absolute (with respect to the server root) or relative to the keyboards option path.
|
||||
The actual keyboard object will be downloaded asynchronously when first selected for use.
|
||||
|
||||
Each argument to addKeyboards() is a string, for example:
|
||||
european2 loads the current version of the Eurolatin 2 keyboard (for its default language)
|
||||
european2@fr loads the current version of the Eurolatin 2 keyboard for French
|
||||
european2@fr@1.2 loads version 1.2 of the Eurolatin 2 keyboard for French
|
||||
|
||||
Argument syntax also supports the following extensions:
|
||||
@fr load the current version of the default keyboard for French
|
||||
@fr$ load all available keyboards (current version) for French
|
||||
|
||||
Each call to addKeyboards() requires a single call to the remote server,
|
||||
(unless all keyboards listed are local and fully specified) so it is better
|
||||
to use multiple arguments rather than separate function calls.
|
||||
|
||||
Calling addKeyboards() with no arguments returns a list of *all* available keyboards.
|
||||
The Toolbar (desktop browser) UI is best suited for allowing users to select
|
||||
the appropriate language and keyboard in this case.
|
||||
|
||||
Keyboards may also be specified by language name using addKeyboardsForLanguage()
|
||||
for example:
|
||||
keymanweb.addKeyboardsForLanguage('Burmese');
|
||||
|
||||
Appending $ to the language name will again cause all available keyboards for that
|
||||
language to be loaded rather than the default keyboard.
|
||||
|
||||
The first call to addKeyboardsForLanguage() makes an additional call to the
|
||||
keyman API to load the current list of keyboard/language associations.
|
||||
|
||||
In this example, the following function loads the indicated keyboards,
|
||||
and is called when the page loads.
|
||||
*/
|
||||
|
||||
function loadKeyboards()
|
||||
{
|
||||
var kmw=window['keyman'] ? keyman : tavultesoft.keymanweb;
|
||||
|
||||
// The first keyboard added will be the default keyboard for touch devices.
|
||||
// For faster loading, it may be best for the default keyboard to be
|
||||
// locally sourced.
|
||||
kmw.addKeyboards({id:'us',name:'English',languages:{id:'en',name:'English', region:'North America'},
|
||||
filename:'../us-1.0.js'});
|
||||
|
||||
// Add more keyboards to the language menu, by keyboard name,
|
||||
// keyboard name and language code, or just the BCP-47 language code.
|
||||
kmw.addKeyboards('french','european2@sv','european2@no','@he');
|
||||
|
||||
// Add a keyboard by language name. Note that the name must be spelled
|
||||
// correctly, or the keyboard will not be found. (Using BCP-47 codes is
|
||||
// usually easier.)
|
||||
kmw.addKeyboardsForLanguage('Dzongkha');
|
||||
|
||||
// Add a fully-specified, locally-sourced, keyboard with custom font
|
||||
kmw.addKeyboards({id:'lao_2008_basic',name:'Lao Basic',
|
||||
languages:{
|
||||
id:'lo',name:'Lao',region:'Asia',
|
||||
font:{family:'LaoWeb',source:['../font/saysettha_web.ttf','../font/saysettha_web.woff','../font/saysettha_web.eot']}
|
||||
},
|
||||
filename:'../lao_2008_basic.js'
|
||||
});
|
||||
|
||||
// The following two optional calls should be delayed until language menus are fully loaded:
|
||||
// (a) a specific mapped input element input is focused, to ensure that the OSK appears
|
||||
// (b) a specific keyboard is loaded, rather than the keyboard last used.
|
||||
//window.setTimeout(function(){kmw.setActiveElement('ta1',true);},2500);
|
||||
//window.setTimeout(function(){kmw.setActiveKeyboard('Keyboard_french','fr');},3000);
|
||||
|
||||
// Note that locally specified keyboards will be listed before keyboards
|
||||
// requested from the remote server by user interfaces that do not order
|
||||
// keyboards alphabetically by language.
|
||||
}
|
||||
|
||||
// Script to allow a user to add any keyboard to the keyboard menu
|
||||
function addKeyboard(n)
|
||||
{
|
||||
var sKbd, kmw=window['keyman'] ? keyman : tavultesoft.keymanweb;
|
||||
switch(n)
|
||||
{
|
||||
case 1:
|
||||
sKbd=document.getElementById('kbd_id1').value;
|
||||
kmw.addKeyboards(sKbd);
|
||||
break;
|
||||
case 2:
|
||||
sKbd=document.getElementById('kbd_id2').value.toLowerCase();
|
||||
kmw.addKeyboards('@'+sKbd);
|
||||
break;
|
||||
case 3:
|
||||
sKbd=document.getElementById('kbd_id3').value;
|
||||
kmw.addKeyboardsForLanguage(sKbd);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Add keyboard on Enter (as well as pressing button)
|
||||
function clickOnEnter(e,id)
|
||||
{
|
||||
e = e || window.event;
|
||||
if(e.keyCode == 13) addKeyboard(id);
|
||||
}
|
||||
|
||||
function setActiveKeyboard() {
|
||||
var kmw=window['keyman'] ? keyman : tavultesoft.keymanweb;
|
||||
|
||||
var sKbd = document.getElementById('kbd_id4').value;
|
||||
var sLng = document.getElementById('lang_id4').value;
|
||||
var result = kmw.setActiveKeyboard("Keyboard_" + sKbd, sLng);
|
||||
}
|
||||
|
||||
|
||||
var sKbd = document.getElementById('kbd_id4').value;
|
||||
var sLng = document.getElementById('lang_id4').value;
|
||||
var result = kmw.setActiveKeyboard("Keyboard_" + sKbd, sLng);
|
||||
}
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
</style>
|
||||
|
||||
<!-- Insert uncompiled KeymanWeb source scripts -->
|
||||
<script src="../../intermediate/keymanweb.js" type="application/javascript"></script>
|
||||
<script src="../../release/unminified/web/keymanweb.js" type="application/javascript"></script>
|
||||
|
||||
<!--
|
||||
For desktop browsers, a script for the user interface must be inserted here.
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
The toolbar UI is best for any page designed to support keyboards for
|
||||
a large number of languages.
|
||||
-->
|
||||
<script src="../../intermediate/kmwuitoggle.js"></script>
|
||||
<script src="../../release/unminified/web/kmwuitoggle.js"></script>
|
||||
|
||||
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
|
||||
<script>
|
||||
|
|
@ -43,12 +43,13 @@
|
|||
</script>
|
||||
|
||||
<!-- Add keyboard management script for local selection of keyboards to use -->
|
||||
<script src="./header.js"></script>
|
||||
<script src="../commonHeader.js"></script>
|
||||
<script src="./header.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<!-- Sample page HTML -->
|
||||
<body onload='loadKeyboards();'>
|
||||
<body onload='loadKeyboards(1);'>
|
||||
<h2>KeymanWeb: Test page for interactions between setActiveKeyboard and the toolbar UI</h2>
|
||||
|
||||
<h3>This version is used to test the interactions of <code>SetActiveKeyboard</code> with the Toolbar UI.</h3>
|
||||
|
|
@ -58,7 +59,7 @@
|
|||
<li>french, fr</li>
|
||||
<li>european2, no</li>
|
||||
<li>european2, sv</li>
|
||||
<li>hebrew, heb</li>
|
||||
<li>hebrew, he</li>
|
||||
<li>dzongkha, dzo</li>
|
||||
<li>lao_2008_basic, lo</li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
</style>
|
||||
|
||||
<!-- Insert uncompiled KeymanWeb source scripts -->
|
||||
<script src="../../intermediate/keymanweb.js" type="application/javascript"></script>
|
||||
<script src="../../release/unminified/web/keymanweb.js" type="application/javascript"></script>
|
||||
|
||||
<!--
|
||||
For desktop browsers, a script for the user interface must be inserted here.
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
The toolbar UI is best for any page designed to support keyboards for
|
||||
a large number of languages.
|
||||
-->
|
||||
<script src="../../intermediate/kmwuitoggle.js"></script>
|
||||
<script src="../../release/unminified/web/kmwuitoggle.js"></script>
|
||||
|
||||
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
|
||||
<script>
|
||||
|
|
@ -42,12 +42,13 @@
|
|||
</script>
|
||||
|
||||
<!-- Add keyboard management script for local selection of keyboards to use -->
|
||||
<script src="./issue-29.js"></script>
|
||||
<script src="../commonHeader.js"></script>
|
||||
<script src="issue-29.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<!-- Sample page HTML -->
|
||||
<body onload='loadKeyboards();'>
|
||||
<body onload='loadKeyboards(1);'>
|
||||
<h2>KeymanWeb: Test desktop MutationObserver functionality</h2>
|
||||
|
||||
<div id='DynamicTextboxes'>
|
||||
|
|
|
|||
|
|
@ -1,128 +1,45 @@
|
|||
// JavaScript Document samplehdr.js: Keyboard management for KeymanWeb demonstration pages
|
||||
{
|
||||
var inputCounter = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
The keyboard name and/or BCP-47 code must be specified for each keyboard that is to be available.
|
||||
If the same keyboard is used for several languages, it must be listed for each
|
||||
language, but the keyboard itself will only be loaded once.
|
||||
If two (or more) keyboards are to be available for a given language, both must be listed.
|
||||
Any number of keyboards may be specified in one or more calls.
|
||||
Keyboard paths may be absolute (with respect to the server root) or relative to the keyboards option path.
|
||||
The actual keyboard object will be downloaded asynchronously when first selected for use.
|
||||
|
||||
Each argument to addKeyboards() is a string, for example:
|
||||
european2 loads the current version of the Eurolatin 2 keyboard (for its default language)
|
||||
european2@fr loads the current version of the Eurolatin 2 keyboard for French
|
||||
european2@fr@1.2 loads version 1.2 of the Eurolatin 2 keyboard for French
|
||||
|
||||
Argument syntax also supports the following extensions:
|
||||
@fr load the current version of the default keyboard for French
|
||||
@fr$ load all available keyboards (current version) for French
|
||||
|
||||
Each call to addKeyboards() requires a single call to the remote server,
|
||||
(unless all keyboards listed are local and fully specified) so it is better
|
||||
to use multiple arguments rather than separate function calls.
|
||||
|
||||
Calling addKeyboards() with no arguments returns a list of *all* available keyboards.
|
||||
The Toolbar (desktop browser) UI is best suited for allowing users to select
|
||||
the appropriate language and keyboard in this case.
|
||||
function addInputs() {
|
||||
var masterDiv = document.getElementById('DynamicTextboxes');
|
||||
|
||||
Keyboards may also be specified by language name using addKeyboardsForLanguage()
|
||||
for example:
|
||||
keymanweb.addKeyboardsForLanguage('Burmese');
|
||||
|
||||
Appending $ to the language name will again cause all available keyboards for that
|
||||
language to be loaded rather than the default keyboard.
|
||||
|
||||
The first call to addKeyboardsForLanguage() makes an additional call to the
|
||||
keyman API to load the current list of keyboard/language associations.
|
||||
var newTextArea = document.createElement("textarea");
|
||||
|
||||
In this example, the following function loads the indicated keyboards,
|
||||
and is called when the page loads.
|
||||
*/
|
||||
var i = inputCounter++;
|
||||
|
||||
function loadKeyboards()
|
||||
{
|
||||
var kmw=keyman;
|
||||
|
||||
// The first keyboard added will be the default keyboard for touch devices.
|
||||
// For faster loading, it may be best for the default keyboard to be
|
||||
// locally sourced.
|
||||
kmw.addKeyboards({id:'us',name:'English',languages:{id:'en',name:'English'},
|
||||
filename:'../us-1.0.js'});
|
||||
|
||||
// Add more keyboards to the language menu, by keyboard name,
|
||||
// keyboard name and language code, or just the BCP-47 language code.
|
||||
kmw.addKeyboards('french','european2@sv','european2@no','@he');
|
||||
|
||||
// Add a keyboard by language name. Note that the name must be spelled
|
||||
// correctly, or the keyboard will not be found. (Using BCP-47 codes is
|
||||
// usually easier.)
|
||||
kmw.addKeyboardsForLanguage('Dzongkha');
|
||||
|
||||
// Add a fully-specified, locally-sourced, keyboard with custom font
|
||||
kmw.addKeyboards({id:'lao_2008_basic',name:'Lao Basic',
|
||||
languages:{
|
||||
id:'lo',name:'Lao',region:'Asia',
|
||||
font:{family:'LaoWeb',source:['../font/saysettha_web.ttf','../font/saysettha_web.woff','../font/saysettha_web.eot']}
|
||||
},
|
||||
filename:'../lao_2008_basic.js'
|
||||
});
|
||||
newTextArea.id = 'ta' + i;
|
||||
newTextArea.className = 'test';
|
||||
newTextArea.placeholder = "Dynamic area!";
|
||||
|
||||
// The following two optional calls should be delayed until language menus are fully loaded:
|
||||
// (a) a specific mapped input element input is focused, to ensure that the OSK appears
|
||||
// (b) a specific keyboard is loaded, rather than the keyboard last used.
|
||||
//window.setTimeout(function(){kmw.setActiveElement('ta1',true);},2500);
|
||||
//window.setTimeout(function(){kmw.setActiveKeyboard('Keyboard_french','fr');},3000);
|
||||
|
||||
// Note that locally specified keyboards will be listed before keyboards
|
||||
// requested from the remote server by user interfaces that do not order
|
||||
// keyboards alphabetically by language.
|
||||
}
|
||||
|
||||
{
|
||||
var inputCounter = 1;
|
||||
}
|
||||
|
||||
function addInputs()
|
||||
{
|
||||
var masterDiv = document.getElementById('DynamicTextboxes');
|
||||
|
||||
var newTextArea = document.createElement("textarea");
|
||||
|
||||
var i = inputCounter++;
|
||||
|
||||
newTextArea.id = 'ta' + i;
|
||||
newTextArea.className = 'test';
|
||||
newTextArea.placeholder = "Dynamic area!";
|
||||
|
||||
var newInput = document.createElement("input");
|
||||
newInput.id = 'in' + i;
|
||||
newInput.className = 'test';
|
||||
newInput.placeholder = "Dynamic area!";
|
||||
|
||||
//masterDiv.appendChild(newTextArea);
|
||||
//masterDiv.appendChild(newInput);
|
||||
|
||||
var newDiv = document.createElement("div");
|
||||
|
||||
newDiv.appendChild(newTextArea);
|
||||
newDiv.appendChild(newInput);
|
||||
|
||||
masterDiv.appendChild(newDiv);
|
||||
}
|
||||
|
||||
function addIFrame()
|
||||
{
|
||||
var masterDiv = document.getElementById('DynamicTextboxes');
|
||||
|
||||
var frame = document.createElement("iframe");
|
||||
frame.height = "100";
|
||||
frame.src = "issue-29-iframe.html";
|
||||
frame.onload = function() {console.log('Original onload!');};
|
||||
|
||||
//masterDiv.appendChild(frame);
|
||||
|
||||
var newDiv = document.createElement("div");
|
||||
newDiv.appendChild(frame);
|
||||
masterDiv.appendChild(newDiv);
|
||||
}
|
||||
var newInput = document.createElement("input");
|
||||
newInput.id = 'in' + i;
|
||||
newInput.className = 'test';
|
||||
newInput.placeholder = "Dynamic area!";
|
||||
|
||||
//masterDiv.appendChild(newTextArea);
|
||||
//masterDiv.appendChild(newInput);
|
||||
|
||||
var newDiv = document.createElement("div");
|
||||
|
||||
newDiv.appendChild(newTextArea);
|
||||
newDiv.appendChild(newInput);
|
||||
|
||||
masterDiv.appendChild(newDiv);
|
||||
}
|
||||
|
||||
function addIFrame() {
|
||||
var masterDiv = document.getElementById('DynamicTextboxes');
|
||||
|
||||
var frame = document.createElement("iframe");
|
||||
frame.height = "100";
|
||||
frame.src = "issue-29-iframe.html";
|
||||
frame.onload = function() {console.log('Original onload!');};
|
||||
|
||||
//masterDiv.appendChild(frame);
|
||||
|
||||
var newDiv = document.createElement("div");
|
||||
newDiv.appendChild(frame);
|
||||
masterDiv.appendChild(newDiv);
|
||||
}
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
</style>
|
||||
|
||||
<!-- Insert uncompiled KeymanWeb source scripts -->
|
||||
<script src="../../intermediate/keymanweb.js" type="application/javascript"></script>
|
||||
<script src="../../release/unminified/web/keymanweb.js" type="application/javascript"></script>
|
||||
|
||||
<!--
|
||||
For desktop browsers, a script for the user interface must be inserted here.
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
The toolbar UI is best for any page designed to support keyboards for
|
||||
a large number of languages.
|
||||
-->
|
||||
<script src="../../intermediate/kmwuitoggle.js"></script>
|
||||
<script src="../../release/unminified/web/kmwuitoggle.js"></script>
|
||||
|
||||
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -1,89 +1,47 @@
|
|||
// JavaScript Document samplehdr.js: Keyboard management for KeymanWeb demonstration pages
|
||||
function loadKeyboards()
|
||||
{
|
||||
var kmw=keyman;
|
||||
|
||||
/*
|
||||
The keyboard name and/or BCP-47 code must be specified for each keyboard that is to be available.
|
||||
If the same keyboard is used for several languages, it must be listed for each
|
||||
language, but the keyboard itself will only be loaded once.
|
||||
If two (or more) keyboards are to be available for a given language, both must be listed.
|
||||
Any number of keyboards may be specified in one or more calls.
|
||||
Keyboard paths may be absolute (with respect to the server root) or relative to the keyboards option path.
|
||||
The actual keyboard object will be downloaded asynchronously when first selected for use.
|
||||
|
||||
Each argument to addKeyboards() is a string, for example:
|
||||
european2 loads the current version of the Eurolatin 2 keyboard (for its default language)
|
||||
european2@fr loads the current version of the Eurolatin 2 keyboard for French
|
||||
european2@fr@1.2 loads version 1.2 of the Eurolatin 2 keyboard for French
|
||||
|
||||
Argument syntax also supports the following extensions:
|
||||
@fr load the current version of the default keyboard for French
|
||||
@fr$ load all available keyboards (current version) for French
|
||||
|
||||
Each call to addKeyboards() requires a single call to the remote server,
|
||||
(unless all keyboards listed are local and fully specified) so it is better
|
||||
to use multiple arguments rather than separate function calls.
|
||||
|
||||
Calling addKeyboards() with no arguments returns a list of *all* available keyboards.
|
||||
The Toolbar (desktop browser) UI is best suited for allowing users to select
|
||||
the appropriate language and keyboard in this case.
|
||||
// Add a fully-specified, locally-sourced, keyboard.
|
||||
kmw.addKeyboards({id:'layered_debug_keyboard',name:'Web_Layer_Debugging',
|
||||
languages:{
|
||||
id:'dbg',name:'Debug',region:'North America'
|
||||
},
|
||||
filename:'./layered_debug_keyboard.js'
|
||||
});
|
||||
}
|
||||
|
||||
Keyboards may also be specified by language name using addKeyboardsForLanguage()
|
||||
for example:
|
||||
keymanweb.addKeyboardsForLanguage('Burmese');
|
||||
|
||||
Appending $ to the language name will again cause all available keyboards for that
|
||||
language to be loaded rather than the default keyboard.
|
||||
|
||||
The first call to addKeyboardsForLanguage() makes an additional call to the
|
||||
keyman API to load the current list of keyboard/language associations.
|
||||
|
||||
In this example, the following function loads the indicated keyboards,
|
||||
and is called when the page loads.
|
||||
*/
|
||||
|
||||
function loadKeyboards()
|
||||
{
|
||||
var kmw=keyman;
|
||||
|
||||
// Add a fully-specified, locally-sourced, keyboard.
|
||||
kmw.addKeyboards({id:'layered_debug_keyboard',name:'Web_Layer_Debugging',
|
||||
languages:{
|
||||
id:'dbg',name:'Debug',region:'North America'
|
||||
},
|
||||
filename:'./layered_debug_keyboard-1.0.js'
|
||||
});
|
||||
}
|
||||
|
||||
// Script to allow a user to add any keyboard to the keyboard menu
|
||||
function addKeyboard(n)
|
||||
{
|
||||
var sKbd,kmw=keyman;
|
||||
switch(n)
|
||||
{
|
||||
case 1:
|
||||
sKbd=document.getElementById('kbd_id1').value;
|
||||
kmw.addKeyboards(sKbd);
|
||||
break;
|
||||
case 2:
|
||||
sKbd=document.getElementById('kbd_id2').value.toLowerCase();
|
||||
kmw.addKeyboards('@'+sKbd);
|
||||
break;
|
||||
case 3:
|
||||
sKbd=document.getElementById('kbd_id3').value;
|
||||
kmw.addKeyboardsForLanguage(sKbd);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function removeKeyboard(n)
|
||||
// Script to allow a user to add any keyboard to the keyboard menu
|
||||
function addKeyboard(n)
|
||||
{
|
||||
var sKbd,kmw=keyman;
|
||||
switch(n)
|
||||
{
|
||||
var sKbd=document.getElementById('kbd_id4').value, kmw=keyman;
|
||||
kmw["removeKeyboards"](sKbd);
|
||||
}
|
||||
|
||||
// Add keyboard on Enter (as well as pressing button)
|
||||
function clickOnEnter(e,id)
|
||||
{
|
||||
e = e || window.event;
|
||||
if(e.keyCode == 13) addKeyboard(id);
|
||||
case 1:
|
||||
sKbd=document.getElementById('kbd_id1').value;
|
||||
kmw.addKeyboards(sKbd);
|
||||
break;
|
||||
case 2:
|
||||
sKbd=document.getElementById('kbd_id2').value.toLowerCase();
|
||||
kmw.addKeyboards('@'+sKbd);
|
||||
break;
|
||||
case 3:
|
||||
sKbd=document.getElementById('kbd_id3').value;
|
||||
kmw.addKeyboardsForLanguage(sKbd);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function removeKeyboard(n)
|
||||
{
|
||||
var sKbd=document.getElementById('kbd_id4').value, kmw=keyman;
|
||||
kmw["removeKeyboards"](sKbd);
|
||||
}
|
||||
|
||||
// Add keyboard on Enter (as well as pressing button)
|
||||
function clickOnEnter(e,id)
|
||||
{
|
||||
e = e || window.event;
|
||||
if(e.keyCode == 13) addKeyboard(id);
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"options" : {
|
||||
"device" : "any",
|
||||
"keyboardBaseUri" : "http://your-host-here/keyboard-path/",
|
||||
"fontBaseUri" : "http://your-host-here/font-path/"
|
||||
},
|
||||
"keyboard" : {
|
||||
"id" : "layered_debug_keyboard",
|
||||
"name" : "Web_Layer_Debugging",
|
||||
"filename" : "layered_debug_keyboard-1.0.js",
|
||||
"version" : "1.0",
|
||||
"lastModified" : "2017-05-30T14:37:43.913+07:00",
|
||||
"languages" : [
|
||||
{
|
||||
"id" : "eng",
|
||||
"name" : "English"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
KeymanWeb.KRS(new Stub_Keyboard_layered_debug_keyboard()); function Stub_Keyboard_layered_debug_keyboard() {this.KF="layered_debug_keyboard-1.0.js";this.KI="Keyboard_layered_debug_keyboard";this.KN="Web_Layer_Debugging";}
|
||||
1
web/testing/issue53/layered_debug_keyboard.js
Normal file
1
web/testing/issue53/layered_debug_keyboard.js
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -1,10 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<visualkeyboard>
|
||||
<header>
|
||||
<version>10.0</version>
|
||||
<kbdname></kbdname>
|
||||
<flags>
|
||||
<displayunderlying/>
|
||||
</flags>
|
||||
</header>
|
||||
</visualkeyboard>
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
</style>
|
||||
|
||||
<!-- Insert uncompiled KeymanWeb source scripts -->
|
||||
<script src="../../intermediate/keymanweb.js" type="application/javascript"></script>
|
||||
<script src="../../release/unminified/web/keymanweb.js" type="application/javascript"></script>
|
||||
|
||||
<!--
|
||||
For desktop browsers, a script for the user interface must be inserted here.
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
The toolbar UI is best for any page designed to support keyboards for
|
||||
a large number of languages.
|
||||
-->
|
||||
<script src="../../intermediate/kmwuitoggle.js"></script>
|
||||
<script src="../../release/unminified/web/kmwuitoggle.js"></script>
|
||||
|
||||
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
|
||||
<script>
|
||||
|
|
@ -43,12 +43,13 @@
|
|||
</script>
|
||||
|
||||
<!-- Add keyboard management script for local selection of keyboards to use -->
|
||||
<script src="../commonHeader.js"></script>
|
||||
<script src="./issue-62.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<!-- Sample page HTML -->
|
||||
<body onload='loadKeyboards();'>
|
||||
<body onload='loadKeyboards(1);'>
|
||||
<h2>KeymanWeb: Light test for touch-based MutationObserver functionality</h2>
|
||||
|
||||
<div id='DynamicTextboxes'>
|
||||
|
|
|
|||
|
|
@ -1,98 +1,17 @@
|
|||
// JavaScript Document samplehdr.js: Keyboard management for KeymanWeb demonstration pages
|
||||
function addInputs()
|
||||
{
|
||||
var masterDiv = document.getElementById('DynamicTextboxes');
|
||||
|
||||
/*
|
||||
The keyboard name and/or BCP-47 code must be specified for each keyboard that is to be available.
|
||||
If the same keyboard is used for several languages, it must be listed for each
|
||||
language, but the keyboard itself will only be loaded once.
|
||||
If two (or more) keyboards are to be available for a given language, both must be listed.
|
||||
Any number of keyboards may be specified in one or more calls.
|
||||
Keyboard paths may be absolute (with respect to the server root) or relative to the keyboards option path.
|
||||
The actual keyboard object will be downloaded asynchronously when first selected for use.
|
||||
|
||||
Each argument to addKeyboards() is a string, for example:
|
||||
european2 loads the current version of the Eurolatin 2 keyboard (for its default language)
|
||||
european2@fr loads the current version of the Eurolatin 2 keyboard for French
|
||||
european2@fr@1.2 loads version 1.2 of the Eurolatin 2 keyboard for French
|
||||
|
||||
Argument syntax also supports the following extensions:
|
||||
@fr load the current version of the default keyboard for French
|
||||
@fr$ load all available keyboards (current version) for French
|
||||
|
||||
Each call to addKeyboards() requires a single call to the remote server,
|
||||
(unless all keyboards listed are local and fully specified) so it is better
|
||||
to use multiple arguments rather than separate function calls.
|
||||
|
||||
Calling addKeyboards() with no arguments returns a list of *all* available keyboards.
|
||||
The Toolbar (desktop browser) UI is best suited for allowing users to select
|
||||
the appropriate language and keyboard in this case.
|
||||
var newTextArea = document.createElement("textarea");
|
||||
newTextArea.id = 'ta2';
|
||||
newTextArea.className = 'test';
|
||||
newTextArea.placeholder = "Dynamic area!";
|
||||
|
||||
Keyboards may also be specified by language name using addKeyboardsForLanguage()
|
||||
for example:
|
||||
keymanweb.addKeyboardsForLanguage('Burmese');
|
||||
|
||||
Appending $ to the language name will again cause all available keyboards for that
|
||||
language to be loaded rather than the default keyboard.
|
||||
|
||||
The first call to addKeyboardsForLanguage() makes an additional call to the
|
||||
keyman API to load the current list of keyboard/language associations.
|
||||
var newInput = document.createElement("input");
|
||||
newInput.id = 'in2';
|
||||
newInput.className = 'test';
|
||||
newInput.placeholder = "Dynamic area!";
|
||||
|
||||
In this example, the following function loads the indicated keyboards,
|
||||
and is called when the page loads.
|
||||
*/
|
||||
|
||||
function loadKeyboards()
|
||||
{
|
||||
var kmw=keyman;
|
||||
|
||||
// The first keyboard added will be the default keyboard for touch devices.
|
||||
// For faster loading, it may be best for the default keyboard to be
|
||||
// locally sourced.
|
||||
kmw.addKeyboards({id:'us',name:'English',languages:{id:'en',name:'English'},
|
||||
filename:'../us-1.0.js'});
|
||||
|
||||
// Add more keyboards to the language menu, by keyboard name,
|
||||
// keyboard name and language code, or just the BCP-47 language code.
|
||||
kmw.addKeyboards('french','european2@sv','european2@no','@he');
|
||||
|
||||
// Add a keyboard by language name. Note that the name must be spelled
|
||||
// correctly, or the keyboard will not be found. (Using BCP-47 codes is
|
||||
// usually easier.)
|
||||
kmw.addKeyboardsForLanguage('Dzongkha');
|
||||
|
||||
// Add a fully-specified, locally-sourced, keyboard with custom font
|
||||
kmw.addKeyboards({id:'lao_2008_basic',name:'Lao Basic',
|
||||
languages:{
|
||||
id:'lo',name:'Lao',region:'Asia',
|
||||
font:{family:'LaoWeb',source:['../font/saysettha_web.ttf','../font/saysettha_web.woff','../font/saysettha_web.eot']}
|
||||
},
|
||||
filename:'../lao_2008_basic.js'
|
||||
});
|
||||
|
||||
// The following two optional calls should be delayed until language menus are fully loaded:
|
||||
// (a) a specific mapped input element input is focused, to ensure that the OSK appears
|
||||
// (b) a specific keyboard is loaded, rather than the keyboard last used.
|
||||
//window.setTimeout(function(){kmw.setActiveElement('ta1',true);},2500);
|
||||
//window.setTimeout(function(){kmw.setActiveKeyboard('Keyboard_french','fr');},3000);
|
||||
|
||||
// Note that locally specified keyboards will be listed before keyboards
|
||||
// requested from the remote server by user interfaces that do not order
|
||||
// keyboards alphabetically by language.
|
||||
}
|
||||
|
||||
function addInputs()
|
||||
{
|
||||
var masterDiv = document.getElementById('DynamicTextboxes');
|
||||
|
||||
var newTextArea = document.createElement("textarea");
|
||||
newTextArea.id = 'ta2';
|
||||
newTextArea.className = 'test';
|
||||
newTextArea.placeholder = "Dynamic area!";
|
||||
|
||||
var newInput = document.createElement("input");
|
||||
newInput.id = 'in2';
|
||||
newInput.className = 'test';
|
||||
newInput.placeholder = "Dynamic area!";
|
||||
|
||||
masterDiv.appendChild(newTextArea);
|
||||
masterDiv.appendChild(newInput);
|
||||
}
|
||||
masterDiv.appendChild(newTextArea);
|
||||
masterDiv.appendChild(newInput);
|
||||
}
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
</style>
|
||||
|
||||
<!-- Insert uncompiled KeymanWeb source scripts -->
|
||||
<script src="../../intermediate/keymanweb.js" type="application/javascript"></script>
|
||||
<script src="../../release/unminified/web/keymanweb.js" type="application/javascript"></script>
|
||||
|
||||
<!--
|
||||
For desktop browsers, a script for the user interface must be inserted here.
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
The toolbar UI is best for any page designed to support keyboards for
|
||||
a large number of languages.
|
||||
-->
|
||||
<script src="../../intermediate/kmwuitoggle.js"></script>
|
||||
<script src="../../release/unminified/web/kmwuitoggle.js"></script>
|
||||
|
||||
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
|
||||
<script>
|
||||
|
|
@ -43,12 +43,13 @@
|
|||
</script>
|
||||
|
||||
<!-- Add keyboard management script for local selection of keyboards to use -->
|
||||
<script src="../commonHeader.js"></script>
|
||||
<script src="./issue-63.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<!-- Sample page HTML -->
|
||||
<body onload='loadKeyboards();'>
|
||||
<body onload='loadKeyboards(1);'>
|
||||
<h2>KeymanWeb: Test/stress-test touch-based MutationObserver functionality</h2>
|
||||
|
||||
<div id='DynamicTextboxes'>
|
||||
|
|
|
|||
|
|
@ -1,156 +1,70 @@
|
|||
// JavaScript Document samplehdr.js: Keyboard management for KeymanWeb demonstration pages
|
||||
{
|
||||
var inputCounter = 1;
|
||||
var removalCounter = 1;
|
||||
var removedElements = [];
|
||||
}
|
||||
|
||||
/*
|
||||
The keyboard name and/or BCP-47 code must be specified for each keyboard that is to be available.
|
||||
If the same keyboard is used for several languages, it must be listed for each
|
||||
language, but the keyboard itself will only be loaded once.
|
||||
If two (or more) keyboards are to be available for a given language, both must be listed.
|
||||
Any number of keyboards may be specified in one or more calls.
|
||||
Keyboard paths may be absolute (with respect to the server root) or relative to the keyboards option path.
|
||||
The actual keyboard object will be downloaded asynchronously when first selected for use.
|
||||
|
||||
Each argument to addKeyboards() is a string, for example:
|
||||
european2 loads the current version of the Eurolatin 2 keyboard (for its default language)
|
||||
european2@fr loads the current version of the Eurolatin 2 keyboard for French
|
||||
european2@fr@1.2 loads version 1.2 of the Eurolatin 2 keyboard for French
|
||||
|
||||
Argument syntax also supports the following extensions:
|
||||
@fr load the current version of the default keyboard for French
|
||||
@fr$ load all available keyboards (current version) for French
|
||||
|
||||
Each call to addKeyboards() requires a single call to the remote server,
|
||||
(unless all keyboards listed are local and fully specified) so it is better
|
||||
to use multiple arguments rather than separate function calls.
|
||||
|
||||
Calling addKeyboards() with no arguments returns a list of *all* available keyboards.
|
||||
The Toolbar (desktop browser) UI is best suited for allowing users to select
|
||||
the appropriate language and keyboard in this case.
|
||||
function addInputs() {
|
||||
var masterDiv = document.getElementById('DynamicTextboxes');
|
||||
|
||||
Keyboards may also be specified by language name using addKeyboardsForLanguage()
|
||||
for example:
|
||||
keymanweb.addKeyboardsForLanguage('Burmese');
|
||||
|
||||
Appending $ to the language name will again cause all available keyboards for that
|
||||
language to be loaded rather than the default keyboard.
|
||||
|
||||
The first call to addKeyboardsForLanguage() makes an additional call to the
|
||||
keyman API to load the current list of keyboard/language associations.
|
||||
var newTextArea = document.createElement("textarea");
|
||||
|
||||
In this example, the following function loads the indicated keyboards,
|
||||
and is called when the page loads.
|
||||
*/
|
||||
var i = inputCounter++;
|
||||
|
||||
function loadKeyboards()
|
||||
{
|
||||
var kmw=keyman;
|
||||
|
||||
// The first keyboard added will be the default keyboard for touch devices.
|
||||
// For faster loading, it may be best for the default keyboard to be
|
||||
// locally sourced.
|
||||
kmw.addKeyboards({id:'us',name:'English',languages:{id:'en',name:'English'},
|
||||
filename:'../us-1.0.js'});
|
||||
|
||||
// Add more keyboards to the language menu, by keyboard name,
|
||||
// keyboard name and language code, or just the BCP-47 language code.
|
||||
kmw.addKeyboards('french','european2@sv','european2@no','@he');
|
||||
|
||||
// Add a keyboard by language name. Note that the name must be spelled
|
||||
// correctly, or the keyboard will not be found. (Using BCP-47 codes is
|
||||
// usually easier.)
|
||||
kmw.addKeyboardsForLanguage('Dzongkha');
|
||||
|
||||
// Add a fully-specified, locally-sourced, keyboard with custom font
|
||||
kmw.addKeyboards({id:'lao_2008_basic',name:'Lao Basic',
|
||||
languages:{
|
||||
id:'lo',name:'Lao',region:'Asia',
|
||||
font:{family:'LaoWeb',source:['../font/saysettha_web.ttf','../font/saysettha_web.woff','../font/saysettha_web.eot']}
|
||||
},
|
||||
filename:'../lao_2008_basic.js'
|
||||
});
|
||||
newTextArea.id = 'ta' + i;
|
||||
newTextArea.className = 'test';
|
||||
newTextArea.placeholder = "Dynamic area #" + i + "!";
|
||||
|
||||
// The following two optional calls should be delayed until language menus are fully loaded:
|
||||
// (a) a specific mapped input element input is focused, to ensure that the OSK appears
|
||||
// (b) a specific keyboard is loaded, rather than the keyboard last used.
|
||||
//window.setTimeout(function(){kmw.setActiveElement('ta1',true);},2500);
|
||||
//window.setTimeout(function(){kmw.setActiveKeyboard('Keyboard_french','fr');},3000);
|
||||
|
||||
// Note that locally specified keyboards will be listed before keyboards
|
||||
// requested from the remote server by user interfaces that do not order
|
||||
// keyboards alphabetically by language.
|
||||
var newInput = document.createElement("input");
|
||||
newInput.id = 'in' + i;
|
||||
newInput.className = 'test';
|
||||
newInput.placeholder = "Dynamic area #" + i + "!";
|
||||
|
||||
//masterDiv.appendChild(newTextArea);
|
||||
//masterDiv.appendChild(newInput);
|
||||
|
||||
var newDiv = document.createElement("div");
|
||||
newDiv.id = "dynamic_div" + i;
|
||||
|
||||
//newDiv.appendChild(newTextArea);
|
||||
newDiv.appendChild(newInput);
|
||||
|
||||
masterDiv.appendChild(newDiv);
|
||||
}
|
||||
|
||||
function removeInputs() {
|
||||
var parent = document.getElementById('DynamicTextboxes');
|
||||
var div = document.getElementById("dynamic_div" + removalCounter);
|
||||
if(div) {
|
||||
removalCounter++;
|
||||
parent.removeChild(div);
|
||||
removedElements.push(div);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function restoreInputs() {
|
||||
var masterDiv = document.getElementById('DynamicTextboxes');
|
||||
removalCounter = 1;
|
||||
|
||||
for(var i = 0; i < removedElements.length; i++)
|
||||
{
|
||||
var inputCounter = 1;
|
||||
var removalCounter = 1;
|
||||
var removedElements = [];
|
||||
masterDiv.appendChild(removedElements[i]);
|
||||
}
|
||||
|
||||
function addInputs()
|
||||
{
|
||||
var masterDiv = document.getElementById('DynamicTextboxes');
|
||||
|
||||
var newTextArea = document.createElement("textarea");
|
||||
|
||||
var i = inputCounter++;
|
||||
|
||||
newTextArea.id = 'ta' + i;
|
||||
newTextArea.className = 'test';
|
||||
newTextArea.placeholder = "Dynamic area #" + i + "!";
|
||||
|
||||
var newInput = document.createElement("input");
|
||||
newInput.id = 'in' + i;
|
||||
newInput.className = 'test';
|
||||
newInput.placeholder = "Dynamic area #" + i + "!";
|
||||
|
||||
//masterDiv.appendChild(newTextArea);
|
||||
//masterDiv.appendChild(newInput);
|
||||
|
||||
var newDiv = document.createElement("div");
|
||||
newDiv.id = "dynamic_div" + i;
|
||||
|
||||
//newDiv.appendChild(newTextArea);
|
||||
newDiv.appendChild(newInput);
|
||||
|
||||
masterDiv.appendChild(newDiv);
|
||||
}
|
||||
|
||||
function removeInputs()
|
||||
{
|
||||
var parent = document.getElementById('DynamicTextboxes');
|
||||
var div = document.getElementById("dynamic_div" + removalCounter);
|
||||
if(div)
|
||||
{
|
||||
removalCounter++;
|
||||
parent.removeChild(div);
|
||||
removedElements.push(div);
|
||||
}
|
||||
}
|
||||
|
||||
function restoreInputs()
|
||||
{
|
||||
var masterDiv = document.getElementById('DynamicTextboxes');
|
||||
removalCounter = 1;
|
||||
|
||||
for(var i = 0; i < removedElements.length; i++)
|
||||
{
|
||||
masterDiv.appendChild(removedElements[i]);
|
||||
}
|
||||
|
||||
removedElements = [];
|
||||
}
|
||||
|
||||
function addIFrame()
|
||||
{
|
||||
var masterDiv = document.getElementById('DynamicTextboxes');
|
||||
|
||||
var frame = document.createElement("iframe");
|
||||
frame.height = "100";
|
||||
frame.src = "issue-29-iframe.html";
|
||||
frame.onload = function() {console.log('Original onload!');};
|
||||
|
||||
//masterDiv.appendChild(frame);
|
||||
|
||||
var newDiv = document.createElement("div");
|
||||
newDiv.appendChild(frame);
|
||||
masterDiv.appendChild(newDiv);
|
||||
}
|
||||
|
||||
removedElements = [];
|
||||
}
|
||||
|
||||
function addIFrame() {
|
||||
var masterDiv = document.getElementById('DynamicTextboxes');
|
||||
|
||||
var frame = document.createElement("iframe");
|
||||
frame.height = "100";
|
||||
frame.src = "issue-29-iframe.html";
|
||||
frame.onload = function() {console.log('Original onload!');};
|
||||
|
||||
//masterDiv.appendChild(frame);
|
||||
|
||||
var newDiv = document.createElement("div");
|
||||
newDiv.appendChild(frame);
|
||||
masterDiv.appendChild(newDiv);
|
||||
}
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
</style>
|
||||
|
||||
<!-- Insert uncompiled KeymanWeb source scripts -->
|
||||
<script src="../../intermediate/keymanweb.js" type="application/javascript"></script>
|
||||
<script src="../../release/unminified/web/keymanweb.js" type="application/javascript"></script>
|
||||
|
||||
<!--
|
||||
For desktop browsers, a script for the user interface must be inserted here.
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
The toolbar UI is best for any page designed to support keyboards for
|
||||
a large number of languages.
|
||||
-->
|
||||
<script src="../../intermediate/kmwuitoggle.js"></script>
|
||||
<script src="../../release/unminified/web/kmwuitoggle.js"></script>
|
||||
|
||||
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
</style>
|
||||
|
||||
<!-- Insert uncompiled KeymanWeb source scripts -->
|
||||
<script src="../intermediate/keymanweb.js" type="application/javascript"></script>
|
||||
<script src="../release/unminified/web/keymanweb.js" type="application/javascript"></script>
|
||||
|
||||
<!--
|
||||
For desktop browsers, a script for the user interface must be inserted here.
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
The toolbar UI is best for any page designed to support keyboards for
|
||||
a large number of languages.
|
||||
-->
|
||||
<script src="../intermediate/kmwuitoggle.js"></script>
|
||||
<script src="../release/unminified/web/kmwuitoggle.js"></script>
|
||||
|
||||
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
|
||||
<script>
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
</script>
|
||||
|
||||
<!-- Add keyboard management script for local selection of keyboards to use -->
|
||||
<script src="./samplehdr.js"></script>
|
||||
<script src="commonHeader.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
</style>
|
||||
|
||||
<!-- Insert uncompiled KeymanWeb source scripts -->
|
||||
<script src="../intermediate/keymanweb.js" type="application/javascript"></script>
|
||||
<script src="../release/unminified/web/keymanweb.js" type="application/javascript"></script>
|
||||
|
||||
<!--
|
||||
For desktop browsers, a script for the user interface must be inserted here.
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
The toolbar UI is best for any page designed to support keyboards for
|
||||
a large number of languages.
|
||||
-->
|
||||
<script src="../intermediate/kmwuitoggle.js"></script>
|
||||
<script src="../release/unminified/web/kmwuitoggle.js"></script>
|
||||
|
||||
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
|
||||
<script>
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
</script>
|
||||
|
||||
<!-- Add keyboard management script for local selection of keyboards to use -->
|
||||
<script src="./samplehdr.js"></script>
|
||||
<script src="commonHeader.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue