mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-05 16:35:33 +00:00
101 lines
No EOL
3.2 KiB
HTML
101 lines
No EOL
3.2 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" name="viewport">
|
|
|
|
<title>KeymanWeb Sample Page - Unminified Source</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'
|
|
});
|
|
</script>
|
|
|
|
<!-- Add keyboard management script for local selection of keyboards to use -->
|
|
<script src="../commonHeader.js"></script>
|
|
</head>
|
|
<body onload='loadKeyboards(1);'>
|
|
|
|
<textarea cols=50 rows=20 id='e' style='overflow: scroll' class='kmw-disabled'></textarea>
|
|
<br><br>
|
|
<input></input>
|
|
|
|
<script>
|
|
var e = document.getElementById('e');
|
|
var lastW, lastH, lastO;
|
|
//var lastOSKW, lastOSKH, lastVS;
|
|
var noRecentChange = 100;
|
|
|
|
function doLog(event, onlyIfChanged) {
|
|
var orient = window.orientation;
|
|
var orientText = ' w.o=';
|
|
|
|
if(orient === undefined) {
|
|
orient = window.screen.orientation.angle;
|
|
orientText = ' w.soa=';
|
|
}
|
|
|
|
if(onlyIfChanged) {
|
|
if(lastW == window.innerWidth && lastH == window.innerHeight && lastO == orient) {
|
|
if(noRecentChange == 100) {
|
|
e.value = e.value + event + ": no-change" + '\n\n';
|
|
}
|
|
noRecentChange++;
|
|
return;
|
|
}
|
|
lastW = window.innerWidth;
|
|
lastH = window.innerHeight;
|
|
lastO = orient;
|
|
}
|
|
|
|
e.value = e.value + event + ': w.iw='+window.innerWidth+' w.ih='+window.innerHeight+orientText+orient+'\n';
|
|
|
|
if(event == 'kmw.rh') {
|
|
e.value = e.value + ' osk.w=' + keyman.osk.getWidth() + ' osk.h=' + keyman.osk.getHeight() + ' kmw.vs=' + keyman.util.getViewportScale() + '\n';
|
|
}
|
|
|
|
e.scrollTop = e.scrollHeight;
|
|
noRecentChange = 0;
|
|
}
|
|
|
|
window.setInterval(function() {
|
|
doLog('tick', true);
|
|
}, 1);
|
|
|
|
window.addEventListener('resize', function() { doLog('resize-b', false) }, false);
|
|
window.addEventListener('resize', function() { doLog('resize-c', false) }, true);
|
|
window.addEventListener('orientationchange', function() { doLog('orientationchange-b', false) }, false);
|
|
window.addEventListener('orientationchange', function() { doLog('orientationchange-c', false) }, true);
|
|
|
|
var kmw_rh = keyman.rotationHandler;
|
|
|
|
keyman.rotationHandler = function() {
|
|
doLog('kmw.rh');
|
|
kmw_rh();
|
|
}
|
|
</script>
|
|
<p><a href="../">Return to main index.</a>
|
|
</body>
|
|
</html> |