[Libreoffice-commits] online.git: 2 commits - kit/ChildSession.cpp loleaflet/dist loleaflet/src

Henry Castro hcastro at collabora.com
Mon Nov 28 03:45:09 UTC 2016


 kit/ChildSession.cpp                      |    2 +-
 loleaflet/dist/toolbar/toolbar.js         |    5 +++++
 loleaflet/src/layer/tile/TileLayer.js     |    3 +--
 loleaflet/src/map/handler/Map.Keyboard.js |   12 ++++++++++++
 4 files changed, 19 insertions(+), 3 deletions(-)

New commits:
commit 02095a3387fb0d32d577142b684ef425cb6e1e6d
Author: Henry Castro <hcastro at collabora.com>
Date:   Sun Nov 27 21:19:55 2016 -0400

    loleaflet: notify repair document when exists a conflict of multiple ..
    
    .. users undo/redo

diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index 80cdd08..1eb56d4 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -1206,6 +1206,11 @@ map.on('commandresult', function (e) {
 			window.parent.documentsMain.saveDocumentBack();
 		}
 	}
+	else if ((commandName === '.uno:Undo' || commandName === '.uno:Redo') &&
+		e.success === true && e.result.value && e.result.value === '130') { /*UNDO_CONFLICT*/
+		$('#tb_toolbar-up_item_repair').w2overlay({ html: '<div style="padding: 10px; line-height: 150%">' +
+			_('Conflict Undo/Redo with multiple users. Please use document repair to resolve') + '</div>'});
+	}
 });
 
 map.on('cellformula', function (e) {
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index ba5e5d7..aee3833 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -973,8 +973,7 @@ L.TileLayer = L.GridLayer.extend({
 		}
 
 		this._map.hideBusy();
-		// TODO when implemented in the LOK, add also obj.result
-		this._map.fire('commandresult', {commandName: commandName, success: success});
+		this._map.fire('commandresult', {commandName: commandName, success: success, result: obj.result});
 
 	},
 
diff --git a/loleaflet/src/map/handler/Map.Keyboard.js b/loleaflet/src/map/handler/Map.Keyboard.js
index 1a6988b..2a35423 100644
--- a/loleaflet/src/map/handler/Map.Keyboard.js
+++ b/loleaflet/src/map/handler/Map.Keyboard.js
@@ -383,6 +383,18 @@ L.Map.Keyboard = L.Handler.extend({
 			e.originalEvent.preventDefault();
 		}
 
+		if (e.originalEvent.ctrlKey && (e.originalEvent.key === 'z' || e.originalEvent.key === 'Z')) {
+			this._map._socket.sendMessage('uno .uno:Undo');
+			e.originalEvent.preventDefault();
+			return true;
+		}
+
+		if (e.originalEvent.ctrlKey && (e.originalEvent.key === 'y' || e.originalEvent.key === 'Y')) {
+			this._map._socket.sendMessage('uno .uno:Redo');
+			e.originalEvent.preventDefault();
+			return true;
+		}
+
 		if (e.originalEvent.altKey || e.originalEvent.shiftKey) {
 
 			// need to handle Ctrl + Alt + C separately for Firefox
commit ddd91b4251a9d98c2c84709aa5cf6f8d9cd065ce
Author: Henry Castro <hcastro at collabora.com>
Date:   Sun Nov 27 20:53:11 2016 -0400

    kit: enable notify undo/redo commands

diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp
index 66e532b..65868cf 100644
--- a/kit/ChildSession.cpp
+++ b/kit/ChildSession.cpp
@@ -787,7 +787,7 @@ bool ChildSession::unoCommand(const char* /*buffer*/, int /*length*/, StringToke
     }
 
     // we need to get LOK_CALLBACK_UNO_COMMAND_RESULT callback when saving
-    const bool bNotify = (tokens[1] == ".uno:Save");
+    const bool bNotify = (tokens[1] == ".uno:Save" || tokens[1] == ".uno:Undo" || tokens[1] == ".uno:Redo");
 
     std::unique_lock<std::mutex> lock(_docManager.getDocumentMutex());
 


More information about the Libreoffice-commits mailing list