Change icon path from png to svg

This commit is contained in:
Kazuhito Yokoi 2022-05-05 20:38:55 +09:00
parent 329008bf6d
commit c5af71e0a2
5 changed files with 15 additions and 15 deletions

View File

@ -311,8 +311,8 @@
types:[ types:[
'str','num','bool', 'str','num','bool',
{value:"null",label:RED._("common.type.null"),hasValue:false}, {value:"null",label:RED._("common.type.null"),hasValue:false},
{value:"array",label:RED._("common.type.array"),hasValue:false,icon:"red/images/typedInput/json.png"}, {value:"array",label:RED._("common.type.array"),hasValue:false,icon:"red/images/typedInput/json.svg"},
{value:"object",label:RED._("common.type.object"),hasValue:false,icon:"red/images/typedInput/json.png"} {value:"object",label:RED._("common.type.object"),hasValue:false,icon:"red/images/typedInput/json.svg"}
], ],
default: valType default: valType
}); });

View File

@ -69,7 +69,7 @@
outputs:1, // set the number of outputs - 0 to n outputs:1, // set the number of outputs - 0 to n
color: "#ddd", // set icon color color: "#ddd", // set icon color
// set the icon (held in icons dir below where you save the node) // set the icon (held in icons dir below where you save the node)
icon: "myicon.png", // saved in icons/myicon.png icon: "myicon.svg", // saved in icons/myicon.svg
label: function() { // sets the default label contents label: function() { // sets the default label contents
return this.name||this.topic||"sample"; return this.name||this.topic||"sample";
}, },

View File

@ -146,13 +146,13 @@
function createTypeValueField(row, defaultType){ function createTypeValueField(row, defaultType){
return $('<input/>',{class:"node-input-rule-type-value",type:"text",style:"width: 100%;"}).appendTo(row).typedInput({default:defaultType || 'string',types:[ return $('<input/>',{class:"node-input-rule-type-value",type:"text",style:"width: 100%;"}).appendTo(row).typedInput({default:defaultType || 'string',types:[
{value:"string",label:RED._("common.type.string"),hasValue:false,icon:"red/images/typedInput/az.png"}, {value:"string",label:RED._("common.type.string"),hasValue:false,icon:"red/images/typedInput/az.svg"},
{value:"number",label:RED._("common.type.number"),hasValue:false,icon:"red/images/typedInput/09.png"}, {value:"number",label:RED._("common.type.number"),hasValue:false,icon:"red/images/typedInput/09.svg"},
{value:"boolean",label:RED._("common.type.boolean"),hasValue:false,icon:"red/images/typedInput/bool.png"}, {value:"boolean",label:RED._("common.type.boolean"),hasValue:false,icon:"red/images/typedInput/bool.svg"},
{value:"array",label:RED._("common.type.array"),hasValue:false,icon:"red/images/typedInput/json.png"}, {value:"array",label:RED._("common.type.array"),hasValue:false,icon:"red/images/typedInput/json.svg"},
{value:"buffer",label:RED._("common.type.buffer"),hasValue:false,icon:"red/images/typedInput/bin.png"}, {value:"buffer",label:RED._("common.type.buffer"),hasValue:false,icon:"red/images/typedInput/bin.svg"},
{value:"object",label:RED._("common.type.object"),hasValue:false,icon:"red/images/typedInput/json.png"}, {value:"object",label:RED._("common.type.object"),hasValue:false,icon:"red/images/typedInput/json.svg"},
{value:"json",label:RED._("common.type.jsonString"),hasValue:false,icon:"red/images/typedInput/json.png"}, {value:"json",label:RED._("common.type.jsonString"),hasValue:false,icon:"red/images/typedInput/json.svg"},
{value:"undefined",label:RED._("common.type.undefined"),hasValue:false}, {value:"undefined",label:RED._("common.type.undefined"),hasValue:false},
{value:"null",label:RED._("common.type.null"),hasValue:false} {value:"null",label:RED._("common.type.null"),hasValue:false}
]}); ]});

View File

@ -129,7 +129,7 @@
var headerTypes = [ var headerTypes = [
{value:"content-type",label:"Content-Type",hasValue: false}, {value:"content-type",label:"Content-Type",hasValue: false},
{value:"location",label:"Location",hasValue: false}, {value:"location",label:"Location",hasValue: false},
{value:"other",label:RED._("node-red:httpin.label.other"),icon:"red/images/typedInput/az.png"} {value:"other",label:RED._("node-red:httpin.label.other"),icon:"red/images/typedInput/az.svg"}
] ]
var contentTypes = [ var contentTypes = [
{value:"application/json",label:"application/json",hasValue: false}, {value:"application/json",label:"application/json",hasValue: false},
@ -139,7 +139,7 @@
{value:"text/plain",label:"text/plain",hasValue: false}, {value:"text/plain",label:"text/plain",hasValue: false},
{value:"image/gif",label:"image/gif",hasValue: false}, {value:"image/gif",label:"image/gif",hasValue: false},
{value:"image/png",label:"image/png",hasValue: false}, {value:"image/png",label:"image/png",hasValue: false},
{value:"other",label:RED._("node-red:httpin.label.other"),icon:"red/images/typedInput/az.png"} {value:"other",label:RED._("node-red:httpin.label.other"),icon:"red/images/typedInput/az.svg"}
]; ];
RED.nodes.registerType('http response',{ RED.nodes.registerType('http response',{
@ -180,7 +180,7 @@
var propertyValue = $('<input/>',{class:"node-input-header-value",type:"text",style:"width: 100%"}) var propertyValue = $('<input/>',{class:"node-input-header-value",type:"text",style:"width: 100%"})
.appendTo(propertyValueCell) .appendTo(propertyValueCell)
.typedInput({types: .typedInput({types:
header.h === 'content-type'?contentTypes:[{value:"other",label:"other",icon:"red/images/typedInput/az.png"}] header.h === 'content-type'?contentTypes:[{value:"other",label:"other",icon:"red/images/typedInput/az.svg"}]
}); });
var matchedType = headerTypes.filter(function(ht) { var matchedType = headerTypes.filter(function(ht) {
@ -223,7 +223,7 @@
if (type === 'content-type') { if (type === 'content-type') {
propertyValue.typedInput('types',contentTypes); propertyValue.typedInput('types',contentTypes);
} else { } else {
propertyValue.typedInput('types',[{value:"other",label:"other",icon:"red/images/typedInput/az.png"}]); propertyValue.typedInput('types',[{value:"other",label:"other",icon:"red/images/typedInput/az.svg"}]);
} }
}); });
}, },

View File

@ -247,7 +247,7 @@
var jsonata_or_empty = { var jsonata_or_empty = {
value: "jsonata", value: "jsonata",
label: "expression", label: "expression",
icon: "red/images/typedInput/expr.png", icon: "red/images/typedInput/expr.svg",
validate: function(v) { validate: function(v) {
try{ try{
if(v !== "") { if(v !== "") {