master
Dmitry Baranovskiy 2013-11-20 12:29:50 +11:00
parent 913d1d578b
commit 74cbaf763b
5 changed files with 55 additions and 57 deletions

File diff suppressed because one or more lines are too long

23
dist/snap.svg.js vendored
View File

@ -3076,18 +3076,21 @@ function arrayFirstValue(arr) {
= (Fragment) the @Fragment
\*/
Snap.parse = function (svg) {
var f,
var f = glob.doc.createDocumentFragment(),
full = true,
div = glob.doc.createElement("div");
svg = "<svg>" + svg + "</svg>";
svg = Str(svg);
if (!svg.match(/^\s*<\s*svg(?:\s|>)/)) {
svg = "<svg>" + svg + "</svg>";
full = false;
}
div.innerHTML = svg;
svg = div.getElementsByTagName("svg")[0];
if (svg) {
f = new Fragment(svg);
div.innerHTML = E;
return f;
while (svg && svg.firstChild) {
f.appendChild(svg.firstChild);
}
div.innerHTML = E;
return new Fragment(glob.doc.createDocumentFragment());
return new Fragment(f);
};
function Fragment(frag) {
this.node = frag;
@ -6518,11 +6521,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) {
filter = $("filter");
$(filter, {
id: id,
filterUnits: "userSpaceOnUse",
x: 0,
y: 0,
width: width,
height: height
filterUnits: "userSpaceOnUse"
});
filter.appendChild(f.node);
paper.defs.appendChild(filter);

View File

@ -5709,7 +5709,7 @@ If key is not provided, removes all the data of the element.
<article id="Fragment.select">
<header>
<h3 class="dr-method">Fragment.select()<a href="#Fragment.select" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2353 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2353">&#x27ad;</a></h3>
<h3 class="dr-method">Fragment.select()<a href="#Fragment.select" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2356 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2356">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Fragment.select-extra"></div>
@ -5734,7 +5734,7 @@ If key is not provided, removes all the data of the element.
<article id="Fragment.selectAll">
<header>
<h3 class="dr-method">Fragment.selectAll()<a href="#Fragment.selectAll" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2360 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2360">&#x27ad;</a></h3>
<h3 class="dr-method">Fragment.selectAll()<a href="#Fragment.selectAll" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2363 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2363">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Fragment.selectAll-extra"></div>
@ -5759,7 +5759,7 @@ If key is not provided, removes all the data of the element.
<article id="Snap.fragment">
<header>
<h3 class="dr-method">Snap.fragment(varargs)<a href="#Snap.fragment" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2371 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2371">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.fragment(varargs)<a href="#Snap.fragment" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2374 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2374">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.fragment-extra"></div>
@ -5819,7 +5819,7 @@ If key is not provided, removes all the data of the element.
<article id="Paper.el">
<header>
<h3 class="dr-method">Paper.el(name, attr)<a href="#Paper.el" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2572 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2572">&#x27ad;</a></h3>
<h3 class="dr-method">Paper.el(name, attr)<a href="#Paper.el" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2575 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2575">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Paper.el-extra"></div>
@ -5909,7 +5909,7 @@ var c = paper.el("circle").attr({
<article id="Paper.rect">
<header>
<h3 class="dr-method">Paper.rect(x, y, width, height, [rx], [ry])<a href="#Paper.rect" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2595 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2595">&#x27ad;</a></h3>
<h3 class="dr-method">Paper.rect(x, y, width, height, [rx], [ry])<a href="#Paper.rect" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2598 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2598">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Paper.rect-extra"></div>
@ -6009,7 +6009,7 @@ var c = paper.rect(40, 40, 50, 50, 10);</code></pre></section>
<article id="Paper.circle">
<header>
<h3 class="dr-method">Paper.circle(x, y, r)<a href="#Paper.circle" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2632 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2632">&#x27ad;</a></h3>
<h3 class="dr-method">Paper.circle(x, y, r)<a href="#Paper.circle" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2635 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2635">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Paper.circle-extra"></div>
@ -6097,7 +6097,7 @@ var c = paper.rect(40, 40, 50, 50, 10);</code></pre></section>
<article id="Paper.image">
<header>
<h3 class="dr-method">Paper.image(src, x, y, width, height)<a href="#Paper.image" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2664 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2664">&#x27ad;</a></h3>
<h3 class="dr-method">Paper.image(src, x, y, width, height)<a href="#Paper.image" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2667 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2667">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Paper.image-extra"></div>
@ -6219,7 +6219,7 @@ var c = paper.rect(40, 40, 50, 50, 10);</code></pre></section>
<article id="Paper.ellipse">
<header>
<h3 class="dr-method">Paper.ellipse(x, y, rx, ry)<a href="#Paper.ellipse" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2707 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2707">&#x27ad;</a></h3>
<h3 class="dr-method">Paper.ellipse(x, y, rx, ry)<a href="#Paper.ellipse" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2710 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2710">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Paper.ellipse-extra"></div>
@ -6310,7 +6310,7 @@ var c = paper.rect(40, 40, 50, 50, 10);</code></pre></section>
<article id="Paper.path">
<header>
<h3 class="dr-method">Paper.path([pathString])<a href="#Paper.path" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2752 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2752">&#x27ad;</a></h3>
<h3 class="dr-method">Paper.path([pathString])<a href="#Paper.path" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2755 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2755">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Paper.path-extra"></div>
@ -6578,7 +6578,7 @@ Note: there is a special case when a path consists of only three commands: <code
<article id="Paper.g">
<header>
<h3 class="dr-method">Paper.g([varargs])<a href="#Paper.g" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2783 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2783">&#x27ad;</a></h3>
<h3 class="dr-method">Paper.g([varargs])<a href="#Paper.g" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2786 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2786">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Paper.g-extra"></div>
@ -6687,7 +6687,7 @@ g.add(c2, c1);</code></pre></section>
<article id="Paper.group">
<header>
<h3 class="dr-method">Paper.group()<a href="#Paper.group" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2789 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2789">&#x27ad;</a></h3>
<h3 class="dr-method">Paper.group()<a href="#Paper.group" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2792 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2792">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Paper.group-extra"></div>
@ -6712,7 +6712,7 @@ g.add(c2, c1);</code></pre></section>
<article id="Paper.text">
<header>
<h3 class="dr-method">Paper.text(x, y, text)<a href="#Paper.text" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2817 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2817">&#x27ad;</a></h3>
<h3 class="dr-method">Paper.text(x, y, text)<a href="#Paper.text" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2820 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2820">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Paper.text-extra"></div>
@ -6801,7 +6801,7 @@ var t2 = paper.text(50, 50, ["S","n","a","p"]);</code></pre></section>
<article id="Paper.line">
<header>
<h3 class="dr-method">Paper.line(x1, y1, x2, y2)<a href="#Paper.line" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2845 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2845">&#x27ad;</a></h3>
<h3 class="dr-method">Paper.line(x1, y1, x2, y2)<a href="#Paper.line" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2848 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2848">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Paper.line-extra"></div>
@ -6892,7 +6892,7 @@ var t2 = paper.text(50, 50, ["S","n","a","p"]);</code></pre></section>
<article id="Paper.polyline">
<header>
<h3 class="dr-method">Paper.polyline(…)<a href="#Paper.polyline" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2874 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2874">&#x27ad;</a></h3>
<h3 class="dr-method">Paper.polyline(…)<a href="#Paper.polyline" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2877 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2877">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Paper.polyline-extra"></div>
@ -7004,7 +7004,7 @@ var p2 = paper.polyline(10, 10, 100, 100);</code></pre></section>
<article id="Paper.polygon">
<header>
<h3 class="dr-method">Paper.polygon()<a href="#Paper.polygon" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2894 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2894">&#x27ad;</a></h3>
<h3 class="dr-method">Paper.polygon()<a href="#Paper.polygon" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2897 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2897">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Paper.polygon-extra"></div>
@ -7029,7 +7029,7 @@ var p2 = paper.polyline(10, 10, 100, 100);</code></pre></section>
<article id="Paper.gradient">
<header>
<h3 class="dr-method">Paper.gradient(gradient)<a href="#Paper.gradient" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2947 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2947">&#x27ad;</a></h3>
<h3 class="dr-method">Paper.gradient(gradient)<a href="#Paper.gradient" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2950 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2950">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Paper.gradient-extra"></div>
@ -7227,7 +7227,7 @@ half the width, from black to white:
<article id="Paper.toString">
<header>
<h3 class="dr-method">Paper.toString()<a href="#Paper.toString" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2963 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2963">&#x27ad;</a></h3>
<h3 class="dr-method">Paper.toString()<a href="#Paper.toString" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2966 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2966">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Paper.toString-extra"></div>
@ -7269,7 +7269,7 @@ half the width, from black to white:
<article id="Paper.clear">
<header>
<h3 class="dr-method">Paper.clear()<a href="#Paper.clear" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2981 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2981">&#x27ad;</a></h3>
<h3 class="dr-method">Paper.clear()<a href="#Paper.clear" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 2984 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#2984">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Paper.clear-extra"></div>
@ -7294,7 +7294,7 @@ half the width, from black to white:
<article id="Snap.ajax">
<header>
<h3 class="dr-method">Snap.ajax(…)<a href="#Snap.ajax" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3012 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#3012">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.ajax(…)<a href="#Snap.ajax" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3015 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#3015">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.ajax-extra"></div>
@ -7398,7 +7398,7 @@ half the width, from black to white:
<article id="Snap.load">
<header>
<h3 class="dr-method">Snap.load(url, callback, [scope])<a href="#Snap.load" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3058 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#3058">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.load(url, callback, [scope])<a href="#Snap.load" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3061 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#3061">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.load-extra"></div>
@ -7447,7 +7447,7 @@ half the width, from black to white:
<article id="Snap.getElementByPoint">
<header>
<h3 class="dr-method">Snap.getElementByPoint(x, y)<a href="#Snap.getElementByPoint" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3487 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#3487">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.getElementByPoint(x, y)<a href="#Snap.getElementByPoint" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3490 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#3490">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.getElementByPoint-extra"></div>
@ -7532,7 +7532,7 @@ half the width, from black to white:
<article id="Snap.plugin">
<header>
<h3 class="dr-method">Snap.plugin(f)<a href="#Snap.plugin" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3522 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#3522">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.plugin(f)<a href="#Snap.plugin" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 3525 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#3525">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.plugin-extra"></div>
@ -8486,7 +8486,7 @@ prototypes). This allow you to extend anything you want.
<article id="Snap.filter.blur">
<header>
<h3 class="dr-method">Snap.filter.blur(x, [y])<a href="#Snap.filter.blur" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 102 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#102">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.filter.blur(x, [y])<a href="#Snap.filter.blur" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 98 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#98">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.filter.blur-extra"></div>
@ -8574,7 +8574,7 @@ prototypes). This allow you to extend anything you want.
<article id="Snap.filter.shadow">
<header>
<h3 class="dr-method">Snap.filter.shadow(dx, dy, [blur], [color])<a href="#Snap.filter.shadow" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 131 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#131">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.filter.shadow(dx, dy, [blur], [color])<a href="#Snap.filter.shadow" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 127 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#127">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.filter.shadow-extra"></div>
@ -8668,7 +8668,7 @@ prototypes). This allow you to extend anything you want.
<article id="Snap.filter.grayscale">
<header>
<h3 class="dr-method">Snap.filter.grayscale(amount)<a href="#Snap.filter.grayscale" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 167 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#167">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.filter.grayscale(amount)<a href="#Snap.filter.grayscale" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 163 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#163">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.filter.grayscale-extra"></div>
@ -8728,7 +8728,7 @@ prototypes). This allow you to extend anything you want.
<article id="Snap.filter.sepia">
<header>
<h3 class="dr-method">Snap.filter.sepia(amount)<a href="#Snap.filter.sepia" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 194 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#194">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.filter.sepia(amount)<a href="#Snap.filter.sepia" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 190 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#190">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.filter.sepia-extra"></div>
@ -8788,7 +8788,7 @@ prototypes). This allow you to extend anything you want.
<article id="Snap.filter.saturate">
<header>
<h3 class="dr-method">Snap.filter.saturate(amount)<a href="#Snap.filter.saturate" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 222 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#222">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.filter.saturate(amount)<a href="#Snap.filter.saturate" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 218 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#218">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.filter.saturate-extra"></div>
@ -8848,7 +8848,7 @@ prototypes). This allow you to extend anything you want.
<article id="Snap.filter.hueRotate">
<header>
<h3 class="dr-method">Snap.filter.hueRotate(angle)<a href="#Snap.filter.hueRotate" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 242 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#242">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.filter.hueRotate(angle)<a href="#Snap.filter.hueRotate" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 238 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#238">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.filter.hueRotate-extra"></div>
@ -8908,7 +8908,7 @@ prototypes). This allow you to extend anything you want.
<article id="Snap.filter.invert">
<header>
<h3 class="dr-method">Snap.filter.invert(amount)<a href="#Snap.filter.invert" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 260 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#260">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.filter.invert(amount)<a href="#Snap.filter.invert" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 256 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#256">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.filter.invert-extra"></div>
@ -8968,7 +8968,7 @@ prototypes). This allow you to extend anything you want.
<article id="Snap.filter.brightness">
<header>
<h3 class="dr-method">Snap.filter.brightness(amount)<a href="#Snap.filter.brightness" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 281 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#281">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.filter.brightness(amount)<a href="#Snap.filter.brightness" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 277 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#277">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.filter.brightness-extra"></div>
@ -9028,7 +9028,7 @@ prototypes). This allow you to extend anything you want.
<article id="Snap.filter.contrast">
<header>
<h3 class="dr-method">Snap.filter.contrast(amount)<a href="#Snap.filter.contrast" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 301 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#301">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.filter.contrast(amount)<a href="#Snap.filter.contrast" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 297 in the source" href="https://github.com/adobe-webplatform/savage/blob/master/src/svg.js#297">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.filter.contrast-extra"></div>

View File

@ -46,11 +46,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) {
filter = $("filter");
$(filter, {
id: id,
filterUnits: "userSpaceOnUse",
x: 0,
y: 0,
width: width,
height: height
filterUnits: "userSpaceOnUse"
});
filter.appendChild(f.node);
paper.defs.appendChild(filter);

View File

@ -2328,18 +2328,21 @@ function arrayFirstValue(arr) {
= (Fragment) the @Fragment
\*/
Snap.parse = function (svg) {
var f,
var f = glob.doc.createDocumentFragment(),
full = true,
div = glob.doc.createElement("div");
svg = "<svg>" + svg + "</svg>";
svg = Str(svg);
if (!svg.match(/^\s*<\s*svg(?:\s|>)/)) {
svg = "<svg>" + svg + "</svg>";
full = false;
}
div.innerHTML = svg;
svg = div.getElementsByTagName("svg")[0];
if (svg) {
f = new Fragment(svg);
div.innerHTML = E;
return f;
while (svg && svg.firstChild) {
f.appendChild(svg.firstChild);
}
div.innerHTML = E;
return new Fragment(glob.doc.createDocumentFragment());
return new Fragment(f);
};
function Fragment(frag) {
this.node = frag;