[Libreoffice-commits] online.git: Branch 'feature/jsdialogs' - 31 commits - loleaflet/css loleaflet/src

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Wed Apr 1 12:11:25 UTC 2020


Rebased ref, commits from common ancestor:
commit 7b0f2734703623729ba33e526adb2bf4f9cb3e33
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Mar 31 12:17:20 2020 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:33 2020 +0200

    jsdialog: show ok button in message boxes
    
    Change-Id: I4f57b6cc0275875150a6cd1c944e2d12394a59a4

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index de49745d8..bbc9f4e05 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -35,6 +35,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		this._controlHandlers['edit'] = this._editControl;
 		this._controlHandlers['multilineedit'] = this._multiLineEditControl;
 		this._controlHandlers['pushbutton'] = this._pushbuttonControl;
+		this._controlHandlers['okbutton'] = this._pushbuttonControl;
 		this._controlHandlers['combobox'] = this._comboboxControl;
 		this._controlHandlers['comboboxentry'] = this._comboboxEntry;
 		this._controlHandlers['listbox'] = this._listboxControl;
commit 83ce484ccfef1e00094c2739dddc76b1c5f5e80a
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Mar 31 12:14:40 2020 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:32 2020 +0200

    jsdialog: close mobilewizard before all dialogs
    
    Mobilewizard has reference to the last window so in
    case of message box it will be closed first.
    This prevent us from closing parent window before child
    as we close all windows in closePopups.
    
    Change-Id: I9887b56374f2fc7e1cabb46d97e2c8ee03511596

diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js
index 849f64d69..0b5bb095b 100644
--- a/loleaflet/src/map/handler/Map.TouchGesture.js
+++ b/loleaflet/src/map/handler/Map.TouchGesture.js
@@ -330,8 +330,8 @@ L.Map.TouchGesture = L.Handler.extend({
 		    this._map.hyperlinkPopup._contentNode == e.target.parentNode)
 			this._map.fire('hyperlinkclicked', {url: e.target.href});
 
-		this._map.fire('closepopups');
 		this._map.fire('closemobilewizard');
+		this._map.fire('closepopups');
 		this._map.fire('editorgotfocus');
 
 		var docLayer = this._map._docLayer;
commit d306c94c6c8993d9b589d34fc5b82e5167303cf0
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Mar 26 14:58:14 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:32 2020 +0200

    jsdialog: customize spell checking error label
    
    Change-Id: Ieb977363bda76af51a4e5d41052fc378995e24ea

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index 88b9ab199..3adedab41 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -822,6 +822,12 @@
 		font-size: 15pt;
 	}
 
+	#mobile-spell-error {
+		border: none;
+		font-size: 15pt;
+		color: red !important;
+	}
+
 	#searchlabel {
 		border: none;
 		font-size: 11pt;
commit 8dfa787a9284804a8540909659af9bfa20c198bc
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 25 12:17:06 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:32 2020 +0200

    jsdialog: handle drawingarea
    
    Change-Id: Ia3bc01e76c71edc7ac59e3157e7de5700397c21d

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index 9bb813415..88b9ab199 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -831,4 +831,8 @@
 		width: 30% !important;
 	}
 
+	.mobile-wizard.ui-drawing-area {
+		margin: 10px 5% 10px 5% !important;
+		width: 90%;
+	}
 }
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 94869da71..de49745d8 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -58,6 +58,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		this._controlHandlers['divcontainer'] = this._divContainerHandler;
 		this._controlHandlers['colorlistbox'] = this._colorControl;
 		this._controlHandlers['treelistbox'] = this._listboxControl;
+		this._controlHandlers['drawingarea'] = this._drawingAreaControl;
 
 		this._controlHandlers['mainmenu'] = this._containerHandler;
 		this._controlHandlers['submenu'] = this._subMenuHandler;
@@ -1350,6 +1351,15 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		return false;
 	},
 
+	_drawingAreaControl: function(parentContainer, data) {
+		if (data.image) {
+			var image = L.DomUtil.create('img', 'mobile-wizard ui-drawing-area', parentContainer);
+			image.src = data.image.replace('\\', '');
+			image.id = data.id;
+		}
+		return false;
+	},
+
 	_htmlControl: function(parentContainer, data) {
 		var container = L.DomUtil.create('div', 'mobile-wizard', parentContainer);
 		container.appendChild(data.content);
commit 32c00a5441e1c15cf57d780c39802f07acafac81
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Mar 24 14:53:35 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:32 2020 +0200

    jsdialog: handle treelistbox
    
    Change-Id: I89da1b60591f8a83413b0d25ec75812120ab5f11

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index fc084bdfc..94869da71 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -57,6 +57,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		this._controlHandlers['colorsample'] = this._colorSampleControl;
 		this._controlHandlers['divcontainer'] = this._divContainerHandler;
 		this._controlHandlers['colorlistbox'] = this._colorControl;
+		this._controlHandlers['treelistbox'] = this._listboxControl;
 
 		this._controlHandlers['mainmenu'] = this._containerHandler;
 		this._controlHandlers['submenu'] = this._subMenuHandler;
@@ -1253,9 +1254,10 @@ L.Control.JSDialogBuilder = L.Control.extend({
 				var value = data.entries[data.selectedEntries[0]];
 				valueNode = L.DomUtil.create('div', '', null);
 				valueNode.innerHTML = value;
-			} else {
+			} else if (isNaN(parseInt(data.selectedEntries[0])))
+				title = builder._cleanText(data.selectedEntries[0]);
+			else
 				title = data.entries[data.selectedEntries[0]];
-			}
 		}
 		title = builder._cleanText(title);
 		data.text = title;
