master
baranovs 2014-07-31 18:37:34 +10:00
parent 5b17fca57c
commit 728fc208f2
4 changed files with 61 additions and 61 deletions

File diff suppressed because one or more lines are too long

22
dist/snap.svg.js vendored
View File

@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
// build: 2014-06-03
// build: 2014-07-31
// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
@ -867,14 +867,13 @@ var has = "hasOwnProperty",
colourRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\))\s*$/i,
bezierrg = /^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,
reURLValue = /^url\(#?([^)]+)\)$/,
spaces = "\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029",
separator = Snap._.separator = new RegExp("[," + spaces + "]+"),
whitespace = new RegExp("[" + spaces + "]", "g"),
commaSpaces = new RegExp("[" + spaces + "]*,[" + spaces + "]*"),
separator = Snap._.separator = /[,\s]+/,
whitespace = /[\s]/g,
commaSpaces = /[\s]*,[\s]*/,
hsrg = {hs: 1, rg: 1},
pathCommand = new RegExp("([a-z])[" + spaces + ",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[" + spaces + "]*,?[" + spaces + "]*)+)", "ig"),
tCommand = new RegExp("([rstm])[" + spaces + ",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[" + spaces + "]*,?[" + spaces + "]*)+)", "ig"),
pathValues = new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[" + spaces + "]*,?[" + spaces + "]*", "ig"),
pathCommand = /([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
tCommand = /([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
pathValues = /(-?\d*\.?\d*(?:e[\-+]?\\d+)?)[\s]*,?[\s]*/ig,
idgen = 0,
idprefix = "S" + (+new Date).toString(36),
ID = function () {
@ -920,7 +919,6 @@ function $(el, attr) {
}
} else {
el = glob.doc.createElementNS(xmlns, el);
// el.style && (el.style.webkitTapHighlightColor = "rgba(0,0,0,0)");
}
return el;
}
@ -1664,7 +1662,7 @@ function svgTransform2string(tstr) {
return res;
}
Snap._.svgTransform2string = svgTransform2string;
Snap._.rgTransform = new RegExp("^[a-z][" + spaces + "]*-?\\.?\\d", "i");
Snap._.rgTransform = /^[a-z][\s]*-?\.?\d/i;
function transform2matrix(tstr, bbox) {
var tdata = parseTransformString(tstr),
m = new Snap.Matrix;
@ -1906,6 +1904,7 @@ function unit2px(el, name, value) {
= (Element) the current element
\*/
Snap.select = function (query) {
query = Str(query).replace(/([^\\]):/g, "$1\\:");
return wrap(glob.doc.querySelector(query));
};
/*\
@ -2403,6 +2402,7 @@ function Element(el) {
= (Element) result of query selection
\*/
elproto.select = function (query) {
query = Str(query).replace(/([^\\]):/g, "$1\\:");
return wrap(this.node.querySelector(query));
};
/*\
@ -7650,4 +7650,4 @@ Snap.plugin(function (Snap, Element, Paper, glob) {
};
});
return Snap;
}));
}));

View File

@ -922,7 +922,7 @@
<article id="Snap.format">
<header>
<h3 class="dr-method">Snap.format(token, json)<a href="#Snap.format" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 189 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L189">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.format(token, json)<a href="#Snap.format" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 187 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L187">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.format-extra"></div>
@ -1016,7 +1016,7 @@ paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']
<article id="Snap.rad">
<header>
<h3 class="dr-method">Snap.rad(deg)<a href="#Snap.rad" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 279 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L279">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.rad(deg)<a href="#Snap.rad" 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/Snap.svg/blob/master/src/svg.js#L277">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.rad-extra"></div>
@ -1076,7 +1076,7 @@ paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']
<article id="Snap.deg">
<header>
<h3 class="dr-method">Snap.deg(rad)<a href="#Snap.deg" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 288 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L288">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.deg(rad)<a href="#Snap.deg" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 286 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L286">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.deg-extra"></div>
@ -1136,7 +1136,7 @@ paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']
<article id="Snap.angle">
<header>
<h3 class="dr-method">Snap.angle(x1, y1, x2, y2, [x3], [y3])<a href="#Snap.angle" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 303 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L303">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.angle(x1, y1, x2, y2, [x3], [y3])<a href="#Snap.angle" 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/Snap.svg/blob/master/src/svg.js#L301">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.angle-extra"></div>
@ -1222,7 +1222,7 @@ paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']
<article id="Snap.is">
<header>
<h3 class="dr-method">Snap.is(o, type)<a href="#Snap.is" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 313 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L313">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.is(o, type)<a href="#Snap.is" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 311 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L311">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.is-extra"></div>
@ -1285,7 +1285,7 @@ paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']
<article id="Snap.snapTo">
<header>
<h3 class="dr-method">Snap.snapTo(values, value, [tolerance])<a href="#Snap.snapTo" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 324 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L324">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.snapTo(values, value, [tolerance])<a href="#Snap.snapTo" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 322 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L322">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.snapTo-extra"></div>
@ -1351,7 +1351,7 @@ paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']
<article id="Snap.getRGB">
<header>
<h3 class="dr-method">Snap.getRGB(color)<a href="#Snap.getRGB" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 377 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L377">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.getRGB(color)<a href="#Snap.getRGB" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 375 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L375">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.getRGB-extra"></div>
@ -1686,7 +1686,7 @@ paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']
<article id="Snap.hsb">
<header>
<h3 class="dr-method">Snap.hsb(h, s, b)<a href="#Snap.hsb" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 466 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L466">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.hsb(h, s, b)<a href="#Snap.hsb" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 464 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L464">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.hsb-extra"></div>
@ -1752,7 +1752,7 @@ paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']
<article id="Snap.hsl">
<header>
<h3 class="dr-method">Snap.hsl(h, s, l)<a href="#Snap.hsl" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 479 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L479">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.hsl(h, s, l)<a href="#Snap.hsl" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 477 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L477">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.hsl-extra"></div>
@ -1818,7 +1818,7 @@ paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']
<article id="Snap.rgb">
<header>
<h3 class="dr-method">Snap.rgb(r, g, b)<a href="#Snap.rgb" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 492 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L492">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.rgb(r, g, b)<a href="#Snap.rgb" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 490 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L490">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.rgb-extra"></div>
@ -1884,7 +1884,7 @@ paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']
<article id="Snap.color">
<header>
<h3 class="dr-method">Snap.color(clr)<a href="#Snap.color" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 579 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L579">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.color(clr)<a href="#Snap.color" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 577 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L577">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.color-extra"></div>
@ -2036,7 +2036,7 @@ paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']
<article id="Snap.hsb2rgb">
<header>
<h3 class="dr-method">Snap.hsb2rgb(h, s, v)<a href="#Snap.hsb2rgb" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 631 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L631">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.hsb2rgb(h, s, v)<a href="#Snap.hsb2rgb" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 629 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L629">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.hsb2rgb-extra"></div>
@ -2154,7 +2154,7 @@ paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']
<article id="Snap.hsl2rgb">
<header>
<h3 class="dr-method">Snap.hsl2rgb(h, s, l)<a href="#Snap.hsl2rgb" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 667 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L667">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.hsl2rgb(h, s, l)<a href="#Snap.hsl2rgb" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 665 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L665">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.hsl2rgb-extra"></div>
@ -2272,7 +2272,7 @@ paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']
<article id="Snap.rgb2hsb">
<header>
<h3 class="dr-method">Snap.rgb2hsb(r, g, b)<a href="#Snap.rgb2hsb" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 706 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L706">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.rgb2hsb(r, g, b)<a href="#Snap.rgb2hsb" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 704 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L704">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.rgb2hsb-extra"></div>
@ -2382,7 +2382,7 @@ paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']
<article id="Snap.rgb2hsl">
<header>
<h3 class="dr-method">Snap.rgb2hsl(r, g, b)<a href="#Snap.rgb2hsl" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 739 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L739">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.rgb2hsl(r, g, b)<a href="#Snap.rgb2hsl" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 737 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L737">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.rgb2hsl-extra"></div>
@ -2492,7 +2492,7 @@ paper.path(Snap.format("M{x},{y}h{dim.width}v{dim.height}h{dim['negative width']
<article id="Snap.parsePathString">
<header>
<h3 class="dr-method">Snap.parsePathString(pathString)<a href="#Snap.parsePathString" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 773 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L773">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.parsePathString(pathString)<a href="#Snap.parsePathString" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 771 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L771">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.parsePathString-extra"></div>
@ -2553,7 +2553,7 @@ Parses given path string into an array of arrays of path segments
<article id="Snap.parseTransformString">
<header>
<h3 class="dr-method">Snap.parseTransformString(TString)<a href="#Snap.parseTransformString" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 826 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L826">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.parseTransformString(TString)<a href="#Snap.parseTransformString" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 824 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L824">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.parseTransformString-extra"></div>
@ -2614,7 +2614,7 @@ Parses given transform string into an array of transformations
<article id="Snap.select">
<header>
<h3 class="dr-method">Snap.select(query)<a href="#Snap.select" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1118 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1118">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.select(query)<a href="#Snap.select" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1116 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1116">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.select-extra"></div>
@ -2674,7 +2674,7 @@ Parses given transform string into an array of transformations
<article id="Snap.selectAll">
<header>
<h3 class="dr-method">Snap.selectAll(query)<a href="#Snap.selectAll" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1129 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1129">&#x27ad;</a></h3>
<h3 class="dr-method">Snap.selectAll(query)<a href="#Snap.selectAll" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1128 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1128">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Snap.selectAll-extra"></div>
@ -2734,7 +2734,7 @@ Parses given transform string into an array of transformations
<article id="Element.node">
<header>
<h3 class="dr-property">Element.node(x, y, width, height, refX, refY)<a href="#Element.node" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1192 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1192">&#x27ad;</a></h3>
<h3 class="dr-property">Element.node(x, y, width, height, refX, refY)<a href="#Element.node" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1191 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1191">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Element.node-extra"></div>
@ -2785,7 +2785,7 @@ c.node.onclick = function () {
<article id="Element.type">
<header>
<h3 class="dr-property">Element.type(tstr)<a href="#Element.type" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1202 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1202">&#x27ad;</a></h3>
<h3 class="dr-property">Element.type(tstr)<a href="#Element.type" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1201 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1201">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Element.type-extra"></div>
@ -2810,7 +2810,7 @@ c.node.onclick = function () {
<article id="Element.attr">
<header>
<h3 class="dr-method">Element.attr(…)<a href="#Element.attr" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1244 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1244">&#x27ad;</a></h3>
<h3 class="dr-method">Element.attr(…)<a href="#Element.attr" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1243 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1243">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Element.attr-extra"></div>
@ -2969,7 +2969,7 @@ and <code>-</code>: <code>&quot;+=2em&quot;</code>.
<article id="Element.getBBox">
<header>
<h3 class="dr-method">Element.getBBox()<a href="#Element.getBBox" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1291 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1291">&#x27ad;</a></h3>
<h3 class="dr-method">Element.getBBox()<a href="#Element.getBBox" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1290 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1290">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Element.getBBox-extra"></div>
@ -3151,7 +3151,7 @@ and <code>-</code>: <code>&quot;+=2em&quot;</code>.
<article id="Element.transform">
<header>
<h3 class="dr-method">Element.transform(tstr)<a href="#Element.transform" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1351 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1351">&#x27ad;</a></h3>
<h3 class="dr-method">Element.transform(tstr)<a href="#Element.transform" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1350 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1350">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Element.transform-extra"></div>
@ -3315,7 +3315,7 @@ and <code>-</code>: <code>&quot;+=2em&quot;</code>.
<article id="Element.parent">
<header>
<h3 class="dr-method">Element.parent()<a href="#Element.parent" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1408 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1408">&#x27ad;</a></h3>
<h3 class="dr-method">Element.parent()<a href="#Element.parent" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1407 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1407">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Element.parent-extra"></div>
@ -3357,7 +3357,7 @@ and <code>-</code>: <code>&quot;+=2em&quot;</code>.
<article id="Element.append">
<header>
<h3 class="dr-method">Element.append(el)<a href="#Element.append" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1420 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1420">&#x27ad;</a></h3>
<h3 class="dr-method">Element.append(el)<a href="#Element.append" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1419 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1419">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Element.append-extra"></div>
@ -3417,7 +3417,7 @@ and <code>-</code>: <code>&quot;+=2em&quot;</code>.
<article id="Element.add">
<header>
<h3 class="dr-method">Element.add()<a href="#Element.add" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1426 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1426">&#x27ad;</a></h3>
<h3 class="dr-method">Element.add()<a href="#Element.add" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1425 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1425">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Element.add-extra"></div>
@ -3442,7 +3442,7 @@ and <code>-</code>: <code>&quot;+=2em&quot;</code>.
<article id="Element.appendTo">
<header>
<h3 class="dr-method">Element.appendTo(el)<a href="#Element.appendTo" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1450 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1450">&#x27ad;</a></h3>
<h3 class="dr-method">Element.appendTo(el)<a href="#Element.appendTo" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1449 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1449">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Element.appendTo-extra"></div>
@ -3502,7 +3502,7 @@ and <code>-</code>: <code>&quot;+=2em&quot;</code>.
<article id="Element.prepend">
<header>
<h3 class="dr-method">Element.prepend(el)<a href="#Element.prepend" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1466 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1466">&#x27ad;</a></h3>
<h3 class="dr-method">Element.prepend(el)<a href="#Element.prepend" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1465 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1465">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Element.prepend-extra"></div>
@ -3562,7 +3562,7 @@ and <code>-</code>: <code>&quot;+=2em&quot;</code>.
<article id="Element.prependTo">
<header>
<h3 class="dr-method">Element.prependTo(el)<a href="#Element.prependTo" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1500 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1500">&#x27ad;</a></h3>
<h3 class="dr-method">Element.prependTo(el)<a href="#Element.prependTo" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1499 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1499">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Element.prependTo-extra"></div>
@ -3622,7 +3622,7 @@ and <code>-</code>: <code>&quot;+=2em&quot;</code>.
<article id="Element.before">
<header>
<h3 class="dr-method">Element.before(el)<a href="#Element.before" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1514 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1514">&#x27ad;</a></h3>
<h3 class="dr-method">Element.before(el)<a href="#Element.before" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1513 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1513">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Element.before-extra"></div>
@ -3682,7 +3682,7 @@ and <code>-</code>: <code>&quot;+=2em&quot;</code>.
<article id="Element.after">
<header>
<h3 class="dr-method">Element.after(el)<a href="#Element.after" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1542 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1542">&#x27ad;</a></h3>
<h3 class="dr-method">Element.after(el)<a href="#Element.after" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1541 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1541">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Element.after-extra"></div>
@ -3742,7 +3742,7 @@ and <code>-</code>: <code>&quot;+=2em&quot;</code>.
<article id="Element.insertBefore">
<header>
<h3 class="dr-method">Element.insertBefore(el)<a href="#Element.insertBefore" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1564 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1564">&#x27ad;</a></h3>
<h3 class="dr-method">Element.insertBefore(el)<a href="#Element.insertBefore" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1563 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1563">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Element.insertBefore-extra"></div>
@ -3802,7 +3802,7 @@ and <code>-</code>: <code>&quot;+=2em&quot;</code>.
<article id="Element.insertAfter">
<header>
<h3 class="dr-method">Element.insertAfter(el)<a href="#Element.insertAfter" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1582 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1582">&#x27ad;</a></h3>
<h3 class="dr-method">Element.insertAfter(el)<a href="#Element.insertAfter" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1581 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1581">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Element.insertAfter-extra"></div>
@ -3862,7 +3862,7 @@ and <code>-</code>: <code>&quot;+=2em&quot;</code>.
<article id="Element.remove">
<header>
<h3 class="dr-method">Element.remove()<a href="#Element.remove" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1598 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1598">&#x27ad;</a></h3>
<h3 class="dr-method">Element.remove()<a href="#Element.remove" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1597 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1597">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Element.remove-extra"></div>
@ -3904,7 +3904,7 @@ and <code>-</code>: <code>&quot;+=2em&quot;</code>.
<article id="Element.select">
<header>
<h3 class="dr-method">Element.select(query)<a href="#Element.select" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1615 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1615">&#x27ad;</a></h3>
<h3 class="dr-method">Element.select(query)<a href="#Element.select" title="Link to this section" class="dr-hash">&#x2693;</a><a class="dr-sourceline" title="Go to line 1614 in the source" href="https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js#L1614">&#x27ad;</a></h3>
</header>
<section>
<div class="extra" id="Element.select-extra"></div>
@ -13630,4 +13630,4 @@ h.onclick=h.onchange=h.onkeydown=h.onkeyup=function(){var t=h.value,r=[]
if(t.length>1){for(var i=0,o=a.length;o>i;i++)r[i]={li:a[i].li,weight:n(a[i].text,t)}
r.sort(f)}else r=a
for(i=0,o=r.length;o>i;i++)e.appendChild(r[i].li)}}}(document.getElementById("dr-toc"))</script>
</body></html>
</body></html>

View File

@ -77,14 +77,13 @@ var has = "hasOwnProperty",
colourRegExp = /^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\))\s*$/i,
bezierrg = /^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,
reURLValue = /^url\(#?([^)]+)\)$/,
spaces = "\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029",
separator = Snap._.separator = new RegExp("[," + spaces + "]+"),
whitespace = new RegExp("[" + spaces + "]", "g"),
commaSpaces = new RegExp("[" + spaces + "]*,[" + spaces + "]*"),
separator = Snap._.separator = /[,\s]+/,
whitespace = /[\s]/g,
commaSpaces = /[\s]*,[\s]*/,
hsrg = {hs: 1, rg: 1},
pathCommand = new RegExp("([a-z])[" + spaces + ",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[" + spaces + "]*,?[" + spaces + "]*)+)", "ig"),
tCommand = new RegExp("([rstm])[" + spaces + ",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[" + spaces + "]*,?[" + spaces + "]*)+)", "ig"),
pathValues = new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[" + spaces + "]*,?[" + spaces + "]*", "ig"),
pathCommand = /([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
tCommand = /([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/ig,
pathValues = /(-?\d*\.?\d*(?:e[\-+]?\\d+)?)[\s]*,?[\s]*/ig,
idgen = 0,
idprefix = "S" + (+new Date).toString(36),
ID = function () {
@ -130,7 +129,6 @@ function $(el, attr) {
}
} else {
el = glob.doc.createElementNS(xmlns, el);
// el.style && (el.style.webkitTapHighlightColor = "rgba(0,0,0,0)");
}
return el;
}
@ -874,7 +872,7 @@ function svgTransform2string(tstr) {
return res;
}
Snap._.svgTransform2string = svgTransform2string;
Snap._.rgTransform = new RegExp("^[a-z][" + spaces + "]*-?\\.?\\d", "i");
Snap._.rgTransform = /^[a-z][\s]*-?\.?\d/i;
function transform2matrix(tstr, bbox) {
var tdata = parseTransformString(tstr),
m = new Snap.Matrix;
@ -1116,6 +1114,7 @@ function unit2px(el, name, value) {
= (Element) the current element
\*/
Snap.select = function (query) {
query = Str(query).replace(/([^\\]):/g, "$1\\:");
return wrap(glob.doc.querySelector(query));
};
/*\
@ -1613,6 +1612,7 @@ function Element(el) {
= (Element) result of query selection
\*/
elproto.select = function (query) {
query = Str(query).replace(/([^\\]):/g, "$1\\:");
return wrap(this.node.querySelector(query));
};
/*\