[Libreoffice-commits] online.git: loleaflet/dist
Pranav Kant
pranavk at collabora.com
Fri Apr 1 17:22:34 UTC 2016
loleaflet/dist/loleaflet.html | 8 ++++----
loleaflet/dist/toolbar/toolbar.js | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
New commits:
commit 2220c9d0d0bde0bc17cc17dac6cbcef8c20669da
Author: Pranav Kant <pranavk at collabora.com>
Date: Fri Apr 1 21:33:32 2016 +0530
loleaflet: Rename filename -> title
Change-Id: Ic65b8e819979e35d684807371c76abca55bd5928
Reviewed-on: https://gerrit.libreoffice.org/23734
Reviewed-by: Jan Holesovsky <kendy at collabora.com>
Tested-by: Jan Holesovsky <kendy at collabora.com>
diff --git a/loleaflet/dist/loleaflet.html b/loleaflet/dist/loleaflet.html
index e2fc517..656fd0d 100644
--- a/loleaflet/dist/loleaflet.html
+++ b/loleaflet/dist/loleaflet.html
@@ -269,9 +269,9 @@
var wopiSrc = getParameterByName('WOPISrc');
var filePath = getParameterByName('file_path');
- var fileName = decodeURIComponent(filePath.substring(filePath.lastIndexOf('/')+1));
- if (wopiSrc !== '') {
- fileName = getParameterByName('filename');
+ var title = getParameterByName('title');
+ if (title === '') {
+ title = decodeURIComponent(filePath.substring(filePath.lastIndexOf('/')+1));
}
var host = getParameterByName('host');
var permission = getParameterByName('permission');
@@ -288,7 +288,7 @@
}
var docURL = wopiSrc !== '' ? wopiSrc : filePath;
- document.title = fileName;
+ document.title = title;
var map = L.map('map', {
server: host,
doc: docURL,
diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index 08aa509..911c5ff 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -328,7 +328,7 @@ function onClick(id) {
else if (id.startsWith('menu:file:downloadas-')) {
var format = id.substring('menu:file:downloadas-'.length);
// remove the extension if any
- fileName = fileName.substr(0, fileName.lastIndexOf('.')) || fileName;
+ var fileName = title.substr(0, title.lastIndexOf('.')) || title;
// check if it is empty
fileName = fileName === '' ? 'document' : fileName;
map.downloadAs(fileName + '.' + format, format);
More information about the Libreoffice-commits
mailing list