forked from node-red/node-red-ui-nodes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure socketid is passed if present.
- Loading branch information
Dave Conway-Jones
committed
Oct 30, 2020
1 parent
f2bb9cb
commit 8bbe241
Showing
6 changed files
with
44 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ function loadScripts(list, callback) { | |
script.onload = script.onreadystatechange = function() { | ||
if (!done) { | ||
if (!this.readyState || | ||
(this.readyState === "loaded") || | ||
(this.readyState === "loaded") || | ||
(this.readyState === "complete")) { | ||
done = true; | ||
loadScripts(list, callback); | ||
|
@@ -63,15 +63,15 @@ function loadScripts(list, callback) { | |
} | ||
function showVega(spec) { | ||
vegaEmbed('#${vid}', spec, | ||
vegaEmbed('#${vid}', spec, | ||
{ | ||
actions: false | ||
}); | ||
} | ||
loadScripts(["https://cdn.jsdelivr.net/npm/[email protected]", | ||
"https://cdn.jsdelivr.net/npm/[email protected]", | ||
"https://cdn.jsdelivr.net/npm/[email protected]"], | ||
loadScripts(["https://cdn.jsdelivr.net/npm/[email protected]", | ||
"https://cdn.jsdelivr.net/npm/[email protected]", | ||
"https://cdn.jsdelivr.net/npm/[email protected]"], | ||
function() { | ||
`+ | ||
"var vegaSpec = " +vegaSpec +";" + | ||
|
@@ -107,32 +107,32 @@ loadScripts(["https://cdn.jsdelivr.net/npm/[email protected]", | |
RED.nodes.createNode(this, config); | ||
var done = null; | ||
if (checkConfig(node, config)) { | ||
var html = HTML(config); | ||
done = ui.addWidget({ | ||
node: node, | ||
order: config.order, | ||
group: config.group, | ||
width: config.width, | ||
height: config.height, | ||
format: html, | ||
templateScope: "local", | ||
emitOnlyNewValues: false, | ||
forwardInputMessages: false, | ||
storeFrontEndInputAsState: true, | ||
convertBack: function (value) { | ||
return value; | ||
}, | ||
beforeEmit: function(msg, value) { | ||
return { msg: { payload: value } }; | ||
}, | ||
beforeSend: function (msg, orig) { | ||
if (orig) { | ||
return orig.msg; | ||
var html = HTML(config); | ||
done = ui.addWidget({ | ||
node: node, | ||
order: config.order, | ||
group: config.group, | ||
width: config.width, | ||
height: config.height, | ||
format: html, | ||
templateScope: "local", | ||
emitOnlyNewValues: false, | ||
forwardInputMessages: false, | ||
storeFrontEndInputAsState: true, | ||
convertBack: function (value) { | ||
return value; | ||
}, | ||
beforeEmit: function(msg, value) { | ||
return { msg: { payload:value, socketid:msg.socketid } }; | ||
}, | ||
beforeSend: function (msg, orig) { | ||
if (orig) { | ||
return orig.msg; | ||
} | ||
}, | ||
initController: function($scope, events) { | ||
} | ||
}, | ||
initController: function($scope, events) { | ||
} | ||
}); | ||
}); | ||
} | ||
} | ||
catch (e) { | ||
|