loleaflet/README                      |    3 +++
 loleaflet/reference.html              |   22 ++++++++++++++++++++++
 loleaflet/src/layer/tile/TileLayer.js |   16 ++++++++++++++++
 loolwsd/protocol.txt                  |    4 ++++
 4 files changed, 45 insertions(+)

New commits:
commit 7a88c9b959b1a477b0cef932e282cdcb89ff8ae0
Author: Jan Holesovsky <ke...@collabora.com>
Date:   Wed Nov 4 13:33:11 2015 +0100

    loolwsd: Document unocommandresult in the protocol.

diff --git a/loolwsd/protocol.txt b/loolwsd/protocol.txt
index 085813a..21de54c 100644
--- a/loolwsd/protocol.txt
+++ b/loolwsd/protocol.txt
@@ -174,6 +174,10 @@ Websocket connections to the clients) and a child process 
(handling
 one document through LibreOfficeKit) uses the same protocol, with
 the following additions and changes:
 
+unocommandresult: <payload>
+
+Callback that an UNO command has finished.
+See LOK_CALLBACK_UNO_COMMAND_RESULT for details.
 
 child -> parent
 ===============
commit b068d9622c7c6294edbee7109dfef47a11a0866a
Author: Jan Holesovsky <ke...@collabora.com>
Date:   Wed Nov 4 13:27:23 2015 +0100

    loleaflet: Add 'commandresult' event.
    
    It's the loleaflet equivalent of the LOK_CALLBACK_UNO_COMMAND_RESULT 
callback.

diff --git a/loleaflet/README b/loleaflet/README
index 57f09c8..63fdda6 100644
--- a/loleaflet/README
+++ b/loleaflet/README
@@ -96,6 +96,9 @@ Buttons like Bold, Italic, Strike through etc.
             + e.commandName == '.uno:' + 'Bold' | 'Italic' | 'StyleApply' | 
'CharFontName' | 'FontHeight' etc.
             + e.state = 'true' | 'false'
             + e.state = fontName | fontSize | styleName
+        map.on('commandresult', function (e) {}) where:
+            + e.commandName == '.uno:' + 'Bold' | 'Italic' | 'StyleApply' | 
'CharFontName' | 'FontHeight' etc.
+            + e.success = true | false | undefined
 
 Parts (like slides in presentation, or sheets in spreadsheets):
     - API:
diff --git a/loleaflet/reference.html b/loleaflet/reference.html
index 4f13e94..5e904cb 100644
--- a/loleaflet/reference.html
+++ b/loleaflet/reference.html
@@ -1780,6 +1780,28 @@ var map = L.map('map', {
        </tr>
 </table>
 
+<h3 id="commandresult-event">CommandResult</h3>
+
+<table data-id='events'>
+       <tr>
+               <th class="width100">property</th>
+               <th>type</th>
+               <th>description</th>
+       </tr>
+       <tr>
+               <td><code><b>commandName</b></code></td>
+               <td><code><a 
href="#commandstatechanged-values">CommandStateChangedValues</a></code></td>
+               <td>UNO command.</td>
+       </tr>
+       <tr>
+               <td><code><b>success</b></code></td>
+               <td><code>Boolean or undefined</code></td>
+               <td>Returns the status code of the command execution, or
+                   undefined if the result is not provided, and the command
+                   only indicates that the operation has finished.</td>
+       </tr>
+</table>
+
 <h3 id="updateparts-event">UpdatePartsEvent</h3>
 
 <table data-id='events'>
diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index aa0a88b..6dc4d1f 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -257,6 +257,9 @@ L.TileLayer = L.GridLayer.extend({
                else if (textMsg.startsWith('tile:')) {
                        this._onTileMsg(textMsg, img);
                }
+               else if (textMsg.startsWith('unocommandresult:')) {
+                       this._onUnoCommandResultMsg(textMsg);
+               }
        },
 
        _onCommandValuesMsg: function (textMsg) {
@@ -410,6 +413,19 @@ L.TileLayer = L.GridLayer.extend({
                this._map.fire('commandstatechanged', {commandName : 
commandName, state : state});
        },
 
+       _onUnoCommandResultMsg: function (textMsg) {
+               textMsg = textMsg.substring(18);
+               var obj = JSON.parse(textMsg);
+               var commandName = obj.commandName;
+               var success = undefined;
+               if (obj.success === 'true')
+                       success = true;
+               else if (obj.success === 'false')
+                       success = false;
+               // TODO when implemented in the LOK, add also obj.result
+               this._map.fire('commandresult', {commandName: commandName, 
success: success});
+       },
+
        _onStatusIndicatorMsg: function (textMsg) {
                if (textMsg.startsWith('statusindicatorstart:')) {
                        this._map.fire('statusindicator', {statusType : 
'start'});
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to