mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-29 19:57:41 +00:00
Converts kmwosk.js -> kmwosk.ts; adds HTML element extension class.
This commit is contained in:
parent
abff656b2d
commit
2f4d3210bc
4 changed files with 24 additions and 18 deletions
|
|
@ -1,12 +1,10 @@
|
|||
/// <reference path="kmwexthtml.ts" /> // Includes KMW-added property declaration extensions for HTML elements.
|
||||
|
||||
/***
|
||||
KeymanWeb 10.0
|
||||
Copyright 2017 SIL International
|
||||
***/
|
||||
|
||||
interface Document {
|
||||
selection: any
|
||||
}
|
||||
|
||||
// If KMW is already initialized, the KMW script has been loaded more than once. We wish to prevent resetting the
|
||||
// KMW system, so we use the fact that 'initialized' is only 1 / true after all scripts are loaded for the initial
|
||||
// load of KMW.
|
||||
|
|
|
|||
7
web/source/kmwexthtml.ts
Normal file
7
web/source/kmwexthtml.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
interface Document {
|
||||
selection: any
|
||||
}
|
||||
|
||||
interface Element {
|
||||
shim: Element
|
||||
}
|
||||
|
|
@ -1,3 +1,6 @@
|
|||
/// <reference path="kmwexthtml.ts" /> // Includes KMW-added property declaration extensions for HTML elements.
|
||||
/// <reference path="kmwstring.ts" /> // Includes KMW string extension declarations.
|
||||
|
||||
/***
|
||||
KeymanWeb 10.0
|
||||
Copyright 2017 SIL International
|
||||
|
|
@ -292,18 +295,15 @@ if(!window['keyman']['initialized']) {
|
|||
* @return {Object.<string,number>} Array object with position and size of OSK container
|
||||
* Description Get rectangle containing KMW Virtual Keyboard
|
||||
*/
|
||||
osk['getRect'] = osk.getRect = function() // I2405
|
||||
{
|
||||
var p={};
|
||||
if(osk._DivVKbd)
|
||||
{
|
||||
osk['getRect'] = osk.getRect = function() { // I2405
|
||||
var p: any;
|
||||
|
||||
if(osk._DivVKbd) {
|
||||
p['left'] = p.left = util._GetAbsoluteX(osk._DivVKbd);
|
||||
p['top'] = p.top = util._GetAbsoluteY(osk._DivVKbd);
|
||||
p['width'] = p.width = util._GetAbsoluteX(osk._DivVKbdHelp) - util._GetAbsoluteX(osk._DivVKbd) + osk._DivVKbdHelp.offsetWidth;
|
||||
p['height'] = p.height = util._GetAbsoluteY(osk._DivVKbdHelp) - util._GetAbsoluteY(osk._DivVKbd) + osk._DivVKbdHelp.offsetHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
p['left'] = p.left = util._GetAbsoluteX(osk._Box);
|
||||
p['top'] = p.top = util._GetAbsoluteY(osk._Box);
|
||||
p['width'] = p.width = util._GetAbsoluteX(osk._Box) + osk._Box.offsetWidth;
|
||||
|
|
@ -384,11 +384,12 @@ if(!window['keyman']['initialized']) {
|
|||
*
|
||||
* @return {Object.<string,number>} Array object with OSK window position
|
||||
**/
|
||||
osk.getPos = function()
|
||||
{
|
||||
var Lkbd=osk._Box, p={};
|
||||
p.left = osk._Visible ? Lkbd.offsetLeft : osk.x;
|
||||
p.top = osk._Visible ? Lkbd.offsetTop : osk.y;
|
||||
osk.getPos = function() {
|
||||
var Lkbd=osk._Box, p={
|
||||
left: osk._Visible ? Lkbd.offsetLeft : osk.x,
|
||||
top:osk._Visible ? Lkbd.offsetTop : osk.y
|
||||
};
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
"files": [
|
||||
"kmwbase.js",
|
||||
"keymanweb.js",
|
||||
"kmwosk.js",
|
||||
"kmwosk.ts",
|
||||
"kmwnative.ts",
|
||||
"kmwcallback.ts",
|
||||
"kmwkeymaps.ts",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue