Update to latet SVG-Edit API

This commit is contained in:
Jacques Distler 2010-03-12 03:50:23 -06:00
parent 7e7ae4c6f0
commit 9636cab11e
6 changed files with 866 additions and 721 deletions

View file

@ -83,28 +83,16 @@ function setupSVGedit(path){
SVGeditButton.disabled = true;
Event.observe(SVGeditButton, 'click', function(){
var editor = window.open(path, 'Edit SVG graphic', 'status=1,resizable=1,scrollbars=1');
if (selected) {
editor.addEventListener("load", function() {
editor.svgCanvas.setCustomHandlers({
'save': function(window,svg){
window.opener.postMessage(svg, window.location.protocol + '//' + window.location.host);
window.close();
}
});
editor.svgCanvas.randomizeIds();
editor.svgCanvas.setSvgString(selected);
}, true);
} else {
editor.addEventListener("load", function() {
editor.svgCanvas.setCustomHandlers({
'save': function(window,svg){
window.opener.postMessage(svg, window.location.protocol + '//' + window.location.host);
window.close();
}
});
editor.svgCanvas.randomizeIds();
}, true);
}
editor.addEventListener("load", function() {
editor.svgEditor.setCustomHandlers({
'save': function(window,svg){
window.opener.postMessage(svg, window.location.protocol + '//' + window.location.host);
window.close();
}
});
editor.svgEditor.randomizeIds();
if (selected) editor.svgEditor.loadFromString(selected);
}, true);
SVGeditButton.disabled = true;
SVGeditButton.value = 'Create SVG graphic';
editor.focus();