diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js b/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js index 01503a58d..a494066ea 100755 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js @@ -17,7 +17,21 @@ RED.palette = (function() { var exclusion = ['config','unknown','deprecated']; - var coreCategories = ['subflows', 'input', 'output', 'function', 'social', 'mobile', 'storage', 'analysis', 'advanced']; + var coreCategories = [ + 'subflows', + 'common', + 'function', + 'network', + 'input', + 'output', + 'sequence', + 'parser', + 'storage', + 'analysis', + 'social', + 'mobile', + 'advanced' + ]; var categoryContainers = {}; var sidebarControls; @@ -37,6 +51,7 @@ RED.palette = (function() { var catDiv = $('
'+ '
'+label+'
'+ '
'+ + '
'+ '
'+ '
'+ '
'+ @@ -153,19 +168,24 @@ RED.palette = (function() { return $(".red-ui-palette-node[data-palette-type='"+type+"']"); } + function escapeCategory(category) { + return category.replace(/[ /.]/g,"_"); + } function addNodeType(nt,def) { if (getPaletteNode(nt).length) { return; } - if (exclusion.indexOf(def.category)===-1) { + var nodeCategory = def.category; - var originalCategory = def.category; - var category = def.category.replace(/ /g,"_"); + if (exclusion.indexOf(nodeCategory)===-1) { + + var originalCategory = nodeCategory; + var category = escapeCategory(nodeCategory); var rootCategory = category.split("-")[0]; var d = $('
',{class:"red-ui-palette-node"}).attr("data-palette-type",nt).data('category',rootCategory); - var label = /^(.*?)([ -]in|[ -]out)?$/.exec(nt)[1]; + var label = nt;///^(.*?)([ -]in|[ -]out)?$/.exec(nt)[1]; if (typeof def.paletteLabel !== "undefined") { try { label = (typeof def.paletteLabel === "function" ? def.paletteLabel.call(def) : def.paletteLabel)||""; @@ -203,7 +223,7 @@ RED.palette = (function() { d.append(portIn); } - createCategory(def.category,rootCategory,category,(coreCategories.indexOf(rootCategory) !== -1)?"node-red":def.set.id); + createCategory(nodeCategory,rootCategory,category,(coreCategories.indexOf(rootCategory) !== -1)?"node-red":def.set.id); $("#red-ui-palette-"+category).append(d); @@ -411,7 +431,7 @@ RED.palette = (function() { var currentCategory = paletteNode.data('category'); var newCategory = (sf.category||"subflows"); if (currentCategory !== newCategory) { - var category = newCategory.replace(/ /g,"_"); + var category = escapeCategory(newCategory); createCategory(newCategory,category,category,"node-red"); var currentCategoryNode = paletteNode.closest(".red-ui-palette-category"); @@ -544,7 +564,7 @@ RED.palette = (function() { categoryList = coreCategories } categoryList.forEach(function(category){ - createCategoryContainer(category, category, "palette.label."+category); + createCategoryContainer(category, escapeCategory(category), "palette.label."+escapeCategory(category)); }); diff --git a/packages/node_modules/@node-red/nodes/core/core/20-inject.html b/packages/node_modules/@node-red/nodes/core/common/20-inject.html similarity index 99% rename from packages/node_modules/@node-red/nodes/core/core/20-inject.html rename to packages/node_modules/@node-red/nodes/core/common/20-inject.html index 69fd9c8d1..4953505eb 100644 --- a/packages/node_modules/@node-red/nodes/core/core/20-inject.html +++ b/packages/node_modules/@node-red/nodes/core/common/20-inject.html @@ -156,7 +156,7 @@