@gregoriusrippenstein/node-red-contrib-introspection 0.12.8 → 0.12.9

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gregoriusrippenstein/node-red-contrib-introspection",
3
- "version": "0.12.8",
3
+ "version": "0.12.9",
4
4
  "dependencies": {
5
5
  "got": "^13",
6
6
  "uglify-js": "^3.17.4",
@@ -19,9 +19,7 @@
19
19
  function transformInjectToChangeNode(t){t&&t.preventDefault();t=[...(RED.view.selection().nodes||[]).filter(e=>"inject"==e.type),...(RED.view.selection().nodes||[]).filter(e=>"group"==e.type).map(e=>e.nodes.filter(e=>"inject"==e.type))].flat();if(0==(t=RED.nodes.createExportableNodeSet(t)).length)RED.notify("No inject nodes found in node selection",{type:"warning"});else{let e=t.map(o=>{var e={id:RED.nodes.id(),type:"change",name:o.name,action:"",property:"",from:"",to:"",reg:!1,x:0,y:0,wires:[[]]};return e.rules=o.props.map(e=>{var t={t:"set",p:e.p,pt:"msg",to:e.v,tot:e.vt};return"payload"==e.p?(t.to=o.payload,t.tot=o.payloadType):"topic"==e.p&&(t.to=o.topic),t}),e});setTimeout(()=>{RED.clipboard.import(),setTimeout(()=>{$("#red-ui-clipboard-dialog-import-text").val(JSON.stringify(e)).trigger("paste")},300)},400)}}
20
20
 
21
21
  // Add your plugin as a new tabsheet in the right sidebar AFTER the flow editor is completely started
22
- var initialiseConfigNodeOnce = () => {
23
- RED.events.off('runtime-state', initialiseConfigNodeOnce);
24
-
22
+ var setupSidebarForIntrospection = () => {
25
23
  // The html content of the sidebar has been specified below as a data-template, from where it can be loaded:
26
24
  var content = $($('script[type="text/x-red"][data-template-name="Screenshot"]').i18n().html());
27
25
 
@@ -291,14 +289,6 @@
291
289
  msgTracerDebugOff()
292
290
  })
293
291
 
294
- // NR 5.x has a debug pausing feature that others don't. If so, then the convenience
295
- // button in the tracer is activated else hidden.
296
- if (isNodeRedFive()) {
297
- $('#node-input-msgtrace-pause-debug-btn').on('click', RED.debug.toggleDebugMessages)
298
- } else {
299
- $('#node-input-msgtrace-pause-debug-btn').hide()
300
- }
301
-
302
292
  RED.actions.add( "introspection:show-link-call-links", highlightAllLinkCalls)
303
293
 
304
294
  // event is triggered by the unittesting node package, has no affect otherwise.
@@ -336,8 +326,22 @@
336
326
  $('#node-input-orphan-target-container-div').parent().css('height', `calc(${topSze}px - 15vh)`)
337
327
  }
338
328
  })
329
+
330
+ // RED.debug isn't yet available
331
+ let fillInSiderBarForm = () => {
332
+ RED.events.off('flows:loaded', fillInSiderBarForm);
333
+ // NR 5.x has a debug pausing feature that others don't. If so, then the convenience
334
+ // button in the tracer is activated else hidden.
335
+ if (isNodeRedFive()) {
336
+ $('#node-input-msgtrace-pause-debug-btn').on('click', RED.debug.toggleDebugMessages)
337
+ } else {
338
+ $('#node-input-msgtrace-pause-debug-btn').hide()
339
+ }
340
+ }
341
+ RED.events.on('flows:loaded', fillInSiderBarForm);
339
342
  };
340
- RED.events.on('runtime-state', initialiseConfigNodeOnce);
343
+
344
+ RED.plugins.registerPlugin("intro-spection-sidebar-plugin", { onadd: setupSidebarForIntrospection });
341
345
  })();
342
346
  </script>
343
347