Skip to content

Commit

Permalink
Merge pull request #9822 from keymanapp/fix/developer/9702-server-dow…
Browse files Browse the repository at this point in the history
…nload-keyman-link

fix(developer): server download Keyman link
  • Loading branch information
mcdurdin authored Oct 26, 2023
2 parents a51adc7 + 8aee151 commit 72f7a6e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions developer/src/server/src/site/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ menuDropdown.onclick = (value) => {
menuDropdown.set(''); // we never show an 'active' package
if(value == '#install-keyman') {
let href = '';
switch(keyman.util.device.OS) {
case 'iOS': href = 'https://keyman.com/go/developer/'+versionMajor+'/ios-app'; break;
case 'Android': href = 'https://keyman.com/go/developer/'+versionMajor+'/android-app'; break;
case 'Linux': href = 'https://keyman.com/linux/download'; break;
case 'Windows': href = 'https://keyman.com/go/download/keyman-windows'; break;
case 'MacOSX': href = 'https://keyman.com/go/download/keyman-mac'; break;
switch(keyman.config.hostDevice.OS) { // note: KeymanWeb internal API
case 'ios': href = 'https://keyman.com/go/developer/'+versionMajor+'/ios-app'; break;
case 'android': href = 'https://keyman.com/go/developer/'+versionMajor+'/android-app'; break;
case 'linux': href = 'https://keyman.com/linux/download'; break;
case 'windows': href = 'https://keyman.com/go/download/keyman-windows'; break;
case 'macosx': href = 'https://keyman.com/go/download/keyman-mac'; break;
default: href = 'https://keyman.com/downloads'; break;
}
location.href = href;
Expand Down
14 changes: 7 additions & 7 deletions developer/src/server/src/site/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,14 @@ window.onload = function() {

if(newOSK) {
document.getElementById('osk-host').removeChild(newOSK.element);
keyman.osk = null;
keyman.osk = null; // Note: undocumented KeymanWeb API
}

// Create a new on screen keyboard view and tell KeymanWeb that
// we are using the targetDevice for context input.
newOSK = new keyman.views.InlinedOSKView(keyman, { device: targetDevice });
keyman.core.contextDevice = targetDevice;
keyman.osk = newOSK;
newOSK = new keyman.views.InlinedOSKView(keyman, { device: targetDevice }); // Note: KeymanWeb internal API
keyman.core.contextDevice = targetDevice; // Note: KeymanWeb internal API
keyman.osk = newOSK; // Note: undocumented KeymanWeb API

if(document.body.offsetWidth < targetDevice.dimensions[0]) {
newOSK.setSize('320px', '200px');
Expand All @@ -237,8 +237,8 @@ window.onload = function() {

keyman.addEventListener('keyboardchange', function(keyboardProperties) {
if(newOSK) {
keyman.osk = newOSK;
newOSK.activeKeyboard = keyman.contextManager.activeKeyboard; // Private API refs on both sides
keyman.osk = newOSK; // Note: undocumented KeymanWeb API
newOSK.activeKeyboard = keyman.contextManager.activeKeyboard; // Note: undocumented KeymanWeb API refs on both sides
}
keyboardDropdown.set(keyboardProperties.internalName);
window.sessionStorage.setItem('current-keyboard', keyboardProperties.internalName);
Expand Down Expand Up @@ -284,7 +284,7 @@ function unloadKeyboardsAndModels() {
const lastModel = keyman.core.activeModel;
if(lastModel) {
console.log('Unregistering model '+lastModel.id);
keyman.removeModel(lastModel.id);
keyman.removeModel(lastModel.id); // Note: undocumented KeymanWeb API
}

modelDropdown.removeAll();
Expand Down

0 comments on commit 72f7a6e

Please sign in to comment.