added postMessage listner which evals commands to enable a potential future embed API
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@663 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
4b00fad3d1
commit
d0101dbc84
|
@ -1141,4 +1141,15 @@ function svg_edit_setup() {
|
||||||
// This happens when the page is loaded
|
// This happens when the page is loaded
|
||||||
$(function() {
|
$(function() {
|
||||||
svgCanvas = svg_edit_setup();
|
svgCanvas = svg_edit_setup();
|
||||||
|
|
||||||
|
try{
|
||||||
|
window.addEventListener("message", function(e){
|
||||||
|
try{
|
||||||
|
e.source.postMessage(eval(e.data), e.origin);
|
||||||
|
}catch(err){
|
||||||
|
e.source.postMessage("error:"+err.message, e.origin);
|
||||||
|
}
|
||||||
|
}, false)
|
||||||
|
}catch(err){}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue