mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Escape all user input
This commit is contained in:
parent
0fef2ab509
commit
02d1369d5b
@ -94,19 +94,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
buttons.forEach(function(button) {
|
buttons.forEach(function(button) {
|
||||||
var text = "";
|
var element = $('<a href="#" class="red-ui-button red-ui-button-small red-ui-editableList-addButton" style="margin-top: 4px; margin-right: 5px;"></a>')
|
||||||
var titleAttribute="";
|
|
||||||
if (button.icon) {
|
|
||||||
text = '<i class="'+button.icon+'"></i> ';
|
|
||||||
}
|
|
||||||
if (button.label) {
|
|
||||||
text += button.label;
|
|
||||||
}
|
|
||||||
if (button.title) {
|
|
||||||
titleAttribute = 'title="'+button.title+'"';
|
|
||||||
}
|
|
||||||
$('<a href="#" class="red-ui-button red-ui-button-small red-ui-editableList-addButton" style="margin-top: 4px; margin-right: 5px;" '+titleAttribute+'></a>')
|
|
||||||
.text(text)
|
|
||||||
.appendTo(that.topContainer)
|
.appendTo(that.topContainer)
|
||||||
.on("click", function(evt) {
|
.on("click", function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
@ -114,6 +102,16 @@
|
|||||||
button.click(evt);
|
button.click(evt);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (button.title) {
|
||||||
|
element.attr("title", button.title);
|
||||||
|
}
|
||||||
|
if (button.icon) {
|
||||||
|
element.append($("<i></i>").attr("class", button.icon));
|
||||||
|
}
|
||||||
|
if (button.label) {
|
||||||
|
element.append($("<span></span>").text(" " + button.label));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.element.css("position") === "absolute") {
|
if (this.element.css("position") === "absolute") {
|
||||||
|
Loading…
Reference in New Issue
Block a user