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-75d572ba1ddd
master
Kevin Kwok 2009-09-18 20:22:02 +00:00
parent 4b00fad3d1
commit d0101dbc84
1 changed files with 11 additions and 0 deletions

View File

@ -1141,4 +1141,15 @@ function svg_edit_setup() {
// This happens when the page is loaded
$(function() {
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){}
});