mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-06 14:07:32 +00:00
Refactors TS compile defs, converts the UI element sources.
This commit is contained in:
parent
6856adb1c1
commit
3a3c91515f
9 changed files with 50 additions and 23 deletions
|
|
@ -1,3 +1,8 @@
|
|||
interface Window {
|
||||
attachEvent: (eventNameWithOn:string, callback: () => void) => void,
|
||||
clientWidth: number
|
||||
}
|
||||
|
||||
interface Document {
|
||||
selection: any // Is IE only; TS ignores it because of this.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -412,13 +412,13 @@ if(!window['keyman']['ui']['name']) {
|
|||
if(!ui.init) return;
|
||||
|
||||
// Clear existing list first (first two nodes must be preserved)
|
||||
for(var i=ui._KeymanWeb_KbdList.childNodes.length; i>2; i--)
|
||||
for(var i:number=ui._KeymanWeb_KbdList.childNodes.length; i>2; i--)
|
||||
ui._KeymanWeb_KbdList.removeChild(ui._KeymanWeb_KbdList.childNodes[i-1]);
|
||||
|
||||
var kbds=keymanweb['getKeyboards']();
|
||||
if(kbds.length > 0)
|
||||
{
|
||||
for(var i=0; i<kbds.length; i++)
|
||||
for(var i:number=0; i<kbds.length; i++)
|
||||
ui.registerKeyboard(kbds[i]['InternalName'],kbds[i]['LanguageName'],kbds[i]['Name'],kbds[i]['LanguageCode'],kbds[i]['RegionCode']);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
/// <reference path="kmwexthtml.ts" /> // Includes KMW-added property declaration extensions for HTML elements.
|
||||
|
||||
/***
|
||||
KeymanWeb 10.0
|
||||
Copyright 2017 SIL International
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
/// <reference path="kmwexthtml.ts" /> // Includes KMW-added property declaration extensions for HTML elements.
|
||||
|
||||
/***
|
||||
KeymanWeb 10.0
|
||||
Copyright 2017 SIL International
|
||||
|
|
@ -32,7 +34,7 @@ if(!window['keyman']['ui']['name']) {
|
|||
if(util['isTouchDevice']()) throw '';
|
||||
|
||||
// Initialize user interface common variables
|
||||
var ui=keymanweb['ui'] = {
|
||||
var ui:any=keymanweb['ui'] = {
|
||||
name: 'toggle',
|
||||
initialized: false,
|
||||
controller: null,
|
||||
|
|
@ -460,7 +462,7 @@ if(!window['keyman']['ui']['name']) {
|
|||
if(_kbds.length > 1)
|
||||
{
|
||||
// Multiple keyboards
|
||||
var _kmw_ctrl_img=document.getElementById('KMW_Controller_Img')
|
||||
var _kmw_ctrl_img=<HTMLImageElement> document.getElementById('KMW_Controller_Img')
|
||||
_kmw_ctrl_img.src = imgPath+'kmw_logo_16_down.gif';
|
||||
_kmw_ctrl_img.style.width = '100%';
|
||||
|
||||
|
|
@ -482,7 +484,7 @@ if(!window['keyman']['ui']['name']) {
|
|||
// Single keyboard
|
||||
else if(_kbds.length == 1)
|
||||
{
|
||||
var _kmw_ctrl_img=document.getElementById('KMW_Controller_Img')
|
||||
var _kmw_ctrl_img=<HTMLImageElement> document.getElementById('KMW_Controller_Img')
|
||||
_kmw_ctrl_img.src = imgPath+'kmw_logo_16.gif';
|
||||
|
||||
ui.kbdButton.getElem().id = 'kmwico';
|
||||
|
|
@ -326,7 +326,7 @@ if(!window['keyman']['ui']['name']) {
|
|||
languageCode = Keyboards[j]['LanguageCode'];
|
||||
max++;
|
||||
}
|
||||
max = ((max+3)/4).toFixed(0); // Get number of entries per column
|
||||
max = Number(((max+3)/4).toFixed(0)); // Get number of entries per column
|
||||
|
||||
// Add language list to columns for the region
|
||||
languageCode='';
|
||||
9
web/source/tsconfig.base.json
Normal file
9
web/source/tsconfig.base.json
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"module": "system",
|
||||
"outDir": "../output/",
|
||||
"sourceMap": true,
|
||||
"target": "es5"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,19 +1,3 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"module": "system",
|
||||
"outFile": "../output/keymanweb.js",
|
||||
"sourceMap": true,
|
||||
"target": "es5"
|
||||
},
|
||||
"files": [
|
||||
"kmwbase.ts",
|
||||
"keymanweb.ts",
|
||||
"kmwosk.ts",
|
||||
"kmwnative.ts",
|
||||
"kmwcallback.ts",
|
||||
"kmwkeymaps.ts",
|
||||
"kmwlayout.ts",
|
||||
"kmwinit.ts"
|
||||
]
|
||||
"extends": "./tsconfig.web.json"
|
||||
}
|
||||
|
|
|
|||
9
web/source/tsconfig.ui.json
Normal file
9
web/source/tsconfig.ui.json
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"files": [
|
||||
"kmwuibutton.ts",
|
||||
"kmwuifloat.ts",
|
||||
"kmwuitoggle.ts",
|
||||
"kmwuitoolbar.ts"
|
||||
]
|
||||
}
|
||||
16
web/source/tsconfig.web.json
Normal file
16
web/source/tsconfig.web.json
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outFile": "../output/keymanweb.js"
|
||||
},
|
||||
"files": [
|
||||
"kmwbase.ts",
|
||||
"keymanweb.ts",
|
||||
"kmwosk.ts",
|
||||
"kmwnative.ts",
|
||||
"kmwcallback.ts",
|
||||
"kmwkeymaps.ts",
|
||||
"kmwlayout.ts",
|
||||
"kmwinit.ts"
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue