diff --git a/common/core/web/keyboard-processor/src/keyboards/keyboard.ts b/common/core/web/keyboard-processor/src/keyboards/keyboard.ts index 9d3a41390d..bedfadfb00 100644 --- a/common/core/web/keyboard-processor/src/keyboards/keyboard.ts +++ b/common/core/web/keyboard-processor/src/keyboards/keyboard.ts @@ -107,6 +107,12 @@ namespace com.keyman.keyboards { return this.scriptObject['KH']; } + /** + * Embedded JS script designed for use with a keyboard's HTML help text. Always defined + * within the file referenced by &kmw_embedjs in a keyboard's source, though that file + * may also contain _other_ script definitions as well. (`KHF` must be explicitly defined + * within that file.) + */ get hasScript(): boolean { return !!this.scriptObject['KHF']; } diff --git a/web/source/kmwembedded.ts b/web/source/kmwembedded.ts index 4561262059..ba1a60f63e 100644 --- a/web/source/kmwembedded.ts +++ b/web/source/kmwembedded.ts @@ -256,7 +256,7 @@ namespace com.keyman.text { */ keymanweb['correctOSKTextSize']=function() { let osk: com.keyman.osk.OSKManager = keymanweb.osk; - if(osk && osk.vkbd && osk.vkbd.adjustHeights(osk.getKeyboardHeight())) { + if(osk?.vkbd?.adjustHeights(osk.getKeyboardHeight())) { var b: HTMLElement = osk._Box, bs=b.style; bs.height=bs.maxHeight=osk.vkbd.computedAdjustedOskHeight(osk.getHeight())+'px'; diff --git a/web/source/osk/oskManager.ts b/web/source/osk/oskManager.ts index 6b7915a605..60d5004712 100644 --- a/web/source/osk/oskManager.ts +++ b/web/source/osk/oskManager.ts @@ -198,7 +198,7 @@ namespace com.keyman.osk { } else { this.vkbd.adjustHeights(this.getKeyboardHeight()); - var b: HTMLElement = this._Box, bs=b.style; + let b: HTMLElement = this._Box, bs=b.style; bs.height=bs.maxHeight=this.vkbd.computedAdjustedOskHeight(this.getHeight())+'px'; } @@ -212,7 +212,7 @@ namespace com.keyman.osk { kbdID = kbdID.substring(kbdID.indexOf('::') + 2); } - var kbdClassSuffix = ' kmw-keyboard-' + kbdID; + const kbdClassSuffix = ' kmw-keyboard-' + kbdID; kbdView.element.className = kbdView.element.className + kbdClassSuffix; this.banner.appendStyles(); diff --git a/web/source/osk/visualKeyboard.ts b/web/source/osk/visualKeyboard.ts index 788135ce27..306f4cb1b8 100644 --- a/web/source/osk/visualKeyboard.ts +++ b/web/source/osk/visualKeyboard.ts @@ -1536,7 +1536,7 @@ namespace com.keyman.osk { * @param {Object} PKbd the keyboard object to be displayed * @param {string=} argFormFactor layout form factor, defaulting to 'desktop' * @param {(string|number)=} argLayerId name or index of layer to show, defaulting to 'default' - * @param {Object} height Target height for the rendered keyboard + * @param {number} height Target height for the rendered keyboard * (currently required for legacy reasons) * @return {Object} DIV object with filled keyboard layer content */