Merge pull request #353 from keymanapp/web-350-establish-testing

Refactors KeymanWeb sample & test pages.
This commit is contained in:
Joshua Horton 2017-10-12 08:06:17 +07:00 committed by GitHub
commit 4622ec00dd
57 changed files with 339 additions and 101 deletions

View file

@ -6,12 +6,13 @@ Google Closures Compiler is used to compile the JavaScript modules into a single
**********************************************************************
The following folders contain the distribution for KeymanWeb 2.0:
The following folders contain the distribution for KeymanWeb:
source Source code
output Fully-compiled KeymanWeb modules for testing
embedded Fully-compiled KMEA/KMEI modules for inclusion in mobile app builds
samples Sample and test-case web-pages
samples Sample pages demonstrating ways to link with KeymanWeb
testing Test-case web-pages for various aspects of KeymanWeb functionality
## Usage
Open **index.html** or **samples/index.html** in your browser. The pages using uncompiled KeymanWeb should work as-is.

View file

@ -19,9 +19,8 @@
</style>
</head>
<body>
<h1>KeymanWeb 2 Testing</h1>
<h2><a href="./samples/uncompiled.html">Test uncompiled Keymanweb</a></h2>
<h2><a href="./samples/compiled.html">Test fully compiled Keymanweb</a></h2>
<h2><a href="./samples/multilingual.html">Full multilingual (compiled) Keymanweb</a></h2>
<h1>KeymanWeb Repo Index</h1>
<h2><a href="./samples/">View Keymanweb use samples.</a></h2>
<h2><a href="./testing/">View Keymanweb manual test pages.</a></h2>
</body>
</html>

View file

