spiegel-keyman/web/samples/multilingual.html
2017-10-27 09:14:39 +07:00

81 lines
3.2 KiB
HTML

<!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 Multilingual Sample Page</title>
<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:92%; min-height:30px; border: 1px solid gray;}
#KeymanWebControl {width:50%; min-width:600px;}
</style>
<!-- KeymanWeb script -->
<script src="../output/keymanweb.js"></script>
<!--The script linking to the cloud or custom user interface must be inserted here -->
<script src="../output/kmwuitoolbar.js"></script>
<!-- Initialization: set paths to keyboards, resources and fonts as required -->
<script>
var kmw=window.keyman;
kmw.init({
attachType:'auto',
resources:''
});
</script>
<!--
Keyboard specifications, with the keyboard name and language code for each keyboard that is to be available.
The actual keyboard object will be downloaded asynchronously when first selected for use.
Any number of keyboards may be specified. If the same keyboard is used for several languages, it will only be loaded
once, but should be referenced for each supported language.
If two (or more) keyboards are wanted to be available for a given language, both should be referenced.
Keyboard paths may be absolute (with respect to the server root) or relative to the keyboards option path.
-->
<script>
function loadKeyboards()
{
var kmw=keyman;
kmw.addKeyboards();
// Set US English as the default, allowing time to fully initialize
window.setTimeout(function(){kmw.setActiveKeyboard('Keyboard_us','eng');},2500);
}
</script>
</head>
<!-- Sample page HTML -->
<body onload='loadKeyboards();'>
<h2>KeymanWeb Multilingual Page Example</h2>
<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 not required and is ignored by other User Interfaces.
-->
<div id='KeymanWebControl'></div>
<h3>Type in the following text area in <i>your </i>language:</h3>
<textarea id='ta1' class='test'></textarea>
<h3>or in this input field:</h3>
<input class='test'/>
<h3><a href="../samples/index.html">Return to samples home page</a></h3>
</div>
</body>
</html>