spiegel-keyman/web/testing/spacebar-text/index.html

115 lines
4.2 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<!-- Set the viewport width to match phone and tablet device widths -->
<meta name="viewport" content="width=device-width,user-scalable=no" />
<title>KeymanWeb SpacebarText Tests</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>
keyman.init({
attachType: 'auto'
});
window.addEventListener('load', function() {
keyman.addKeyboards({id:'rac_balti',name:'RAC Balti',
languages:{
id:'bft-Arab-PK',name:'Balti'
},
filename:'rac_balti.js',
displayName: 'My Custom Name'
}, {id:'lao_2008_basic',name:'Lao 2008 Basic',
languages:{
id:'lo',name:'Lao'
},
filename:'../lao_2008_basic-1.2.js',
displayName: ''
},
'@en');
}, false);
function setST(t) {
keyman.options['spacebarText'] = t;
document.getElementById('ta1').focus();
//keyman.osk.show(true); <-- this is needed if you are not triggering a re-display of
// the keyboard, which the focus() call does for us here.
}
</script>
</head>
<!-- Sample page HTML -->
<body>
<h2>KeymanWeb Sample Page - SpacebarText Testing</h2>
<p>See <a href='https://github.com/keymanapp/keyman/pull/5348'>PR #5348</a>
and <a href='https://github.com/keymanapp/keyman/issue/5524'>issue #5524</a> for details.</p>
<p>The English keyboard should have its spacebar caption modified by the radio controls,
whereas the Balti keyboard has a custom caption specified in its `addKeyboards` call.
</p>
<p>Lao 2008 has a custom blank caption (empty string "")</p>
<hr/>
<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'/>
<div>Set default caption to:<br>
<input type='radio' name='st' onclick="setST('language')" id='radioLanguage' /><label for='radioLanguage'>Language</label>
<input type='radio' name='st' onclick="setST('keyboard')" id='radioKeyboard' /><label for='radioKeyboard'>Keyboard</label>
<input type='radio' name='st' checked onclick="setST('languageKeyboard')" id='radioLanguageKeyboard' /><label for='radioLanguageKeyboard'>Language - Keyboard</label>
<input type='radio' name='st' onclick="setST('blank')" id='radioBlank' /><label for='radioBlank'>Blank</label>
</div>
<hr/>
<h3><a href="../index.html">Return to testing home page</a></h3>
</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>