From 04fa7e33d54798fd538ee4800e27454b9d4a787d Mon Sep 17 00:00:00 2001 From: jahorton Date: Fri, 20 Sep 2019 12:06:54 +0700 Subject: [PATCH 1/3] Adds capitalized equivalents for some legacy funcs --- web/source/text/kbdInterface.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/source/text/kbdInterface.ts b/web/source/text/kbdInterface.ts index 4748f3635b..50e9dace11 100644 --- a/web/source/text/kbdInterface.ts +++ b/web/source/text/kbdInterface.ts @@ -1143,7 +1143,11 @@ namespace com.keyman.text { } } - // Needed for some legacy CJK keyboards. + // Also needed for some legacy CJK keyboards. + ['GetLastActiveElement'] = ['getLastActiveElement']; + ['FocusLastActiveElement'] = ['focusLastActiveElement']; + ['HideHelp'] = self['hideHelp']; + ['ShowHelp'] = self['showHelp']; ['ShowPinnedHelp'] = this['showPinnedHelp']; resetContext() { From 5fec50c34e84ac7c62854fa67a9846f37de3acc2 Mon Sep 17 00:00:00 2001 From: jahorton Date: Fri, 20 Sep 2019 12:51:22 +0700 Subject: [PATCH 2/3] Helps to reference 'this' when creating aliases... --- web/source/text/kbdInterface.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/source/text/kbdInterface.ts b/web/source/text/kbdInterface.ts index 50e9dace11..b41de76b74 100644 --- a/web/source/text/kbdInterface.ts +++ b/web/source/text/kbdInterface.ts @@ -1144,10 +1144,10 @@ namespace com.keyman.text { } // Also needed for some legacy CJK keyboards. - ['GetLastActiveElement'] = ['getLastActiveElement']; - ['FocusLastActiveElement'] = ['focusLastActiveElement']; - ['HideHelp'] = self['hideHelp']; - ['ShowHelp'] = self['showHelp']; + ['GetLastActiveElement'] = this['getLastActiveElement']; + ['FocusLastActiveElement'] = this['focusLastActiveElement']; + ['HideHelp'] = this['hideHelp']; + ['ShowHelp'] = this['showHelp']; ['ShowPinnedHelp'] = this['showPinnedHelp']; resetContext() { From 7ce05c803851868569b7cb6a447837a69dd7c3a6 Mon Sep 17 00:00:00 2001 From: jahorton Date: Fri, 20 Sep 2019 14:02:23 +0700 Subject: [PATCH 3/3] Adjustment to legacy API for OutputTarget compat --- web/source/text/kbdInterface.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/web/source/text/kbdInterface.ts b/web/source/text/kbdInterface.ts index b41de76b74..c6d8a0dadb 100644 --- a/web/source/text/kbdInterface.ts +++ b/web/source/text/kbdInterface.ts @@ -1103,14 +1103,8 @@ namespace com.keyman.text { /** * Legacy entry points (non-standard names)- included only to allow existing IME keyboards to continue to be used */ - ['getLastActiveElement'](): HTMLElement { - let keyman = com.keyman.singleton; - if(!keyman.isHeadless) { - return keyman.domManager.getLastActiveElement(); - } else { - // What are the IMEs looking for with this method? Would an element interface suffice? - return null; - } + ['getLastActiveElement'](): OutputTarget { + return text.Processor.getOutputTarget(); } ['focusLastActiveElement'](): void {