diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-11-17 15:38:05 +0100 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-11-24 14:12:30 +0100 |
commit | 7041d5c5b035007f09f092d15b40aae4731803a6 (patch) | |
tree | 0bdf006cbe204b0be53f64078b86a0dbf7ccbdb4 /scripts | |
parent | Seccomp: add ARM support (diff) | |
download | online-7041d5c5b035007f09f092d15b40aae4731803a6.tar.gz online-7041d5c5b035007f09f092d15b40aae4731803a6.zip |
Update conext menu code to handle Spelling Popup
* Use unique IDs for sub menus.
* Handle uno command's parameter.
* When there is any parameter, we use the menu text.
* Avoid to enable FontDialog on other conext menus
* Introduce the command ".uno:None" to indicate that the
menu item can't be executed.
* Whitelisted spelling context menu's uno commands.
* Add a black list in unocommands.py to list those uno
commands which have no text in xcu file. In this case,
we can use the text sent in the menu structure.
Change-Id: Ie84fcb7d6c7a2f4cd50c666dbcd8c77cf42731de
Reviewed-on: https://gerrit.libreoffice.org/83606
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/unocommands.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/unocommands.py b/scripts/unocommands.py index e4dc45ef4e..59aa19d84a 100755 --- a/scripts/unocommands.py +++ b/scripts/unocommands.py @@ -86,6 +86,7 @@ def extractMenuCommands(path): # Extract all the uno commands we are using in the Online context menu def extractContextCommands(path): + commandsToIgnore = ["FontDialogForParagraph"] commands = [] # extract from the comments whitelist @@ -114,6 +115,7 @@ def extractContextCommands(path): if line.find("_UNO(") >= 0: commands += commandFromMenuLine(line) + commands = [command for command in commands if command not in commandsToIgnore] # may the list unique return set(commands) @@ -242,6 +244,10 @@ window._UNO = function(string, component, isContext) { \t\t} \t} +\treturn this.removeAccessKey(text); +} + +window.removeAccessKey = function(text) { \t// Remove access key markers from translated strings \t// 1. access key in parenthesis in case of non-latin scripts \ttext = text.replace(/\(~[A-Za-z]\)/, ''); |