Makefile.am | 1 + debian/loolwsd.postinst.in | 4 ++++ debian/loolwsd.postrm | 5 +++++ loleaflet/src/map/handler/Map.FileInserter.js | 24 ++++++++++++++++++------ 4 files changed, 28 insertions(+), 6 deletions(-)
New commits: commit 63200128f05fcb63db9332a8abb51944fd8e0357 Author: Andras Timar <andras.ti...@collabora.com> AuthorDate: Tue Nov 26 22:56:58 2019 +0100 Commit: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> CommitDate: Tue Dec 17 09:28:14 2019 +0100 deb: trigger systemplate update after apt operations (e.g. installation of a new font, etc.) Change-Id: Ia356249598d2f451d135985511b0fce71335a28d (cherry picked from commit da56f1fc73ffdd17e44347d38ee4a844fa72a147) diff --git a/Makefile.am b/Makefile.am index 1b9dd4d35..16ec4e1a9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -252,6 +252,7 @@ EXTRA_DIST = discovery.xml \ debian/changelog \ debian/control \ debian/loolwsd.postinst \ + debian/loolwsd.postrm \ etc/key.pem \ etc/cert.pem \ etc/ca-chain.cert.pem \ diff --git a/debian/loolwsd.postinst.in b/debian/loolwsd.postinst.in index 942cbc695..bbbfcfeda 100755 --- a/debian/loolwsd.postinst.in +++ b/debian/loolwsd.postinst.in @@ -24,6 +24,10 @@ case "$1" in fc-cache @LO_PATH@/share/fonts/truetype loolwsd-systemplate-setup /opt/lool/systemplate @LO_PATH@ >/dev/null 2>&1 + cat << EOF > /etc/apt/apt.conf.d/25loolwsd +// Rebuild systemplate of LibreOffice Online +DPkg::Post-Invoke { "echo Updating loolwsd systemplate;su lool --shell=/bin/sh -c 'loolwsd-systemplate-setup /opt/lool/systemplate @LO_PATH@ >/dev/null 2>&1'"; }; +EOF ;; esac diff --git a/debian/loolwsd.postrm b/debian/loolwsd.postrm new file mode 100755 index 000000000..784ad65ba --- /dev/null +++ b/debian/loolwsd.postrm @@ -0,0 +1,5 @@ +#!/bin/sh + +set -e + +rm -f /etc/apt/apt.conf.d/25loolwsd commit c12dda560f1ac0b2c6bbb914eca86b5fad766490 Author: Marco Cecchetti <marco.cecche...@collabora.com> AuthorDate: Sun Oct 20 17:23:24 2019 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> CommitDate: Tue Dec 17 09:28:14 2019 +0100 loleaflet: handling server errors when uploading a file to server fails Change-Id: I910833e23cf448697f20cb8e8173c151a11d65bf (cherry picked from commit 26a2f552c0a9ea8a707a31b83d478a67dac027ba) diff --git a/loleaflet/src/map/handler/Map.FileInserter.js b/loleaflet/src/map/handler/Map.FileInserter.js index a2047d41b..969e17893 100644 --- a/loleaflet/src/map/handler/Map.FileInserter.js +++ b/loleaflet/src/map/handler/Map.FileInserter.js @@ -47,7 +47,7 @@ L.Map.FileInserter = L.Handler.extend({ this._toInsert[Date.now()] = e.file; } else { - this._sendFile(Date.now(), e.file); + this._sendFile(Date.now(), e.file, 'graphic'); } }, @@ -64,7 +64,7 @@ L.Map.FileInserter = L.Handler.extend({ _onChildIdMsg: function (e) { this._childId = e.id; for (var name in this._toInsert) { - this._sendFile(name, this._toInsert[name]); + this._sendFile(name, this._toInsert[name], 'graphic'); } this._toInsert = {}; @@ -74,7 +74,7 @@ L.Map.FileInserter = L.Handler.extend({ this._toInsertURL = {}; }, - _sendFile: function (name, file) { + _sendFile: function (name, file, type) { var socket = this._map._socket; var map = this._map; var url = this.getWopiUrl(map); @@ -89,7 +89,7 @@ L.Map.FileInserter = L.Handler.extend({ for (var i = 0; i < byteBuffer.length; i++) { strBytes += String.fromCharCode(byteBuffer[i]); } - window.postMobileMessage('insertfile name=' + aFile.name + ' type=graphic' + + window.postMobileMessage('insertfile name=' + aFile.name + ' type=' + type + ' data=' + window.btoa(strBytes)); }; })(file); @@ -104,9 +104,21 @@ L.Map.FileInserter = L.Handler.extend({ var xmlHttp = new XMLHttpRequest(); this._map.showBusy(_('Uploading...'), false); xmlHttp.onreadystatechange = function () { - if (xmlHttp.readyState === 4 && xmlHttp.status === 200) { + if (xmlHttp.readyState === 4) { map.hideBusy(); - socket.sendMessage('insertfile name=' + name + ' type=graphic'); + socket.sendMessage('insertfile name=' + name + ' type=' + type); + if (xmlHttp.status === 200) { + socket.sendMessage('insertfile name=' + name + ' type=' + type); + } + else if (xmlHttp.status === 404) { + console.error(_('Uploading file to server failed, file not found.')); + } + else if (xmlHttp.status === 413) { + console.error(_('Uploading file to server failed, file is too large.')); + } + else { + console.error('Uploading file to server failed with status: ' + xmlHttp.status + ': ' + xmlHttp.statusText); + } } }; xmlHttp.open('POST', url, true); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits