loleaflet/src/control/Control.JSDialogBuilder.js | 38 +++++++++++++---------- 1 file changed, 22 insertions(+), 16 deletions(-)
New commits: commit d3234102c77eeb29e3b87cd847b816a212600491 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Tue Sep 24 16:08:08 2019 +0200 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Fri Sep 27 17:04:11 2019 +0200 jsdialogs: clean ~ from labels Change-Id: Ic73aad88ef26d785c65f29d84946ebf73168c7af Reviewed-on: https://gerrit.libreoffice.org/79730 Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Tested-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 2331a9fc0..979ce5a20 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -39,6 +39,10 @@ L.Control.JSDialogBuilder = L.Control.extend({ this._currentDepth = 0; }, + _cleanText: function(text) { + return text.replace('~', ''); + }, + _containerHandler: function() { return true; }, @@ -71,7 +75,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ }, _frameHandler: function(parentContainer, data, builder) { - var title = data.children[0].text; + var title = builder._cleanText(data.children[0].text); var contentNode = data.children[1]; builder._explorableEntry(parentContainer, title, contentNode, builder); @@ -88,10 +92,10 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, - _radiobuttonControl: function(parentContainer, data) { + _radiobuttonControl: function(parentContainer, data, builder) { var radiobutton = L.DomUtil.create('input', '', parentContainer); radiobutton.type = 'radiobutton'; - radiobutton.value = data.text; + radiobutton.value = builder._cleanText(data.text); if (data.enabled == 'false') $(radiobutton).attr('disabled', 'disabled'); @@ -99,11 +103,11 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, - _checkboxControl: function(parentContainer, data) { + _checkboxControl: function(parentContainer, data, builder) { var checkbox = L.DomUtil.createWithId('input', data.id, parentContainer); checkbox.type = 'checkbox'; var checkboxLabel = L.DomUtil.create('label', '', parentContainer); - checkboxLabel.innerHTML = data.text; + checkboxLabel.innerHTML = builder._cleanText(data.text); checkboxLabel.for = data.id; if (data.enabled == 'false') @@ -112,10 +116,10 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, - _spinfieldControl: function(parentContainer, data) { + _spinfieldControl: function(parentContainer, data, builder) { var spinfield = L.DomUtil.create('input', '', parentContainer); spinfield.type = 'number'; - spinfield.value = data.text; + spinfield.value = builder._cleanText(data.text); if (data.enabled == 'false') $(spinfield).attr('disabled', 'disabled'); @@ -123,9 +127,9 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, - _editControl: function(parentContainer, data) { + _editControl: function(parentContainer, data, builder) { var edit = L.DomUtil.create('input', '', parentContainer); - edit.value = data.text; + edit.value = builder._cleanText(data.text); if (data.enabled == 'false') $(edit).attr('disabled', 'disabled'); @@ -133,9 +137,9 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, - _pushbuttonControl: function(parentContainer, data) { + _pushbuttonControl: function(parentContainer, data, builder) { var pushbutton = L.DomUtil.create('button', '', parentContainer); - pushbutton.innerHTML = data.text; + pushbutton.innerHTML = builder._cleanText(data.text); if (data.enabled == 'false') $(pushbutton).attr('disabled', 'disabled'); @@ -143,9 +147,9 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, - _comboboxControl: function(parentContainer, data) { + _comboboxControl: function(parentContainer, data, builder) { var listbox = L.DomUtil.create('select', '', parentContainer); - listbox.value = data.text; + listbox.value = builder._cleanText(data.text); if (data.enabled == 'false') $(listbox).attr('disabled', 'disabled'); @@ -153,9 +157,9 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, - _fixedtextControl: function(parentContainer, data) { + _fixedtextControl: function(parentContainer, data, builder) { var fixedtext = L.DomUtil.create('p', '', parentContainer); - fixedtext.innerHTML = data.text; + fixedtext.innerHTML = builder._cleanText(data.text); return false; }, commit e1851555d8c3b6d28fc56d77452433dedf5309cf Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Tue Sep 24 14:36:29 2019 +0200 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Fri Sep 27 17:04:03 2019 +0200 jsdialogs: update doc comment Change-Id: Idb024543ae87f6eac9bf8948757462812f08ee2f Reviewed-on: https://gerrit.libreoffice.org/79729 Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Tested-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 6b041a8a2..2331a9fc0 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -7,9 +7,11 @@ /* global $ */ L.Control.JSDialogBuilder = L.Control.extend({ - /* Handler is a function which takes two parameters: + /* Handler is a function which takes three parameters: * parentContainer - place where insert the content * data - data of a control under process + * builder - current builder reference + * * returns boolean: true if children should be processed * and false otherwise */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits