diff options
author | Tor Lillqvist <tml@collabora.com> | 2020-01-15 14:02:26 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2020-01-15 13:40:52 +0100 |
commit | e03c81a976a88af2babf869d8e9d9aef69700ace (patch) | |
tree | 920095f8d4687fa23334e7b25937efc203e10de6 | |
parent | e18fe5e5ef8ab1e6993d7864ff2ae5c2dd14aee8 (diff) |
Show the document file name in the mobile apps, too
Show it in the same text input field that is used in the WOPI-like
case. Make the text input field non-editable and not even focusable.
Show the file name as it should be displayed to the user. I.e. reverse
two layers of URL encoding. At least for the iOS app this is
necessary.
Change-Id: Ifc3c8c0907178ecb419f3108ffc558a05a16313d
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86840
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
-rw-r--r-- | loleaflet/src/control/Control.Toolbar.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 0074e9585..b8f74b279 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -1681,7 +1681,10 @@ function onDocLayerInit() { nUsers = '%n'; oneUser = '1'; noUser = '0'; - $('#document-name-input').hide(); + if (!window.ThisIsAMobileApp) + $('#document-name-input').hide(); + else + $('#document-name-input').show(); } else { nUsers = _('%n users'); oneUser = _('1 user'); @@ -1695,6 +1698,16 @@ function onDocLayerInit() { if (statusbar) statusbar.refresh(); + if (window.ThisIsAMobileApp) { + // We can now set the document name in the menu bar + $('#document-name-input').prop('disabled', false); + $('#document-name-input').removeClass('editable'); + $('#document-name-input').focus(function() { $(this).blur(); }); + // Call decodecodeURIComponent twice: Reverse both our encoding and the encoding of + // the name in the file system. + $('#document-name-input').val(decodeURIComponent(decodeURIComponent(map.options.doc.replace(/.*\//, '')))); + } + if (!window.ThisIsTheiOSApp && window.mode.isTablet()) { map.hideMenubar(); |