Skip to content

Commit

Permalink
jsdialog: use unformatted text
Browse files Browse the repository at this point in the history
Signed-off-by: Szymon Kłos <[email protected]>
Change-Id: Ic6dbd0ca47798cd421d8a5f5ceabbf1c38022448
  • Loading branch information
eszkadev committed Nov 19, 2021
1 parent e44737a commit 90a9772
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
40 changes: 20 additions & 20 deletions browser/src/control/Control.JSDialogBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ L.Control.JSDialogBuilder = L.Control.extend({

if (data.unit) {
var unit = L.DomUtil.create('span', builder.options.cssClass + ' spinfieldunit', div);
unit.innerHTML = builder._unitToVisibleString(data.unit);
unit.textContent = builder._unitToVisibleString(data.unit);
}

if (data.min != undefined)
Expand Down Expand Up @@ -620,7 +620,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
}

var arrowSpan = L.DomUtil.create('span', 'sub-menu-arrow', rightDiv);
arrowSpan.innerHTML = '>';
arrowSpan.textContent = '>';

var updateFunction = function(titleSpan) {
titleSpan.innerHTML = data.text;
Expand Down Expand Up @@ -669,11 +669,11 @@ L.Control.JSDialogBuilder = L.Control.extend({
var leftDiv = L.DomUtil.create('div', 'ui-header-left', sectionTitle);
var titleClass = 'func-name';
var titleSpan = L.DomUtil.create('span', titleClass, leftDiv);
titleSpan.innerHTML = data.text;
titleSpan.textContent = data.text;

var rightDiv = L.DomUtil.create('div', 'ui-header-right', sectionTitle);
var arrowSpan = L.DomUtil.create('div', 'func-info-icon', rightDiv);
arrowSpan.innerHTML = '';
arrowSpan.textContent = '';

var contentDiv = L.DomUtil.create('div', 'ui-content level-' + builder._currentDepth + ' ' + builder.options.cssClass, mainContainer);
contentDiv.title = data.text;
Expand Down Expand Up @@ -808,7 +808,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
titleSpan.innerHTML = title;
}
var arrowSpan = L.DomUtil.create('span', 'sub-menu-arrow', sectionTitle);
arrowSpan.innerHTML = '>';
arrowSpan.textContent = '>';

var contentDiv = L.DomUtil.create('div', 'ui-content level-' + builder._currentDepth + ' ' + builder.options.cssClass, mainContainer);
contentDiv.title = title;
Expand Down Expand Up @@ -965,7 +965,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
tabIds[tabIdx] = item.name;

var label = L.DomUtil.create('span', 'ui-tab-content ' + builder.options.cssClass + ' unolabel', tab);
label.innerHTML = title;
label.textContent = title;

var contentDiv = L.DomUtil.create('div', 'ui-content level-' + builder._currentDepth + ' ' + builder.options.cssClass, contentsContainer);
contentDiv.id = item.name;
Expand Down Expand Up @@ -1039,7 +1039,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
tabs[tabIdx] = tab;

var label = L.DomUtil.create('span', 'ui-tab-content ' + builder.options.cssClass + ' unolabel', tab);
label.innerHTML = title;
label.textContent = title;
labels[tabIdx] = title;

var contentDiv = L.DomUtil.create('div', 'ui-content level-' + builder._currentDepth + ' ' + builder.options.cssClass, contentsContainer);
Expand Down Expand Up @@ -1107,7 +1107,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
radiobutton.name = data.group;

var radiobuttonLabel = L.DomUtil.create('label', '', container);
radiobuttonLabel.innerHTML = builder._cleanText(data.text);
radiobuttonLabel.textContent = builder._cleanText(data.text);
radiobuttonLabel.for = data.id;

var toggleFunction = function() {
Expand Down Expand Up @@ -1141,7 +1141,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
var checkbox = L.DomUtil.create('input', builder.options.cssClass, div);
checkbox.type = 'checkbox';
var checkboxLabel = L.DomUtil.create('label', builder.options.cssClass, div);
checkboxLabel.innerHTML = builder._cleanText(data.text);
checkboxLabel.textContent = builder._cleanText(data.text);
checkboxLabel.for = data.id;

var toggleFunction = function() {
Expand Down Expand Up @@ -1370,7 +1370,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
else
{
data.text = data.text.replace(/(?:\r\n|\r|\n)/g, '<br>');
edit.innerHTML = builder._cleanText(data.text);
edit.textContent = builder._cleanText(data.text);
}

edit.id = data.id;
Expand Down Expand Up @@ -1460,7 +1460,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
var rightDiv = L.DomUtil.create('div', 'ui-header-right', sectionTitle);

var arrowSpan = L.DomUtil.create('span', 'sub-menu-arrow', rightDiv);
arrowSpan.innerHTML = '>';
arrowSpan.textContent = '>';

var contentDiv = L.DomUtil.create('div', 'ui-content level-' + builder._currentDepth + ' ' + builder.options.cssClass, parentContainer);
contentDiv.title = data.text;
Expand Down Expand Up @@ -1848,7 +1848,7 @@ L.Control.JSDialogBuilder = L.Control.extend({

_comboboxEntry: function(parentContainer, data, builder) {
var fixedtext = L.DomUtil.create('p', builder.options.cssClass, parentContainer);
fixedtext.innerHTML = builder._cleanText(data.text);
fixedtext.textContent = builder._cleanText(data.text);
fixedtext.parent = data.parent;

if (data.style && data.style.length)
Expand All @@ -1858,13 +1858,13 @@ L.Control.JSDialogBuilder = L.Control.extend({
builder.refreshSidebar = true;
if (builder.wizard)
builder.wizard.goLevelUp();
builder.callback('combobox', 'selected', fixedtext.parent, data.pos + ';' + fixedtext.innerHTML, builder);
builder.callback('combobox', 'selected', fixedtext.parent, data.pos + ';' + fixedtext.textContent, builder);
});
},

_fixedtextControl: function(parentContainer, data, builder) {
var fixedtext = L.DomUtil.create('p', builder.options.cssClass, parentContainer);
fixedtext.innerHTML = builder._cleanText(data.text);
fixedtext.textContent = builder._cleanText(data.text);
fixedtext.id = data.id;
if (data.style && data.style.length) {
L.DomUtil.addClass(fixedtext, data.style);
Expand Down Expand Up @@ -2124,7 +2124,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
arrowSpan = L.DomUtil.create('span','sub-menu-arrow', $(container).find('.cool-annotation-content-wrapper')[0]);

arrowSpan.style.display = 'block';
arrowSpan.innerHTML = '>';
arrowSpan.textContent = '>';
arrowSpan.style.padding = '0px';
arrowSpan.id = 'arrow span ' + data.id;

Expand Down Expand Up @@ -2248,7 +2248,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
if (builder.options.noLabelsForUnoButtons !== true) {
var label = L.DomUtil.create('span', 'ui-content unolabel', div);
label.for = buttonId;
label.innerHTML = builder._cleanText(data.text);
label.textContent = builder._cleanText(data.text);

controls['label'] = label;
$(div).addClass('has-label');
Expand All @@ -2264,7 +2264,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
$(div).addClass('inline');
label = L.DomUtil.create('span', 'ui-content unolabel', div);
label.for = buttonId;
label.innerHTML = data.text;
label.textContent = data.text;

controls['label'] = label;
}
Expand Down Expand Up @@ -2306,7 +2306,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
}
} else {
button = L.DomUtil.create('label', 'ui-content unolabel', div);
button.innerHTML = builder._cleanText(data.text);
button.textContent = builder._cleanText(data.text);
controls['label'] = button;
}

Expand Down Expand Up @@ -2547,7 +2547,7 @@ L.Control.JSDialogBuilder = L.Control.extend({

if (builder.options.noLabelsForUnoButtons !== true) {
var titleSpan = L.DomUtil.create('span', titleClass, leftDiv);
titleSpan.innerHTML = builder._cleanText(_UNO(data.command));
titleSpan.textContent = builder._cleanText(_UNO(data.command));
}

$(sectionTitle).click(function () {
Expand Down Expand Up @@ -2623,7 +2623,7 @@ L.Control.JSDialogBuilder = L.Control.extend({

_borderControl: function(parentContainer, data, builder) {
var bordercontrollabel = L.DomUtil.create('p', builder.options.cssClass + ' ui-text', parentContainer);
bordercontrollabel.innerHTML = _('Cell borders');
bordercontrollabel.textContent = _('Cell borders');
bordercontrollabel.id = data.id + 'label';
var current = builder._getCurrentBorderNumber(builder);
for (var i = 1; i < 13; ++i)
Expand Down
14 changes: 7 additions & 7 deletions browser/src/control/Control.MobileWizardBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ L.Control.MobileWizardBuilder = L.Control.JSDialogBuilder.extend({

if (data.unit) {
var unit = L.DomUtil.create('span', 'spinfieldunit', div);
unit.innerHTML = builder._unitToVisibleString(data.unit);
unit.textContent = builder._unitToVisibleString(data.unit);
}

var controlsContainer = L.DomUtil.create('div', 'spinfieldcontrols', div);
var minus = L.DomUtil.create('div', 'minus', controlsContainer);
minus.innerHTML = '-';
minus.textContent = '-';

var plus = L.DomUtil.create('div', 'plus', controlsContainer);
plus.innerHTML = '+';
plus.textContent = '+';

if (data.min != undefined)
$(spinfield).attr('min', data.min);
Expand Down Expand Up @@ -181,7 +181,7 @@ L.Control.MobileWizardBuilder = L.Control.JSDialogBuilder.extend({
if (title && title.length) {
var value = data.entries[data.selectedEntries[0]];
valueNode = L.DomUtil.create('div', '', null);
valueNode.innerHTML = value;
valueNode.textContent = value;
} else if (selectedEntryIsString)
title = builder._cleanText(data.selectedEntries[0]);
else
Expand Down Expand Up @@ -219,7 +219,7 @@ L.Control.MobileWizardBuilder = L.Control.JSDialogBuilder.extend({
L.DomUtil.addClass(div, 'checkbutton');

var checkboxLabel = L.DomUtil.create('label', '', div);
checkboxLabel.innerHTML = builder._cleanText(data.text);
checkboxLabel.textContent = builder._cleanText(data.text);
checkboxLabel.for = data.id;
var checkbox = L.DomUtil.createWithId('input', data.id, div);
checkbox.type = 'checkbox';
Expand Down Expand Up @@ -255,7 +255,7 @@ L.Control.MobileWizardBuilder = L.Control.JSDialogBuilder.extend({
radiobutton.name = data.group;

var radiobuttonLabel = L.DomUtil.create('label', '', container);
radiobuttonLabel.innerHTML = builder._cleanText(data.text);
radiobuttonLabel.textContent = builder._cleanText(data.text);
radiobuttonLabel.for = data.id;

if (data.enabled === 'false' || data.enabled === false)
Expand Down Expand Up @@ -502,7 +502,7 @@ L.Control.MobileWizardBuilder = L.Control.JSDialogBuilder.extend({
data.text = _('Gradient Start');
else if (data.id === 'fillattr3')
data.text = _('Gradient End');
titleSpan.innerHTML = data.text;
titleSpan.textContent = data.text;
}
}.bind(this);

Expand Down

0 comments on commit 90a9772

Please sign in to comment.