diff --git a/packages/node_modules/@node-red/editor-api/lib/editor/theme.js b/packages/node_modules/@node-red/editor-api/lib/editor/theme.js index 234671f2e..17dbbafea 100644 --- a/packages/node_modules/@node-red/editor-api/lib/editor/theme.js +++ b/packages/node_modules/@node-red/editor-api/lib/editor/theme.js @@ -28,7 +28,7 @@ var defaultContext = { }, header: { title: "Node-RED", - image: "red/images/node-red.png" + image: "red/images/node-red.svg" }, asset: { red: (process.env.NODE_ENV == "development")? "red/red.js":"red/red.min.js", diff --git a/packages/node_modules/@node-red/editor-api/lib/editor/ui.js b/packages/node_modules/@node-red/editor-api/lib/editor/ui.js index ce3ec862c..24b819fec 100644 --- a/packages/node_modules/@node-red/editor-api/lib/editor/ui.js +++ b/packages/node_modules/@node-red/editor-api/lib/editor/ui.js @@ -25,7 +25,7 @@ var theme = require("./theme"); var runtimeAPI; var editorClientDir = path.dirname(require.resolve("@node-red/editor-client")); -var defaultNodeIcon = path.join(editorClientDir,"public","red","images","icons","arrow-in.png"); +var defaultNodeIcon = path.join(editorClientDir,"public","red","images","icons","arrow-in.svg"); var editorTemplatePath = path.join(editorClientDir,"templates","index.mst"); var editorTemplate; diff --git a/packages/node_modules/@node-red/editor-client/src/images/deploy-flows-o.png b/packages/node_modules/@node-red/editor-client/src/images/deploy-flows-o.png deleted file mode 100644 index a2f5373e2..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/deploy-flows-o.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/deploy-flows-o.svg b/packages/node_modules/@node-red/editor-client/src/images/deploy-flows-o.svg new file mode 100644 index 000000000..c4511ba87 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/deploy-flows-o.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/node_modules/@node-red/editor-client/src/images/deploy-flows.png b/packages/node_modules/@node-red/editor-client/src/images/deploy-flows.png deleted file mode 100644 index e83638234..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/deploy-flows.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/deploy-flows.svg b/packages/node_modules/@node-red/editor-client/src/images/deploy-flows.svg new file mode 100644 index 000000000..0b0069272 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/deploy-flows.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/node_modules/@node-red/editor-client/src/images/deploy-full-o.png b/packages/node_modules/@node-red/editor-client/src/images/deploy-full-o.png deleted file mode 100644 index b5f3a9870..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/deploy-full-o.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/deploy-full-o.svg b/packages/node_modules/@node-red/editor-client/src/images/deploy-full-o.svg new file mode 100644 index 000000000..fc3221f1c --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/deploy-full-o.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/node_modules/@node-red/editor-client/src/images/deploy-full.png b/packages/node_modules/@node-red/editor-client/src/images/deploy-full.png deleted file mode 100644 index 775374d17..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/deploy-full.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/deploy-full.svg b/packages/node_modules/@node-red/editor-client/src/images/deploy-full.svg new file mode 100644 index 000000000..e4448e10f --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/deploy-full.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/node_modules/@node-red/editor-client/src/images/deploy-nodes-o.png b/packages/node_modules/@node-red/editor-client/src/images/deploy-nodes-o.png deleted file mode 100644 index 3174716cc..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/deploy-nodes-o.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/deploy-nodes-o.svg b/packages/node_modules/@node-red/editor-client/src/images/deploy-nodes-o.svg new file mode 100644 index 000000000..af540dd3d --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/deploy-nodes-o.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/node_modules/@node-red/editor-client/src/images/deploy-nodes.png b/packages/node_modules/@node-red/editor-client/src/images/deploy-nodes.png deleted file mode 100644 index 4d982a9c8..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/deploy-nodes.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/deploy-nodes.svg b/packages/node_modules/@node-red/editor-client/src/images/deploy-nodes.svg new file mode 100644 index 000000000..12d4c8972 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/deploy-nodes.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/node_modules/@node-red/editor-client/src/images/deploy-reload.png b/packages/node_modules/@node-red/editor-client/src/images/deploy-reload.png deleted file mode 100644 index 197fc610d..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/deploy-reload.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/deploy-reload.svg b/packages/node_modules/@node-red/editor-client/src/images/deploy-reload.svg new file mode 100644 index 000000000..00f319014 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/deploy-reload.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/node_modules/@node-red/editor-client/src/images/icons/arrow-in.png b/packages/node_modules/@node-red/editor-client/src/images/icons/arrow-in.png deleted file mode 100644 index e38f39146..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/icons/arrow-in.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/icons/arrow-in.svg b/packages/node_modules/@node-red/editor-client/src/images/icons/arrow-in.svg new file mode 100644 index 000000000..a5fcb49af --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/icons/arrow-in.svg @@ -0,0 +1 @@ + diff --git a/packages/node_modules/@node-red/editor-client/src/images/icons/node-changed.png b/packages/node_modules/@node-red/editor-client/src/images/icons/node-changed.png deleted file mode 100644 index 38a179444..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/icons/node-changed.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/icons/node-error.png b/packages/node_modules/@node-red/editor-client/src/images/icons/node-error.png deleted file mode 100644 index c20c8e85a..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/icons/node-error.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/node-red.png b/packages/node_modules/@node-red/editor-client/src/images/node-red.png deleted file mode 100644 index a60c26729..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/node-red.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/node-red.svg b/packages/node_modules/@node-red/editor-client/src/images/node-red.svg new file mode 100644 index 000000000..c62b35866 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/node-red.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/node_modules/@node-red/editor-client/src/images/pw_maze_white.png b/packages/node_modules/@node-red/editor-client/src/images/pw_maze_white.png deleted file mode 100644 index 66464831c..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/pw_maze_white.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/subflow_tab.png b/packages/node_modules/@node-red/editor-client/src/images/subflow_tab.png deleted file mode 100644 index 022777c4d..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/subflow_tab.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/subflow_tab.svg b/packages/node_modules/@node-red/editor-client/src/images/subflow_tab.svg new file mode 100644 index 000000000..4acb241e4 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/subflow_tab.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/09.png b/packages/node_modules/@node-red/editor-client/src/images/typedInput/09.png deleted file mode 100644 index 247371fe5..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/typedInput/09.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/09.svg b/packages/node_modules/@node-red/editor-client/src/images/typedInput/09.svg new file mode 100644 index 000000000..29c54b860 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/typedInput/09.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/az.png b/packages/node_modules/@node-red/editor-client/src/images/typedInput/az.png deleted file mode 100644 index 5f5d2404e..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/typedInput/az.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/az.svg b/packages/node_modules/@node-red/editor-client/src/images/typedInput/az.svg new file mode 100644 index 000000000..e0abbdc4a --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/typedInput/az.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/bin.png b/packages/node_modules/@node-red/editor-client/src/images/typedInput/bin.png deleted file mode 100644 index 615c8dd4f..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/typedInput/bin.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/bin.svg b/packages/node_modules/@node-red/editor-client/src/images/typedInput/bin.svg new file mode 100644 index 000000000..0ef91aed8 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/typedInput/bin.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/bool.png b/packages/node_modules/@node-red/editor-client/src/images/typedInput/bool.png deleted file mode 100644 index 9530983de..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/typedInput/bool.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/bool.svg b/packages/node_modules/@node-red/editor-client/src/images/typedInput/bool.svg new file mode 100644 index 000000000..e2e4297c7 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/typedInput/bool.svg @@ -0,0 +1 @@ + diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/env.png b/packages/node_modules/@node-red/editor-client/src/images/typedInput/env.png deleted file mode 100644 index 0ea51da00..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/typedInput/env.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/env.svg b/packages/node_modules/@node-red/editor-client/src/images/typedInput/env.svg new file mode 100644 index 000000000..bddd1c082 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/typedInput/env.svg @@ -0,0 +1 @@ + diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/expr.png b/packages/node_modules/@node-red/editor-client/src/images/typedInput/expr.png deleted file mode 100644 index 704105ce5..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/typedInput/expr.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/expr.svg b/packages/node_modules/@node-red/editor-client/src/images/typedInput/expr.svg new file mode 100644 index 000000000..c6357af50 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/typedInput/expr.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/json.png b/packages/node_modules/@node-red/editor-client/src/images/typedInput/json.png deleted file mode 100644 index 57ac8761f..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/typedInput/json.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/json.svg b/packages/node_modules/@node-red/editor-client/src/images/typedInput/json.svg new file mode 100644 index 000000000..713fe7944 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/typedInput/json.svg @@ -0,0 +1 @@ + diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/re.png b/packages/node_modules/@node-red/editor-client/src/images/typedInput/re.png deleted file mode 100644 index 87deb02ae..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/typedInput/re.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/re.svg b/packages/node_modules/@node-red/editor-client/src/images/typedInput/re.svg new file mode 100644 index 000000000..c30cbff55 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/typedInput/re.svg @@ -0,0 +1 @@ + diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/target.png b/packages/node_modules/@node-red/editor-client/src/images/typedInput/target.png deleted file mode 100644 index cc9833b73..000000000 Binary files a/packages/node_modules/@node-red/editor-client/src/images/typedInput/target.png and /dev/null differ diff --git a/packages/node_modules/@node-red/editor-client/src/images/typedInput/target.svg b/packages/node_modules/@node-red/editor-client/src/images/typedInput/target.svg new file mode 100644 index 000000000..b98996701 --- /dev/null +++ b/packages/node_modules/@node-red/editor-client/src/images/typedInput/target.svg @@ -0,0 +1 @@ + diff --git a/packages/node_modules/@node-red/editor-client/src/js/nodes.js b/packages/node_modules/@node-red/editor-client/src/js/nodes.js index 5c544e7b7..62949efce 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/nodes.js +++ b/packages/node_modules/@node-red/editor-client/src/js/nodes.js @@ -362,7 +362,7 @@ RED.nodes = (function() { name:{value:""}, env:{value:[]} }, - icon: function() { return sf.icon||"subflow.png" }, + icon: function() { return sf.icon||"subflow.svg" }, category: sf.category || "subflows", inputs: sf.in.length, outputs: sf.out.length, @@ -583,7 +583,7 @@ RED.nodes = (function() { node.outputLabels = n.outputLabels.slice(); } if (n.icon) { - if (n.icon !== "node-red/subflow.png") { + if (n.icon !== "node-red/subflow.svg") { node.icon = n.icon; } } diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/menu.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/menu.js index 8de4a6e13..e4599f99c 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/menu.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/menu.js @@ -71,7 +71,7 @@ RED.menu = (function() { } if (opt.icon !== undefined) { - if (/\.png/.test(opt.icon)) { + if (/\.(png|svg)/.test(opt.icon)) { linkContent += ' '; } else { linkContent += ' '; diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js index f5fe03890..0ef5b2102 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/typedInput.js @@ -32,6 +32,12 @@ return v; } } + var mapDeprecatedIcon = function(icon) { + if (/^red\/images\/typedInput\/.+\.png$/.test(icon)) { + icon = icon.replace(/.png$/,".svg"); + } + return icon; + } var allOptions = { msg: {value:"msg",label:"msg.",validate:RED.utils.validatePropertyExpression}, flow: {value:"flow",label:"flow.",hasValue:true, @@ -46,13 +52,13 @@ parse: contextParse, export: contextExport }, - str: {value:"str",label:"string",icon:"red/images/typedInput/az.png"}, - num: {value:"num",label:"number",icon:"red/images/typedInput/09.png",validate:/^[+-]?[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?$/}, - bool: {value:"bool",label:"boolean",icon:"red/images/typedInput/bool.png",options:["true","false"]}, + str: {value:"str",label:"string",icon:"red/images/typedInput/az.svg"}, + num: {value:"num",label:"number",icon:"red/images/typedInput/09.svg",validate:/^[+-]?[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?$/}, + bool: {value:"bool",label:"boolean",icon:"red/images/typedInput/bool.svg",options:["true","false"]}, json: { value:"json", label:"JSON", - icon:"red/images/typedInput/json.png", + icon:"red/images/typedInput/json.svg", validate: function(v) { try{JSON.parse(v);return true;}catch(e){return false;}}, expand: function() { var that = this; @@ -74,12 +80,12 @@ }) } }, - re: {value:"re",label:"regular expression",icon:"red/images/typedInput/re.png"}, + re: {value:"re",label:"regular expression",icon:"red/images/typedInput/re.svg"}, date: {value:"date",label:"timestamp",hasValue:false}, jsonata: { value: "jsonata", label: "expression", - icon: "red/images/typedInput/expr.png", + icon: "red/images/typedInput/expr.svg", validate: function(v) { try{jsonata(v);return true;}catch(e){return false;}}, expand:function() { var that = this; @@ -94,7 +100,7 @@ bin: { value: "bin", label: "buffer", - icon: "red/images/typedInput/bin.png", + icon: "red/images/typedInput/bin.svg", expand: function() { var that = this; RED.editor.editBuffer({ @@ -108,12 +114,12 @@ env: { value: "env", label: "env variable", - icon: "red/images/typedInput/env.png" + icon: "red/images/typedInput/env.svg" }, node: { value: "node", label: "node", - icon: "red/images/typedInput/target.png", + icon: "red/images/typedInput/target.svg", valueLabel: function(container,value) { var node = RED.nodes.node(value); var nodeDiv = $('
',{class:"red-ui-search-result-node"}).css({ @@ -353,7 +359,7 @@ if (opt.icon.indexOf("<") === 0) { $(opt.icon).prependTo(op); } else if (opt.icon.indexOf("/") !== -1) { - $('',{src:opt.icon,style:"margin-right: 4px; height: 18px;"}).prependTo(op); + $('',{src:mapDeprecatedIcon(opt.icon),style:"margin-right: 4px; height: 18px;"}).prependTo(op); } else { $('',{class:"red-ui-typedInput-icon "+opt.icon}).prependTo(op); } @@ -507,7 +513,7 @@ $(o.icon).prependTo(this.optionSelectLabel); } else if (o.icon.indexOf("/") !== -1) { // url - $('',{src:o.icon,style:"height: 18px;"}).prependTo(this.optionSelectLabel); + $('',{src:mapDeprecatedIcon(o.icon),style:"height: 18px;"}).prependTo(this.optionSelectLabel); } else { // icon class $('',{class:"red-ui-typedInput-icon "+o.icon}).prependTo(this.optionSelectLabel); @@ -619,8 +625,8 @@ else if (opt.icon.indexOf("/") !== -1) { image = new Image(); image.name = opt.icon; - image.src = opt.icon; - $('',{src:opt.icon,style:"margin-right: 4px;height: 18px;"}).prependTo(this.selectLabel); + image.src = mapDeprecatedIcon(opt.icon); + $('',{src:mapDeprecatedIcon(opt.icon),style:"margin-right: 4px;height: 18px;"}).prependTo(this.selectLabel); } else { $('',{class:"red-ui-typedInput-icon "+opt.icon}).prependTo(this.selectLabel); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js b/packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js index 16a774b0e..cdf84d02f 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/deploy.js @@ -17,9 +17,9 @@ RED.deploy = (function() { var deploymentTypes = { - "full":{img:"red/images/deploy-full-o.png"}, - "nodes":{img:"red/images/deploy-nodes-o.png"}, - "flows":{img:"red/images/deploy-flows-o.png"} + "full":{img:"red/images/deploy-full-o.svg"}, + "nodes":{img:"red/images/deploy-nodes-o.svg"}, + "flows":{img:"red/images/deploy-flows-o.svg"} } var ignoreDeployWarnings = { @@ -44,7 +44,7 @@ RED.deploy = (function() { * type: "default" - Button with drop-down options - no further customisation available * type: "simple" - Button without dropdown. Customisations: * label: the text to display - default: "Deploy" - * icon : the icon to use. Null removes the icon. default: "red/images/deploy-full-o.png" + * icon : the icon to use. Null removes the icon. default: "red/images/deploy-full-o.svg" */ function init(options) { options = options || {}; @@ -54,7 +54,7 @@ RED.deploy = (function() { $('
  • '+ ''+ ''+ - ' '+ + ' '+ ''+RED._("deploy.deploy")+''+ ''+ ''+ @@ -65,17 +65,17 @@ RED.deploy = (function() { '
  • ').prependTo(".red-ui-header-toolbar"); RED.menu.init({id:"red-ui-header-button-deploy-options", options: [ - {id:"deploymenu-item-full",toggle:"deploy-type",icon:"red/images/deploy-full.png",label:RED._("deploy.full"),sublabel:RED._("deploy.fullDesc"),selected: true, onselect:function(s) { if(s){changeDeploymentType("full")}}}, - {id:"deploymenu-item-flow",toggle:"deploy-type",icon:"red/images/deploy-flows.png",label:RED._("deploy.modifiedFlows"),sublabel:RED._("deploy.modifiedFlowsDesc"), onselect:function(s) {if(s){changeDeploymentType("flows")}}}, - {id:"deploymenu-item-node",toggle:"deploy-type",icon:"red/images/deploy-nodes.png",label:RED._("deploy.modifiedNodes"),sublabel:RED._("deploy.modifiedNodesDesc"),onselect:function(s) { if(s){changeDeploymentType("nodes")}}}, + {id:"deploymenu-item-full",toggle:"deploy-type",icon:"red/images/deploy-full.svg",label:RED._("deploy.full"),sublabel:RED._("deploy.fullDesc"),selected: true, onselect:function(s) { if(s){changeDeploymentType("full")}}}, + {id:"deploymenu-item-flow",toggle:"deploy-type",icon:"red/images/deploy-flows.svg",label:RED._("deploy.modifiedFlows"),sublabel:RED._("deploy.modifiedFlowsDesc"), onselect:function(s) {if(s){changeDeploymentType("flows")}}}, + {id:"deploymenu-item-node",toggle:"deploy-type",icon:"red/images/deploy-nodes.svg",label:RED._("deploy.modifiedNodes"),sublabel:RED._("deploy.modifiedNodesDesc"),onselect:function(s) { if(s){changeDeploymentType("nodes")}}}, null, - {id:"deploymenu-item-reload", icon:"red/images/deploy-reload.png",label:RED._("deploy.restartFlows"),sublabel:RED._("deploy.restartFlowsDesc"),onselect:"core:restart-flows"}, + {id:"deploymenu-item-reload", icon:"red/images/deploy-reload.svg",label:RED._("deploy.restartFlows"),sublabel:RED._("deploy.restartFlowsDesc"),onselect:"core:restart-flows"}, ] }); } else if (type == "simple") { var label = options.label || RED._("deploy.deploy"); - var icon = 'red/images/deploy-full-o.png'; + var icon = 'red/images/deploy-full-o.svg'; if (options.hasOwnProperty('icon')) { icon = options.icon; } diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/diff.js b/packages/node_modules/@node-red/editor-client/src/js/ui/diff.js index 9ea599e3d..4ebdcdce9 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/diff.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/diff.js @@ -399,7 +399,7 @@ RED.diff = (function() { diff: localDiff, def: { defaults:{}, - icon:"subflow.png", + icon:"subflow.svg", category: "subflows", color: "#da9" }, @@ -422,7 +422,7 @@ RED.diff = (function() { diff: localDiff, def: { defaults:{}, - icon:"subflow.png", + icon:"subflow.svg", category: "subflows", color: "#da9" }, @@ -443,7 +443,7 @@ RED.diff = (function() { remoteDiff: remoteDiff, def: { defaults:{}, - icon:"subflow.png", + icon:"subflow.svg", category: "subflows", color: "#da9" }, @@ -549,7 +549,7 @@ RED.diff = (function() { if (def === undefined) { if (/^subflow:/.test(node.type)) { def = { - icon:"subflow.png", + icon:"subflow.svg", category: "subflows", color: "#da9", defaults:{name:{value:""}} diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js b/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js index 1b3ccea52..4547dc756 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js @@ -2156,7 +2156,7 @@ RED.editor = (function() { changed = true; } var icon = $("#red-ui-editor-node-icon").text()||""; - if ((editing_node.icon === undefined && icon !== "node-red/subflow.png") || + if ((editing_node.icon === undefined && icon !== "node-red/subflow.svg") || (editing_node.icon !== undefined && editing_node.icon !== icon)) { changes.icon = editing_node.icon; editing_node.icon = icon; diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js b/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js index a7b022172..d26ed4a4c 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js @@ -802,13 +802,13 @@ RED.utils = (function() { function getDefaultNodeIcon(def,node) { var icon_url; if (node && node.type === "subflow") { - icon_url = "node-red/subflow.png"; + icon_url = "node-red/subflow.svg"; } else if (typeof def.icon === "function") { try { icon_url = def.icon.call(node); } catch(err) { console.log("Definition error: "+def.type+".icon",err); - icon_url = "arrow-in.png"; + icon_url = "arrow-in.svg"; } } else { icon_url = def.icon; @@ -838,11 +838,11 @@ RED.utils = (function() { function getNodeIcon(def,node) { if (def.category === 'config') { - return RED.settings.apiRootUrl+"icons/node-red/cog.png" + return RED.settings.apiRootUrl+"icons/node-red/cog.svg" } else if (node && node.type === 'tab') { - return RED.settings.apiRootUrl+"icons/node-red/subflow.png" + return RED.settings.apiRootUrl+"icons/node-red/subflow.svg" } else if (node && node.type === 'unknown') { - return RED.settings.apiRootUrl+"icons/node-red/alert.png" + return RED.settings.apiRootUrl+"icons/node-red/alert.svg" } else if (node && node.icon) { var iconPath = separateIconPath(node.icon); if (isIconExists(iconPath)) { @@ -851,6 +851,11 @@ RED.utils = (function() { } else { return RED.settings.apiRootUrl+"icons/" + node.icon; } + } else if (iconPath.module !== "font-awesome" && /.png$/i.test(iconPath.file)) { + iconPath.file = iconPath.file.replace(/.png$/,".svg"); + if (isIconExists(iconPath)) { + return RED.settings.apiRootUrl+"icons/" + node.icon.replace(/.png$/,".svg"); + } } } @@ -861,17 +866,32 @@ RED.utils = (function() { } else { return RED.settings.apiRootUrl+"icons/"+iconPath.module+"/"+iconPath.file; } - } else { - // This could be a non-core node trying to use a core icon. - iconPath.module = 'node-red'; + } + + if (/.png$/i.test(iconPath.file)) { + var originalFile = iconPath.file; + iconPath.file = iconPath.file.replace(/.png$/,".svg"); + if (isIconExists(iconPath)) { + return RED.settings.apiRootUrl+"icons/"+iconPath.module+"/"+iconPath.file; + } + iconPath.file = originalFile; + } + + // This could be a non-core node trying to use a core icon. + iconPath.module = 'node-red'; + if (isIconExists(iconPath)) { + return RED.settings.apiRootUrl+"icons/"+iconPath.module+"/"+iconPath.file; + } + if (/.png$/i.test(iconPath.file)) { + iconPath.file = iconPath.file.replace(/.png$/,".svg"); if (isIconExists(iconPath)) { return RED.settings.apiRootUrl+"icons/"+iconPath.module+"/"+iconPath.file; - } else if (def.category === 'subflows') { - return RED.settings.apiRootUrl+"icons/node-red/subflow.png"; - } else { - return RED.settings.apiRootUrl+"icons/node-red/arrow-in.png"; } } + if (def.category === 'subflows') { + return RED.settings.apiRootUrl+"icons/node-red/subflow.svg"; + } + return RED.settings.apiRootUrl+"icons/node-red/arrow-in.svg"; } function getNodeLabel(node,defaultLabel) { @@ -1007,7 +1027,7 @@ RED.utils = (function() { return; } // If the specified name is not defined in font-awesome, show arrow-in icon. - iconUrl = RED.settings.apiRootUrl+"icons/node-red/arrow-in.png" + iconUrl = RED.settings.apiRootUrl+"icons/node-red/arrow-in.svg" } var imageIconElement = $('
    ',{class:"red-ui-palette-icon"}).appendTo(iconContainer); imageIconElement.css("backgroundImage", "url("+iconUrl+")"); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js index e3aa33a7f..57cce2852 100755 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js @@ -2463,14 +2463,22 @@ RED.view = (function() { .attr("class","red-ui-flow-node-icon") .attr("x",0) .attr("width","30") - .attr("height","30"); + .attr("height","30") + .style("display","none"); var img = new Image(); img.src = iconUrl; img.onload = function() { - icon.attr("width",Math.min(img.width,30)); - icon.attr("height",Math.min(img.height,30)); - icon.attr("x",15-Math.min(img.width,30)/2); + var largestEdge = Math.max(img.width,img.height); + var scaleFactor = 1; + if (largestEdge > 30) { + scaleFactor = 30/largestEdge; + } + var width = img.width * scaleFactor; + var height = img.height * scaleFactor; + icon.attr("width",width); + icon.attr("height",height); + icon.attr("x",15-width/2); icon.attr("xlink:href",iconUrl); icon.style("display",null); //if ("right" == d._def.align) { diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js b/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js index db36004ab..91fa8e34a 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js @@ -439,7 +439,7 @@ RED.workspaces = (function() { if (!workspace_tabs.contains(id)) { var sf = RED.nodes.subflow(id); if (sf) { - addWorkspace({type:"subflow",id:id,icon:"red/images/subflow_tab.png",label:sf.name, closeable: true}); + addWorkspace({type:"subflow",id:id,icon:"red/images/subflow_tab.svg",label:sf.name, closeable: true}); } else { return; } diff --git a/packages/node_modules/@node-red/nodes/core/core/20-inject.html b/packages/node_modules/@node-red/nodes/core/core/20-inject.html index 558530835..69fd9c8d1 100644 --- a/packages/node_modules/@node-red/nodes/core/core/20-inject.html +++ b/packages/node_modules/@node-red/nodes/core/core/20-inject.html @@ -168,7 +168,7 @@ once: {value:false}, onceDelay: {value:0.1} }, - icon: "inject.png", + icon: "inject.svg", inputs:0, outputs:1, outputLabels: function(index) { diff --git a/packages/node_modules/@node-red/nodes/core/core/25-catch.html b/packages/node_modules/@node-red/nodes/core/core/25-catch.html index 8145fd525..97bd627d5 100644 --- a/packages/node_modules/@node-red/nodes/core/core/25-catch.html +++ b/packages/node_modules/@node-red/nodes/core/core/25-catch.html @@ -34,7 +34,7 @@ }, inputs:0, outputs:1, - icon: "alert.png", + icon: "alert.svg", label: function() { if (this.name) { return this.name; diff --git a/packages/node_modules/@node-red/nodes/core/core/25-status.html b/packages/node_modules/@node-red/nodes/core/core/25-status.html index de52ae281..68eb127a7 100644 --- a/packages/node_modules/@node-red/nodes/core/core/25-status.html +++ b/packages/node_modules/@node-red/nodes/core/core/25-status.html @@ -22,14 +22,14 @@