mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Handle png/svg fallback for def.icon values. Remove old pngs
This commit is contained in:
@@ -866,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.svg";
|
||||
} else {
|
||||
return RED.settings.apiRootUrl+"icons/node-red/arrow-in.svg";
|
||||
}
|
||||
}
|
||||
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) {
|
||||
|
Reference in New Issue
Block a user