mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-10 02:45:32 +00:00
44 lines
No EOL
1.4 KiB
HTML
44 lines
No EOL
1.4 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">
|
|
</head>
|
|
<body>
|
|
|
|
<textarea cols=40 rows=20 id='e' style='overflow: scroll'></textarea>
|
|
|
|
<script>
|
|
var e = document.getElementById('e');
|
|
var lastW, lastH, lastO;
|
|
var noRecentChange = 100;
|
|
|
|
function doLog(event, onlyIfChanged) {
|
|
if(onlyIfChanged) {
|
|
if(lastW == window.innerWidth && lastH == window.innerHeight && lastO == window.orientation) {
|
|
if(noRecentChange == 100) {
|
|
e.value = e.value + event + ": no-change" + '\n\n';
|
|
}
|
|
noRecentChange++;
|
|
return;
|
|
}
|
|
lastW = window.innerWidth;
|
|
lastH = window.innerHeight;
|
|
lastO = window.orientation;
|
|
}
|
|
e.value = e.value + event + ': w.iw='+window.innerWidth+' w.ih='+window.innerHeight+' w.o='+window.orientation+'\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);
|
|
</script>
|
|
|
|
</body>
|
|
</html> |