From 34d48e6721c294737abf4c34629777d364e03674 Mon Sep 17 00:00:00 2001 From: shivam agarwal <88205668+StillAbeginnerr@users.noreply.github.com> Date: Sun, 1 Dec 2024 00:18:13 +0530 Subject: [PATCH 1/3] Fix for issue #4090: cmd.js line 20-26 replaced with OS-specific keyboard shortcut mappings with localization --- modules/ui/cmd.js | 15 +++++++++------ modules/ui/sections/data_layers.js | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/modules/ui/cmd.js b/modules/ui/cmd.js index 66784056af..dfb3eae98e 100644 --- a/modules/ui/cmd.js +++ b/modules/ui/cmd.js @@ -14,14 +14,15 @@ export var uiCmd = function (code) { if (detected.os === 'win') { if (code === '⌘⇧Z') return 'Ctrl+Y'; } - + var mac = (detected.os === 'mac'); var result = '', replacements = { - '⌘': 'Ctrl', - '⇧': 'Shift', - '⌥': 'Alt', - '⌫': 'Backspace', - '⌦': 'Delete' + '⌘': mac ? '⌘ ' + t('shortcuts.key.cmd') : t('shortcuts.key.ctrl'), + '⇧': mac ? '⇧ ' + t('shortcuts.key.shift') : t('shortcuts.key.shift'), + '⌥': mac ? '⌥ ' + t('shortcuts.key.option') : t('shortcuts.key.alt'), + '⌃': mac ? '⌃ ' + t('shortcuts.key.ctrl') : t('shortcuts.key.ctrl'), + '⌫': mac ? '⌫ ' + t('shortcuts.key.delete') : t('shortcuts.key.backspace'), + '⌦': mac ? '⌦ ' + t('shortcuts.key.del') : t('shortcuts.key.del'), }; for (var i = 0; i < code.length; i++) { @@ -36,12 +37,14 @@ export var uiCmd = function (code) { }; + // return a display-focused string for a given keyboard code uiCmd.display = function(code) { if (code.length !== 1) return code; var detected = utilDetect(); var mac = (detected.os === 'mac'); + var replacements = { '⌘': mac ? '⌘ ' + t('shortcuts.key.cmd') : t('shortcuts.key.ctrl'), '⇧': mac ? '⇧ ' + t('shortcuts.key.shift') : t('shortcuts.key.shift'), diff --git a/modules/ui/sections/data_layers.js b/modules/ui/sections/data_layers.js index 4053c3bf17..3e2305e84e 100644 --- a/modules/ui/sections/data_layers.js +++ b/modules/ui/sections/data_layers.js @@ -405,6 +405,7 @@ export function uiSectionDataLayers(context) { .placement('top') ); + historyPanelLabelEnter .append('input') .attr('type', 'checkbox') From 959399e8bda8f38f1c194d8460dad44b3e800db8 Mon Sep 17 00:00:00 2001 From: shivam agarwal <88205668+StillAbeginnerr@users.noreply.github.com> Date: Sun, 1 Dec 2024 00:51:28 +0530 Subject: [PATCH 2/3] Fix for issue #4090: cmd.js line 20-26 replaced with OS-specific keyboard shortcut mappings with localization --- modules/ui/cmd.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/modules/ui/cmd.js b/modules/ui/cmd.js index dfb3eae98e..791011e508 100644 --- a/modules/ui/cmd.js +++ b/modules/ui/cmd.js @@ -17,12 +17,11 @@ export var uiCmd = function (code) { var mac = (detected.os === 'mac'); var result = '', replacements = { - '⌘': mac ? '⌘ ' + t('shortcuts.key.cmd') : t('shortcuts.key.ctrl'), - '⇧': mac ? '⇧ ' + t('shortcuts.key.shift') : t('shortcuts.key.shift'), - '⌥': mac ? '⌥ ' + t('shortcuts.key.option') : t('shortcuts.key.alt'), - '⌃': mac ? '⌃ ' + t('shortcuts.key.ctrl') : t('shortcuts.key.ctrl'), - '⌫': mac ? '⌫ ' + t('shortcuts.key.delete') : t('shortcuts.key.backspace'), - '⌦': mac ? '⌦ ' + t('shortcuts.key.del') : t('shortcuts.key.del'), + '⌘': mac ? t('shortcuts.key.cmd') : t('shortcuts.key.ctrl'), + '⇧': mac ? t('shortcuts.key.shift') : t('shortcuts.key.shift'), + '⌥': mac ? t('shortcuts.key.option') : t('shortcuts.key.alt'), + '⌫': mac ? t('shortcuts.key.delete') : t('shortcuts.key.backspace'), + '⌦': mac ? t('shortcuts.key.del') : t('shortcuts.key.del'), }; for (var i = 0; i < code.length; i++) { @@ -44,7 +43,7 @@ uiCmd.display = function(code) { var detected = utilDetect(); var mac = (detected.os === 'mac'); - + var replacements = { '⌘': mac ? '⌘ ' + t('shortcuts.key.cmd') : t('shortcuts.key.ctrl'), '⇧': mac ? '⇧ ' + t('shortcuts.key.shift') : t('shortcuts.key.shift'), From 672b376cfaac236c5142d097eb8cee09ec7275ba Mon Sep 17 00:00:00 2001 From: shivam agarwal <88205668+StillAbeginnerr@users.noreply.github.com> Date: Sun, 1 Dec 2024 01:11:33 +0530 Subject: [PATCH 3/3] Fix for issue #4090: cmd.js line 20-26 replaced with OS-specific keyboard shortcut mappings with localization --- modules/ui/cmd.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/ui/cmd.js b/modules/ui/cmd.js index 791011e508..1b107d643b 100644 --- a/modules/ui/cmd.js +++ b/modules/ui/cmd.js @@ -17,11 +17,11 @@ export var uiCmd = function (code) { var mac = (detected.os === 'mac'); var result = '', replacements = { - '⌘': mac ? t('shortcuts.key.cmd') : t('shortcuts.key.ctrl'), - '⇧': mac ? t('shortcuts.key.shift') : t('shortcuts.key.shift'), - '⌥': mac ? t('shortcuts.key.option') : t('shortcuts.key.alt'), - '⌫': mac ? t('shortcuts.key.delete') : t('shortcuts.key.backspace'), - '⌦': mac ? t('shortcuts.key.del') : t('shortcuts.key.del'), + '⌘': mac ? '⌘ ' : t('shortcuts.key.ctrl'), + '⇧': mac ? '⇧ ' : t('shortcuts.key.shift'), + '⌥': mac ? '⌥ ' : t('shortcuts.key.alt'), + '⌫': mac ? '⌫ ' : t('shortcuts.key.backspace'), + '⌦': mac ? '⌦ ' : t('shortcuts.key.del'), }; for (var i = 0; i < code.length; i++) {