Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(developer): server download Keyman link #9822

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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