@gregoriusrippenstein/node-red-contrib-introspection 0.9.14 → 0.9.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  <script type="text/javascript">
2
- RED.nodes.registerType("Seeker",{color:"#e5e4ef",icon:"font-awesome/fa-ship",category:"introspection",paletteLabel:"Seeker",defaults:{name:{value:""}},inputs:0,outputs:1,label:function(){return this.name||this._def.paletteLabel},labelStyle:function(){return this.name?"node_label_italic":""},oneditprepare:function(){var n=this,o=(window._introSpectionSeekerStack=[],window._introWorker=void 0,$("#node-input-seeker-target-filter").searchBox({style:"compact",delay:300,change:function(){let t=$(this).val().trim().toLowerCase();var e,n=$("#node-input-seeker-target-container-div").treeList("data");""===t?($("#node-input-seeker-target-container-div").treeList("filter",null),o.searchBox("count","")):(e=$("#node-input-seeker-target-container-div").treeList("filter",function(e){return-1<e._label.toLowerCase().indexOf(t)||-1<e.node.type.toLowerCase().indexOf(t)||e.sublabel.toLowerCase().indexOf(t)}),o.searchBox("count",e+" / "+n.length))}}));$("#node-input-seeker-target-container-div").css({width:"100%",height:"95%"}).treeList({multi:!1}).on("treelistitemmouseover",function(e,t){}).on("treelistitemmouseout",function(e,t){}).on("treelistconfirm",function(e,t){t.node&&!t.children&&(RED.view.reveal(t.node.id),RED.view.select(t.node.id),setTimeout(()=>{RED.editor.edit(t.node)},100))}).on("treelistselect",function(e,t){t.node&&!t.children&&(RED.workspaces.show(t.node.z,!1,!1,!0),RED.view.reveal(t.node.id,!0),RED.view.redraw())});let i=e=>{var t=RED.nodes.node(e[e.length-1]);let n=[];return e.forEach(function(e){var t,e=RED.nodes.node(e)||RED.nodes.junction(e);void 0!==e&&(t=RED.nodes.workspace(e.z)||RED.nodes.subflow(e.z),n.push({label:"",_label:RED.utils.getNodeLabel(e),node:e,sublabel:t&&RED.utils.getNodeLabel(t)||e.z,icon:RED.utils.createNodeIcon(e,!0),class:"intro-remove-top-left"}))}),{node:t,label:RED.utils.getNodeLabel(t),_label:RED.utils.getNodeLabel(t),_pathlen:e.length,sublabel:"Length: "+e.length,selected:!1,checkbox:!1,children:n}};var r=function(t,n){if(n.indexOf(t.id)<0&&!t.d)switch(t.type){case"link call":RED.nodes.getNodeLinks(t).forEach(e=>{r(e.target,[...n,t.id])}),t.links.forEach(e=>{e=RED.nodes.node(e);e&&r(e,[...n,t.id])});break;case"link out":t.links.forEach(e=>{e=RED.nodes.node(e);e&&r(e,[...n,t.id])});break;case"Sink":n.push(t.id),window._introSpectionSeekerStack=[n,...window._introSpectionSeekerStack];break;default:RED.nodes.getNodeLinks(t).forEach(e=>{r(e.target,[...n,t.id])})}};let l=e=>{e&&e.preventDefault();let t=window._introSpectionSeekerStack.length,n=25,o=("-"!=$("#node-input-seeker-show-percent").val()&&(n=parseInt(t*(parseInt($("#node-input-seeker-show-percent").val())/100))),{1:(e,t)=>e.length<t.length?-1:1,2:(e,t)=>e.length>t.length?-1:1,3:(e,t)=>RED.utils.getNodeLabel(RED.nodes.node(e[e.length-1]))<RED.utils.getNodeLabel(RED.nodes.node(t[t.length-1]))?-1:1,4:(e,t)=>{e=RED.utils.getNodeLabel(RED.nodes.node(e[e.length-1]));return RED.utils.getNodeLabel(RED.nodes.node(t[t.length-1]))<e?-1:1},5:(e,t)=>.5<Math.random()?-1:1}[parseInt($("#node-input-seeker-show-ordering").val())]||((e,t)=>e.length<t.length?-1:1));setTimeout(()=>{$("#node-input-seeker-totalPaths").html(n>t?""+t:n+" / "+t),$("#node-input-seeker-target-container-div").treeList("data",window._introSpectionSeekerStack.sort(o).slice(0,n).map(e=>i(e)))},300)},d=()=>{let e=window._introSpectionSeekerStack.length;setTimeout(()=>{$("#node-input-seeker-start-but").prop("disabled",!1),$("#node-input-seeker-totalPaths").html(e),$("#node-input-seeker-spinner").hide()},10),$("#node-input-seeker-show-percent").show(),$("#node-input-seeker-show-ordering").show();var t,n=$("#node-input-seeker-show-percent"),o=(n.html(""),["-",5,10,20,30,40,50,75,100].forEach(function(e){n.append($("<option></option>").val(e).html(100==e?"All":"-"==e?"Show..":e+"%"))}),n.val("-"),(n=$("#node-input-seeker-show-ordering")).html(""),{"Count Asc":1,"Count Desc":2,"Name Asc":3,"Name Desc":4,Random:5});for(t in o)n.append($("<option></option>").val(o[t]).html(t));n.val(1),$("#node-input-seeker-show-ordering").on("change",l),$("#node-input-seeker-show-percent").on("change",l),$("#node-input-seeker-show-percent").trigger("change")};$("#node-input-seeker-show-pathway-but").on("click",e=>{var t=$("#node-input-seeker-target-container-div").treeList("data").filter(e=>e.expanded);1==t.length?(t=t[0].children.filter(e=>e.node.z==RED.workspaces.active()).map(e=>e.node.id),RED.tray.hide(),RED.view.selectNodes({selected:t,onselect:()=>{RED.tray.show()},oncancel:()=>{RED.tray.show()}})):RED.notify("Only one expanded pathway can be shown.",{type:"warning"})}),$("#node-input-seeker-start-but").on("click",e=>{if(e&&e.preventDefault(),setTimeout(()=>{$("#node-input-seeker-start-but").prop("disabled",!0),$("#node-input-seeker-totalPaths").html(""),$("#node-input-seeker-spinner").show(),$("#node-input-seeker-show-percent").hide(),$("#node-input-seeker-show-ordering").hide()},10),window._introSpectionSeekerStack=[],"undefined"!=typeof Worker){let t=new Worker("data:text/javascript;base64,bGV0IGludHJvU3BlY3Rpb25TdGFjaz1bXSxncmFwaD1bXSxncmFwaEluZGV4PXt9LFJFRD17bm9kZXM6e25vZGU6ZT0+Z3JhcGhbZ3JhcGhJbmRleFtlXV0sZ2V0Tm9kZUxpbmtzOmE9PmEuZmxhdHdpcmVzLm1hcChlPT4oe3RhcmdldDpSRUQubm9kZXMubm9kZShlKSxzb3VyY2U6YX0pKX19LHRyYXZlcnNlPWZ1bmN0aW9uKGEscyl7aWYocy5pbmRleE9mKGEuaWQpPDAmJiFhLmQpc3dpdGNoKGEudHlwZSl7Y2FzZSJsaW5rIGNhbGwiOlJFRC5ub2Rlcy5nZXROb2RlTGlua3MoYSkuZm9yRWFjaChlPT57dHJhdmVyc2UoZS50YXJnZXQsWy4uLnMsYS5pZF0pfSksYS5saW5rcy5mb3JFYWNoKGU9PntlPVJFRC5ub2Rlcy5ub2RlKGUpO2UmJnRyYXZlcnNlKGUsWy4uLnMsYS5pZF0pfSk7YnJlYWs7Y2FzZSJsaW5rIG91dCI6YS5saW5rcy5mb3JFYWNoKGU9PntlPVJFRC5ub2Rlcy5ub2RlKGUpO2UmJnRyYXZlcnNlKGUsWy4uLnMsYS5pZF0pfSk7YnJlYWs7Y2FzZSJTaW5rIjpzLnB1c2goYS5pZCkscG9zdE1lc3NhZ2Uocyk7YnJlYWs7ZGVmYXVsdDpSRUQubm9kZXMuZ2V0Tm9kZUxpbmtzKGEpLmZvckVhY2goZT0+e3RyYXZlcnNlKGUudGFyZ2V0LFsuLi5zLGEuaWRdKX0pfX07b25tZXNzYWdlPWZ1bmN0aW9uKGUpe2xldCBhPWUuZGF0YS5zZWVrZXJJZDsoZ3JhcGg9ZS5kYXRhLm5vZGVzLm1hcChlPT4oe3dpcmVzOmUud2lyZXMsbGlua3M6ZS5saW5rcyxkOmUuZGlzYWJsZWR8fGUuZCxpZDplLmlkLHR5cGU6ZS50eXBlfSkpLmZpbHRlcihlPT4hIWUud2lyZXMpLm1hcChlPT4oZS5mbGF0d2lyZXM9ZS53aXJlcy5mbGF0KCksZSkpKS5mb3JFYWNoKChlLGEpPT5ncmFwaEluZGV4W2UuaWRdPWEpLFJFRC5ub2Rlcy5nZXROb2RlTGlua3MoUkVELm5vZGVzLm5vZGUoYSkpLmZvckVhY2goZT0+e3RyYXZlcnNlKGUudGFyZ2V0LFthXSl9KSxwb3N0TWVzc2FnZSgiZG9uZSIpfTs=");(window._introWorker=t).onmessage=function(e){"done"==e.data?(t.terminate(),delete window._introWorker,d()):(window._introSpectionSeekerStack.push(e.data),$("#node-input-seeker-totalPaths").html(window._introSpectionSeekerStack.length),26==window._introSpectionSeekerStack.length&&$("#node-input-seeker-target-container-div").treeList("data",window._introSpectionSeekerStack.sort((e,t)=>e.length<t.length?-1:1).slice(0,25).map(e=>i(e))))},setTimeout(()=>{t.postMessage({seekerId:n.id,nodes:RED.nodes.createCompleteNodeSet({credentials:!1})})},10)}else setTimeout(()=>{RED.nodes.getNodeLinks(n).forEach(e=>{r(e.target,[n.id])}),d()},300)})},oneditsave:function(){window._introWorker&&(window._introWorker.terminate(),delete window._introWorker),delete window._introSpectionSeekerStack},oneditcancel:function(){window._introWorker&&(window._introWorker.terminate(),delete window._introWorker),delete window._introSpectionSeekerStack},oneditresize:function(e){for(var t=$("#dialog-form>div:not(.node-input-target-list-row)"),n=$("#dialog-form").height(),o=0;o<t.length;o++)n-=$(t[o]).outerHeight(!0);$("#dialog-form>div.node-input-target-list-row").css("height",n+"px")}});
2
+ RED.nodes.registerType("Seeker",{color:"#e5e4ef",icon:"font-awesome/fa-ship",category:"introspection",paletteLabel:"Seeker",defaults:{name:{value:""}},inputs:0,outputs:1,label:function(){return this.name||this._def.paletteLabel},labelStyle:function(){return this.name?"node_label_italic":""},oneditprepare:function(){var n=this;window._introSpectionSeekerStack=[],window._introWorker=void 0;let i=e=>{var t=RED.nodes.node(e[e.length-1]);let n=[];return e.forEach(function(e){var t,e=RED.nodes.node(e)||RED.nodes.junction(e);void 0!==e&&(t=RED.nodes.workspace(e.z)||RED.nodes.subflow(e.z),n.push({label:"",_label:RED.utils.getNodeLabel(e),node:e,sublabel:t&&RED.utils.getNodeLabel(t)||e.z,icon:RED.utils.createNodeIcon(e,!0),class:"intro-remove-top-left"}))}),{node:t,label:RED.utils.getNodeLabel(t),_label:RED.utils.getNodeLabel(t),_pathlen:e.length,sublabel:"Length: "+e.length,selected:!1,checkbox:!1,children:n}};var o=$("#node-input-seeker-target-filter").searchBox({style:"compact",delay:300,change:function(){let t=$(this).val().trim().toLowerCase();var e,n=$("#node-input-seeker-target-container-div").treeList("data");""===t?($("#node-input-seeker-target-container-div").treeList("filter",null),o.searchBox("count","")):(e=$("#node-input-seeker-target-container-div").treeList("filter",function(e){return-1<e._label.toLowerCase().indexOf(t)||-1<e.node.type.toLowerCase().indexOf(t)||e.sublabel.toLowerCase().indexOf(t)}),o.searchBox("count",e+" / "+n.length))}}),r=((e=>{let n=`#node-input-${e}-target-container-div`,o=`#node-input-${e}-extract-pathway-but`,i=`#node-input-${e}-show-pathway-but`;$(n).css({width:"100%",height:"95%"}).treeList({multi:!1}).on("treelistitemmouseover",function(e,t){}).on("treelistitemmouseout",function(e,t){}).on("treelistconfirm",function(e,t){t.node&&!t.children&&(RED.view.reveal(t.node.id),RED.view.select(t.node.id),setTimeout(()=>{RED.editor.edit(t.node)},100))}).on("treelistselect",function(e,t){t.node&&!t.children&&(RED.workspaces.show(t.node.z,!1,!1,!0),RED.view.reveal(t.node.id,!0),RED.view.redraw()),1==$(n).treeList("data").filter(e=>e.expanded).length?($(o).prop("disabled",!1),$(i).prop("disabled",!1)):($(o).prop("disabled",!0),$(i).prop("disabled",!0))})})("seeker"),function(t,n){if(n.indexOf(t.id)<0&&!t.d)switch(t.type){case"link call":RED.nodes.getNodeLinks(t).forEach(e=>{r(e.target,[...n,t.id])}),t.links.forEach(e=>{e=RED.nodes.node(e);e&&r(e,[...n,t.id])});break;case"link out":t.links.forEach(e=>{e=RED.nodes.node(e);e&&r(e,[...n,t.id])});break;case"Sink":n.push(t.id),window._introSpectionSeekerStack=[n,...window._introSpectionSeekerStack];break;default:RED.nodes.getNodeLinks(t).forEach(e=>{r(e.target,[...n,t.id])})}});let a=e=>{e&&e.preventDefault();let t=window._introSpectionSeekerStack.length,n=25,o=("-"!=$("#node-input-seeker-show-percent").val()&&(n=parseInt(t*(parseInt($("#node-input-seeker-show-percent").val())/100))),e=$("#node-input-seeker-show-ordering").val(),{1:(e,t)=>e.length<t.length?-1:1,2:(e,t)=>e.length>t.length?-1:1,3:(e,t)=>RED.utils.getNodeLabel(RED.nodes.node(e[e.length-1]))<RED.utils.getNodeLabel(RED.nodes.node(t[t.length-1]))?-1:1,4:(e,t)=>{e=RED.utils.getNodeLabel(RED.nodes.node(e[e.length-1]));return RED.utils.getNodeLabel(RED.nodes.node(t[t.length-1]))<e?-1:1},5:(e,t)=>.5<Math.random()?-1:1}[parseInt(e)]||((e,t)=>e.length<t.length?-1:1));setTimeout(()=>{setTimeout(()=>{$("#node-input-seeker-totalPaths").html(n>t?""+t:n+" / "+t)},10),setTimeout(()=>{$("#node-input-seeker-target-container-div").treeList("data",window._introSpectionSeekerStack.sort(o).slice(0,n).map(e=>i(e)))},20)},100)},d=()=>{let e=window._introSpectionSeekerStack.length;setTimeout(()=>{$("#node-input-seeker-start-but").prop("disabled",!1),$("#node-input-seeker-totalPaths").html(e),$("#node-input-seeker-spinner").hide()},10);var t="seeker",n=e;$(`#node-input-${t}-show-percent`).show(),$(`#node-input-${t}-show-ordering`).show();var o,i=$(`#node-input-${t}-show-percent`),r=(i.html(""),i.append($("<option></option>").val("-").html("Show..")),[5,10,20,30,40,50,75].forEach(e=>{var t=parseInt(e*n/100);0!=t&&i.append($("<option></option>").val(e).html(t+" paths"))}),i.append($("<option></option>").val(100).html("All")),i.val("-"),(i=$(`#node-input-${t}-show-ordering`)).html(""),{"Count Asc":1,"Count Desc":2,"Name Asc":3,"Name Desc":4,Random:5});for(o in r)i.append($("<option></option>").val(r[o]).html(o));i.val(1),$("#node-input-seeker-show-ordering").on("change",a),$("#node-input-seeker-show-percent").on("change",a),$("#node-input-seeker-show-percent").trigger("change")};$("#node-input-seeker-show-pathway-but").on("click",e=>{e&&e.preventDefault();var e=$("#node-input-seeker-target-container-div").treeList("data").filter(e=>e.expanded);1==(e=e).length?(e=e[0].children.filter(e=>e.node.z==RED.workspaces.active()).map(e=>e.node.id),RED.tray.hide(),RED.view.selectNodes({selected:e,onselect:()=>{RED.tray.show()},oncancel:()=>{RED.tray.show()}})):RED.notify("Only one expanded pathway can be shown.",{type:"warning"})}),$("#node-input-seeker-extract-pathway-but").on("click",e=>{e&&e.preventDefault(),(e=>{if(1==e.length){e=e[0].children.map(e=>e.node).filter(e=>"link in"!=e.type&&"link out"!=e.type&&"Seeker"!=e.type&&"Sink"!=e.type&&"junction"!=e.type);let n=RED.nodes.createExportableNodeSet(e);n=n.map((e,t)=>(delete e.z,e.y=50*t,e.x=0,t!=n.length-1?e.wires=[[n[t+1].id]]:e.wires=[[]],e)),RED.clipboard.copyText(JSON.stringify(n))&&RED.notify("Pathway copied to clipboard",{type:"success"})}else RED.notify("Only one expanded pathway can be extracted.",{type:"warning"})})($("#node-input-seeker-target-container-div").treeList("data").filter(e=>e.expanded))}),$("#node-input-seeker-start-but").on("click",e=>{if(e&&e.preventDefault(),setTimeout(()=>{$("#node-input-seeker-start-but").prop("disabled",!0),$("#node-input-seeker-totalPaths").html(""),$("#node-input-seeker-spinner").show(),$("#node-input-seeker-show-percent").hide(),$("#node-input-seeker-show-ordering").hide()},10),window._introSpectionSeekerStack=[],"undefined"!=typeof Worker){let t=new Worker("data:text/javascript;base64,bGV0IGludHJvU3BlY3Rpb25TdGFjaz1bXSxncmFwaD1bXSxncmFwaEluZGV4PXt9LFJFRD17bm9kZXM6e25vZGU6ZT0+Z3JhcGhbZ3JhcGhJbmRleFtlXV0sZ2V0Tm9kZUxpbmtzOmE9PmEuZmxhdHdpcmVzLm1hcChlPT4oe3RhcmdldDpSRUQubm9kZXMubm9kZShlKSxzb3VyY2U6YX0pKX19LHRyYXZlcnNlPWZ1bmN0aW9uKGEscyl7aWYocy5pbmRleE9mKGEuaWQpPDAmJiFhLmQpc3dpdGNoKGEudHlwZSl7Y2FzZSJsaW5rIGNhbGwiOlJFRC5ub2Rlcy5nZXROb2RlTGlua3MoYSkuZm9yRWFjaChlPT57dHJhdmVyc2UoZS50YXJnZXQsWy4uLnMsYS5pZF0pfSksYS5saW5rcy5mb3JFYWNoKGU9PntlPVJFRC5ub2Rlcy5ub2RlKGUpO2UmJnRyYXZlcnNlKGUsWy4uLnMsYS5pZF0pfSk7YnJlYWs7Y2FzZSJsaW5rIG91dCI6YS5saW5rcy5mb3JFYWNoKGU9PntlPVJFRC5ub2Rlcy5ub2RlKGUpO2UmJnRyYXZlcnNlKGUsWy4uLnMsYS5pZF0pfSk7YnJlYWs7Y2FzZSJTaW5rIjpzLnB1c2goYS5pZCkscG9zdE1lc3NhZ2Uocyk7YnJlYWs7ZGVmYXVsdDpSRUQubm9kZXMuZ2V0Tm9kZUxpbmtzKGEpLmZvckVhY2goZT0+e3RyYXZlcnNlKGUudGFyZ2V0LFsuLi5zLGEuaWRdKX0pfX07b25tZXNzYWdlPWZ1bmN0aW9uKGUpe2xldCBhPWUuZGF0YS5zZWVrZXJJZDsoZ3JhcGg9ZS5kYXRhLm5vZGVzLm1hcChlPT4oe3dpcmVzOmUud2lyZXMsbGlua3M6ZS5saW5rcyxkOmUuZGlzYWJsZWR8fGUuZCxpZDplLmlkLHR5cGU6ZS50eXBlfSkpLmZpbHRlcihlPT4hIWUud2lyZXMpLm1hcChlPT4oZS5mbGF0d2lyZXM9ZS53aXJlcy5mbGF0KCksZSkpKS5mb3JFYWNoKChlLGEpPT5ncmFwaEluZGV4W2UuaWRdPWEpLFJFRC5ub2Rlcy5nZXROb2RlTGlua3MoUkVELm5vZGVzLm5vZGUoYSkpLmZvckVhY2goZT0+e3RyYXZlcnNlKGUudGFyZ2V0LFthXSl9KSxwb3N0TWVzc2FnZSgiZG9uZSIpfTs=");(window._introWorker=t).onmessage=function(e){"done"==e.data?(t.terminate(),delete window._introWorker,d()):(window._introSpectionSeekerStack.push(e.data),$("#node-input-seeker-totalPaths").html(window._introSpectionSeekerStack.length),26==window._introSpectionSeekerStack.length&&$("#node-input-seeker-target-container-div").treeList("data",window._introSpectionSeekerStack.sort((e,t)=>e.length<t.length?-1:1).slice(0,25).map(e=>i(e))))},setTimeout(()=>{t.postMessage({seekerId:n.id,nodes:RED.nodes.createCompleteNodeSet({credentials:!1})})},10)}else setTimeout(()=>{RED.nodes.getNodeLinks(n).forEach(e=>{r(e.target,[n.id])}),d()},300)})},oneditsave:function(){window._introWorker&&(window._introWorker.terminate(),delete window._introWorker),delete window._introSpectionSeekerStack},oneditcancel:function(){window._introWorker&&(window._introWorker.terminate(),delete window._introWorker),delete window._introSpectionSeekerStack},oneditresize:function(e){for(var t=$("#dialog-form>div:not(.node-input-target-list-row)"),n=$("#dialog-form").height(),o=0;o<t.length;o++)n-=$(t[o]).outerHeight(!0);$("#dialog-form>div.node-input-target-list-row").css("height",n+"px")}});
3
3
  </script>
