diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2022-03-18 13:07:13 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-03-21 21:46:49 +0100 |
commit | bb802528f165675fb92cd20ea3a251d4c4276109 (patch) | |
tree | d7d8d8b058b6a9ffaa0bf270e3f191b0d0ebcae5 /browser/src | |
parent | Revert "image operation: make sure embedded svgs are shown in writer only" (diff) | |
download | online-bb802528f165675fb92cd20ea3a251d4c4276109.tar.gz online-bb802528f165675fb92cd20ea3a251d4c4276109.zip |
co-22.05: mobile writer/insert_formatting_mark_spec.js
- add possibility to specify UNO command alias for newer
version of core so we will call all the versions for
compatibility of online with many versions of core
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I380fb1d2fd7f63bac297745401fa9d619f693348
Diffstat (limited to 'browser/src')
-rw-r--r-- | browser/src/control/Toolbar.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/browser/src/control/Toolbar.js b/browser/src/control/Toolbar.js index 2ad27add93..d6f68d8fe4 100644 --- a/browser/src/control/Toolbar.js +++ b/browser/src/control/Toolbar.js @@ -325,6 +325,11 @@ L.Map.include({ // To exercise the Trace Event functionality, uncomment this // app.socket.emitInstantTraceEvent('cool-unocommand:' + command); + // Used when new varsion of core uses different name for a command + var compatibilityAliases = { + '.uno:InsertZWNBSP': ['.uno:InsertWJ'] + }; + var isAllowedInReadOnly = false; var allowedCommands = ['.uno:Save', '.uno:WordCountDialog', '.uno:EditAnnotation', '.uno:InsertAnnotation', '.uno:DeleteAnnotation', '.uno:Signature', @@ -354,8 +359,16 @@ L.Map.include({ if (this.dialog.hasOpenedDialog()) this.dialog.blinkOpenDialog(); else if (this.isPermissionEdit() || isAllowedInReadOnly) { - if (!this.messageNeedsToBeRedirected(command)) + if (!this.messageNeedsToBeRedirected(command)) { app.socket.sendMessage('uno ' + command + (json ? ' ' + JSON.stringify(json) : '')); + + if (compatibilityAliases[command]) { + for (var i in compatibilityAliases[command]) { + command = compatibilityAliases[command][i]; + app.socket.sendMessage('uno ' + command + (json ? ' ' + JSON.stringify(json) : '')); + } + } + } } }, |