[Libreoffice-commits] online.git: loleaflet/src

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Dec 19 07:41:58 UTC 2018


 loleaflet/src/control/Signing.js |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 78fb9cca30f3cc1d9afab3d7977c24f66778b3e3
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Wed Dec 19 08:40:27 2018 +0100
Commit:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
CommitDate: Wed Dec 19 08:40:27 2018 +0100

    vereign upload: use wopi ifilename or create a random one
    
    Change-Id: I0f4b294e6c517459835731c6afcc39f932477c0f

diff --git a/loleaflet/src/control/Signing.js b/loleaflet/src/control/Signing.js
index 9f1b51a9c..b18ef4745 100644
--- a/loleaflet/src/control/Signing.js
+++ b/loleaflet/src/control/Signing.js
@@ -265,6 +265,10 @@ function vereignRestoreIdentity() {
 	});
 }
 
+function randomName() {
+	return Math.random().toString(36).substring(2) + (new Date()).getTime().toString(36);
+}
+
 L.Map.include({
 	showSignDocument: function() {
 		$('#document-signing-bar').show();
@@ -312,8 +316,8 @@ L.Map.include({
 		var map = this;
 
 		vex.dialog.open({
-			message: _('Select document tpye to push to Vereign:'),
-			input: 'Type: <select name="selection"><option value="ODT">ODT</option><option value="DOCX">DOCX</option><option value="PDF">PDF</option></select>',
+			message: _('Select document type to upload:'),
+			input: 'Type: <select name="selection"><option value="ODT">ODT</option><option value="DOCX">DOCX</option><option value="PDF">PDF</option></select></p>',
 			callback: function(data) {
 				var documentType = null;
 
@@ -332,7 +336,9 @@ L.Map.include({
 				if (documentType == null)
 					return;
 
-				var filename = 'fileId.' + documentType; // need to read the filename
+				var filename = map['wopi'].BaseFileName;
+				if (!filename)
+					filename = randomName() + '.' + documentType;
 
 				library.getPassports(filename).then(function(result) {
 					var vereignURL = window.documentSigningURL == null ? '' : window.documentSigningURL;
@@ -350,7 +356,7 @@ L.Map.include({
 								map._socket.sendMessage(blob);
 								// Let the user know that we're done.
 								map.fire('infobar', {
-									msg: _('Document uploaded.'),
+									msg: _('Document "' + filename + '"uploaded.'),
 									action: null,
 									actionLabel: null
 								});


More information about the Libreoffice-commits mailing list