spiegel-keyman/web/testing/issue917-context-and-notany/index.html
Marc Durdin 54efc34454 fix(web): support for notany() and context()
Fixes #917.

This PR goes along with #3816 to enable support for `notany()` and
`context()` references from the output.
2020-11-04 14:37:52 +11:00

107 lines
4.9 KiB
HTML

<!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 - context() and notany() interaction (#917)</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="../../release/unminified/web/keymanweb.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="../../release/unminified/web/kmwuitoggle.js"></script>
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
<script>
var kmw=window.keyman;
kmw.init({
attachType:'auto'
}).then(function() {
kmw.addKeyboards({id:'test_917',name:'test_917',languages:{id:'en',name:'English'}, filename:'test_917/build/test_917.js'});
});
</script>
</head>
<!-- Sample page HTML -->
<body>
<h2>KeymanWeb Sample Page -context() and notany() interaction (<a href="https://github.com/keymanapp/keyman/issues/917">#917</a>)</h2>
<p>KeymanWeb did not support notany() and context() together. This keyboard tests various scenarios in the implementation (14.0 min):</p>
<table>
<thead><tr><th>Input</th><th>Result</th><th>Notes</th></tr></thead>
<tbody>
<tr><td>abc</td><td>'abc'</td><td>Should not match rule on line 19</td></tr>
<tr><td>xbc</td><td>'xBC'</td><td>Basic character match at start of context (notany vowel) on line 19</td></tr>
<tr><td>dbc</td><td>DK(1) 'BC'</td><td>Deadkey match at start of context on line 19</td></tr>
<tr><td>adcd</td><td>'a' DK(1) 'XX'</td><td>Second position in context, match deadkey rule on line 27</td></tr>
<tr><td>adcd?</td><td>'pass!'</td><td>Verifies that deadkey is conserved through rule match on line 27</td></tr>
<tr><td>axcd</td><td>'axXX'</td><td>Verifies that match occurs for character on line 27</td></tr>
<tr><td>axcd?</td><td>'axXX?'</td><td>Sanity check for line 27</td></tr>
<tr><td>fghi</td><td>'fgXX'</td><td>Testing adjusted index for `if` statement on line 35</td></tr>
<tr><td>fghi?</td><td>'fgXX?'</td><td>Sanity check for line 35</td></tr>
<tr><td>fdhi</td><td>'f' DK(1) XX'</td><td>Testing deadkey match for adjusted index for `if` statement on line 35</td></tr>
<tr><td>fdhi?</td><td>'pass!'</td><td>Verifies that deadkey is conserved thrghou rule match on line 35</td></tr>
</tbody>
</table>
<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'/>
<h3><a href="./">Return to testing home page</a></h3>
<input id="btnPredict" type="button" onclick="togglePredictions();" value="Disable predictions"/>
<input id="btnCorrect" type="button" onclick="toggleCorrections();" value="Disable corrections"/>
</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>