@gregoriusrippenstein/node-red-contrib-introspection 0.1.0 → 0.1.1
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.
|
Binary file
|
package/nodes/15-screenshot.html
CHANGED
|
@@ -249,14 +249,24 @@
|
|
|
249
249
|
if ( !window[functName] ) {
|
|
250
250
|
window[functName] = (e,m) => {
|
|
251
251
|
if ( m.msg == "timer-tripped" ) {
|
|
252
|
-
|
|
252
|
+
|
|
253
|
+
if ( m.notification != "off" ) {
|
|
254
|
+
RED.notify("Screenshot triggered", { type: "warning" });
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
var notification = m.notification;
|
|
253
258
|
nr_intro_generate_svg( (svgdata) => {
|
|
254
259
|
$.ajax({
|
|
255
260
|
type: "POST",
|
|
256
261
|
url: "/screenshot",
|
|
257
|
-
data: {
|
|
262
|
+
data: {
|
|
263
|
+
...m,
|
|
264
|
+
d: svgdata
|
|
265
|
+
},
|
|
258
266
|
complete: (data) => {
|
|
259
|
-
|
|
267
|
+
if ( notification != "off" ) {
|
|
268
|
+
RED.notify("Screenshot posted", { type: "success" });
|
|
269
|
+
}
|
|
260
270
|
},
|
|
261
271
|
dataType: "image/svg+xml;charset=utf-8"
|
|
262
272
|
});
|
package/nodes/15-screenshot.js
CHANGED
|
@@ -11,10 +11,11 @@ module.exports = function(RED) {
|
|
|
11
11
|
|
|
12
12
|
node.on("input", function(msg, send, done) {
|
|
13
13
|
RED.comms.publish("introspect:" + node.id, RED.util.encodeObject({
|
|
14
|
+
...msg,
|
|
14
15
|
msg: "timer-tripped",
|
|
15
16
|
}));
|
|
16
17
|
|
|
17
|
-
node.status({ fill: "green", shape: "dot", text:"Taking screenshot" });
|
|
18
|
+
node.status({ fill: "green", shape: "dot", text: "Taking screenshot" });
|
|
18
19
|
setTimeout( () => { node.status({}) }, 1432 );
|
|
19
20
|
|
|
20
21
|
send(msg);
|