@@ -1264,6 +1266,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		for (var index in data.entries) {
 			var style = 'ui-combobox-text';
 			if ((data.selectedEntries && index == data.selectedEntries[0])
+				|| (data.selectedEntries && data.entries[index] == data.selectedEntries[0])
 				|| data.entries[index] == title) {
 				style += ' selected';
 			}
commit ea6a183f4471871c6aab47b178cdd0e5c914253e
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Mar 19 14:02:21 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:32 2020 +0200

    jsdialog: add custom text for select range button

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 5efb372e2..fc084bdfc 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1130,9 +1130,17 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		return false;
 	},
 
+	_customPushButtonTextForId: function(buttonId) {
+		if (buttonId == 'validref')
+			return _('Select range');
+
+		return '';
+	},
+
 	_pushbuttonControl: function(parentContainer, data, builder, customCallback) {
 		var pushbutton = L.DomUtil.create('button', '', parentContainer);
-		pushbutton.innerHTML = builder._cleanText(data.text);
+		var customText = builder._customPushButtonTextForId(data.id);
+		pushbutton.innerHTML = customText !== '' ? customText : builder._cleanText(data.text);
 		pushbutton.id = data.id;
 
 		if (data.enabled == 'false')
commit 09c1708b6272f802ce2ade944b00c877934d63fc
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 18 14:47:36 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:32 2020 +0200

    jsdialog: full width combobox

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index b5f147329..9bb813415 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -806,6 +806,11 @@
 		width: 100%;
 	}
 
