[Libreoffice-commits] online.git: 2 commits - loleaflet/dist loleaflet/reference.html loleaflet/src

Mihai Varga mihai.varga at collabora.com
Wed Oct 21 08:50:15 PDT 2015


 loleaflet/dist/leaflet.css                    |    1 +
 loleaflet/reference.html                      |    5 +++++
 loleaflet/src/control/Control.PartsPreview.js |    2 +-
 loleaflet/src/control/Toolbar.js              |    8 ++++++++
 loleaflet/src/map/handler/Map.Keyboard.js     |    2 +-
 loleaflet/src/map/handler/Map.Print.js        |    4 ++--
 6 files changed, 18 insertions(+), 4 deletions(-)

New commits:
commit e6ce519f1c5730c66307344c92c7cce7b6831826
Author: Mihai Varga <mihai.varga at collabora.com>
Date:   Wed Oct 21 18:41:24 2015 +0300

    loleaflet: added a map.print() method
    
    Also renamed the print handler so that it does not interfere with the
    new method

diff --git a/loleaflet/reference.html b/loleaflet/reference.html
index 07574de..4f13e94 100644
--- a/loleaflet/reference.html
+++ b/loleaflet/reference.html
@@ -1598,6 +1598,11 @@ var map = L.map('map', {
 		<td><code>undefined</code></td>
         <td>Download the document as "format" with the name "name" by applying the filter options.</td>
 	</tr>
+	<tr>
+		<td><code><b>print</b>()</code></td>
+		<td><code>undefined</code></td>
+        <td>Opens the browser's print dialog or promts the user to download a pdf version of the document.</td>
+	</tr>
 </table>
 
 <h2 id="loleaflet-page">Page oriented</h2>
diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 8b04431..2b85406 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -46,6 +46,10 @@ L.Map.include({
 			'options=' + options);
 	},
 
+	print: function () {
+		this.downloadAs('print.pdf', 'pdf', null, 'print');
+	},
+
 	saveAs: function (url, format, options) {
 		if (format === undefined || format === null) {
 			format = '';
@@ -80,5 +84,9 @@ L.Map.include({
 			}
 			L.Socket.sendMessage('uno ' + unoState);
 		}
+	},
+
+	insertFile: function (file) {
+		this.fire('insertfile', {file: file});
 	}
 });
diff --git a/loleaflet/src/map/handler/Map.Keyboard.js b/loleaflet/src/map/handler/Map.Keyboard.js
index 5aa146b..6f4f3c1 100644
--- a/loleaflet/src/map/handler/Map.Keyboard.js
+++ b/loleaflet/src/map/handler/Map.Keyboard.js
@@ -287,7 +287,7 @@ L.Map.Keyboard = L.Handler.extend({
 				L.Socket.sendMessage('uno .uno:LeftPara');
 				break;
 			case 80: // p
-				this._map.downloadAs('print.pdf', 'pdf', null, 'print');
+				this._map.print();
 				break;
 			case 82: // r
 				L.Socket.sendMessage('uno .uno:RightPara');
diff --git a/loleaflet/src/map/handler/Map.Print.js b/loleaflet/src/map/handler/Map.Print.js
index 1a92c8b..9adda5b 100644
--- a/loleaflet/src/map/handler/Map.Print.js
+++ b/loleaflet/src/map/handler/Map.Print.js
@@ -3,7 +3,7 @@
  */
 
 L.Map.mergeOptions({
-	print: true
+	printHandler: true
 });
 
 L.Map.Print = L.Handler.extend({
@@ -59,4 +59,4 @@ L.Map.Print = L.Handler.extend({
 	}
 });
 
-L.Map.addInitHook('addHandler', 'print', L.Map.Print);
+L.Map.addInitHook('addHandler', 'printHandler', L.Map.Print);
commit 0fa8f600943cab3036e4666746c811c39245b31a
Author: Mihai Varga <mihai.varga at collabora.com>
Date:   Wed Oct 21 11:22:55 2015 +0300

    loleaflet: stick the parts preview to the left

diff --git a/loleaflet/dist/leaflet.css b/loleaflet/dist/leaflet.css
index e11233e..b1a3dac 100644
--- a/loleaflet/dist/leaflet.css
+++ b/loleaflet/dist/leaflet.css
@@ -703,6 +703,7 @@ a.leaflet-control-buttons:hover:first-child {
 	background: #DFDFDF;
 	position: absolute;
 	top: 70px;
+    left: 0px;
 	bottom: 0px;
 	max-width: 195px;
 	overflow: hidden;
diff --git a/loleaflet/src/control/Control.PartsPreview.js b/loleaflet/src/control/Control.PartsPreview.js
index 5439b49..2a6c5ad 100644
--- a/loleaflet/src/control/Control.PartsPreview.js
+++ b/loleaflet/src/control/Control.PartsPreview.js
@@ -29,7 +29,7 @@ L.Control.PartsPreview = L.Control.extend({
 		if (!this._previewInitialized && docType === 'presentation') {
 			// make room for the preview
 			var docContainer = L.DomUtil.get('document-container');
-			L.DomUtil.setStyle(docContainer, 'left', '200px');
+			L.DomUtil.setStyle(docContainer, 'left', '195px');
 			setTimeout(L.bind(function () {
 				this._map.invalidateSize();
 				$('.scroll-container').mCustomScrollbar('update');


More information about the Libreoffice-commits mailing list