4
4
 
5
5
  <script type="text/html" data-template-name="Seeker">
@@ -26,6 +26,7 @@ RED.nodes.registerType("Seeker",{color:"#e5e4ef",icon:"font-awesome/fa-ship",cat
26
26
  <label>Total Paths:
27
27
  <span id="node-input-seeker-totalPaths"></span><img class='hide' id="node-input-seeker-spinner" src='red/images/spin.svg'/>
28
28
  </label>
29
+ <button id="node-input-seeker-extract-pathway-but" style="float: right" class="red-ui-button">Extract Pathway to Clipboard</button>
29
30
  </div>
30
31
 
31
32
  </script>
@@ -1,5 +1,5 @@
1
1
  <script type="text/javascript">
2
- RED.nodes.registerType("Sink",{color:"#e5e4ef",icon:"font-awesome/fa-anchor",category:"introspection",paletteLabel:"Sink",defaults:{name:{value:""}},inputs:1,outputs:0,label:function(){return this.name||this._def.paletteLabel},labelStyle:function(){return this.name?"node_label_italic":""},oneditprepare:function(){var t=this;let o=1;window._introSpectionsinkStack=[],window._introWorker=void 0;var i=$("#node-input-sink-target-filter").searchBox({style:"compact",delay:300,change:function(){let n=$(this).val().trim().toLowerCase();var e,t=$("#node-input-sink-target-container-div").treeList("data");""===n?($("#node-input-sink-target-container-div").treeList("filter",null),i.searchBox("count","")):(e=$("#node-input-sink-target-container-div").treeList("filter",function(e){return-1<e._label.toLowerCase().indexOf(n)||-1<e.node.type.toLowerCase().indexOf(n)||e.sublabel.toLowerCase().indexOf(n)}),i.searchBox("count",e+" / "+t.length))}});$("#node-input-sink-target-container-div").css({width:"100%",height:"95%"}).treeList({multi:!1}).on("treelistitemmouseover",function(e,n){}).on("treelistitemmouseout",function(e,n){}).on("treelistconfirm",function(e,n){n.node&&!n.children&&(RED.view.reveal(n.node.id),RED.view.select(n.node.id),setTimeout(()=>{RED.editor.edit(n.node)},100))}).on("treelistselect",function(e,n){n.node&&!n.children&&(RED.workspaces.show(n.node.z,!1,!1,!0),RED.view.reveal(n.node.id,!0),RED.view.redraw())});let l=e=>{var n=RED.nodes.node(e[e.length-1]);let t=[];return e.forEach(function(e){var n,e=RED.nodes.node(e)||RED.nodes.junction(e);void 0!==e&&(n=RED.nodes.workspace(e.z)||RED.nodes.subflow(e.z),t.push({label:"",_label:RED.utils.getNodeLabel(e),node:e,sublabel:n&&RED.utils.getNodeLabel(n)||e.z,icon:RED.utils.createNodeIcon(e,!0),class:"intro-remove-top-left"}))}),{node:n,label:RED.utils.getNodeLabel(n),_label:RED.utils.getNodeLabel(n),_pathlen:e.length,sublabel:"Length: "+e.length,selected:!1,checkbox:!1,children:t}};var s=function(n,t){if(t.indexOf(n.id)<0&&!n.d)switch(n.type){case"link in":n.links.forEach(e=>{e=RED.nodes.node(e);e&&s(e,[...t,n.id])});break;case"Seeker":t.push(n.id),window._introSpectionsinkStack=[t,...window._introSpectionsinkStack];break;default:RED.nodes.getNodeLinks(n,o).forEach(e=>{s(e.source,[...t,n.id])})}};let a=e=>{e&&e.preventDefault();let n=window._introSpectionsinkStack.length,t=25,o=("-"!=$("#node-input-sink-show-percent").val()&&(t=parseInt(n*(parseInt($("#node-input-sink-show-percent").val())/100))),{1:(e,n)=>e.length<n.length?-1:1,2:(e,n)=>e.length>n.length?-1:1,3:(e,n)=>RED.utils.getNodeLabel(RED.nodes.node(e[e.length-1]))<RED.utils.getNodeLabel(RED.nodes.node(n[n.length-1]))?-1:1,4:(e,n)=>{e=RED.utils.getNodeLabel(RED.nodes.node(e[e.length-1]));return RED.utils.getNodeLabel(RED.nodes.node(n[n.length-1]))<e?-1:1},5:(e,n)=>.5<Math.random()?-1:1}[parseInt($("#node-input-sink-show-ordering").val())]||((e,n)=>e.length<n.length?-1:1));setTimeout(()=>{$("#node-input-sink-totalPaths").html(t>n?""+n:t+" / "+n),$("#node-input-sink-target-container-div").treeList("data",window._introSpectionsinkStack.sort(o).slice(0,t).map(e=>l(e)))},300)},d=()=>{let e=window._introSpectionsinkStack.length;setTimeout(()=>{$("#node-input-sink-start-but").prop("disabled",!1),$("#node-input-sink-totalPaths").html(e),$("#node-input-sink-spinner").hide()},10),$("#node-input-sink-show-percent").show(),$("#node-input-sink-show-ordering").show();var n,t=$("#node-input-sink-show-percent"),o=(t.html(""),["-",5,10,20,30,40,50,75,100].forEach(function(e){t.append($("<option></option>").val(e).html(100==e?"All":"-"==e?"Show..":e+"%"))}),t.val("-"),(t=$("#node-input-sink-show-ordering")).html(""),{"Count Asc":1,"Count Desc":2,"Name Asc":3,"Name Desc":4,Random:5});for(n in o)t.append($("<option></option>").val(o[n]).html(n));t.val(1),$("#node-input-sink-show-ordering").on("change",a),$("#node-input-sink-show-percent").on("change",a),$("#node-input-sink-show-percent").trigger("change")};$("#node-input-sink-show-pathway-but").on("click",e=>{var n=$("#node-input-sink-target-container-div").treeList("data").filter(e=>e.expanded);1==n.length?(n=n[0].children.filter(e=>e.node.z==RED.workspaces.active()).map(e=>e.node.id),RED.tray.hide(),RED.view.selectNodes({selected:n,onselect:()=>{RED.tray.show()},oncancel:()=>{RED.tray.show()}})):RED.notify("Only one expanded pathway can be shown.",{type:"warning"})}),$("#node-input-sink-start-but").on("click",e=>{if(e&&e.preventDefault(),setTimeout(()=>{$("#node-input-sink-start-but").prop("disabled",!0),$("#node-input-sink-totalPaths").html(""),$("#node-input-sink-spinner").show(),$("#node-input-sink-show-percent").hide(),$("#node-input-sink-show-ordering").hide()},10),window._introSpectionsinkStack=[],"undefined"!=typeof Worker){let n=new Worker("data:text/javascript;base64,bGV0IGludHJvU3BlY3Rpb25TdGFjaz1bXSxncmFwaD1bXSxncmFwaEluZGV4PXt9LFJFRD17bm9kZXM6e25vZGU6ZT0+Z3JhcGhbZ3JhcGhJbmRleFtlXV0sZ2V0Tm9kZUxpbmtzOnM9PnMuaW53aXJlcy5tYXAoZT0+KHt0YXJnZXQ6cyxzb3VyY2U6UkVELm5vZGVzLm5vZGUoZSl9KSl9fTt2YXIgdHJhdmVyc2U9ZnVuY3Rpb24ocyxhKXtpZihhLmluZGV4T2Yocy5pZCk8MCYmIXMuZClzd2l0Y2gocy50eXBlKXtjYXNlImxpbmsgaW4iOnMubGlua3MuZm9yRWFjaChlPT57ZT1SRUQubm9kZXMubm9kZShlKTtlJiZ0cmF2ZXJzZShlLFsuLi5hLHMuaWRdKX0pO2JyZWFrO2Nhc2UiU2Vla2VyIjphLnB1c2gocy5pZCkscG9zdE1lc3NhZ2UoYSk7YnJlYWs7ZGVmYXVsdDpSRUQubm9kZXMuZ2V0Tm9kZUxpbmtzKHMpLmZvckVhY2goZT0+e3RyYXZlcnNlKGUuc291cmNlLFsuLi5hLHMuaWRdKX0pfX07b25tZXNzYWdlPWZ1bmN0aW9uKGUpe2xldCBzPWUuZGF0YS5zaW5rSWQ7KGdyYXBoPShncmFwaD1lLmRhdGEubm9kZXMubWFwKGU9Pih7d2lyZXM6ZS53aXJlcyxsaW5rczplLmxpbmtzLGQ6ZS5kaXNhYmxlZHx8ZS5kLGlkOmUuaWQsdHlwZTplLnR5cGV9KSkuZmlsdGVyKGU9PiEhZS53aXJlcykubWFwKGU9PihlLmZsYXR3aXJlcz1lLndpcmVzLmZsYXQoKSxlKSkpLm1hcChzPT4ocy5pbndpcmVzPWdyYXBoLmZpbHRlcihlPT4tMTxlLmZsYXR3aXJlcy5pbmRleE9mKHMuaWQpKS5tYXAoZT0+ZS5pZCkscykpKS5mb3JFYWNoKChlLHMpPT5ncmFwaEluZGV4W2UuaWRdPXMpLFJFRC5ub2Rlcy5nZXROb2RlTGlua3MoUkVELm5vZGVzLm5vZGUocykpLmZvckVhY2goZT0+e3RyYXZlcnNlKGUuc291cmNlLFtzXSl9KSxwb3N0TWVzc2FnZSgiZG9uZSIpfTs=");(window._introWorker=n).onmessage=function(e){"done"==e.data?(n.terminate(),delete window._introWorker,d()):(window._introSpectionsinkStack.push(e.data),$("#node-input-sink-totalPaths").html(window._introSpectionsinkStack.length),26==window._introSpectionsinkStack.length&&$("#node-input-sink-target-container-div").treeList("data",window._introSpectionsinkStack.sort((e,n)=>e.length<n.length?-1:1).slice(0,25).map(e=>l(e))))},setTimeout(()=>{n.postMessage({sinkId:t.id,nodes:RED.nodes.createCompleteNodeSet({credentials:!1})})},10)}else setTimeout(()=>{RED.nodes.getNodeLinks(t,o).forEach(e=>{s(e.source,[t.id])}),d()},300)})},oneditsave:function(){window._introWorker&&(window._introWorker.terminate(),delete window._introWorker),delete window._introSpectionsinkStack},oneditcancel:function(){window._introWorker&&(window._introWorker.terminate(),delete window._introWorker),delete window._introSpectionsinkStack},oneditresize:function(e){for(var n=$("#dialog-form>div:not(.node-input-target-list-row)"),t=$("#dialog-form").height(),o=0;o<n.length;o++)t-=$(n[o]).outerHeight(!0);$("#dialog-form>div.node-input-target-list-row").css("height",t+"px")}});
2
+ RED.nodes.registerType("Sink",{color:"#e5e4ef",icon:"font-awesome/fa-anchor",category:"introspection",paletteLabel:"Sink",defaults:{name:{value:""}},inputs:1,outputs:0,label:function(){return this.name||this._def.paletteLabel},labelStyle:function(){return this.name?"node_label_italic":""},oneditprepare:function(){var n=this;let o=1,i=(window._introSpectionsinkStack=[],window._introWorker=void 0,e=>{var t=RED.nodes.node(e[e.length-1]);let n=[];return e.forEach(function(e){var t,e=RED.nodes.node(e)||RED.nodes.junction(e);void 0!==e&&(t=RED.nodes.workspace(e.z)||RED.nodes.subflow(e.z),n.push({label:"",_label:RED.utils.getNodeLabel(e),node:e,sublabel:t&&RED.utils.getNodeLabel(t)||e.z,icon:RED.utils.createNodeIcon(e,!0),class:"intro-remove-top-left"}))}),{node:t,label:RED.utils.getNodeLabel(t),_label:RED.utils.getNodeLabel(t),_pathlen:e.length,sublabel:"Length: "+e.length,selected:!1,checkbox:!1,children:n}});var a=$("#node-input-sink-target-filter").searchBox({style:"compact",delay:300,change:function(){let t=$(this).val().trim().toLowerCase();var e,n=$("#node-input-sink-target-container-div").treeList("data");""===t?($("#node-input-sink-target-container-div").treeList("filter",null),a.searchBox("count","")):(e=$("#node-input-sink-target-container-div").treeList("filter",function(e){return-1<e._label.toLowerCase().indexOf(t)||-1<e.node.type.toLowerCase().indexOf(t)||e.sublabel.toLowerCase().indexOf(t)}),a.searchBox("count",e+" / "+n.length))}}),d=((e=>{let n=`#node-input-${e}-target-container-div`,o=`#node-input-${e}-extract-pathway-but`,i=`#node-input-${e}-show-pathway-but`;$(n).css({width:"100%",height:"95%"}).treeList({multi:!1}).on("treelistitemmouseover",function(e,t){}).on("treelistitemmouseout",function(e,t){}).on("treelistconfirm",function(e,t){t.node&&!t.children&&(RED.view.reveal(t.node.id),RED.view.select(t.node.id),setTimeout(()=>{RED.editor.edit(t.node)},100))}).on("treelistselect",function(e,t){t.node&&!t.children&&(RED.workspaces.show(t.node.z,!1,!1,!0),RED.view.reveal(t.node.id,!0),RED.view.redraw()),1==$(n).treeList("data").filter(e=>e.expanded).length?($(o).prop("disabled",!1),$(i).prop("disabled",!1)):($(o).prop("disabled",!0),$(i).prop("disabled",!0))})})("sink"),function(t,n){if(n.indexOf(t.id)<0&&!t.d)switch(t.type){case"link in":t.links.forEach(e=>{e=RED.nodes.node(e);e&&d(e,[...n,t.id])});break;case"Seeker":n.push(t.id),window._introSpectionsinkStack=[n,...window._introSpectionsinkStack];break;default:RED.nodes.getNodeLinks(t,o).forEach(e=>{d(e.source,[...n,t.id])})}});let l=e=>{e&&e.preventDefault();let t=window._introSpectionsinkStack.length,n=25,o=("-"!=$("#node-input-sink-show-percent").val()&&(n=parseInt(t*(parseInt($("#node-input-sink-show-percent").val())/100))),e=$("#node-input-sink-show-ordering").val(),{1:(e,t)=>e.length<t.length?-1:1,2:(e,t)=>e.length>t.length?-1:1,3:(e,t)=>RED.utils.getNodeLabel(RED.nodes.node(e[e.length-1]))<RED.utils.getNodeLabel(RED.nodes.node(t[t.length-1]))?-1:1,4:(e,t)=>{e=RED.utils.getNodeLabel(RED.nodes.node(e[e.length-1]));return RED.utils.getNodeLabel(RED.nodes.node(t[t.length-1]))<e?-1:1},5:(e,t)=>.5<Math.random()?-1:1}[parseInt(e)]||((e,t)=>e.length<t.length?-1:1));setTimeout(()=>{setTimeout(()=>{$("#node-input-sink-totalPaths").html(n>t?""+t:n+" / "+t)},10),setTimeout(()=>{$("#node-input-sink-target-container-div").treeList("data",window._introSpectionsinkStack.sort(o).slice(0,n).map(e=>i(e)))},20)},100)},s=()=>{let e=window._introSpectionsinkStack.length;setTimeout(()=>{$("#node-input-sink-start-but").prop("disabled",!1),$("#node-input-sink-totalPaths").html(e),$("#node-input-sink-spinner").hide()},10);var t="sink",n=e;$(`#node-input-${t}-show-percent`).show(),$(`#node-input-${t}-show-ordering`).show();var o,i=$(`#node-input-${t}-show-percent`),a=(i.html(""),i.append($("<option></option>").val("-").html("Show..")),[5,10,20,30,40,50,75].forEach(e=>{var t=parseInt(e*n/100);0!=t&&i.append($("<option></option>").val(e).html(t+" paths"))}),i.append($("<option></option>").val(100).html("All")),i.val("-"),(i=$(`#node-input-${t}-show-ordering`)).html(""),{"Count Asc":1,"Count Desc":2,"Name Asc":3,"Name Desc":4,Random:5});for(o in a)i.append($("<option></option>").val(a[o]).html(o));i.val(1),$("#node-input-sink-show-ordering").on("change",l),$("#node-input-sink-show-percent").on("change",l),$("#node-input-sink-show-percent").trigger("change")};$("#node-input-sink-show-pathway-but").on("click",e=>{e&&e.preventDefault();var e=$("#node-input-sink-target-container-div").treeList("data").filter(e=>e.expanded);1==(e=e).length?(e=e[0].children.filter(e=>e.node.z==RED.workspaces.active()).map(e=>e.node.id),RED.tray.hide(),RED.view.selectNodes({selected:e,onselect:()=>{RED.tray.show()},oncancel:()=>{RED.tray.show()}})):RED.notify("Only one expanded pathway can be shown.",{type:"warning"})}),$("#node-input-sink-extract-pathway-but").on("click",e=>{e&&e.preventDefault(),(e=>{if(1==e.length){e=e[0].children.map(e=>e.node).filter(e=>"link in"!=e.type&&"link out"!=e.type&&"Seeker"!=e.type&&"Sink"!=e.type&&"junction"!=e.type);let n=RED.nodes.createExportableNodeSet(e);n=n.map((e,t)=>(delete e.z,e.y=50*t,e.x=0,t!=n.length-1?e.wires=[[n[t+1].id]]:e.wires=[[]],e)),RED.clipboard.copyText(JSON.stringify(n))&&RED.notify("Pathway copied to clipboard",{type:"success"})}else RED.notify("Only one expanded pathway can be extracted.",{type:"warning"})})($("#node-input-sink-target-container-div").treeList("data").filter(e=>e.expanded))}),$("#node-input-sink-start-but").on("click",e=>{if(e&&e.preventDefault(),setTimeout(()=>{$("#node-input-sink-start-but").prop("disabled",!0),$("#node-input-sink-totalPaths").html(""),$("#node-input-sink-spinner").show(),$("#node-input-sink-show-percent").hide(),$("#node-input-sink-show-ordering").hide()},10),window._introSpectionsinkStack=[],"undefined"!=typeof Worker){let t=new Worker("data:text/javascript;base64,bGV0IGludHJvU3BlY3Rpb25TdGFjaz1bXSxncmFwaD1bXSxncmFwaEluZGV4PXt9LFJFRD17bm9kZXM6e25vZGU6ZT0+Z3JhcGhbZ3JhcGhJbmRleFtlXV0sZ2V0Tm9kZUxpbmtzOnM9PnMuaW53aXJlcy5tYXAoZT0+KHt0YXJnZXQ6cyxzb3VyY2U6UkVELm5vZGVzLm5vZGUoZSl9KSl9fTt2YXIgdHJhdmVyc2U9ZnVuY3Rpb24ocyxhKXtpZihhLmluZGV4T2Yocy5pZCk8MCYmIXMuZClzd2l0Y2gocy50eXBlKXtjYXNlImxpbmsgaW4iOnMubGlua3MuZm9yRWFjaChlPT57ZT1SRUQubm9kZXMubm9kZShlKTtlJiZ0cmF2ZXJzZShlLFsuLi5hLHMuaWRdKX0pO2JyZWFrO2Nhc2UiU2Vla2VyIjphLnB1c2gocy5pZCkscG9zdE1lc3NhZ2UoYSk7YnJlYWs7ZGVmYXVsdDpSRUQubm9kZXMuZ2V0Tm9kZUxpbmtzKHMpLmZvckVhY2goZT0+e3RyYXZlcnNlKGUuc291cmNlLFsuLi5hLHMuaWRdKX0pfX07b25tZXNzYWdlPWZ1bmN0aW9uKGUpe2xldCBzPWUuZGF0YS5zaW5rSWQ7KGdyYXBoPShncmFwaD1lLmRhdGEubm9kZXMubWFwKGU9Pih7d2lyZXM6ZS53aXJlcyxsaW5rczplLmxpbmtzLGQ6ZS5kaXNhYmxlZHx8ZS5kLGlkOmUuaWQsdHlwZTplLnR5cGV9KSkuZmlsdGVyKGU9PiEhZS53aXJlcykubWFwKGU9PihlLmZsYXR3aXJlcz1lLndpcmVzLmZsYXQoKSxlKSkpLm1hcChzPT4ocy5pbndpcmVzPWdyYXBoLmZpbHRlcihlPT4tMTxlLmZsYXR3aXJlcy5pbmRleE9mKHMuaWQpKS5tYXAoZT0+ZS5pZCkscykpKS5mb3JFYWNoKChlLHMpPT5ncmFwaEluZGV4W2UuaWRdPXMpLFJFRC5ub2Rlcy5nZXROb2RlTGlua3MoUkVELm5vZGVzLm5vZGUocykpLmZvckVhY2goZT0+e3RyYXZlcnNlKGUuc291cmNlLFtzXSl9KSxwb3N0TWVzc2FnZSgiZG9uZSIpfTs=");(window._introWorker=t).onmessage=function(e){"done"==e.data?(t.terminate(),delete window._introWorker,s()):(window._introSpectionsinkStack.push(e.data),$("#node-input-sink-totalPaths").html(window._introSpectionsinkStack.length),26==window._introSpectionsinkStack.length&&$("#node-input-sink-target-container-div").treeList("data",window._introSpectionsinkStack.sort((e,t)=>e.length<t.length?-1:1).slice(0,25).map(e=>i(e))))},setTimeout(()=>{t.postMessage({sinkId:n.id,nodes:RED.nodes.createCompleteNodeSet({credentials:!1})})},10)}else setTimeout(()=>{RED.nodes.getNodeLinks(n,o).forEach(e=>{d(e.source,[n.id])}),s()},300)})},oneditsave:function(){window._introWorker&&(window._introWorker.terminate(),delete window._introWorker),delete window._introSpectionsinkStack},oneditcancel:function(){window._introWorker&&(window._introWorker.terminate(),delete window._introWorker),delete window._introSpectionsinkStack},oneditresize:function(e){for(var t=$("#dialog-form>div:not(.node-input-target-list-row)"),n=$("#dialog-form").height(),o=0;o<t.length;o++)n-=$(t[o]).outerHeight(!0);$("#dialog-form>div.node-input-target-list-row").css("height",n+"px")}});
3
3
  </script>
4
4
 
5
5
  <script type="text/html" data-template-name="Sink">
@@ -24,7 +24,8 @@ RED.nodes.registerType("Sink",{color:"#e5e4ef",icon:"font-awesome/fa-anchor",cat
24
24
  <div class="form-row" style="margin-top: -40px;">
25
25
  <label>Total Paths:
26
26
  <span id="node-input-sink-totalPaths"></span><img id="node-input-sink-spinner" class="hide" src='red/images/spin.svg'/>
27
- </label>
27
+ </label>
28
+ <button id="node-input-sink-extract-pathway-but" class="red-ui-button" style="float: right">Extract Pathway to Clipboard</button>
28
29
  </div>
29
30
  </script>
30
31
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gregoriusrippenstein/node-red-contrib-introspection",
3
- "version": "0.9.14",
3
+ "version": "0.9.16",
4
4
  "dependencies": {
5
5
  "got": "^13",
6
6
  "uglify-js": "^3.17.4",
@@ -8,7 +8,7 @@
8
8
 
9
9
  function nr_intro_generate_svg_4_0(r,t){return e=>{try{handleSvgObject($($("#red-ui-workspace-chart").find("svg")[0]),e,t)}catch(t){var n="Error Generating SVG: "+JSON.stringify(t);r.notify(n,{type:"error"}),e('<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg width="1000" height="1000" viewBox="0 0 1000 1000" pointer-events="all" style="cursor: crosshair; touch-action: none;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style>.small { font: bold 20px sans-serif; fill: red;}</style><text x="10" y="30" class="small">'+n+"</text></svg>")}}}function nr_intro_generate_svg_3_1(r,t){return e=>{try{handleSvgObject($($("#red-ui-workspace-chart").find("svg")[0]),e,t)}catch(t){var n="Error Generating SVG: "+JSON.stringify(t);r.notify(n,{type:"error"}),e('<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg width="1000" height="1000" viewBox="0 0 1000 1000" pointer-events="all" style="cursor: crosshair; touch-action: none;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style>.small { font: bold 20px sans-serif; fill: red;}</style><text x="10" y="30" class="small">'+n+"</text></svg>")}}}function nr_intro_generate_svg_3_0(r,t){return e=>{try{handleSvgObject($($("svg")[0]),e,t)}catch(t){var n="Error Generating SVG: "+JSON.stringify(t);r.notify(n,{type:"error"}),e('<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg width="1000" height="1000" viewBox="0 0 1000 1000" pointer-events="all" style="cursor: crosshair; touch-action: none;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style>.small { font: bold 20px sans-serif; fill: red;}</style><text x="10" y="30" class="small">'+n+"</text></svg>")}}}function handleSvgObject(a,e,t){var n=a.clone(),r=(n.find("foreignObject").remove(),n.find("svg.__screenshot").remove(),'width="'+a.attr("width")+'" height="'+a.attr("height")+'"'),s=RED.settings.version.split("."),i=parseInt(s[0]),s=parseInt(s[1]);if(3<=i&&1<=s){var o=$($($(a).children("g")[0]).children("g")[0]).children("g"),l={x:8e3,y:8e3,w:-1,h:-1};for(let t=1;t<o.length;t++){var g=o[t].getBBox();0==g.width&&0==g.height||(l.x=Math.min(g.x,l.x),l.y=Math.min(g.y,l.y),l.w=Math.max(g.width,l.w),l.h=Math.max(g.height,l.h))}r+=` viewBox='${l.x} ${l.y} ${l.w} ${l.h}'`}function c(t,e){for(var n=0;n<t.length;n++){var s=t.item(n),i=e[n];["stroke-width","fill-opacity","stroke-opacity","opacity","stroke-dasharray"].forEach(function(t){s.setAttribute(t,$(i).attr(t)||$(i).css(t))}),["fill","stroke"].forEach(function(t){var e,n,r=(e=$(i).attr(t)||$(i).css(t))&&null!==e&&"none"!=e?(n=e.match(/^#(.)(.)(.)$/))?"#"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]:(n=e.match(/^#......$/))?e:null===(n=e.match(/^rgb\(([0-9]+),\s+([0-9]+),\s+([0-9]+)/))?(r=e.match(/^rgba\(([0-9]+),\s+([0-9]+),\s+([0-9]+),\s+([0-9]+)/))?{clr:"#"+("0"+parseInt(r[1],10).toString(16)).slice(-2)+("0"+parseInt(r[2],10).toString(16)).slice(-2)+("0"+parseInt(r[3],10).toString(16)).slice(-2),opa:r[4]}:(console.log("Screenshot node: returned unknown color: "+e),e):"#"+("0"+parseInt(n[1],10).toString(16)).slice(-2)+("0"+parseInt(n[2],10).toString(16)).slice(-2)+("0"+parseInt(n[3],10).toString(16)).slice(-2):"none";"object"==typeof r?(s.setAttribute(t+"-opacity",r.opa),s.setAttribute(t,r.clr)):s.setAttribute(t,r)}),$(i).hasClass("hide")&&("g"==s.tagName&&s.setAttribute("opacity","0"),s.setAttribute("visibility","hidden"))}}var i='<?xml version="1.0" standalone="no"?>\r\n<svg '+r+' pointer-events="all" style="cursor: crosshair; touch-action: none;" xmlns="http://www.w3.org/2000/svg" class="__screenshot" xmlns:xlink="http://www.w3.org/1999/xlink">\r\n',s=n.html(),h=(new DOMParser).parseFromString(i+s+"\r\n</svg>","image/svg+xml"),v=t=>t,f=(t.rmidsandclasses&&(v=e=>(["g","rect","line","path","circle","image","text"].forEach(t=>{$(e.getElementsByTagName(t)).each((t,e)=>{e.setAttribute("class",""),e.setAttribute("id","")})}),e)),["g","rect","line","path","circle","image"].forEach(function(t){c(h.getElementsByTagName(t),a.find(t))}),["text"].forEach(function(t){c(h.getElementsByTagName(t),a.find(t));for(var e=h.getElementsByTagName(t),n=a.find(t),r=0;r<e.length;r++){var s=e.item(r),i=n[r];["font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","text-anchor","dominant-baseline"].forEach(function(t){s.setAttribute(t,$(i).attr(t)||$(i).css(t))})}}),h.getElementsByTagName("image")),w={},m=(n,r,s)=>{var i=n.getAttribute("xlink:href")||n.getAttribute("href"),a=i.substr(-4,4).toLowerCase(),o={".jpg":"jpeg",jpeg:"jpeg",".png":"png",".svg":"svg+xml"};if(w[i])return n.setAttribute("xlink:href","data:image/"+o[a]+";base64,"+w[i]),s(r-1);switch(a){case".jpg":case"jpeg":case".png":var l=new XMLHttpRequest;l.open("GET",i,!0),l.responseType="arraybuffer";l.onload=function(t){var e=l.response;e&&(e=(t=>{for(var e="",n=new Uint8Array(t),r=n.byteLength,s=0;s<r;s++)e+=String.fromCharCode(n[s]);return window.btoa(e)})(e),w[i]=e,n.setAttribute("xlink:href","data:image/"+o[a]+";base64,"+e)),s(r-1)},l.send(null);break;case".svg":$.get(i,function(t){var e=new XMLSerializer,e=btoa(e.serializeToString(t));w[i]=e,n.setAttribute("xlink:href","data:image/svg+xml;base64,"+e),s(r-1)})}},d=t=>{t<0?e((new XMLSerializer).serializeToString(v(h))):m(f.item(t),t,d)};0<f.length?m(f.item(f.length-1),f.length-1,d):e((new XMLSerializer).serializeToString(v(h)))}function generatorFunctionForVersion(t,e){var n,r=t.settings.version.split("."),s=r[0],r=r[1];if("3"==s){if("0"==r)return nr_intro_generate_svg_3_0(t,e);if("1"==r)return nr_intro_generate_svg_3_1(t,e)}return"4"==s&&"0"==r?nr_intro_generate_svg_4_0(t,e):(n=t,t=>{var e="Node-RED version ("+n.settings.version+") not supported";n.notify(e,{type:"error"}),t&&t('<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg width="1000" height="1000" viewBox="0 0 1000 1000" pointer-events="all" style="cursor: crosshair; touch-action: none;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style>.small { font: bold 20px sans-serif; fill: red;}</style><text x="10" y="30" class="small">'+e+"</text></svg>")})}function addPanZoom(){var t=d3.select("#node-input-screenshot-svgcontainer svg"),e=(t.html("<g>"+t.html()+"</g>"),setTimeout(()=>{var t=$("#node-input-screenshot-svgcontainer svg"),e=$(t).attr("viewBox").split(" ");t.animate({height:parseInt(e[3]),width:parseInt(e[2])},800,"swing")},100),t.select("g")),n=d3.behavior.zoom().scaleExtent([.1,200]).on("zoom",function(t){e.attr({transform:"translate("+n.translate()+") scale("+n.scale()+")"})});t.call(n)}
10
10
 
11
- function setupTreelistInfoness(){var e=collectUndocumentedNodes();if(0==e.length){RED.notify("All nodes documented",{type:"success",timeout:2e3});try{$("#node-input-orphan-target-container-div").treeList("empty")}catch(e){}}else{try{$("#node-input-orphan-target-container-div").treeList("empty")}catch(e){$("#node-input-orphan-target-container-div").css({width:"100%",height:"calc(100%)"}).treeList({multi:!1}).on("treelistitemmouseover",function(e,t){}).on("treelistitemmouseout",function(e,t){}).on("treelistselect",function(e,t){t.node&&(RED.workspaces.show(t.node.z,!1,!1,!0),RED.view.reveal(t.node.id,!0),RED.view.redraw())}).on("treelistconfirm",function(e,t){var i;t.node&&(i=t.node.id,setTimeout(()=>{var e=RED.nodes.node(i);e&&(RED.view.reveal(e.id),RED.view.select(e.id),RED.editor.edit(e,"editor-tab-description")),i==RED.workspaces.active()&&RED.workspaces.edit()},50))}),$("#node-input-orphan-target-filter").show();var i=$("#node-input-orphan-target-filter").searchBox({style:"compact",delay:300,change:function(){var e,t=$(this).val().trim().toLowerCase();""===t?($("#node-input-orphan-target-container-div").treeList("filter",null),i.searchBox("count","")):(e=$("#node-input-orphan-target-container-div").treeList("filter",function(e){return-1<e.label.toLowerCase().indexOf(t)||-1<e.node.type.toLowerCase().indexOf(t)}),i.searchBox("count",e+" / "+$("#node-input-orphan-target-container-div").treeList("data").length))}})}$("#node-input-orphan-target-container-div").treeList("data",e.sort((e,t)=>e.node.z>t.node.z))}}function collectUndocumentedNodes(){let t=[];RED.nodes.eachNode(e=>{if($("#"+e.id).find(".red-ui-info-available-indicator").remove(),e.info&&e.info.trim()){var i=document.createElementNS("http://www.w3.org/2000/svg","g"),n=(i.setAttribute("class","red-ui-info-available-indicator"),document.createElementNS("http://www.w3.org/2000/svg","circle"));n.setAttribute("cx","5"),n.setAttribute("cy","5"),n.setAttribute("r","5"),n.setAttribute("fill","yellow"),n.setAttribute("id","infoclk-"+e.id),n.setAttribute("style","cursor: pointer;"),i.append(n),$(i).insertBefore($("#"+e.id).find(".red-ui-flow-node-changed"));let t=e.id;$("#infoclk-"+e.id).on("click",e=>{e&&e.preventDefault();e=RED.nodes.node(t);RED.editor.edit(e,"editor-tab-description"),RED.sidebar.show("info")})}else e.z==RED.workspaces.active()&&t.push(e)});var o=[],r={};return t.forEach(function(e){var t=RED.nodes.getType(e.type);if(t){var i,n=t.label,n=("function"==typeof n?n.call(e):n)||"";if(0===(i=e.type).indexOf("subflow:"))return}t&&n||(n=e.type),r[e.id]={node:e,label:n,sublabel:i,selected:!1,checkbox:!1},o.push(r[e.id])}),o}
11
+ function setupTreelistInfoness(){var e=collectUndocumentedNodes();if(0==e.length){RED.notify("All nodes documented",{type:"success",timeout:2e3});try{$("#node-input-orphan-target-container-div").treeList("empty")}catch(e){}}else{try{$("#node-input-orphan-target-container-div").treeList("empty")}catch(e){$("#node-input-orphan-target-container-div").css({width:"100%",height:"calc(100%)"}).treeList({multi:!1}).on("treelistitemmouseover",function(e,t){}).on("treelistitemmouseout",function(e,t){}).on("treelistselect",function(e,t){t.node&&(RED.workspaces.show(t.node.z,!1,!1,!0),RED.view.reveal(t.node.id,!0),RED.view.redraw())}).on("treelistconfirm",function(e,t){var i;t.node&&(i=t.node.id,setTimeout(()=>{var e=RED.nodes.node(i);e&&(RED.view.reveal(e.id),RED.view.select(e.id),RED.editor.edit(e,"editor-tab-description")),i==RED.workspaces.active()&&RED.workspaces.edit()},50))}),$("#node-input-orphan-target-filter").show();var i=$("#node-input-orphan-target-filter").searchBox({style:"compact",delay:300,change:function(){var e,t=$(this).val().trim().toLowerCase();""===t?($("#node-input-orphan-target-container-div").treeList("filter",null),i.searchBox("count","")):(e=$("#node-input-orphan-target-container-div").treeList("filter",function(e){return-1<e.label.toLowerCase().indexOf(t)||-1<e.node.type.toLowerCase().indexOf(t)}),i.searchBox("count",e+" / "+$("#node-input-orphan-target-container-div").treeList("data").length))}})}$("#node-input-orphan-target-container-div").treeList("data",e.sort((e,t)=>e.node.z>t.node.z))}}function collectUndocumentedNodes(){let t=[];RED.nodes.eachNode(e=>{if($("#"+e.id).find(".red-ui-info-available-indicator").remove(),e.info&&e.info.trim()&&$("#"+e.id)[0]){var i=document.createElementNS("http://www.w3.org/2000/svg","g"),n=(i.setAttribute("class","red-ui-info-available-indicator"),i.setAttribute("transform","translate(20,10)"),i.setAttribute("id","infoclk-"+e.id),document.createElementNS("http://www.w3.org/2000/svg","g")),o=(n.setAttribute("class","tip"),n.setAttribute("fill","lightyellow"),document.createElementNS("http://www.w3.org/2000/svg","rect")),o=(o.setAttribute("width","30"),o.setAttribute("height","20"),o.setAttribute("x",$("#"+e.id)[0].getBBox().width-60),o.setAttribute("y","-15"),o.setAttribute("rx","2"),o.setAttribute("style","cursor: pointer;"),n.append(o),document.createElementNS("http://www.w3.org/2000/svg","text"));o.setAttribute("x",$("#"+e.id)[0].getBBox().width-55),o.setAttribute("y","-6"),o.appendChild(document.createTextNode("docs")),n.append(o),i.append(n),$(i).insertBefore($("#"+e.id).find(".red-ui-flow-node"));let t=e.id;$("#infoclk-"+e.id).on("click",e=>{e&&e.preventDefault();e=RED.nodes.node(t);RED.editor.edit(e,"editor-tab-description"),RED.sidebar.show("info")})}else e.z==RED.workspaces.active()&&["link in","link out","link call"].indexOf(e.type)<0&&t.push(e)});var o=[],r={};return t.forEach(function(e){var t=RED.nodes.getType(e.type);if(t){var i,n=t.label,n=("function"==typeof n?n.call(e):n)||"";if(0===(i=e.type).indexOf("subflow:"))return}t&&n||(n=e.type),r[e.id]={node:e,label:n,sublabel:i,selected:!1,checkbox:!1},o.push(r[e.id])}),o}
12
12
 
13
13
  function highlightAllLinkCalls(){let e=[];RED.nodes.eachNode(t=>{t.z==RED.workspaces.active()&&"link call"==t.type&&e.push(t)}),e.forEach(t=>{$("#grplnkcallclk-"+t.id).remove();var e=document.createElementNS("http://www.w3.org/2000/svg","g"),l=(e.setAttribute("class","red-ui-linkcall-link-indicator"),e.setAttribute("transform","translate(12,0)"),e.setAttribute("id","grplnkcallclk-"+t.id),document.createElementNS("http://www.w3.org/2000/svg","circle")),i=(l.setAttribute("cx","5"),l.setAttribute("cy","5"),l.setAttribute("r","5"),l.setAttribute("id","lnkcallclk-"+t.id),l.setAttribute("style","cursor: pointer;"),t.links[0]);i?RED.nodes.node(i)?l.setAttribute("fill","green"):l.setAttribute("fill","red"):l.setAttribute("fill","orange"),e.append(l),$(e).insertBefore($("#"+t.id).find(".red-ui-flow-node-changed"));let r=t.id;$("#lnkcallclk-"+t.id).on("click",t=>{t&&t.preventDefault();t=RED.nodes.node(r);if(t){let l=t.links[0];1<t.links.length&&RED.notify("Multiple links, showing first","warning"),RED.nodes.node(l)?(RED.view.reveal(l),RED.view.select(l),setTimeout(()=>{$("#lnkcallclk-"+l).remove();var t=document.createElementNS("http://www.w3.org/2000/svg","g"),e=(t.setAttribute("class","red-ui-linkcall-link-indicator"),t.setAttribute("transform","translate(12,0)"),t.setAttribute("id","lnkcallclk-"+l),document.createElementNS("http://www.w3.org/2000/svg","circle"));e.setAttribute("cx","5"),e.setAttribute("cy","5"),e.setAttribute("r","5"),e.setAttribute("id","lnkcallclk-"+l),e.setAttribute("style","cursor: pointer;"),e.setAttribute("fill","green"),t.append(e),$(t).insertBefore($("#"+l).find(".red-ui-flow-node-changed")),$("#lnkcallclk-"+l).on("click",t=>{t&&t.preventDefault(),RED.view.reveal(r),RED.view.select(r),setTimeout(highlightAllLinkCalls,500)})},500)):RED.notify("Link in node not found","error")}else RED.notify("Node not found","error")})})}
14
14
 
@@ -240,6 +240,7 @@
240
240
  $('#node-input-orphan-clear-workspace-btn').on('click', (e) => {
241
241
  if ( e ) { e.preventDefault() }
242
242
  $('.red-ui-linkcall-link-indicator').remove()
243
+ $('.red-ui-info-available-indicator').remove()
243
244
  })
244
245
 
245
246
  $('#node-input-msgtrace-clear-debug-btn').on('click', (e) => {
@@ -316,6 +317,34 @@
316
317
  position: relative;
317
318
  top: -4px;
318
319
  }
320
+
321
+ svg g.tip {
322
+ transition: transform 0.3s ease, fill-opacity 0.3s ease, stroke-opacity 0.3s ease;
323
+ fill-opacity: 0.3;
324
+ stroke-opacity: 0.3;
325
+ cursor: pointer;
326
+ }
327
+
328
+ svg g.tip text {
329
+ font-style="normal";
330
+ font-size: 8px;
331
+ font-family: sans-serif;
332
+ stroke-width: 0.0;
333
+ fill: #000;
334
+ color: #000;
335
+ }
336
+
337
+ svg .tip rect {
338
+ fill: lightyellow;
339
+ stroke-width: 0.5;
340
+ stroke: #000;
341
+ }
342
+
343
+ svg:hover g.tip:hover {
344
+ transform: translatey(-6px);
345
+ fill-opacity: 1;
346
+ stroke-opacity: 1;
347
+ }
319
348
  </style>
320
349
 
321
350
  <!-- The html for the right sidebar plugin screen -->