@ -11,7 +11,7 @@
<!-- Enable IE9 Standards mode -->
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>KeymanWeb Testing</title>
<title>KeymanWeb Samples</title>
<style type='text/css'>
body {padding-left:20px;margin-left:12px; font-family:Tahoma,Helvetica}
h1 {color: #800;margin-left:10px;}
@ -19,19 +19,10 @@
</style>
</head>
<body>
<h1>KeymanWeb 2 Testing</h1>
<h1>KeymanWeb Samples</h1>
<h2><a href="./uncompiled.html">Test uncompiled Keymanweb</a></h2>
<h2><a href="./compiled.html">Test fully compiled Keymanweb</a></h2>
<h2><a href="./multilingual.html">Full multilingual (compiled) Keymanweb</a></h2>
<h2><a href="./issue-29.html">Uncompiled Keymanweb - test desktop MutationObserver functionality</a></h2>
<h2><a href="./issue-62.html">Uncompiled Keymanweb - light test for touch-based MutationObserver functionality</a></h2>
<h2><a href="./issue-63.html">Uncompiled Keymanweb - test/stress-test touch-based MutationObserver functionality</a></h2>
<h2><a href="./keyboard-errors/uncompiled - error test.html">Uncompiled KeymanWeb - tests keyboard error-handling functionality</a></h2>
<h2><a href="./attachment-api/index.html?mode=auto">Uncompiled KeymanWeb - tests the new Attachment/Enablement API functionality</a><h2>
<h2><a href="./chirality/index.html">Uncompiled KeymanWeb - chirality testing</a><h2>
<h1>Issue Testing</h1>
<h2><a href="./issue-115.html">Long-press on numeric and symbolic layer testing</a></h2>
<h2><a href="./issue-116.html">Next-layer processing testing</a></h2>
<h2><a href="./issue-160.html">Uxxxx code testing</a></h2>
<p><a href="../">Return to main index.</a>
</body>
</html>

File diff suppressed because one or more lines are too long

38
web/testing/index.html Normal file
View file

@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<!-- Set the viewport width to match iOS device widths -->
<!-- <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no" /> -->
<meta name="viewport" content="width=device-width,user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<!-- Enable IE9 Standards mode -->
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>KeymanWeb Testing</title>
<style type='text/css'>
body {padding-left:20px;margin-left:12px; font-family:Tahoma,Helvetica}
h1 {color: #800;margin-left:10px;}
h2 {color: #008;margin-left:20px;}
</style>
</head>
<body>
<h1>KeymanWeb 2 Testing</h1>
<h2><a href="./uncompiled.html">Test uncompiled Keymanweb</a></h2>
<h2><a href="./uncompiled.html">Test uncompiled Keymanweb in manual-attachment mode.</a></h2>
<h2><a href="./keyboard-errors/uncompiled - error test.html">Uncompiled KeymanWeb - tests keyboard error-handling functionality</a></h2>
<h2><a href="./attachment-api/index.html?mode=auto">Uncompiled KeymanWeb - tests the new Attachment/Enablement API functionality</a><h2>
<h2><a href="./chirality/index.html">Uncompiled KeymanWeb - chirality testing</a><h2>
<h1>Auto-attachment mode tests</h1>
<h2><a href="./issue29">Uncompiled Keymanweb - test desktop MutationObserver functionality</a></h2>
<h2><a href="./issue62">Uncompiled Keymanweb - light test for touch-based MutationObserver functionality</a></h2>
<h2><a href="./issue63">Uncompiled Keymanweb - test/stress-test touch-based MutationObserver functionality</a></h2>
<h1>Issue Testing</h1>
<h2><a href="./issue53">Tests layering transitions for keyboards with variable layer sizes.</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>
</body>
</html>

View file

@ -23,15 +23,15 @@
</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="../../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>
<!--
For desktop browsers, a script for the user interface must be inserted here.
@ -40,7 +40,7 @@
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="../../source/kmwuitoggle.js"></script>
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
<script>
@ -72,7 +72,7 @@
</div>
<input type='button' id='btn1' onclick='addInputs();' value='Create Inputs!' />
<input type='button' id='btn2' onclick='addIFrame();' value='Insert an iframe.' />
<h3><a href="../samples/index.html">Return to testing home page</a></h3>
<h3><a href="../">Return to testing home page</a></h3>

View file

@ -48,7 +48,7 @@
// For faster loading, it may be best for the default keybaord to be
// locally sourced.
kmw.addKeyboards({id:'us',name:'English',language:{id:'eng',name:'English'},
filename:'./us-1.0.js'});
filename:'../us-1.0.js'});
// Add more keyboards to the language menu, by keyboard name,
// keyboard name and language code, or just the ISO 639 language code.
@ -65,7 +65,7 @@
id:'lao',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'
filename:'../lao_2008_basic.js'
});
// The following two optional calls should be delayed until language menus are fully loaded:

View file