+	.combobox {
+		width: -moz-available !important;
+		width: -webkit-fill-available !important;
+	}
+
 	.ui-edit.mobile-wizard, textarea {
 		width: -moz-available;
 		width: -webkit-fill-available;
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 6398649ad..5efb372e2 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1165,7 +1165,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		if (data && data.id)
 			sectionTitle.id = data.id;
 
-		var leftDiv = L.DomUtil.create('div', 'ui-header-left', sectionTitle);
+		var leftDiv = L.DomUtil.create('div', 'ui-header-left combobox', sectionTitle);
 
 		var editCallback = function(value) {
 			builder.callback('combobox', 'change', data, value, builder);
commit a8be33ee781f4f2fb868d33ebfd8cffcd03605d6
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 18 14:45:22 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:32 2020 +0200

    jsdialog: keep edit field in line with arrow

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index 51b856ca7..b5f147329 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -809,7 +809,7 @@
 	.ui-edit.mobile-wizard, textarea {
 		width: -moz-available;
 		width: -webkit-fill-available;
-		margin: 0px 5% 10px 5% !important;
+		margin: 10px 5% 10px 5% !important;
 	}
 
 	#label9, #documentlabel-mobile {
commit 7c47c5a71804f831fa84a59f826b3c6d016046b6
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 18 13:01:59 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:32 2020 +0200

    jsdialog: fix checkbox

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 24e549444..6398649ad 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -603,7 +603,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		}
 
 		checkbox.addEventListener('change', function() {
-			builder.callback('checkbox', 'change', checkbox, this.checked, builder);
+			builder.callback('checkbox', 'change', div, this.checked, builder);
 		});
 
 		var customCommand = builder._mapWindowIdToUnoCommand(data.id);
commit 7e3b489b4c3ada2b24b020c440835c23cd4fe5ee
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Mar 17 15:17:57 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:32 2020 +0200

    jsdialog: textarea without cursor is a paragraph

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index a2a355c4f..24e549444 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1101,8 +1101,17 @@ L.Control.JSDialogBuilder = L.Control.extend({
 	},
 
 	_multiLineEditControl: function(parentContainer, data, builder, callback) {
-		var edit = L.DomUtil.create('textarea', '', parentContainer);
-		edit.value = builder._cleanText(data.text);
+		var controlType = 'textarea';
+		if (data.cursor && data.cursor === 'false')
+			controlType = 'p';
+
+		var edit = L.DomUtil.create(controlType, '', parentContainer);
+
+		if (controlType === 'textarea')
+			edit.value = builder._cleanText(data.text);
+		else
+			edit.innerHTML = builder._cleanText(data.text);
+
 		edit.id = data.id;
 
 		if (data.enabled == 'false')
commit e9dc72db441b6944c4d9435ef35e38f3c45e092f
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Mar 16 19:08:38 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:32 2020 +0200

    jsdialog: edit control full width

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index 0b58c0773..51b856ca7 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -807,8 +807,9 @@
 	}
 
 	.ui-edit.mobile-wizard, textarea {
-		margin-left: 5% !important;
-		margin-bottom: 10px;
+		width: -moz-available;
+		width: -webkit-fill-available;
+		margin: 0px 5% 10px 5% !important;
 	}
 
 	#label9, #documentlabel-mobile {
commit bf7d93661ca7f9dc22d2ffe4f00634939195c951
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Mar 12 09:40:00 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:32 2020 +0200

    jsdialog: style dialogs
    
    Change-Id: Iaac2c5521db66ea42900756584262463ae527892

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index 732216702..0b58c0773 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -795,4 +795,34 @@
 		border-color: grey !important;
 	}
 
+	.ui-checkbox.mobile-wizard {
+		margin-top: 25px;
+		padding-left: 2% !important;
+		width: 100%;
+	}
+
+	.ui-header-left > input, .ui-checkbox.mobile-wizard > label {
+		margin-left: 2% !important;
+		width: 100%;
+	}
+
+	.ui-edit.mobile-wizard, textarea {
+		margin-left: 5% !important;
+		margin-bottom: 10px;
+	}
+
+	#label9, #documentlabel-mobile {
+		border: none;
+		font-size: 15pt;
+	}
+
+	#searchlabel {
+		border: none;
+		font-size: 11pt;
+	}
+
+	#criteria.ui-tab, #inputhelp.ui-tab {
+		width: 30% !important;
+	}
+
 }
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index f8d23fea1..a2a355c4f 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1076,7 +1076,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 	},
 
 	_editControl: function(parentContainer, data, builder, callback) {
-		var edit = L.DomUtil.create('input', '', parentContainer);
+		var edit = L.DomUtil.create('input', 'ui-edit mobile-wizard', parentContainer);
 		edit.value = builder._cleanText(data.text);
 		edit.id = data.id;
 
@@ -1211,7 +1211,8 @@ L.Control.JSDialogBuilder = L.Control.extend({
 	_comboboxControl: function(parentContainer, data, builder) {
 		if (data.id === 'applystyle' ||
 			data.id === 'fontnamecombobox' ||
-			data.id === 'fontsizecombobox')
+			data.id === 'fontsizecombobox' ||
+			data.id === 'FontBox')
 			builder._listboxControl(parentContainer, data, builder);
 		else
 			builder._explorableEditControl(parentContainer, data, builder);
@@ -1225,6 +1226,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
 
 		builder._setIconAndNameForCombobox(data);
 
+		if (data.id === 'FontBox')
+			data.text = '';
+
 		var title = data.text;
 		var valueNode = null;
 		if (data.selectedEntries) {
commit 8fb91ab7180e191560abbc2f2c8c21ad707eeacc
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Mar 12 09:00:53 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:32 2020 +0200

    jsdialog: avoid doubled ids
    
    Change-Id: Ib6ad41d60f297906c7104b45e032937c18e45252

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index e3725b15c..f8d23fea1 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -588,11 +588,13 @@ L.Control.JSDialogBuilder = L.Control.extend({
 
 	_checkboxControl: function(parentContainer, data, builder) {
 		var div = L.DomUtil.createWithId('div', data.id, parentContainer);
+		$(div).addClass('ui-checkbox');
+		$(div).addClass('mobile-wizard');
 
 		var checkboxLabel = L.DomUtil.create('label', '', div);
 		checkboxLabel.innerHTML = builder._cleanText(data.text);
 		checkboxLabel.for = data.id;
-		var checkbox = L.DomUtil.createWithId('input', data.id, div);
+		var checkbox = L.DomUtil.create('input', '', div);
 		checkbox.type = 'checkbox';
 
 		if (data.enabled == 'false') {
commit 923dd74190e0a1a0e454a6dc483dcdef0a967cfe
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 11 15:07:43 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:32 2020 +0200

    jsdialog: revert previous font style listboxes
    
    Change-Id: Id2a279f81a09bc7b82293add5fb526fb4516883d

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 00864579f..e3725b15c 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1207,7 +1207,12 @@ L.Control.JSDialogBuilder = L.Control.extend({
 	},
 
 	_comboboxControl: function(parentContainer, data, builder) {
-		builder._explorableEditControl(parentContainer, data, builder);
+		if (data.id === 'applystyle' ||
+			data.id === 'fontnamecombobox' ||
+			data.id === 'fontsizecombobox')
+			builder._listboxControl(parentContainer, data, builder);
+		else
+			builder._explorableEditControl(parentContainer, data, builder);
 	},
 
 	_listboxControl: function(parentContainer, data, builder) {
commit 8b8d9731736013dbb646b75e0e9f4c91c7684a50
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 11 15:03:54 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:32 2020 +0200

    jsdialog: better disabled button styling
    
    Change-Id: I681a1422c4b2fb63def4621d40ba7d287622a50f

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index 5125e891b..732216702 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -778,6 +778,7 @@
 	}
 	#mobile-wizard button:disabled{
 		background-color: silver;
+		border-color: white;
 	}
 	#enablecontour + button {
 		float: right;
commit 406923717cecfa7bc450a7c7c8f2ebb4fcc162d3
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 11 14:45:28 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:32 2020 +0200

    jsdialog: handle selected tab
    
    Change-Id: I80992bfe173cd48bbabf1dd1aa14fbc5701c4fa6

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index b5b389ac9..00864579f 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -467,7 +467,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
 				var title = builder._cleanText(item.text);
 
 				var tab = L.DomUtil.create('div', 'ui-tab mobile-wizard', tabsContainer);
-				tab.id = title;
+				tab.id = data.tabs[tabIdx].name;
+				if (data.selected == data.tabs[tabIdx].id)
+					$(tab).addClass('selected');
 				tabs[tabIdx] = tab;
 
 				var label = L.DomUtil.create('span', 'ui-tab-content mobile-wizard unolabel', tab);
commit bdbe09d669fe58a690dbac42a82b610666dd1849
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 11 14:13:24 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:32 2020 +0200

    jsdialog: style disabled checkboxes
    
    Change-Id: I274f342ee8fb24ab0d0ff3d91875ca3f7332ff7d

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index 09975bd72..5125e891b 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -785,4 +785,13 @@
 	}
 	div#enablecontour + p, #arrangelabel, #SetMinimalRowHeight {clear: both;}
 
+	label.disabled {
+		color: grey !important;
+	}
+
+	input[type=checkbox][disabled] {
+		background-color: grey !important;
+		border-color: grey !important;
+	}
+
 }
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index bdb47f2d2..b5b389ac9 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -593,8 +593,10 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		var checkbox = L.DomUtil.createWithId('input', data.id, div);
 		checkbox.type = 'checkbox';
 
-		if (data.enabled == 'false')
+		if (data.enabled == 'false') {
+			$(checkboxLabel).addClass('disabled');
 			$(checkbox).attr('disabled', 'disabled');
+		}
 
 		checkbox.addEventListener('change', function() {
 			builder.callback('checkbox', 'change', checkbox, this.checked, builder);
commit 5e7e9ab57cccf606fb565ea92d2c1295bcae7131
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 11 14:08:29 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:32 2020 +0200

    jsdialog: style disabled listboxes
    
    Change-Id: I2dbe1b63bc4266261cefb45d472aef45c3b6fd3f

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index dfae7b751..09975bd72 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -320,6 +320,10 @@
 		background-color: #fff;
 	}
 
+	.ui-header.mobile-wizard.disabled .ui-header-left * {
+		color: grey !important;
+	}
+
 	.ui-header.mobile-wizard:active, .mobile-wizard.ui-combobox-text:active, .ui-header.mobile-wizard:focus, .mobile-wizard.ui-combobox-text:focus, .ui-header.mobile-wizard:hover, .mobile-wizard.ui-combobox-text:hover {
 		background-color: #eee;
 	}
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 199c91909..bdb47f2d2 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -247,6 +247,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		if (data && data.id)
 			sectionTitle.id = data.id;
 
+		if (data.enabled === 'false')
+			$(sectionTitle).addClass('disabled');
+
 		var leftDiv = L.DomUtil.create('div', 'ui-header-left', sectionTitle);
 		var titleClass = '';
 		if (iconPath) {
@@ -298,7 +301,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		if (!data.nosubmenu)
 		{
 			$(contentDiv).hide();
-			if (builder.wizard) {
+			if (builder.wizard && data.enabled !== 'false') {
 				$(sectionTitle).click(function(event, data) {
 					builder.wizard.goLevelDown(contentDiv, data);
 					if (contentNode.onshow)
commit 0993935fce2a42be6630e11587df4f07e9654509
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 11 13:17:07 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:31 2020 +0200

    jsdialog: fix inifinite regenetate JSON loop
    
    Change-Id: I52667e115a0cf70f09f570dc6ea1ec0bcac49460

diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js
index b3b98aace..fb0f57014 100644
--- a/loleaflet/src/control/Control.MobileWizard.js
+++ b/loleaflet/src/control/Control.MobileWizard.js
@@ -257,7 +257,8 @@ L.Control.MobileWizard = L.Control.extend({
 	},
 
 	_goToPath: function(path) {
-		if (this._tabs && path && path.length)
+		// when dialog has tabs, tab selection triggers the callback, causes infinite regenetate loop
+		if (this._tabs && path && path.length && !this.map.dialog.hasMobilePanelOpened())
 			this._selectTab(path[0]);
 
 		for (var index in path) {
commit 2955a9c4ca53e1fb5ab734fbc99b73de379c7c30
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 11 13:01:26 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:31 2020 +0200

    jsdialog: don't forget dialog on sidebar events
    
    Change-Id: I74dc646ede106fce03c61faf953bf3c11a0744e1

diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js
index c3c2991b0..b3b98aace 100644
--- a/loleaflet/src/control/Control.MobileWizard.js
+++ b/loleaflet/src/control/Control.MobileWizard.js
@@ -284,14 +284,6 @@ L.Control.MobileWizard = L.Control.extend({
 
 	_onMobileWizard: function(data) {
 		if (data) {
-
-			if (data.id && !isNaN(data.id)) {
-				// id is a number - remember window id for interaction
-				window.windowId = data.id;
-			} else {
-				window.windowId = undefined;
-			}
-
 			var isSidebar = (data.children && data.children.length >= 1 &&
 					 data.children[0].type == 'deck');
 
@@ -303,6 +295,11 @@ L.Control.MobileWizard = L.Control.extend({
 				return;
 			}
 
+			if (data.id && !isNaN(data.id) && !isSidebar) {
+				// id is a number - remember window id for interaction
+				window.windowId = data.id;
+			}
+
 			// Sometimes it happens that we get the same sidebar
 			// structure twice. This makes hard to test mobile wizard.
 			if (isSidebar && L.Browser.cypressTest) {
commit 9b0f52a08c0b8da381edd84c5cbbb0077aebb727
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Mar 6 12:56:59 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:31 2020 +0200

    jsdialog: add style for disabled button
    
    Change-Id: I034470a988a79abaed8eddcb97b84a02a54dcf12

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index 452e351b5..dfae7b751 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -772,6 +772,9 @@
 		border: none;
 		background-color: #ebf2fb;
 	}
+	#mobile-wizard button:disabled{
+		background-color: silver;
+	}
 	#enablecontour + button {
 		float: right;
 		margin: 24px 0px;
commit 2c0ef702fce37eef934709e5986ad3a6cad961eb
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Mar 6 12:30:35 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:31 2020 +0200

    jsdialog: implemented multilineedit control
    
    Change-Id: I1cda88437357f80cafbdcdbee03832af806a55d6

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 9c673b329..199c91909 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -33,6 +33,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		this._controlHandlers['checkbox'] = this._checkboxControl;
 		this._controlHandlers['spinfield'] = this._spinfieldControl;
 		this._controlHandlers['edit'] = this._editControl;
+		this._controlHandlers['multilineedit'] = this._multiLineEditControl;
 		this._controlHandlers['pushbutton'] = this._pushbuttonControl;
 		this._controlHandlers['combobox'] = this._comboboxControl;
 		this._controlHandlers['comboboxentry'] = this._comboboxEntry;
@@ -1090,6 +1091,27 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		return false;
 	},
 
+	_multiLineEditControl: function(parentContainer, data, builder, callback) {
+		var edit = L.DomUtil.create('textarea', '', parentContainer);
+		edit.value = builder._cleanText(data.text);
+		edit.id = data.id;
+
+		if (data.enabled == 'false')
+			$(edit).attr('disabled', 'disabled');
+
+		edit.addEventListener('change', function() {
+			if (callback)
+				callback(this.value);
+			else
+				builder.callback('edit', 'change', edit, this.value, builder);
+		});
+
+		if (data.hidden)
+			$(edit).hide();
+
+		return false;
+	},
+
 	_pushbuttonControl: function(parentContainer, data, builder, customCallback) {
 		var pushbutton = L.DomUtil.create('button', '', parentContainer);
 		pushbutton.innerHTML = builder._cleanText(data.text);
commit 3a03d3c4178d8d9b9c7654800be3d5b0078e6a5b
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Mar 6 10:57:09 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:31 2020 +0200

    jsdialog: custom change event for combobox
    
    Change-Id: Ic48ca0df400fc182a765974d143786afe9f19bd9

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index f06cd041f..9c673b329 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1065,7 +1065,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		return false;
 	},
 
-	_editControl: function(parentContainer, data, builder) {
+	_editControl: function(parentContainer, data, builder, callback) {
 		var edit = L.DomUtil.create('input', '', parentContainer);
 		edit.value = builder._cleanText(data.text);
 		edit.id = data.id;
@@ -1074,7 +1074,10 @@ L.Control.JSDialogBuilder = L.Control.extend({
 			$(edit).attr('disabled', 'disabled');
 
 		edit.addEventListener('change', function() {
-			builder.callback('edit', 'change', edit, this.value, builder);
+			if (callback)
+				callback(this.value);
+			else
+				builder.callback('edit', 'change', edit, this.value, builder);
 		});
 
 		edit.addEventListener('click', function(e) {
@@ -1123,7 +1126,11 @@ L.Control.JSDialogBuilder = L.Control.extend({
 			sectionTitle.id = data.id;
 
 		var leftDiv = L.DomUtil.create('div', 'ui-header-left', sectionTitle);
-		builder._editControl(leftDiv, data, builder);
+
+		var editCallback = function(value) {
+			builder.callback('combobox', 'change', data, value, builder);
+		};
+		builder._editControl(leftDiv, data, builder, editCallback);
 
 		var rightDiv = L.DomUtil.create('div', 'ui-header-right', sectionTitle);
 
commit 2ce71d199df3dd8b16c989be3f9ca0e7e67b44da
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Mar 5 14:40:54 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:31 2020 +0200

    jsdialog: send control type with event
    
    Change-Id: I6cd6f1d26b5c78715f9e0adc992a1869e0f19a97

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index d58615b54..f06cd041f 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -107,8 +107,11 @@ L.Control.JSDialogBuilder = L.Control.extend({
 			data = typeof data === 'string' ? data.replace('"', '\\"') : data;
 			var windowId = window.windowId !== undefined ? window.windowId :
 								(window.sidebarId !== undefined ? window.sidebarId : -1);
-			var message = 'dialogevent ' + windowId +
-			    ' {\"id\":\"' + object.id + '\", \"cmd\": \"' + eventType + '\", \"data\":\"' + data + '\"}';
+			var message = 'dialogevent ' + windowId
+			    + ' {\"id\":\"' + object.id
+				+ '\", \"cmd\": \"' + eventType
+				+ '\", \"data\": \"' + data
+				+ '\", \"type\": \"' + objectType + '\"}';
 			builder.map._socket.sendMessage(message);
 		}
 	},
commit 826205b76ae4214ccb92b4e9c34c4549176dc5ce
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Mar 5 14:40:26 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:31 2020 +0200

    jsdialog: close mobile wizard when dialog is closed
    
    Change-Id: I570317fc6019b22a6ee5ec36507edbb450938cdf

diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js
index 60da46a09..c03ac1778 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -292,7 +292,6 @@ L.Control.LokDialog = L.Control.extend({
 				} else {
 					// In mobile we get jsdialog messages.
 					window.sidebarId = e.id;
-					window.windowId = undefined;
 				}
 			} else if (e.winType === 'child') {
 				var parentId = parseInt(e.parentId);
@@ -315,8 +314,14 @@ L.Control.LokDialog = L.Control.extend({
 		}
 
 		// All other callbacks doen't make sense without an active dialog.
-		if (!(this._isOpen(e.id) || this._getParentId(e.id)))
+		if (!(this._isOpen(e.id) || this._getParentId(e.id))) {
+			if (e.action == 'close' && window.windowId == e.id) {
+				window.windowId = undefined;
+				this._map.fire('closemobilewizard');
+			}
+
 			return;
+		}
 
 		// We don't want dialogs on smartphones
 		if (window.mode.isMobile())
commit befca89273678921b713ac588144b6ba50333792
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 4 15:50:29 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:31 2020 +0200

    jsdialog: tabcontrol widget
    
    Change-Id: Ibe72a382e767869f94db4f8b475dfe2169fcc702

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 808970857..d58615b54 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -44,6 +44,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		this._controlHandlers['frame'] = this._frameHandler;
 		this._controlHandlers['panel'] = this._panelHandler;
 		this._controlHandlers['calcfuncpanel'] = this._calcFuncListPanelHandler;
+		this._controlHandlers['tabcontrol'] = this._tabsControlHandler;
 		this._controlHandlers['paneltabs'] = this._panelTabsHandler;
 		this._controlHandlers['container'] = this._containerHandler;
 		this._controlHandlers['window'] = this._containerHandler;
@@ -444,6 +445,56 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		};
 	},
 
+	_tabsControlHandler: function(parentContainer, data, builder) {
+		if (data.tabs) {
+			var tabsContainer = L.DomUtil.create('div', 'ui-tabs mobile-wizard ui-widget');
+			tabsContainer.id = data.id;
+			var contentsContainer = L.DomUtil.create('div', 'ui-tabs-content mobile-wizard ui-widget', parentContainer);
+
+			var tabs = [];
+			var contentDivs = [];
+			var labels = [];
+			for (var tabIdx = 0; tabIdx < data.tabs.length; tabIdx++) {
+				var item = data.tabs[tabIdx];
+
+				var title = builder._cleanText(item.text);
+
+				var tab = L.DomUtil.create('div', 'ui-tab mobile-wizard', tabsContainer);
+				tab.id = title;
+				tabs[tabIdx] = tab;
+
+				var label = L.DomUtil.create('span', 'ui-tab-content mobile-wizard unolabel', tab);
+				label.innerHTML = title;
+				labels[tabIdx] = title;
+
+				var contentDiv = L.DomUtil.create('div', 'ui-content level-' + builder._currentDepth + ' mobile-wizard', contentsContainer);
+				contentDiv.title = title;
+
+				$(contentDiv).hide();
+				contentDivs[tabIdx] = contentDiv;
+			}
+
+			if (builder.wizard) {
+				builder.wizard.setTabs(tabsContainer);
+
+				for (var t = 0; t < tabs.length; t++) {
+					// to get capture of 't' right has to be a sub fn.
+					var fn = function(id) {
+						return function() {
+							builder._createTabClick(builder, id, tabs, contentDivs, labels)();
+							builder.callback('tabcontrol', 'selecttab', tabsContainer, id, builder);
+						};
+					};
+					$(tabs[t]).click(fn(t));
+				}
+			} else {
+				console.debug('Builder used outside of mobile wizard: please implement the click handler');
+			}
+		}
+
+		return true;
+	},
+
 	_panelTabsHandler: function(parentContainer, data, builder) {
 		var tabsContainer = L.DomUtil.create('div', 'ui-tabs mobile-wizard ui-widget');
 		var contentsContainer = L.DomUtil.create('div', 'ui-tabs-content mobile-wizard ui-widget', parentContainer);
commit 539d35118dd048b4ab41490cd150bcea0f92c501
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Mar 2 15:04:28 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:31 2020 +0200

    jsdialog: close dialog when closed mobile wizard
    
    Change-Id: I5ba1eab7a32eef19dd156c56068e725a14223f48

diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js
index 84fe7176e..c3c2991b0 100644
--- a/loleaflet/src/control/Control.MobileWizard.js
+++ b/loleaflet/src/control/Control.MobileWizard.js
@@ -88,6 +88,12 @@ L.Control.MobileWizard = L.Control.extend({
 	},
 
 	_hideWizard: function() {
+		// dialog
+		if (this.map.dialog.hasMobilePanelOpened()) {
+			this.map.dialog._onDialogClose(window.windowId, true);
+			window.windowId = undefined;
+		}
+
 		$('#mobile-wizard').hide();
 		$('#mobile-wizard-content').empty();
 		if (this.map._permission === 'edit') {
commit 57bdb7380734eb408162a702b7b6efd78fba3669
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Mar 2 12:44:40 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:31 2020 +0200

    jsdialog: implement full combobox
    
    Change-Id: I02432c39ffb78906466efe407118a771de7001f1

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index a986cecac..808970857 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1023,6 +1023,10 @@ L.Control.JSDialogBuilder = L.Control.extend({
 			builder.callback('edit', 'change', edit, this.value, builder);
 		});
 
+		edit.addEventListener('click', function(e) {
+			e.stopPropagation();
+		});
+
 		if (data.hidden)
 			$(edit).hide();
 
@@ -1058,11 +1062,62 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		}
 	},
 
-	_comboboxControl: function(parentContainer, data, builder) {
-		if (data.entries)
-			builder._listboxControl(parentContainer, data, builder);
+	_explorableEditControl: function(parentContainer, data, builder) {
+		var sectionTitle = L.DomUtil.create('div', 'ui-header level-' + builder._currentDepth + ' mobile-wizard ui-widget', parentContainer);
+		$(sectionTitle).css('justify-content', 'space-between');
+		if (data && data.id)
+			sectionTitle.id = data.id;
+
+		var leftDiv = L.DomUtil.create('div', 'ui-header-left', sectionTitle);
+		builder._editControl(leftDiv, data, builder);
+
+		var rightDiv = L.DomUtil.create('div', 'ui-header-right', sectionTitle);
+
+		var arrowSpan = L.DomUtil.create('span', 'sub-menu-arrow', rightDiv);
+		arrowSpan.innerHTML = '>';
+
+		var contentDiv = L.DomUtil.create('div', 'ui-content level-' + builder._currentDepth + ' mobile-wizard', parentContainer);
+		contentDiv.title = data.text;
+
+		var entries = [];
+		if (data.entries) {
+			for (var index in data.entries) {
+				var style = 'ui-combobox-text';
+				if ((data.selectedEntries && index == data.selectedEntries[0])
+					|| data.entries[index] == data.text) {
+					style += ' selected';
+				}
+
+				var entry = { type: 'comboboxentry', text: data.entries[index], pos: index, parent: data, style: style };
+				entries.push(entry);
+			}
+		}
+
+		var contentNode = {type: 'container', children: entries};
+
+		builder._currentDepth++;
+		builder.build(contentDiv, [contentNode]);
+		builder._currentDepth--;
+
+		if (!data.nosubmenu)
+		{
+			$(contentDiv).hide();
+			if (builder.wizard) {
+				$(sectionTitle).click(function(event, data) {
+					builder.wizard.goLevelDown(contentDiv, data);
+					if (contentNode.onshow)
+						contentNode.onshow();
+				});
+			} else {
+				console.debug('Builder used outside of mobile wizard: please implement the click handler');
+			}
+		}
 		else
-			builder._editControl(parentContainer, data, builder);
+			$(sectionTitle).hide();
+	},
+
+	_comboboxControl: function(parentContainer, data, builder) {
+		builder._explorableEditControl(parentContainer, data, builder);
 	},
 
 	_listboxControl: function(parentContainer, data, builder) {
commit 9cbecda730df627468892f1f9611b503c793e57f
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Feb 28 15:08:56 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:31 2020 +0200

    jsdialog: when combobox is empty show edit
    
    Change-Id: I84572335313654f22d5d899e003aaa82a002b128

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 97e28a76f..a986cecac 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -36,7 +36,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		this._controlHandlers['pushbutton'] = this._pushbuttonControl;
 		this._controlHandlers['combobox'] = this._comboboxControl;
 		this._controlHandlers['comboboxentry'] = this._comboboxEntry;
-		this._controlHandlers['listbox'] = this._comboboxControl;
+		this._controlHandlers['listbox'] = this._listboxControl;
 		this._controlHandlers['valueset'] = this._valuesetControl;
 		this._controlHandlers['fixedtext'] = this._fixedtextControl;
 		this._controlHandlers['htmlcontrol'] = this._htmlControl;
@@ -1059,6 +1059,13 @@ L.Control.JSDialogBuilder = L.Control.extend({
 	},
 
 	_comboboxControl: function(parentContainer, data, builder) {
+		if (data.entries)
+			builder._listboxControl(parentContainer, data, builder);
+		else
+			builder._editControl(parentContainer, data, builder);
+	},
+
+	_listboxControl: function(parentContainer, data, builder) {
 		// TODO: event listener in the next level...
 
 		if (!data.entries || data.entries.length === 0)
commit fbc5425b90f9ddd292dd17037b7c829beb4276c4
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Feb 25 10:50:43 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:31 2020 +0200

    jsdialog: build frame also without title
    
    Change-Id: Id5f94eb90756419305ab5d593791663ecb5eb41b

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 90e066730..97e28a76f 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -394,10 +394,13 @@ L.Control.JSDialogBuilder = L.Control.extend({
 	},
 
 	_frameHandler: function(parentContainer, data, builder) {
-		data.text = builder._cleanText(data.children[0].text);
-		var contentNode = data.children[1];
-
-		builder._explorableEntry(parentContainer, data, contentNode, builder);
+		if (data.children.length > 1) {
+			data.text = builder._cleanText(data.children[0].text);
+			var contentNode = data.children[1];
+			builder._explorableEntry(parentContainer, data, contentNode, builder);
+		} else {
+			return true;
+		}
 
 		return false;
 	},
@@ -1597,10 +1600,12 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		}
 
 		for (var idx = 0; idx < data.length; ++idx) {
-			var controlId = data[idx].id;
-			if (controlId && this._missingLabelData.hasOwnProperty(controlId)) {
-				data.splice(idx, 0, this._missingLabelData[controlId]);
-				++idx;
+			if (data[idx]) {
+				var controlId = data[idx].id;
+				if (controlId && this._missingLabelData.hasOwnProperty(controlId)) {
+					data.splice(idx, 0, this._missingLabelData[controlId]);
+					++idx;
+				}
 			}
 		}
 	},
@@ -1614,6 +1619,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
 	build: function(parent, data) {
 		this._amendJSDialogData(data);
 		for (var childIndex in data) {
+			if (!data[childIndex])
+				continue;
+
 			var childData = data[childIndex];
 			this._parentize(childData);
 			var childType = childData.type;
commit be8bebc0dc868cea1e775a7cb37ffb379d2f3a03
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Feb 21 11:37:22 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Apr 1 14:09:09 2020 +0200

    jsdialog: Don't show dialog window on mobile devices
    
    Change-Id: I9828c1aafb7876160a5122a41109dc7165de481d

diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js
index 211175f19..60da46a09 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -59,6 +59,10 @@ L.Control.LokDialog = L.Control.extend({
 
 	dialogIdPrefix: 'lokdialog-',
 
+	hasMobilePanelOpened: function() {
+		return window.windowId !== undefined;
+	},
+
 	onPan: function (ev) {
 		if (!draggedObject)
 			return;
@@ -275,10 +279,11 @@ L.Control.LokDialog = L.Control.extend({
 			e.title = e.title.replace('Collabora Office', brandProductName);
 		}
 
-		if (e.action === 'created') {
+		if (e.action === 'created' && !window.mode.isMobile()) {
 			if (e.winType === 'dialog') {
 				// When left/top are invalid, the dialog shows in the center.
-				this._launchDialog(e.id, left, top, width, height, e.title);
+				if (!this.hasMobilePanelOpened())
+					this._launchDialog(e.id, left, top, width, height, e.title);
 			} else if (e.winType === 'calc-input-win') {
 				this._launchCalcInputBar(e.id, width, height);
 			} else if (e.winType === 'deck') {
@@ -313,7 +318,11 @@ L.Control.LokDialog = L.Control.extend({
 		if (!(this._isOpen(e.id) || this._getParentId(e.id)))
 			return;
 
-		if (e.action === 'invalidate') {
+		// We don't want dialogs on smartphones
+		if (window.mode.isMobile())
+			return;
+
+		if (e.action === 'invalidate' && !this.hasMobilePanelOpened()) {
 			this.wasInvalidated = true;
 			var parent = this._getParentId(e.id);
 			var rectangle = e.rectangle;
@@ -335,7 +344,7 @@ L.Control.LokDialog = L.Control.extend({
 				rectangle = this._createRectStr(e.id);
 			}
 			this._sendPaintWindow(e.id, rectangle);
-		} else if (e.action === 'size_changed') {
+		} else if (e.action === 'size_changed' && !this.hasMobilePanelOpened()) {
 			// FIXME: we don't really have to destroy and launch the dialog again but do it for
 			// now because the size sent to us previously in 'created' cb is not correct
 			$('#' + strId).remove();
@@ -1204,6 +1213,9 @@ L.Control.LokDialog = L.Control.extend({
 				this._onDialogClose(dialogId, true);
 			}
 		}
+		if (window.windowId !== undefined) {
+			this._onDialogClose(window.windowId, true);
+		}
 	},
 
 	onCloseCurrentPopUp: function() {


More information about the Libreoffice-commits mailing list