mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 18:52:19 +00:00
Merge pull request #179 from RobTheFiveNine/enhancement/property-descriptors
Add option to stylise property names
This commit is contained in:
@@ -9453,7 +9453,7 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
entries.push({
|
entries.push({
|
||||||
content:
|
content:
|
||||||
"<span class='property_name'>" +
|
"<span class='property_name'>" +
|
||||||
i +
|
(info.descriptor ? info.descriptor : i) +
|
||||||
"</span>" +
|
"</span>" +
|
||||||
"<span class='property_value'>" +
|
"<span class='property_value'>" +
|
||||||
value +
|
value +
|
||||||
@@ -10051,7 +10051,7 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
|
|
||||||
var dialog = this.createDialog(
|
var dialog = this.createDialog(
|
||||||
"<span class='name'>" +
|
"<span class='name'>" +
|
||||||
property +
|
(info.descriptor ? info.descriptor : property) +
|
||||||
"</span>" +
|
"</span>" +
|
||||||
input_html +
|
input_html +
|
||||||
"<button>OK</button>",
|
"<button>OK</button>",
|
||||||
|
|||||||
36
build/litegraph.min.js
vendored
36
build/litegraph.min.js
vendored
@@ -4048,7 +4048,7 @@ $jscomp.polyfill("Object.values", function(x) {
|
|||||||
a = m.getPropertyPrintableValue(a, n.values);
|
a = m.getPropertyPrintableValue(a, n.values);
|
||||||
}
|
}
|
||||||
a = m.decodeHTML(a);
|
a = m.decodeHTML(a);
|
||||||
k.push({content:"<span class='property_name'>" + p + "</span><span class='property_value'>" + a + "</span>", value:p});
|
k.push({content:"<span class='property_name'>" + (n.descriptor ? n.descriptor : p) + "</span><span class='property_value'>" + a + "</span>", value:p});
|
||||||
}
|
}
|
||||||
if (k.length) {
|
if (k.length) {
|
||||||
return new f.ContextMenu(k, {event:d, callback:function(a, b, d, e) {
|
return new f.ContextMenu(k, {event:d, callback:function(a, b, d, e) {
|
||||||
@@ -4371,7 +4371,7 @@ $jscomp.polyfill("Object.values", function(x) {
|
|||||||
k += "</select>";
|
k += "</select>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var h = this.createDialog("<span class='name'>" + b + "</span>" + k + "<button>OK</button>", d);
|
var h = this.createDialog("<span class='name'>" + (c.descriptor ? c.descriptor : b) + "</span>" + k + "<button>OK</button>", d);
|
||||||
if ("enum" != f && "combo" != f || !c.values) {
|
if ("enum" != f && "combo" != f || !c.values) {
|
||||||
if ("boolean" == f) {
|
if ("boolean" == f) {
|
||||||
(l = h.querySelector("input")) && l.addEventListener("click", function(a) {
|
(l = h.querySelector("input")) && l.addEventListener("click", function(a) {
|
||||||
@@ -5295,18 +5295,18 @@ $jscomp.polyfill("Object.values", function(x) {
|
|||||||
for (d = 0; d < a.length; ++d) {
|
for (d = 0; d < a.length; ++d) {
|
||||||
g = a[d];
|
g = a[d];
|
||||||
if (g.inputs) {
|
if (g.inputs) {
|
||||||
for (var e = 0; e < g.inputs.length; ++e) {
|
for (var c = 0; c < g.inputs.length; ++c) {
|
||||||
var c = g.inputs[e];
|
var e = g.inputs[c];
|
||||||
if (c && c.link) {
|
if (e && e.link) {
|
||||||
var f = g.graph.links[c.link];
|
var f = g.graph.links[e.link];
|
||||||
f && (b[f.origin_id] || this.subgraph.addInput(c.name, f.type));
|
f && (b[f.origin_id] || this.subgraph.addInput(e.name, f.type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (g.outputs) {
|
if (g.outputs) {
|
||||||
for (e = 0; e < g.outputs.length; ++e) {
|
for (c = 0; c < g.outputs.length; ++c) {
|
||||||
if ((c = g.outputs[e]) && c.links && c.links.length) {
|
if ((e = g.outputs[c]) && e.links && e.links.length) {
|
||||||
for (var k = 0; k < c.links.length && (!(f = g.graph.links[c.links[k]]) || b[f.target_id]); ++k) {
|
for (var k = 0; k < e.links.length && (!(f = g.graph.links[e.links[k]]) || b[f.target_id]); ++k) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5568,13 +5568,13 @@ $jscomp.polyfill("Object.values", function(x) {
|
|||||||
t.prototype.onExecute = function() {
|
t.prototype.onExecute = function() {
|
||||||
var a = this.getInputData(0), b = this.getInputData(1), d = this._result;
|
var a = this.getInputData(0), b = this.getInputData(1), d = this._result;
|
||||||
if (a) {
|
if (a) {
|
||||||
for (var c in a) {
|
for (var e in a) {
|
||||||
d[c] = a[c];
|
d[e] = a[e];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (b) {
|
if (b) {
|
||||||
for (c in b) {
|
for (e in b) {
|
||||||
d[c] = b[c];
|
d[e] = b[e];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.setOutputData(0, d);
|
this.setOutputData(0, d);
|
||||||
@@ -5714,8 +5714,8 @@ $jscomp.polyfill("Object.values", function(x) {
|
|||||||
if (256 < a.length) {
|
if (256 < a.length) {
|
||||||
console.warn("Script too long, max 256 chars");
|
console.warn("Script too long, max 256 chars");
|
||||||
} else {
|
} else {
|
||||||
for (var b = a.toLowerCase(), d = "script body document eval nodescript function".split(" "), c = 0; c < d.length; ++c) {
|
for (var b = a.toLowerCase(), d = "script body document eval nodescript function".split(" "), e = 0; e < d.length; ++e) {
|
||||||
if (-1 != b.indexOf(d[c])) {
|
if (-1 != b.indexOf(d[e])) {
|
||||||
console.warn("invalid script");
|
console.warn("invalid script");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -10347,8 +10347,8 @@ $jscomp.polyfill("Object.values", function(x) {
|
|||||||
this.trigger("start");
|
this.trigger("start");
|
||||||
b.onended = function() {
|
b.onended = function() {
|
||||||
a.trigger("ended");
|
a.trigger("ended");
|
||||||
var c = a._audionodes.indexOf(b);
|
var d = a._audionodes.indexOf(b);
|
||||||
-1 != c && a._audionodes.splice(c, 1);
|
-1 != d && a._audionodes.splice(d, 1);
|
||||||
};
|
};
|
||||||
b.started || (b.started = !0, b.start());
|
b.started || (b.started = !0, b.start());
|
||||||
return b;
|
return b;
|
||||||
|
|||||||
@@ -9453,7 +9453,7 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
entries.push({
|
entries.push({
|
||||||
content:
|
content:
|
||||||
"<span class='property_name'>" +
|
"<span class='property_name'>" +
|
||||||
i +
|
(info.descriptor ? info.descriptor : i) +
|
||||||
"</span>" +
|
"</span>" +
|
||||||
"<span class='property_value'>" +
|
"<span class='property_value'>" +
|
||||||
value +
|
value +
|
||||||
@@ -10051,7 +10051,7 @@ LGraphNode.prototype.executeAction = function(action)
|
|||||||
|
|
||||||
var dialog = this.createDialog(
|
var dialog = this.createDialog(
|
||||||
"<span class='name'>" +
|
"<span class='name'>" +
|
||||||
property +
|
(info.descriptor ? info.descriptor : property) +
|
||||||
"</span>" +
|
"</span>" +
|
||||||
input_html +
|
input_html +
|
||||||
"<button>OK</button>",
|
"<button>OK</button>",
|
||||||
|
|||||||
Reference in New Issue
Block a user