[Libreoffice-commits] online.git: loleaflet/build loleaflet/html loleaflet/Makefile.am loleaflet/src

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Fri Nov 15 16:35:11 UTC 2019


 loleaflet/Makefile.am                         |    2 +-
 loleaflet/build/deps.js                       |    8 ++++----
 loleaflet/html/clipboard.html                 |    2 +-
 loleaflet/src/control/Control.LokDialog.js    |   10 +++++-----
 loleaflet/src/layer/marker/TextInput.js       |    8 ++++----
 loleaflet/src/layer/tile/TileLayer.js         |    8 ++++----
 loleaflet/src/map/Clipboard.js                |    6 +++---
 loleaflet/src/map/Map.js                      |   14 +++++++-------
 loleaflet/src/map/handler/Map.Keyboard.js     |   10 +++++-----
 loleaflet/src/map/handler/Map.TouchGesture.js |   10 +++++-----
 10 files changed, 39 insertions(+), 39 deletions(-)

New commits:
commit 946cc5d8e6c547a54a525828662b994d9bf0a06f
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Fri Nov 15 16:26:52 2019 +0000
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Fri Nov 15 16:28:34 2019 +0000

    Rename misleading ClipboardContainer -> TextInput
    
    Change-Id: Idb5ccb9959e0c77dfcdbb2793330bb048db0f0f8

diff --git a/loleaflet/Makefile.am b/loleaflet/Makefile.am
index 94d6506a3..5eac57527 100644
--- a/loleaflet/Makefile.am
+++ b/loleaflet/Makefile.am
@@ -354,7 +354,7 @@ pot:
 		src/core/Socket.js \
 		src/errormessages.js \
 		src/layer/marker/Annotation.js \
-		src/layer/marker/ClipboardContainer.js \
+		src/layer/marker/TextInput.js \
 		src/layer/tile/CalcTileLayer.js \
 		src/layer/tile/ImpressTileLayer.js \
 		src/layer/tile/TileLayer.js \
diff --git a/loleaflet/build/deps.js b/loleaflet/build/deps.js
index 4927268f6..f3e8b72e6 100644
--- a/loleaflet/build/deps.js
+++ b/loleaflet/build/deps.js
@@ -64,7 +64,7 @@ var deps = {
 		desc: 'Calc tile layer.',
 		deps: ['TileLayer', 'CalcGridLines']
 	},
