main
Mark MacKay 2021-05-27 16:27:43 -05:00
parent 59eba184bf
commit 1f99479ea6
3 changed files with 12 additions and 20 deletions

View File

@ -898,7 +898,6 @@ window.methodDraw = function() {
};
var clickSave = function(){
console.log("hi")
flash($('#file_menu'));
svgCanvas.save();
};

View File

@ -50,7 +50,7 @@ var svgWhiteList_ = {
"circle": ["class", "clip-path", "clip-rule", "cx", "cy", "fill", "fill-opacity", "fill-rule", "filter", "id", "mask", "opacity", "r", "requiredFeatures", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "style", "systemLanguage", "transform"],
"clipPath": ["class", "clipPathUnits", "id"],
"defs": [],
"style" : ["type"],
"style" : ["type"],
"desc": [],
"ellipse": ["class", "clip-path", "clip-rule", "cx", "cy", "fill", "fill-opacity", "fill-rule", "filter", "id", "mask", "opacity", "requiredFeatures", "rx", "ry", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "style", "systemLanguage", "transform"],
"feGaussianBlur": ["class", "color-interpolation-filters", "id", "requiredFeatures", "stdDeviation"],

View File

@ -5128,13 +5128,6 @@ this.svgCanvasToString = function() {
pathActions.clear(true);
// Keep SVG-Edit comment on top
$.each(svgcontent.childNodes, function(i, node) {
if(i && node.nodeType === 8 && node.data.indexOf('Created with') >= 0) {
svgcontent.insertBefore(node, svgcontent.firstChild);
}
});
// Move out of in-group editing mode
if(current_group) {
leaveContext();
@ -5162,6 +5155,7 @@ this.svgCanvasToString = function() {
$(this).replaceWith(svg);
}
});
var output = this.svgToString(svgcontent, 0);
// Rewrap gsvg
@ -5202,17 +5196,6 @@ this.svgToString = function(elem, indent) {
var res = getResolution();
var vb = "";
// TODO: Allow this by dividing all values by current baseVal
// Note that this also means we should properly deal with this on import
// if(curConfig.baseUnit !== "px") {
// var unit = curConfig.baseUnit;
// var unit_m = svgedit.units.getTypeMap()[unit];
// res.w = svgedit.units.shortFloat(res.w / unit_m)
// res.h = svgedit.units.shortFloat(res.h / unit_m)
// vb = ' viewBox="' + [0, 0, res.w, res.h].join(' ') + '"';
// res.w += unit;
// res.h += unit;
// }
if(unit !== "px") {
res.w = svgedit.units.convertUnit(res.w, unit) + unit;
@ -5780,6 +5763,13 @@ var convertToGroup = this.convertToGroup = function(elem) {
}
}
this.styleToAttributes = function(doc) {
const docEl = doc.documentElement;
return doc;
}
//
// Function: setSvgString
// This function sets the current drawing as the input SVG XML.
@ -5797,6 +5787,9 @@ this.setSvgString = function(xmlString) {
var batchCmd = new BatchCommand("Change Source");
newDoc = this.styleToAttributes(newDoc);
// remove old svg document
var nextSibling = svgcontent.nextSibling;
var oldzoom = svgroot.removeChild(svgcontent);