Feature #4399 update svg-edit to r2051 (25 oct 2011)
parent
40c5200227
commit
a630724037
@ -0,0 +1,19 @@ |
||||
Copyright (c) 2009-2011 by SVG-edit authors (see AUTHORS file) |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
of this software and associated documentation files (the "Software"), to deal |
||||
in the Software without restriction, including without limitation the rights |
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
copies of the Software, and to permit persons to whom the Software is |
||||
furnished to do so, subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included in |
||||
all copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
||||
THE SOFTWARE. |
@ -0,0 +1,21 @@ |
||||
SVG-edit, a web based SVG editor |
||||
|
||||
http://code.google.com/p/svg-edit/ |
||||
|
||||
see AUTHORS file for authors |
||||
|
||||
----- |
||||
|
||||
SVG-edit contains code from these projects: |
||||
|
||||
jQuery JavaScript Library v1.3.2 |
||||
http://jquery.com/ |
||||
Copyright (c) 2009 John Resig |
||||
|
||||
jQuery js-Hotkeys |
||||
http://code.google.com/p/js-hotkeys/ |
||||
Copyright (c) 2008 Tzury Bar Yochay |
||||
|
||||
jPicker |
||||
http://www.digitalmagicpro.com/jPicker/ |
||||
Copyright (c) 2009 Christopher T. Tillman |
@ -0,0 +1,55 @@ |
||||
/* |
||||
* ext-server_moinsave.js |
||||
* |
||||
* Licensed under the Apache License, Version 2 |
||||
* |
||||
* Copyright(c) 2010 Alexis Deveria |
||||
* 2011 MoinMoin:ReimarBauer |
||||
* adopted for moinmoins item storage. it sends in one post png and svg data |
||||
* (I agree to dual license my work to additional GPLv2 or later) |
||||
* |
||||
*/ |
||||
|
||||
svgEditor.addExtension("server_opensave", { |
||||
callback: function() { |
||||
|
||||
var save_svg_action = '/+modify'; |
||||
|
||||
// Create upload target (hidden iframe)
|
||||
var target = $('<iframe name="output_frame" src="#"/>').hide().appendTo('body'); |
||||
|
||||
svgEditor.setCustomHandlers({ |
||||
save: function(win, data) { |
||||
var svg = "<?xml version=\"1.0\"?>\n" + data; |
||||
var qstr = $.param.querystring(); |
||||
var name = qstr.substr(9).split('/+get/')[1]; |
||||
var svg_data = svgedit.utilities.encode64(svg); |
||||
if(!$('#export_canvas').length) { |
||||
$('<canvas>', {id: 'export_canvas'}).hide().appendTo('body'); |
||||
} |
||||
var c = $('#export_canvas')[0]; |
||||
c.width = svgCanvas.contentW; |
||||
c.height = svgCanvas.contentH; |
||||
$.getScript('canvg/canvg.js', function() { |
||||
canvg(c, svg, {renderCallback: function() { |
||||
var datauri = c.toDataURL('image/png'); |
||||
var uiStrings = svgEditor.uiStrings; |
||||
var png_data = svgedit.utilities.encode64(datauri); |
||||
var form = $('<form>').attr({ |
||||
method: 'post', |
||||
action: save_svg_action + '/' + name, |
||||
target: 'output_frame' |
||||
}) .append('<input type="hidden" name="png_data" value="' + png_data + '">') |
||||
.append('<input type="hidden" name="filepath" value="' + svg_data + '">') |
||||
.append('<input type="hidden" name="filename" value="' + 'drawing.svg">') |
||||
.append('<input type="hidden" name="contenttype" value="application/x-svgdraw">') |
||||
.appendTo('body') |
||||
.submit().remove(); |
||||
}})}); |
||||
alert("Saved! Return to Item View!"); |
||||
top.window.location = '/'+name; |
||||
}, |
||||
}); |
||||
|
||||
} |
||||
}); |
Loading…
Reference in new issue