-	
+
 	ImageOverlay: {
 		src: ['layer/ImageOverlay.js'],
 		desc: 'Used to display an image over a particular rectangular area of the map.'
@@ -75,9 +75,9 @@ var deps = {
 		desc: 'Used to display a progress image over rectangular are of the map.'
 	},
 
-	ClipboardContainer: {
-		src: ['layer/marker/ClipboardContainer.js'],
-		desc: 'Container for hidden input field.'
+	TextInput: {
+		src: ['layer/marker/TextInput.js'],
+		desc: 'Hidden input field.'
 	},
 
 	Marker: {
diff --git a/loleaflet/html/clipboard.html b/loleaflet/html/clipboard.html
index e83463722..6d4f31985 100644
--- a/loleaflet/html/clipboard.html
+++ b/loleaflet/html/clipboard.html
@@ -112,7 +112,7 @@
     <script src="%SERVICE_ROOT%/loleaflet/%VERSION%/src/layer/tile/CalcTileLayer.js" defer></script>
     <script src="%SERVICE_ROOT%/loleaflet/%VERSION%/src/layer/ImageOverlay.js" defer></script>
     <script src="%SERVICE_ROOT%/loleaflet/%VERSION%/src/layer/marker/ProgressOverlay.js" defer></script>
-    <script src="%SERVICE_ROOT%/loleaflet/%VERSION%/src/layer/marker/ClipboardContainer.js" defer></script>
+    <script src="%SERVICE_ROOT%/loleaflet/%VERSION%/src/layer/marker/TextInput.js" defer></script>
     <script src="%SERVICE_ROOT%/loleaflet/%VERSION%/src/layer/marker/Icon.js" defer></script>
     <script src="%SERVICE_ROOT%/loleaflet/%VERSION%/src/layer/marker/Icon.Default.js" defer></script>
     <script src="%SERVICE_ROOT%/loleaflet/%VERSION%/src/layer/marker/Marker.js" defer></script>
diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js
index 29c5cfef5..97e105874 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -371,7 +371,7 @@ L.Control.LokDialog = L.Control.extend({
 		// set the position of the cursor container element
 		L.DomUtil.setStyle(this._dialogs[dlgId].cursor, 'left', x + 'px');
 		L.DomUtil.setStyle(this._dialogs[dlgId].cursor, 'top', y + 'px');
-		this._map.getClipboardContainer().focus();
+		this._map.getTextInput().focus();
 	},
 
 	_createDialogCursor: function(dialogId) {
@@ -397,11 +397,11 @@ L.Control.LokDialog = L.Control.extend({
 		}
 
 		this._map.setWinId(dlgId);
+		var inputContainer = this._map.getTextInput();
 		if (this._dialogs[dlgId].cursorVisible) {
-			this._map.getClipboardContainer().focus();
-		}
-		else {
-			this._map.getClipboardContainer().blur();
+			inputContainer.focus();
+		} else {
+			inputContainer.blur();
 		}
 	},
 
diff --git a/loleaflet/src/layer/marker/ClipboardContainer.js b/loleaflet/src/layer/marker/TextInput.js
similarity index 99%
rename from loleaflet/src/layer/marker/ClipboardContainer.js
rename to loleaflet/src/layer/marker/TextInput.js
index 4d996ffb8..9faf1ea29 100644
--- a/loleaflet/src/layer/marker/ClipboardContainer.js
+++ b/loleaflet/src/layer/marker/TextInput.js
@@ -1,13 +1,13 @@
 /* -*- js-indent-level: 8 -*- */
 /*
- * L.ClipboardContainer is the hidden textarea, which handles text
+ * L.TextInput is the hidden textarea, which handles text
  * input events and clipboard selection.
  *
  */
 
 /* global */
 
-L.ClipboardContainer = L.Layer.extend({
+L.TextInput = L.Layer.extend({
 	initialize: function() {
 		// Flag to denote the composing state, derived from
 		// compositionstart/compositionend events; unused
@@ -656,6 +656,6 @@ L.ClipboardContainer = L.Layer.extend({
 	}
 });
 
-L.clipboardContainer = function() {
-	return new L.ClipboardContainer();
+L.textInput = function() {
+	return new L.TextInput();
 };
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 1179fa383..9ae10c84d 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2000,7 +2000,7 @@ L.TileLayer = L.GridLayer.extend({
 			this._cursorMarker.setLatLng(cursorPos, pixBounds.getSize().multiplyBy(this._map.getZoomScale(this._map.getZoom())));
 		}
 
-		this._map._clipboardContainer.showCursor();
+		this._map._textInput.showCursor();
 		if (this._map._isFocused && !L.Browser.mobile) {
 			// On mobile, this is causing some key input to get lost.
 			this._map.focus();
@@ -2046,7 +2046,7 @@ L.TileLayer = L.GridLayer.extend({
 			this._updateCursorPos();
 		}
 		else {
-			this._map._clipboardContainer.hideCursor();
+			this._map._textInput.hideCursor();
 		}
 	},
 
@@ -3126,7 +3126,7 @@ L.TileLayer = L.GridLayer.extend({
 				if (e.layer === this._debugAlwaysActive) {
 					this._map._debugAlwaysActive = true;
 				} else if (e.layer === this._debugShowClipboard) {
-					this._map._clipboardContainer.debug(true);
+					this._map._textInput.debug(true);
 				} else if (e.layer === this._debugTyper) {
 					this._debugTypeTimeout();
 				} else if (e.layer === this._debugInfo2) {
@@ -3139,7 +3139,7 @@ L.TileLayer = L.GridLayer.extend({
 				if (e.layer === this._debugAlwaysActive) {
 					this._map._debugAlwaysActive = false;
 				} else if (e.layer === this._debugShowClipboard) {
-					this._map._clipboardContainer.debug(false);
+					this._map._textInput.debug(false);
 				} else if (e.layer === this._debugTyper) {
 					clearTimeout(this._debugTypeTimeoutId);
 				} else if (e.layer === this._debugInfo2) {
diff --git a/loleaflet/src/map/Clipboard.js b/loleaflet/src/map/Clipboard.js
index ea80b2469..9dad436ba 100644
--- a/loleaflet/src/map/Clipboard.js
+++ b/loleaflet/src/map/Clipboard.js
@@ -395,7 +395,7 @@ L.Clipboard = L.Class.extend({
 								if (usePasteKeyEvent) {
 									// paste into dialog
 									var KEY_PASTE = 1299;
-									that._map._clipboardContainer._sendKeyEvent(0, KEY_PASTE);
+									that._map._textInput._sendKeyEvent(0, KEY_PASTE);
 								} else {
 									// paste into document
 									that._map._socket.sendMessage('uno .uno:Paste');
@@ -652,7 +652,7 @@ L.Clipboard = L.Class.extend({
 					that._map.focus();
 				else
 					active.focus();
-				that._map._clipboardContainer._abortComposition(ev);
+				that._map._textInput._abortComposition(ev);
 				that._clipboardSerial++;
 			}, 0 /* ASAP */);
 			return false;
@@ -666,7 +666,7 @@ L.Clipboard = L.Class.extend({
 			// pass the clipboard data to a different context (async calls, f.e.).
 			var htmlText = ev.clipboardData.getData('text/html');
 			this.dataTransferToDocument(ev.clipboardData, /* preferInternal = */ true, htmlText, usePasteKeyEvent);
-			this._map._clipboardContainer._abortComposition(ev);
+			this._map._textInput._abortComposition(ev);
 			this._clipboardSerial++;
 			this._stopHideDownload();
 		}
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index c66dea7cd..947706fb5 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -144,8 +144,8 @@ L.Map = L.Evented.extend({
 		}
 		this._progressBar = L.progressOverlay(center, new L.point(150, 25));
 
-		this._clipboardContainer = L.clipboardContainer();
-		this.addLayer(this._clipboardContainer);
+		this._textInput = L.textInput();
+		this.addLayer(this._textInput);
 
 		if (window.mode.isMobile()) {
 			L.DomEvent.on(window, 'resize', function(e) {
@@ -811,9 +811,9 @@ L.Map = L.Evented.extend({
 		return this._container;
 	},
 
-	// Returns the instance of layer/marker/ClipboardContainer in this map.
-	getClipboardContainer: function getClipboardContainer() {
-		return this._clipboardContainer;
+	// Returns the instance of layer/marker/TextInput in this map.
+	getTextInput: function getTextInput() {
+		return this._textInput;
 	},
 
 	// We have one global winId that controls what window (dialog, sidebar, or
@@ -907,12 +907,12 @@ L.Map = L.Evented.extend({
 		// container in order for the user to input text (and on-screen keyboards
 		// to pop-up), unless the document is read only.
 		if (this._permission === 'edit') {
-			this._clipboardContainer.focus();
+			this._textInput.focus();
 		}
 	},
 
 	hasFocus: function () {
-		return this._clipboardContainer.hasFocus();
+		return this._textInput.hasFocus();
 	},
 
 	setHelpTarget: function(page) {
diff --git a/loleaflet/src/map/handler/Map.Keyboard.js b/loleaflet/src/map/handler/Map.Keyboard.js
index 13f605e28..d4bf89185 100644
--- a/loleaflet/src/map/handler/Map.Keyboard.js
+++ b/loleaflet/src/map/handler/Map.Keyboard.js
@@ -4,7 +4,7 @@
  *
  * It handles keyboard interactions which are NOT text input, including those which
  * don't require edit permissions (e.g. page scroll). Text input is handled
- * at ClipboardContainer.
+ * at TextInput.
  */
 
 L.Map.mergeOptions({
@@ -127,7 +127,7 @@ L.Map.Keyboard = L.Handler.extend({
 	handleOnKeyDownKeys: {
 		// these keys need to be handled on keydown in order for them
 		// to work on chrome
-		// Backspace and Delete are handled at ClipboardContainer's 'beforeinput' handler.
+		// Backspace and Delete are handled at TextInput's 'beforeinput' handler.
 		9   : true, // tab
 		19  : true, // pause/break
 		20  : true, // caps lock
@@ -232,7 +232,7 @@ L.Map.Keyboard = L.Handler.extend({
 	// Calls the public onKeyDown(), but only if the event doesn't have
 	// a charCode property (set to something different than 0) - that ignores
 	// any 'beforeinput', 'keypress' and 'input' events that would add
-	// printable characters. Those are handled by ClipboardContainer.js.
+	// printable characters. Those are handled by TextInput.js.
 	_onKeyDown: function (ev) {
 		console.log('keyboard handler:', ev.type, ev.key, ev.charCode, this._expectingInput, ev);
 
@@ -340,7 +340,7 @@ L.Map.Keyboard = L.Handler.extend({
 			else if ((ev.type === 'keypress') && (!this.handleOnKeyDownKeys[keyCode] || charCode !== 0)) {
 				if (keyCode === 8 || keyCode === 46 || keyCode === 13)
 				{
-					// handled generically in ClipboardContainer.js
+					// handled generically in TextInput.js
 					console.log('Ignore backspace/delete/enter keypress');
 					return;
 				}
@@ -500,7 +500,7 @@ L.Map.Keyboard = L.Handler.extend({
 		case 93: // Right Cmd (Safari)
 			// we prepare for a copy or cut event
 			this._map.focus();
-			this._map._clipboardContainer.select();
+			this._map._textInput.select();
 			return true;
 		case 80: // p
 			this._map.print();
diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js
index 84439db5b..d406a2b3d 100644
--- a/loleaflet/src/map/handler/Map.TouchGesture.js
+++ b/loleaflet/src/map/handler/Map.TouchGesture.js
@@ -314,7 +314,7 @@ L.Map.TouchGesture = L.Handler.extend({
 		this._map._docLayer._postMouseEvent('buttonup', mousePos.x, mousePos.y, 1, 1, 0);
 
 		if (this._state === L.Map.TouchGesture.MARKER || this._state === L.Map.TouchGesture.GRAPHIC) {
-			this._map._clipboardContainer.blur();
+			this._map._textInput.blur();
 		} else {
 			this._map.focus();
 		}
@@ -445,8 +445,8 @@ L.Map.TouchGesture = L.Handler.extend({
 		if (this._map._docLayer.isCursorVisible()) {
 			this._map._docLayer._cursorMarker.setOpacity(0);
 		}
-		if (this._map._clipboardContainer._cursorHandler) {
-			this._map._clipboardContainer._cursorHandler.setOpacity(0);
+		if (this._map._textInput._cursorHandler) {
+			this._map._textInput._cursorHandler.setOpacity(0);
 		}
 		if (this._map._docLayer._selectionHandles['start']) {
 			this._map._docLayer._selectionHandles['start'].setOpacity(0);
@@ -487,8 +487,8 @@ L.Map.TouchGesture = L.Handler.extend({
 		if (this._map._docLayer.isCursorVisible()) {
 			this._map._docLayer._cursorMarker.setOpacity(1);
 		}
-		if (this._map._clipboardContainer._cursorHandler) {
-			this._map._clipboardContainer._cursorHandler.setOpacity(1);
+		if (this._map._textInput._cursorHandler) {
+			this._map._textInput._cursorHandler.setOpacity(1);
 		}
 		if (this._map._docLayer._selectionHandles['start']) {
 			this._map._docLayer._selectionHandles['start'].setOpacity(1);


More information about the Libreoffice-commits mailing list