2016-06-20 22:35:20 +02:00
|
|
|
$(function() {
|
2020-07-07 22:14:44 +02:00
|
|
|
RED.i18n.init({apiRootUrl:"../../"},function() {
|
2017-05-12 23:22:47 +02:00
|
|
|
var options = {
|
|
|
|
messageMouseEnter: function(sourceId) {
|
|
|
|
window.opener.postMessage({event:"mouseEnter",id:sourceId},'*');
|
|
|
|
},
|
|
|
|
messageMouseLeave: function(sourceId) {
|
|
|
|
window.opener.postMessage({event:"mouseLeave",id:sourceId},'*');
|
|
|
|
},
|
2020-01-17 17:53:01 +01:00
|
|
|
messageSourceClick: function(sourceId, aliasId, path) {
|
|
|
|
window.opener.postMessage({event:"mouseClick",id:sourceId, _alias: aliasId, path: path},'*');
|
2017-05-12 23:22:47 +02:00
|
|
|
},
|
|
|
|
clear: function() {
|
|
|
|
window.opener.postMessage({event:"clear"},'*');
|
|
|
|
}
|
2016-10-27 09:48:32 +02:00
|
|
|
}
|
2016-06-21 00:08:37 +02:00
|
|
|
|
2021-10-12 17:50:33 +02:00
|
|
|
try {
|
|
|
|
var uiComponents = RED.debug.init(options);
|
|
|
|
$(".red-ui-debug-window").append(uiComponents.content);
|
2016-06-21 00:08:37 +02:00
|
|
|
|
2021-10-12 17:50:33 +02:00
|
|
|
window.addEventListener('message',function(evt) {
|
|
|
|
if (evt.data.event === "message") {
|
|
|
|
RED.debug.handleDebugMessage(evt.data.msg);
|
|
|
|
} else if (evt.data.event === "workspaceChange") {
|
|
|
|
RED.debug.refreshMessageList(evt.data.activeWorkspace);
|
|
|
|
} else if (evt.data.event === "projectChange") {
|
|
|
|
RED.debug.clearMessageList(true);
|
|
|
|
}
|
|
|
|
},false);
|
|
|
|
} catch(err) {
|
|
|
|
console.error(err)
|
|
|
|
}
|
2016-06-21 00:08:37 +02:00
|
|
|
|
2017-05-12 23:22:47 +02:00
|
|
|
})
|
2016-06-20 22:35:20 +02:00
|
|
|
});
|