mirror of
https://github.com/lubosz/overte.git
synced 2025-04-16 09:46:29 +02:00
Remove superfluous keyboardControl.js file and references
The raiseAndLowerKeyboard.js script is automatically injected into these pages, instead.
This commit is contained in:
parent
8e214d8ee8
commit
dd8eac8cb2
4 changed files with 0 additions and 76 deletions
|
@ -14,7 +14,6 @@
|
|||
<script type="text/javascript" src="qrc:///qtwebchannel/qwebchannel.js"></script>
|
||||
<script type="text/javascript" src="js/eventBridgeLoader.js"></script>
|
||||
<script type="text/javascript" src="js/spinButtons.js"></script>
|
||||
<script type="text/javascript" src="js/keyboardControl.js"></script>
|
||||
<script type="text/javascript" src="js/entityList.js"></script>
|
||||
</head>
|
||||
<body onload='loaded();'>
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
<script type="text/javascript" src="qrc:///qtwebchannel/qwebchannel.js"></script>
|
||||
<script type="text/javascript" src="js/eventBridgeLoader.js"></script>
|
||||
<script type="text/javascript" src="js/spinButtons.js"></script>
|
||||
<script type="text/javascript" src="js/keyboardControl.js"></script>
|
||||
<script type="text/javascript" src="js/entityProperties.js"></script>
|
||||
<script src="js/jsoneditor.min.js"></script>
|
||||
</head>
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
<script type="text/javascript" src="qrc:///qtwebchannel/qwebchannel.js"></script>
|
||||
<script type="text/javascript" src="js/eventBridgeLoader.js"></script>
|
||||
<script type="text/javascript" src="js/spinButtons.js"></script>
|
||||
<script type="text/javascript" src="js/keyboardControl.js"></script>
|
||||
<script type="text/javascript" src="js/gridControls.js"></script>
|
||||
</head>
|
||||
<body onload='loaded();'>
|
||||
|
|
|
@ -1,73 +0,0 @@
|
|||
//
|
||||
// keyboardControl.js
|
||||
//
|
||||
// Created by David Rowe on 28 Sep 2016.
|
||||
// Copyright 2016 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
function setUpKeyboardControl() {
|
||||
|
||||
var lowerTimer = null;
|
||||
var isRaised = false;
|
||||
var KEYBOARD_HEIGHT = 200;
|
||||
|
||||
function raiseKeyboard() {
|
||||
window.isKeyboardRaised = true;
|
||||
window.isNumericKeyboard = this.type === "number";
|
||||
|
||||
if (lowerTimer !== null) {
|
||||
clearTimeout(lowerTimer);
|
||||
lowerTimer = null;
|
||||
}
|
||||
|
||||
EventBridge.emitWebEvent("_RAISE_KEYBOARD" + (this.type === "number" ? "_NUMERIC" : ""));
|
||||
|
||||
if (!isRaised) {
|
||||
var delta = this.getBoundingClientRect().bottom + 10 - (document.body.clientHeight - KEYBOARD_HEIGHT);
|
||||
if (delta > 0) {
|
||||
setTimeout(function () {
|
||||
document.body.scrollTop += delta;
|
||||
}, 500); // Allow time for keyboard to be raised in QML.
|
||||
}
|
||||
}
|
||||
|
||||
isRaised = true;
|
||||
}
|
||||
|
||||
function doLowerKeyboard() {
|
||||
window.isKeyboardRaised = false;
|
||||
window.isNumericKeyboard = false;
|
||||
|
||||
EventBridge.emitWebEvent("_LOWER_KEYBOARD");
|
||||
lowerTimer = null;
|
||||
isRaised = false;
|
||||
}
|
||||
|
||||
function lowerKeyboard() {
|
||||
// Delay lowering keyboard a little in case immediately raise it again.
|
||||
if (lowerTimer === null) {
|
||||
lowerTimer = setTimeout(doLowerKeyboard, 20);
|
||||
}
|
||||
}
|
||||
|
||||
function documentBlur() {
|
||||
// Action any pending Lower keyboard event immediately upon leaving document window so that they don't interfere with
|
||||
// other Entities Editor tab.
|
||||
if (lowerTimer !== null) {
|
||||
clearTimeout(lowerTimer);
|
||||
doLowerKeyboard();
|
||||
}
|
||||
}
|
||||
|
||||
var inputs = document.querySelectorAll("input[type=text], input[type=password], input[type=number], textarea");
|
||||
for (var i = 0, length = inputs.length; i < length; i++) {
|
||||
inputs[i].addEventListener("focus", raiseKeyboard);
|
||||
inputs[i].addEventListener("blur", lowerKeyboard);
|
||||
}
|
||||
|
||||
window.addEventListener("blur", documentBlur);
|
||||
}
|
||||
|
Loading…
Reference in a new issue