[Web] Core refactoring#356
Conversation
…Functions properly.
…space. With a little housekeeping and bug fixes related to work on this issue.
darcywong00
left a comment
There was a problem hiding this comment.
One kmw got missed in samplehdr.js addKeyboard(n)
| function loadKeyboards() | ||
| { | ||
| var kmw=tavultesoft.keymanweb; | ||
| var kmw=keyman; |
There was a problem hiding this comment.
line 85 will also need to be changed for kmw
There was a problem hiding this comment.
Thanks, got it now.
darcywong00
left a comment
There was a problem hiding this comment.
I think there's 2 more lines to update in the test chirality.js keyboard
| continue; | ||
| } else if(kls[layer][key] != '') { | ||
| if (k.KKM(e, modCode, k.osk.keyCodes[keySymbol])) { | ||
| if (k.KKM(e, modCode, osk.keyCodes[keySymbol])) { |
There was a problem hiding this comment.
Does this become kbdInterface.keyMatch?
There was a problem hiding this comment.
From kmwcallback.js:
var keymanweb=window['keyman'], kbdInterface=window['KeymanWeb']=keymanweb['interface'], KeymanWeb=kbdInterface;
//...
KeymanWeb['KKM'] = kbdInterface['keyMatch'] = kbdInterface.keyMatch = function(e,Lruleshift,Lrulekey) // ...
Technically speaking, both KKM and keyMatch are both fields of k. Old keyboards will only know this as k.KKM, which must be supported through a legacy KeymanWeb variable, which is how k is set above.
The published API will instead point people to keyman.interface.keyMatch, which is a more user-friendly/documentation-friendly name for the same function. KeymanWeb === keyman.interface.
If the initialization at the top is fun to parse, it goes like this.
var keymanweb=window['keyman'], kbdInterface=window['KeymanWeb']=keymanweb['interface'], KeymanWeb=kbdInterface;
Left to right
keymanwebrefers to the global variablekeyman. It used to refer totavultesoft.keymanweb; reusing it with no variable name refactoring means a lot less review clutter, as we can leave many old lines in place unchanged.- Define a new global
KeymanWeb(viawindow) and set it as an alias tokeyman.interface. Also set the local shorthandkbdInterfaceso that it's clear we're defining methods for use throughkeyman.interface. - Create a direct alias for that local shorthand to clearly establish the method names provided for legacy support.
KeymanWeb['KKM'] = kbdInterface['keyMatch'] = kbdInterface.keyMatch = function(e,Lruleshift,Lrulekey) // ...
Left to right
- Define the legacy name for the keyboard interface function.
- Establish it as an exposed name for the API. (b/c Google Closures is a thing)
- Establish it as an internal name for minification. (b/c Google Closures is a thing)
- Define the function.
So, chirality.js is still using the legacy interface, same as all the other old keyboards.
| if (k.KKM(e, modCode, osk.keyCodes[keySymbol])) { | ||
| r = m = 1; | ||
| if(k.KSM(e, k.osk.modifierCodes['CAPS'])) { | ||
| if(k.KSM(e, osk.modifierCodes['CAPS'])) { |
There was a problem hiding this comment.
and kbdInterface.stateMatch
…pp/keyman into web-349-core-refactoring
…bject instead of 'tavultesoft.keymanweb.'
…ts previously-referenced location.
[iOS] KMW core refactoring
Addresses the KMEA portion of #349 Modify keyboard.html to use the new `keyman` JS namespace instead of `tavultesoft.keymanweb`
Modified the KMEA keyboard.html to use the new `keyman` JS namespace
fix: Add Docker for developer use 🦭
Addresses the KMW part of #349.
https://github.com/sillsdev/keyman-help.keyman.com/pull/114 addresses the help.keyman.com side of things, reflecting the new name changes made here.