diff --git a/web/src/app/browser/src/contextManager.ts b/web/src/app/browser/src/contextManager.ts index 45898bfee22..7521bda9014 100644 --- a/web/src/app/browser/src/contextManager.ts +++ b/web/src/app/browser/src/contextManager.ts @@ -423,7 +423,7 @@ export class ContextManager extends ContextManagerBase { */ public setKeyboardForTextStore(textStore: AbstractElementTextStore, kbdId?: string | null, langId?: string | null): void { if(textStore instanceof DesignIFrameElementTextStore) { - console.warn("'keymanweb.setKeyboardForControl' cannot set keyboard on iframes."); + console.warn("ContextManager.setKeyboardForTextStore cannot set keyboard on iframes."); return; } diff --git a/web/src/app/browser/src/keymanEngine.ts b/web/src/app/browser/src/keymanEngine.ts index 8b70d598799..2fd5aa38555 100644 --- a/web/src/app/browser/src/keymanEngine.ts +++ b/web/src/app/browser/src/keymanEngine.ts @@ -77,28 +77,28 @@ export class KeymanEngine extends KeymanEngineBase { - const e = (textStore as AbstractElementTextStore)?.getElement(); + const elem = (textStore as AbstractElementTextStore)?.getElement(); if(this.osk) { - (this.osk.activationModel as TwoStateActivator).activationTrigger = e; + (this.osk.activationModel as TwoStateActivator).activationTrigger = elem; } if(this.config.hostDevice.touchable && textStore) { - this.ensureElementVisibility(e); + this.ensureElementVisibility(elem); } }); } - public ensureElementVisibility(e: HTMLElement): void { - if(!e || !this.osk) { + public ensureElementVisibility(elem: HTMLElement): void { + if(!elem || !this.osk) { return; } // Get the absolute position of the caret - const y = getAbsoluteY(e); + const y = getAbsoluteY(elem); const t = window.pageYOffset; let dy = y-t; if(y >= t) { - dy -= (window.innerHeight - this.osk._Box.offsetHeight - e.offsetHeight - 2); + dy -= (window.innerHeight - this.osk._Box.offsetHeight - elem.offsetHeight - 2); if(dy < 0) { dy=0; } diff --git a/web/src/engine/src/element-text-stores/nestedInstanceOf.ts b/web/src/engine/src/element-text-stores/nestedInstanceOf.ts index 739f11a982b..933c595057f 100644 --- a/web/src/engine/src/element-text-stores/nestedInstanceOf.ts +++ b/web/src/engine/src/element-text-stores/nestedInstanceOf.ts @@ -1,38 +1,42 @@ /** - * Checks the type of an input DOM-related object while ensuring that it is checked against the correct prototype, - * as class prototypes are (by specification) scoped upon the owning Window. + * Checks the type of an input DOM-related object while ensuring that it + * is checked against the correct prototype, as class prototypes are (by + * specification) scoped upon the owning Window. * - * See https://stackoverflow.com/questions/43587286/why-does-instanceof-return-false-on-chrome-safari-and-edge-and-true-on-firefox + * See + * https://stackoverflow.com/questions/43587286/why-does-instanceof-return-false-on-chrome-safari-and-edge-and-true-on-firefox * for more details. * - * @param {EventTarget} Pelem An element of the web page or one of its IFrame-based subdocuments. - * @param {string} className The plain-text name of the expected Element type. + * @param {EventTarget} elem An element of the web page or one of + * its IFrame-based subdocuments. + * @param {string} className The plain-text name of the expected + * Element type. * @return {boolean} */ -export function nestedInstanceOf(Pelem: EventTarget, className: string): boolean { +export function nestedInstanceOf(elem: EventTarget, className: string): boolean { let scopedClass; - if(!Pelem) { + if(!elem) { // If we're bothering to check something's type, null references don't match // what we're looking for. return false; } // @ts-ignore - if (Pelem['Window']) { // Window objects contain the class definitions for types held within them. So, we can check for those. + if (elem['Window']) { // Window objects contain the class definitions for types held within them. So, we can check for those. return className == 'Window'; // @ts-ignore - } else if (Pelem['defaultView']) { // Covers Document. + } else if (elem['defaultView']) { // Covers Document. // @ts-ignore - scopedClass = (Pelem as Document)['defaultView'][className]; + scopedClass = (elem as Document)['defaultView'][className]; // @ts-ignore - } else if(Pelem['ownerDocument']) { + } else if(elem['ownerDocument']) { // @ts-ignore - scopedClass = (Pelem as Node).ownerDocument.defaultView[className]; + scopedClass = (elem as Node).ownerDocument.defaultView[className]; } if(scopedClass) { - return Pelem instanceof scopedClass; + return elem instanceof scopedClass; } else { return false; } -} \ No newline at end of file +} diff --git a/web/src/engine/src/osk/views/floatingOskView.ts b/web/src/engine/src/osk/views/floatingOskView.ts index 291105b49bc..fff1adef36f 100644 --- a/web/src/engine/src/osk/views/floatingOskView.ts +++ b/web/src/engine/src/osk/views/floatingOskView.ts @@ -183,23 +183,22 @@ export class FloatingOSKView extends OSKView { }.bind(this); /** - * Function enabled - * Scope Public - * @return {boolean|number} True if KMW OSK enabled - * Description Test if KMW OSK is enabled + * Test if KMW OSK is enabled + * + * @return {boolean} True if KMW OSK enabled */ - ['isEnabled'](): boolean { + public isEnabled(): boolean { return this.displayIfActive; } /** - * Function isVisible - * Scope Public - * @return {boolean|number} True if KMW OSK visible - * Description Test if KMW OSK is actually visible - * Note that this will usually return false after any UI event that results in (temporary) loss of input focus + * Test if KMW OSK is actually visible + * Note that this will usually return false after any UI event that results in + * (temporary) loss of input focus. + * + * @return {boolean} True if KMW OSK visible */ - ['isVisible'](): boolean { + public isVisible(): boolean { return this._Visible; } @@ -504,30 +503,30 @@ export class FloatingOSKView extends OSKView { } public setDisplayPositioning() { - const Ls = this._Box.style; + const {style} = this._Box; - Ls.position='absolute'; + style.position='absolute'; // Keep it hidden if not currently displayed. if(this.activationModel.canActivate) { - Ls.display='block'; //Ls.visibility='visible'; + style.display='block'; //Ls.visibility='visible'; } - Ls.left='0px'; + style.left='0px'; if(this.specifiedPosition || this.userPositioned) { - Ls.left = this.x+'px'; - Ls.top = this.y+'px'; + style.left = this.x+'px'; + style.top = this.y+'px'; } else { const el: HTMLElement = this.typedActivationModel.activationTrigger || null; if(this.dfltX) { - Ls.left=this.dfltX; + style.left=this.dfltX; } else if(typeof el != 'undefined' && el != null) { - Ls.left=getAbsoluteX(el) + 'px'; + style.left=getAbsoluteX(el) + 'px'; } if(this.dfltY) { - Ls.top=this.dfltY; + style.top=this.dfltY; } else if(typeof el != 'undefined' && el != null) { - Ls.top=(getAbsoluteY(el) + el.offsetHeight)+'px'; + style.top=(getAbsoluteY(el) + el.offsetHeight)+'px'; } } @@ -584,24 +583,22 @@ export class FloatingOSKView extends OSKView { } } - ['show'](bShow?: boolean) { + public show(bShow?: boolean) { if(bShow !== undefined) { - super['show'](bShow); + super.show(bShow); } else { - super['show'](); + super.show(); } this.savePersistedLayout(); } /** - * Function userPositioned - * Scope Public - * @return {(boolean|number)} true if user located - * Description Test if OSK window has been repositioned by user - * + * Test if OSK window has been repositioned by user * See https://help.keyman.com/developer/engine/web/current-version/reference/osk/userLocated + * + * @return {boolean} true if user located */ - public userLocated() { + public userLocated(): boolean { return this.userPositioned; }