Add more whitelisted attributes for the <image> element. Add XLINK namespace to svg root.
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@581 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
4c8227ce99
commit
83df0e1403
|
@ -13,6 +13,7 @@ var svgWhiteList = {
|
||||||
"circle": ["cx", "cy", "fill", "fill-opacity", "id", "opacity", "r", "stroke", "stroke-dasharray", "stroke-opacity", "stroke-width", "transform"],
|
"circle": ["cx", "cy", "fill", "fill-opacity", "id", "opacity", "r", "stroke", "stroke-dasharray", "stroke-opacity", "stroke-width", "transform"],
|
||||||
"defs": [],
|
"defs": [],
|
||||||
"ellipse": ["cx", "cy", "fill", "fill-opacity", "id", "opacity", "rx", "ry", "stroke", "stroke-dasharray", "stroke-opacity", "stroke-width", "transform"],
|
"ellipse": ["cx", "cy", "fill", "fill-opacity", "id", "opacity", "rx", "ry", "stroke", "stroke-dasharray", "stroke-opacity", "stroke-width", "transform"],
|
||||||
|
"image": ["height", "id", "opacity", "width", "x", "xlink:href", "y"],
|
||||||
"line": ["fill", "fill-opacity", "id", "opacity", "stroke", "stroke-dasharray", "stroke-linecap", "stroke-opacity", "stroke-width", "transform", "x1", "x2", "y1", "y2"],
|
"line": ["fill", "fill-opacity", "id", "opacity", "stroke", "stroke-dasharray", "stroke-linecap", "stroke-opacity", "stroke-width", "transform", "x1", "x2", "y1", "y2"],
|
||||||
"linearGradient": ["id", "gradientTransform", "gradientUnits", "spreadMethod", "x1", "x2", "y1", "y2"],
|
"linearGradient": ["id", "gradientTransform", "gradientUnits", "spreadMethod", "x1", "x2", "y1", "y2"],
|
||||||
"path": ["d", "fill", "fill-opacity", "id", "opacity", "stroke", "stroke-dasharray", "stroke-linecap", "stroke-linejoin", "stroke-opacity", "stroke-width", "transform"],
|
"path": ["d", "fill", "fill-opacity", "id", "opacity", "stroke", "stroke-dasharray", "stroke-linecap", "stroke-linejoin", "stroke-opacity", "stroke-width", "transform"],
|
||||||
|
@ -21,8 +22,7 @@ var svgWhiteList = {
|
||||||
"radialGradient": ["id", "cx", "cy", "fx", "fy", "gradientTransform", "gradientUnits", "r", "spreadMethod"],
|
"radialGradient": ["id", "cx", "cy", "fx", "fy", "gradientTransform", "gradientUnits", "r", "spreadMethod"],
|
||||||
"rect": ["fill", "fill-opacity", "height", "id", "opacity", "rx", "ry", "stroke", "stroke-dasharray", "stroke-linecap", "stroke-linejoin", "stroke-opacity", "stroke-width", "transform", "width", "x", "y"],
|
"rect": ["fill", "fill-opacity", "height", "id", "opacity", "rx", "ry", "stroke", "stroke-dasharray", "stroke-linecap", "stroke-linejoin", "stroke-opacity", "stroke-width", "transform", "width", "x", "y"],
|
||||||
"stop": ["id", "offset", "stop-color", "stop-opacity"],
|
"stop": ["id", "offset", "stop-color", "stop-opacity"],
|
||||||
"svg": ["id", "height", "transform", "width", "xmlns"],
|
"svg": ["id", "height", "transform", "width", "xmlns", "xmlns:xlink"],
|
||||||
"image": ["id","width","height","opacity","x","y"],
|
|
||||||
"text": ["fill", "fill-opacity", "font-family", "font-size", "font-style", "font-weight", "id", "opacity", "stroke", "stroke-dasharray", "stroke-linecap", "stroke-linejoin", "stroke-opacity", "stroke-width", "transform", "text-anchor", "x", "y"],
|
"text": ["fill", "fill-opacity", "font-family", "font-size", "font-style", "font-weight", "id", "opacity", "stroke", "stroke-dasharray", "stroke-linecap", "stroke-linejoin", "stroke-opacity", "stroke-width", "transform", "text-anchor", "x", "y"],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -542,7 +542,7 @@ function BatchCommand(text) {
|
||||||
var canvas = this;
|
var canvas = this;
|
||||||
var container = c;
|
var container = c;
|
||||||
var svgns = "http://www.w3.org/2000/svg";
|
var svgns = "http://www.w3.org/2000/svg";
|
||||||
|
var xlinkns = "http://www.w3.org/1999/xlink";
|
||||||
var idprefix = "svg_";
|
var idprefix = "svg_";
|
||||||
var svgdoc = c.ownerDocument;
|
var svgdoc = c.ownerDocument;
|
||||||
var svgroot = svgdoc.createElementNS(svgns, "svg");
|
var svgroot = svgdoc.createElementNS(svgns, "svg");
|
||||||
|
@ -550,6 +550,8 @@ function BatchCommand(text) {
|
||||||
svgroot.setAttribute("height", 480);
|
svgroot.setAttribute("height", 480);
|
||||||
svgroot.setAttribute("id", "svgroot");
|
svgroot.setAttribute("id", "svgroot");
|
||||||
svgroot.setAttribute("xmlns", svgns);
|
svgroot.setAttribute("xmlns", svgns);
|
||||||
|
svgroot.setAttribute("xmlns:xlink", xlinkns);
|
||||||
|
|
||||||
container.appendChild(svgroot);
|
container.appendChild(svgroot);
|
||||||
var comment = svgdoc.createComment(" created with SVG-edit - http://svg-edit.googlecode.com/ ");
|
var comment = svgdoc.createComment(" created with SVG-edit - http://svg-edit.googlecode.com/ ");
|
||||||
svgroot.appendChild(comment);
|
svgroot.appendChild(comment);
|
||||||
|
|
Loading…
Reference in New Issue