Move embedapi.html code which is not part of the API into embedapi-dom.js; demo export PDF in embedded editor; add new exportPDF method to canvas (and exposed to embedded editor) which can support JSON-able data URI string response, removing PDF exporting from rasterExport; JSLint; move dependency checking code for canvg and jsPDF to utilities; simplify Utils calls; allow for custom PDF export handler (but not yet implemented in server-based extensions); import PDF todo
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2860 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
|
||||
svgEditor.addExtension("server_opensave", {
|
||||
callback: function() {'use strict';
|
||||
|
||||
var Utils = svgedit.utilities;
|
||||
var save_svg_action = '/+modify';
|
||||
|
||||
// Create upload target (hidden iframe)
|
||||
@@ -25,18 +25,18 @@ svgEditor.addExtension("server_opensave", {
|
||||
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);
|
||||
var svg_data = Utils.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;
|
||||
svgEditor.buildCanvgCallback(function () {
|
||||
Utils.buildCanvgCallback(function () {
|
||||
canvg(c, svg, {renderCallback: function() {
|
||||
var datauri = c.toDataURL('image/png');
|
||||
// var uiStrings = svgEditor.uiStrings;
|
||||
var png_data = svgedit.utilities.encode64(datauri);
|
||||
var png_data = Utils.encode64(datauri);
|
||||
var form = $('<form>').attr({
|
||||
method: 'post',
|
||||
action: save_svg_action + '/' + name,
|
||||
|
||||
Reference in New Issue
Block a user