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

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Fri May 1 19:39:15 UTC 2020


 loleaflet/src/control/Control.NotebookbarBuilder.js |   27 ++++++++++++++++++++
 loleaflet/src/control/Control.Toolbar.js            |    9 ++++++
 loleaflet/src/control/Control.TopToolbar.js         |    3 --
 3 files changed, 37 insertions(+), 2 deletions(-)

New commits:
commit bd9637ae1211423090ec1f10eadabb9e68582d53
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Apr 30 11:09:24 2020 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri May 1 21:39:12 2020 +0200

    notebookbar: insert shapes popup
    
    Change-Id: Icb75574372f48bf101ce14fc22bdf373e5e2026a
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93298
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js b/loleaflet/src/control/Control.NotebookbarBuilder.js
index d94e795fa..4614f27b9 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -36,6 +36,7 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
 		this._toolitemHandlers['.uno:Cut'] = this._clipboardButtonControl;
 		this._toolitemHandlers['.uno:Copy'] = this._clipboardButtonControl;
 		this._toolitemHandlers['.uno:Paste'] = this._clipboardButtonControl;
+		this._toolitemHandlers['.uno:BasicShapes'] = this._shapesControl;
 
 		this._toolitemHandlers['.uno:SelectWidth'] = function() {};
 
@@ -202,6 +203,22 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
 		});
 	},
 
+	_shapesControl: function(parentContainer, data, builder) {
+		var control = builder._unoToolButton(parentContainer, data, builder);
+
+		$(control.container).unbind('click');
+		$(control.container).click(function () {
+			if (!$('.insertshape-grid').length) {
+				$(control.container).w2overlay(window.getShapesPopupHtml());
+				window.insertShapes();
+
+				$('.insertshape-grid .row .col').click(function () {
+					$(control.container).w2overlay();
+				});
+			}
+		});
+	},
+
 	_insertGraphicControl: function(parentContainer, data, builder) {
 		var control = builder._unoToolButton(parentContainer, data, builder);
 
diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js
index 7a2290667..26777205c 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -502,6 +502,14 @@ function insertShapes(mobile) {
 	});
 }
 
+function getShapesPopupHtml() {
+	return '<div id="insertshape-wrapper">\
+				<div id="insertshape-popup" class="insertshape-pop ui-widget ui-corner-all">\
+					<div class="insertshape-grid"></div>\
+				</div>\
+			</div>';
+}
+
 function getColorPickerData(type) {
 	var uno;
 	if (type === 'Font Color') {
@@ -1063,6 +1071,7 @@ global.onClick = onClick;
 global.hideTooltip = hideTooltip;
 global.insertTable = insertTable;
 global.getInsertTablePopupHtml = getInsertTablePopupHtml;
+global.getShapesPopupHtml = getShapesPopupHtml;
 global.insertShapes = insertShapes;
 global.createShapesPanel = createShapesPanel;
 global.onUpdatePermission = onUpdatePermission;
diff --git a/loleaflet/src/control/Control.TopToolbar.js b/loleaflet/src/control/Control.TopToolbar.js
index 0e5f9f51d..7fda20d6d 100644
--- a/loleaflet/src/control/Control.TopToolbar.js
+++ b/loleaflet/src/control/Control.TopToolbar.js
@@ -223,8 +223,7 @@ L.Control.TopToolbar = L.Control.extend({
 					{id: 'remotegraphic', text: _UNO('.uno:InsertGraphic', '', true)},
 				]},
 			{type: 'button',  id: 'insertobjectchart',  img: 'insertobjectchart', hint: _UNO('.uno:InsertObjectChart', '', true), uno: 'InsertObjectChart'},
-			{type: 'drop',  id: 'insertshapes',  img: 'basicshapes_ellipse', hint: _('Insert shapes'), overlay: {onShow: window.insertShapes},
-				html: '<div id="insertshape-wrapper"><div id="insertshape-popup" class="insertshape-pop ui-widget ui-corner-all"><div class="insertshape-grid"></div></div></div>'},
+			{type: 'drop',  id: 'insertshapes',  img: 'basicshapes_ellipse', hint: _('Insert shapes'), overlay: {onShow: window.insertShapes}, html: window.getShapesPopupHtml()},
 			{type: 'button',  id: 'link',  img: 'link', hint: _UNO('.uno:HyperlinkDialog', '', true), disabled: true},
 			{type: 'button',  id: 'insertsymbol', img: 'insertsymbol', hint: _UNO('.uno:InsertSymbol', '', true), uno: 'InsertSymbol'},
 			{type: 'spacer'},
commit 8970ab16df4e8a0fc39f01fb6a26480b3a3bc01c
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Apr 29 13:17:47 2020 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri May 1 21:38:56 2020 +0200

    notebookbar: insert symbol control
    
    Change-Id: I7d845862ceb2b666aefcba4c861f2f950524fe73
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93295
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js b/loleaflet/src/control/Control.NotebookbarBuilder.js
index b0eb08e03..d94e795fa 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -32,6 +32,7 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
 		this._toolitemHandlers['.uno:InsertGraphic'] = this._insertGraphicControl;
 		this._toolitemHandlers['.uno:InsertAnnotation'] = this._insertAnnotationControl;
 		this._toolitemHandlers['.uno:LineSpacing'] = this._lineSpacingControl;
+		this._toolitemHandlers['.uno:CharmapControl'] = this._symbolControl;
 		this._toolitemHandlers['.uno:Cut'] = this._clipboardButtonControl;
 		this._toolitemHandlers['.uno:Copy'] = this._clipboardButtonControl;
 		this._toolitemHandlers['.uno:Paste'] = this._clipboardButtonControl;
@@ -265,6 +266,15 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
 		});
 	},
 
+	_symbolControl: function(parentContainer, data, builder) {
+		var control = builder._unoToolButton(parentContainer, data, builder);
+
+		$(control.container).unbind('click');
+		$(control.container).click(function () {
+			builder.map.sendUnoCommand('.uno:InsertSymbol');
+		});
+	},
+
 	build: function(parent, data, hasVerticalParent, parentHasManyChildren) {
 		this._amendJSDialogData(data);
 


More information about the Libreoffice-commits mailing list