@gregoriusrippenstein/node-red-contrib-introspection 0.12.7 → 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.7",
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
 
@@ -65,6 +63,11 @@
65
63
  label: 'Obfuscation'
66
64
  });
67
65
 
66
+ // used to feature deactivate stuff
67
+ let isNodeRedFive = () => {
68
+ return RED.settings.version.split(".")[0] == "5"
69
+ }
70
+
68
71
  let callObfuscatieCurrentFlow = (copy_or_import) => {
69
72
  obfuscatieCurrentFlow({
70
73
  name: $('#node-input-obfuscate-name').is(":checked"),
@@ -323,8 +326,22 @@
323
326
  $('#node-input-orphan-target-container-div').parent().css('height', `calc(${topSze}px - 15vh)`)
324
327
  }
325
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);
326
342
  };
327
- RED.events.on('runtime-state', initialiseConfigNodeOnce);
343
+
344
+ RED.plugins.registerPlugin("intro-spection-sidebar-plugin", { onadd: setupSidebarForIntrospection });
328
345
  })();
329
346
  </script>
330
347
 
@@ -537,6 +554,8 @@
537
554
 
538
555
  <button id="node-input-msgtrace-clear-debug-btn" style="margin-left: 10px;"
539
556
  class="red-ui-button">Clear Debug</button>
557
+ <button id="node-input-msgtrace-pause-debug-btn" style="margin-left: 10px;"
558
+ class="red-ui-button">Pause Debug</button>
540
559
  </div>
541
560
  </div>
542
561
  </div>