loleaflet/src/control/Control.Toolbar.js |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit e03c81a976a88af2babf869d8e9d9aef69700ace
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Wed Jan 15 14:02:26 2020 +0200
Commit:     Tor Lillqvist <t...@collabora.com>
CommitDate: Wed Jan 15 13:40:52 2020 +0100

    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 <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Tor Lillqvist <t...@collabora.com>

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();
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to