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

Mihai Varga mihai.varga at collabora.com
Wed Dec 16 06:17:20 PST 2015


 loleaflet/reference.html              |  102 ++++++++++++++++++++++++++++++++++
 loleaflet/src/control/Control.Tabs.js |    3 -
 2 files changed, 104 insertions(+), 1 deletion(-)

New commits:
commit 1970ab4a2e91c630ab7e4a27a4614197894c0924
Author: Mihai Varga <mihai.varga at collabora.com>
Date:   Wed Dec 16 16:15:39 2015 +0200

    loleaflet: scroll to [0, 0] after creating the tab control
    
    Creating the tab control offset the document a bit so we need to reset
    it.

diff --git a/loleaflet/src/control/Control.Tabs.js b/loleaflet/src/control/Control.Tabs.js
index 576408b..685ce4f 100644
--- a/loleaflet/src/control/Control.Tabs.js
+++ b/loleaflet/src/control/Control.Tabs.js
@@ -30,7 +30,8 @@ L.Control.Tabs = L.Control.extend({
 				setTimeout(L.bind(function () {
 					this._map.invalidateSize();
 					$('.scroll-container').mCustomScrollbar('update');
-				}, this), 500);
+					$('.scroll-container').mCustomScrollbar('scrollTo', [0, 0]);
+				}, this), 100);
 				for (var i = 0; i < parts; i++) {
 					var id = 'spreadsheet-tab' + i;
 					var tab = L.DomUtil.create('li', '', this._tabsCont);
commit 3a13f2bea4aae540b7743a8212b6e11b591b7cdd
Author: Mihai Varga <mihai.varga at collabora.com>
Date:   Tue Dec 15 18:58:05 2015 +0200

    loleaflet: document the current initialization methods

diff --git a/loleaflet/reference.html b/loleaflet/reference.html
index 30dc3b9..ef4a708 100644
--- a/loleaflet/reference.html
+++ b/loleaflet/reference.html
@@ -58,6 +58,7 @@
 	<div class="toc-col">
 		<h4 style="color:red;">LOLeaflet API</h4>
 		<ul>
+			<li><a href="#loleaflet-initialization">Initialization</a></li>
 			<li><a href="#loleaflet-general">General</a></li>
 			<li><a href="#loleaflet-toolbar">Toolbar</a></li>
 			<li><a href="#loleaflet-page">Page oriented</a></li>
@@ -1392,6 +1393,98 @@ var map = L.map('map', {
 	</tr>
 </table>
 
+<h2 id="loleaflet-initialization">Initialization</h2>
+
+<h3>Usage example</h3>
+
+<pre><code class="javascript">
+var map = L.map('map', {
+    doc: 'file:///path/to/document',
+    server: 'ws://localhost',
+    edit: true,
+    documentContainer: 'document-container'
+});</code></pre>
+
+<h3 class="left">Creation</h3>
+
+<table data-id='map'>
+	<tr>
+		<th>Factory</th>
+		<th>Description</th>
+	</tr>
+	<tr>
+		<td><code><b>L.map</b>(
+			<nobr><HTMLElement|String> <i>id</i>,</nobr>
+			<nobr><<a href="#map-options">Map options</a>> <i>options?</i> )</nobr>
+		</code></td>
+
+
+		<td>Instantiates a map object given a div element (or its id) and optionally an object literal with map options described below.</td>
+	</tr>
+</table>
+
+<h3>Options</h3>
+
+<h4>These are the options intended to be used for loleaflet, using any additional options from Leaflet might cause some
+unexpected behaviour.</h4>
+
+<table data-id='map'>
+	<tr>
+		<th>Option</th>
+		<th>Type</th>
+		<th>Default</th>
+		<th>Description</th>
+	</tr>
+	<tr>
+		<td><code><b>doc</b></code></td>
+		<td><code>String</code></td>
+		<td><code><span class="literal">undefined</span></code></td>
+		<td>Document URL, the server should be able to access the document.</td>
+	</tr>
+	<tr>
+		<td><code><b>server</b></code></td>
+		<td><code>String</code></td>
+		<td><code><span class="literal">undefined</span></code></td>
+		<td>The server hosting loolwsd.</td>
+	</tr>
+	<tr>
+		<td><code><b>edit</b></code></td>
+		<td><code>Boolean</code></td>
+		<td><code><span class="literal">false</span></code></td>
+		<td>Whether the documet starts in viewing or editing mode.</td>
+	</tr>
+	<tr>
+		<td><code><b>readOnly</b></code></td>
+		<td><code>Boolean</code></td>
+		<td><code><span class="literal">false</span></code></td>
+		<td>Whether the documet is read-only.</td>
+	</tr>
+	<tr>
+		<td><code><b>timestamp</b></code></td>
+		<td><code>String</code></td>
+		<td><code><span class="literal">undefined</span></code></td>
+		<td>A timestamp of the last modification to the document.</td>
+	</tr>
+	<tr>
+		<td><code><b>documentContainer</b></code></td>
+		<td><code>String / DOM element</code></td>
+		<td><code><span class="literal">undefined</span></code></td>
+		<td>An outer div, containing the map div, that is used internally for the creation of the toolbar.</td>
+	</tr>
+	<tr>
+		<td><code><b>renderingOptions</b></code></td>
+		<td><code>Object</code></td>
+		<td><code><span class="literal">undefined</span></code></td>
+		<td>Enables the continous, web view, of the document, see the UNO commands below for this parameter.</td>
+	</tr>
+	<tr>
+		<td><code><b>print</b></code></td>
+		<td><code>Boolean</code></td>
+		<td><code><span class="literal">true</span></code></td>
+		<td>Whether the print handler is active (for Chrome).</td>
+	</tr>
+</table>
+
 <h2 id="loleaflet-general">General</h2>
 
 <p>General methods for document interaction.</p>
@@ -8139,6 +8232,15 @@ var unoCommands = [
 },
 
 {
+    uno: '.uno:HideWhitespace',
+    parameter: {
+        'type': 'boolean',
+        'value': 'false'
+    },
+    description: 'Continous web view of the document'
+},
+
+{
     uno: '.uno:IncrementIndent',
     parameter: null,
     description: 'Increment paragraph indentation.'


More information about the Libreoffice-commits mailing list