@ -0,0 +1,114 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<!-- Set the viewport width to match phone and tablet device widths -->
<meta name="viewport" content="width=device-width,user-scalable=no" />
<!-- Allow KeymanWeb to be saved to the iPhone home screen -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<!-- Enable IE9 Standards mode -->
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>KeymanWeb Testing Page - Mismatched Layer Rows</title>
<!-- Your page CSS -->
<style type='text/css'>
body {font-family: Tahoma,helvetica;}
h3 {font-size: 1em;font-weight:normal;color: darkred; margin-bottom: 4px}
.test {font-size: 1.5em; width:80%; min-height:30px; border: 1px solid gray;}
#KeymanWebControl {width:50%;min-width:600px;}
</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>
<!--
For desktop browsers, a script for the user interface must be inserted here.
Standard UIs are toggle, button, float and toolbar.
The toolbar UI is best for any page designed to support keyboards for
a large number of languages.
-->
<script src="../../source/kmwuitoggle.js"></script>
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
<script>
var kmw=window.tavultesoft.keymanweb;
kmw.init({
resources:'resources',
attachType:'auto'
});
</script>
<!-- Add keyboard management script for local selection of keyboards to use -->
<script src="./issue53.js"></script>
</head>
<!-- Sample page HTML -->
<body onload='loadKeyboards();'>
<h2>KeymanWeb Testing Page - Mismatched Layer Rows</h2>
<p>This test should be run from mobile devices or with Chrome's mobile device emulation settings available within Developer Mode.</p>
<div>
<!--
The following DIV is used to position the Button or Toolbar User Interfaces on the page.
If omitted, those User Interfaces will appear at the top of the document body.
(It is ignored by other User Interfaces.)
-->
<div id='KeymanWebControl'></div>
<h3>Type in your language in this text area:</h3>
<textarea id='ta1' class='test' placeholder='Type here'></textarea>
<h3>or in this input field:</h3>
<input class='test' value='' placeholder='or here'/>
<!-- The following elements show how the language menu can be dynamically extended at any time -->
<h3>Add a keyboard by keyboard name:</h3>
<input type='input' id='kbd_id1' class='kmw-disabled' onkeypress="clickOnEnter(event,1);"/>
<input type='button' id='btn1' onclick='addKeyboard(1);' value='Add' />
<h3>Add a keyboard by ISO 639 language code:</h3>
<input type='input' id='kbd_id2' class='kmw-disabled' onkeypress="clickOnEnter(event,2);"/>
<input type='button' id='btn2' onclick='addKeyboard(2);' value='Add' />
<h3>Add a keyboard by language name:</h3>
<input type='input' id='kbd_id3' class='kmw-disabled' onkeypress="clickOnEnter(event,3);"/>
<input type='button' id='btn3' onclick='addKeyboard(3);' value='Add' />
<h3>Remove a keyboard by keyboard name:</h3>
<input type='input' id='kbd_id4' class='kmw-disabled' onkeypress="clickOnEnter(event,1);"/>
<input type='button' id='btn4' onclick='removeKeyboard(1);' value='Remove' />
<h3><a href="../index.html">Return to testing home page</a></h3>
</div>
</body>
<!--
*** DEVELOPER NOTE -- FIREFOX CONFIGURATION FOR TESTING ***
*
* If the URL bar starts with <b>file://</b>, Firefox may not load the font used
* to display the special characters used in the On-Screen Keyboard.
*
* To work around this Firefox bug, navigate to <b>about:config</b>
* and set <b>security.fileuri.strict_origin_policy</b> to <b>false</b>
* while testing.
*
* Firefox resolves website-based CSS URI references correctly without needing
* any configuration change, so this change should only be made for file-based testing.
*
***
-->
</html>

View file

@ -43,33 +43,14 @@
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 keybaord to be
// locally sourced.
kmw.addKeyboards({id:'us',name:'English',language:{id:'eng',name:'English'},
filename:'./us-1.0.js'});
// Add a fully-specified, locally-sourced, keyboard with custom font
kmw.addKeyboards({id:'lao_2008_basic',name:'Lao Basic',
// Add a fully-specified, locally-sourced, keyboard.
kmw.addKeyboards({id:'layered_debug_keyboard',name:'Web_Layer_Debugging',
language:{
id:'lao',name:'Lao',region:'Asia',
font:{family:'LaoWeb',source:['../font/saysettha_web.ttf','../font/saysettha_web.woff','../font/saysettha_web.eot']}
id:'dbg',name:'Debug',region:'North America'
},
filename:'./lao_2008_basic.js'
filename:'./layered_debug_keyboard-1.0.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','fra');},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

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -23,15 +23,15 @@
</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="../../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>
<!--
For desktop browsers, a script for the user interface must be inserted here.
@ -40,14 +40,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="../../source/kmwuitoggle.js"></script>
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
<script>
var kmw=window.tavultesoft.keymanweb;
kmw.init({
resources:'resources',
attachType:'auto'
resources:'resources',
attachType:'auto'
});
</script>
@ -73,7 +73,7 @@
<hr>
</div>
<input type='button' id='btn1' onclick='addInputs();' value='More Inputs!' />
<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>

View file

@ -48,7 +48,7 @@
// For faster loading, it may be best for the default keybaord to be
// locally sourced.
kmw.addKeyboards({id:'us',name:'English',language:{id:'eng',name:'English'},
filename:'./us-1.0.js'});
filename:'../us-1.0.js'});
// Add more keyboards to the language menu, by keyboard name,
// keyboard name and language code, or just the ISO 639 language code.
@ -65,7 +65,7 @@
id:'lao',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'
filename:'../lao_2008_basic.js'
});
// The following two optional calls should be delayed until language menus are fully loaded:
@ -95,15 +95,4 @@
masterDiv.appendChild(newTextArea);
masterDiv.appendChild(newInput);
// keymanweb.inputList = [];
// keymanweb.setupDesktopPage();
// keymanweb._AttachToControls(newTextArea);
// keymanweb._AttachToControls(newInput);
keymanweb.setupDesktopElement(newTextArea);
keymanweb.setupDesktopElement(newInput);
keymanweb.attachToControl(newTextArea);
keymanweb.attachToControl(newInput);
keymanweb.listInputs();
}

