Update to latet SVG-Edit API
This commit is contained in:
parent
7e7ae4c6f0
commit
9636cab11e
6 changed files with 866 additions and 721 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue