[Libreoffice-commits] online.git: Branch 'distro/collabora/milestone-7' - loleaflet/src

Henry Castro hcastro at collabora.com
Sat Jan 16 12:26:19 PST 2016


 loleaflet/src/control/Control.Zoom.js     |    2 -
 loleaflet/src/core/Log.js                 |    2 -
 loleaflet/src/core/Socket.js              |    2 -
 loleaflet/src/map/handler/Map.Keyboard.js |   37 +++++++++++++++++++++++++++++-
 4 files changed, 39 insertions(+), 4 deletions(-)

New commits:
commit 29478bb7faff8ed74bc199a27ae8b7231be19499
Author: Henry Castro <hcastro at collabora.com>
Date:   Sat Jan 16 15:06:50 2016 -0400

    loleaflet: fixed js lint errors misc files

diff --git a/loleaflet/src/control/Control.Zoom.js b/loleaflet/src/control/Control.Zoom.js
index 407a25b..c3a38d4 100644
--- a/loleaflet/src/control/Control.Zoom.js
+++ b/loleaflet/src/control/Control.Zoom.js
@@ -53,7 +53,7 @@ L.Control.Zoom = L.Control.extend({
 		}
 	},
 
-	_fitWidth: function (e) {
+	_fitWidth: function () {
 		if (!this._disabled) {
 			this._map.fitWidthZoom();
 		}
diff --git a/loleaflet/src/core/Log.js b/loleaflet/src/core/Log.js
index 551cff7..667378b 100644
--- a/loleaflet/src/core/Log.js
+++ b/loleaflet/src/core/Log.js
@@ -31,7 +31,7 @@ L.Log = {
 	},
 
 	print: function () {
-		console.log(this._getEntries());
+		// console.log(this._getEntries());
 	},
 
 	save: function () {
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index ec16169..57f239f 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -248,5 +248,5 @@ L.Socket = L.Class.extend({
 });
 
 L.socket = function (map) {
-    return new L.Socket(map);
+	return new L.Socket(map);
 };
diff --git a/loleaflet/src/map/handler/Map.Keyboard.js b/loleaflet/src/map/handler/Map.Keyboard.js
index 6b03aaa..cac51b9 100644
--- a/loleaflet/src/map/handler/Map.Keyboard.js
+++ b/loleaflet/src/map/handler/Map.Keyboard.js
@@ -139,6 +139,11 @@ L.Map.Keyboard = L.Handler.extend({
 		46  : true // delete
 	},
 
+	keyCodes: {
+		pageUp:   33,
+		pageDown: 34
+	},
+
 	navigationKeyCodes: {
 		left:    [37],
 		right:   [39],
@@ -225,7 +230,12 @@ L.Map.Keyboard = L.Handler.extend({
 		var shift = e.originalEvent.shiftKey ? this.keyModifier.shift : 0;
 		var ctrl = e.originalEvent.ctrlKey ? this.keyModifier.ctrl : 0;
 		var alt = e.originalEvent.altKey ? this.keyModifier.alt : 0;
-		this.modifier = shift | ctrl | alt;
+		var cmd = e.originalEvent.metaKey ? this.keyModifier.ctrlMac : 0;
+		this.modifier = shift | ctrl | alt | cmd;
+
+		if (cmd) {
+			return;
+		}
 
 		if (ctrl) {
 			if (this._handleCtrlCommand(e)) {
@@ -233,6 +243,22 @@ L.Map.Keyboard = L.Handler.extend({
 			}
 		}
 
+		// Change slides with PgUp/PgDown in Presentation
+		if (this._map.getDocType() === 'presentation' && !this.modifier && e.type === 'keyup') {
+			var _keyCode = e.originalEvent.keyCode;
+			if (_keyCode === this.keyCodes.pageUp || _keyCode === this.keyCodes.pageDown) {
+				e.originalEvent.preventDefault();
+				e.originalEvent.stopPropagation();
+
+				if (_keyCode === this.keyCodes.pageUp) {
+					this._map.setPart('prev');
+				}
+				else if (_keyCode === this.keyCodes.pageDown) {
+					this._map.setPart('next');
+				}
+			}
+		}
+
 		var charCode = e.originalEvent.charCode;
 		var keyCode = e.originalEvent.keyCode;
 		var unoKeyCode = this._toUNOKeyCode(keyCode);
@@ -307,6 +333,12 @@ L.Map.Keyboard = L.Handler.extend({
 
 		if (e.originalEvent.altKey || e.originalEvent.shiftKey) {
 
+			// need to handle Ctrl + Alt + C separately for Firefox
+			if (e.originalEvent.key === 'c' && e.originalEvent.altKey) {
+				this._map._socket.sendMessage('uno .uno:InsertAnnotation');
+				return true;
+			}
+
 			// Ctrl + Alt
 			if (!e.originalEvent.shiftKey) {
 				switch (e.originalEvent.keyCode) {
@@ -354,6 +386,9 @@ L.Map.Keyboard = L.Handler.extend({
 				return true;
 			case 86: // v
 				return true;
+			case 112: // f1
+				this._map._socket.sendMessage('uno .uno:NoteVisible');
+				return true;
 			case 188: // ,
 				this._map._socket.sendMessage('uno .uno:SubScript');
 				return true;


More information about the Libreoffice-commits mailing list