View file

@ -23,15 +23,15 @@
</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="../../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>
<!--
For desktop browsers, a script for the user interface must be inserted here.
@ -40,14 +40,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="../../source/kmwuitoggle.js"></script>
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
<script>
var kmw=window.tavultesoft.keymanweb;
kmw.init({
resources:'resources',
attachType:'auto'
attachType:'auto'
});
</script>
@ -77,7 +77,7 @@
<input type='button' id='btn4' onclick="restoreInputs();" value="Restore removed inputs!" />
<hr>
</div>
<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>

View file

@ -0,0 +1,6 @@
<html>
<body>
<h3>Hello World!</h3>
<input id='text' placeholder='This is only a test.'/>
</body>
</html>

View file

@ -48,7 +48,7 @@
// For faster loading, it may be best for the default keybaord to be
// locally sourced.
kmw.addKeyboards({id:'us',name:'English',language:{id:'eng',name:'English'},
filename:'./us-1.0.js'});
filename:'../us-1.0.js'});
// Add more keyboards to the language menu, by keyboard name,
// keyboard name and language code, or just the ISO 639 language code.
@ -65,7 +65,7 @@
id:'lao',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'
filename:'../lao_2008_basic.js'
});
// The following two optional calls should be delayed until language menus are fully loaded:

File diff suppressed because one or more lines are too long

View file

@ -58,6 +58,15 @@
// correctly, or the keyboard will not be found. (Using ISO 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:'lao',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

View file

@ -46,12 +46,13 @@
<script>
var kmw=window.tavultesoft.keymanweb;
kmw.init({
resources:'resources'
resources:'resources',
attachType:'manual'
});
</script>
<!-- Add keyboard management script for local selection of keyboards to use -->
<script src="./issue58.js"></script>
<script src="./samplehdr.js"></script>
</head>
@ -86,9 +87,6 @@
<input type='input' id='kbd_id3' class='kmw-disabled' onkeypress="clickOnEnter(event,3);"/>
<input type='button' id='btn3' onclick='addKeyboard(3);' value='Add' />
<h3>Remove a keyboard by keyboard name:</h3>
<input type='input' id='kbd_id4' class='kmw-disabled' onkeypress="clickOnEnter(event,1);"/>
<input type='button' id='btn4' onclick='removeKeyboard(1);' value='Remove' />
<h3><a href="../samples/index.html">Return to testing home page</a></h3>
</div>

View file

@ -46,13 +46,13 @@
<script>
var kmw=window.tavultesoft.keymanweb;
kmw.init({
attachType:'auto',
resources:'resources'
});
</script>
<!-- Add keyboard management script for local selection of keyboards to use -->
<script src="./issue-53.js"></script>
<script src="./issue53/layered_debug_keyboard-1.0_load.js"></script>
<script src="./samplehdr.js"></script>
</head>

1
web/testing/us-1.0.js Normal file

File diff suppressed because one or more lines are too long