update bower version and dependencies
This commit is contained in:
8
bower_components/raphael/.bower.json
vendored
8
bower_components/raphael/.bower.json
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "raphael",
|
||||
"version": "2.1.2",
|
||||
"version": "2.1.4",
|
||||
"main": "raphael.js",
|
||||
"ignore": [
|
||||
"eve",
|
||||
@@ -17,11 +17,11 @@
|
||||
"reference.js"
|
||||
],
|
||||
"homepage": "https://github.com/DmitryBaranovskiy/raphael",
|
||||
"_release": "2.1.2",
|
||||
"_release": "2.1.4",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v2.1.2",
|
||||
"commit": "3331359c102e23dc72a224ba65e4fdec6f20894c"
|
||||
"tag": "v2.1.4",
|
||||
"commit": "a29d980d1f6b0aed9a0f18d751a76e862f5fbc4f"
|
||||
},
|
||||
"_source": "git://github.com/DmitryBaranovskiy/raphael.git",
|
||||
"_target": ">= 2.0",
|
||||
|
||||
2
bower_components/raphael/bower.json
vendored
2
bower_components/raphael/bower.json
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "raphael",
|
||||
"version": "2.1.1",
|
||||
"version": "2.1.4",
|
||||
"main": "raphael.js",
|
||||
"ignore": [
|
||||
"eve",
|
||||
|
||||
4
bower_components/raphael/dev/amdDev.js
vendored
4
bower_components/raphael/dev/amdDev.js
vendored
@@ -1,6 +1,6 @@
|
||||
require(['../raphael'], function(Raphael){
|
||||
var paper = Raphael(0, 0, 640, 720, "container");
|
||||
//paper.circle(100, 100, 100); //example
|
||||
|
||||
// Work here
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
8
bower_components/raphael/dev/index.js
vendored
Normal file
8
bower_components/raphael/dev/index.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
var core = require('./raphael.core');
|
||||
if(core.svg){
|
||||
require('./raphael.svg');
|
||||
}
|
||||
if(core.vml){
|
||||
require('./raphael.vml');
|
||||
}
|
||||
module.exports = core;
|
||||
8
bower_components/raphael/raphael-min.js
vendored
8
bower_components/raphael/raphael-min.js
vendored
File diff suppressed because one or more lines are too long
298
bower_components/raphael/raphael.js
vendored
298
bower_components/raphael/raphael.js
vendored
@@ -1,5 +1,5 @@
|
||||
// ┌────────────────────────────────────────────────────────────────────┐ \\
|
||||
// │ Raphaël 2.1.1 - JavaScript Vector Library │ \\
|
||||
// │ Raphaël 2.1.4 - JavaScript Vector Library │ \\
|
||||
// ├────────────────────────────────────────────────────────────────────┤ \\
|
||||
// │ Copyright © 2008-2012 Dmitry Baranovskiy (http://raphaeljs.com) │ \\
|
||||
// │ Copyright © 2008-2012 Sencha Labs (http://sencha.com) │ \\
|
||||
@@ -376,9 +376,9 @@
|
||||
return "You are running Eve " + version;
|
||||
};
|
||||
(typeof module != "undefined" && module.exports) ? (module.exports = eve) : (typeof define != "undefined" ? (define("eve", [], function() { return eve; })) : (glob.eve = eve));
|
||||
})(this);
|
||||
})(window || this);
|
||||
// ┌─────────────────────────────────────────────────────────────────────┐ \\
|
||||
// │ "Raphaël 2.1.0" - JavaScript Vector Library │ \\
|
||||
// │ "Raphaël 2.1.2" - JavaScript Vector Library │ \\
|
||||
// ├─────────────────────────────────────────────────────────────────────┤ \\
|
||||
// │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://raphaeljs.com) │ \\
|
||||
// │ Copyright (c) 2008-2011 Sencha Labs (http://sencha.com) │ \\
|
||||
@@ -395,7 +395,7 @@
|
||||
} else {
|
||||
// Browser globals (glob is window)
|
||||
// Raphael adds itself to window
|
||||
factory(glob, glob.eve);
|
||||
factory(glob, glob.eve || (typeof require == "function" && require('eve')) );
|
||||
}
|
||||
}(this, function (window, eve) {
|
||||
/*\
|
||||
@@ -465,7 +465,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
R.version = "2.1.0";
|
||||
R.version = "2.1.2";
|
||||
R.eve = eve;
|
||||
var loaded,
|
||||
separator = /[, ]+/,
|
||||
@@ -505,7 +505,7 @@
|
||||
| var c = paper.circle(10, 10, 10).attr({hue: .45});
|
||||
| // or even like this:
|
||||
| c.animate({hue: 1}, 1e3);
|
||||
|
|
||||
|
|
||||
| // You could also create custom attribute
|
||||
| // with multiple parameters:
|
||||
| paper.customAttributes.hsb = function (h, s, b) {
|
||||
@@ -546,7 +546,7 @@
|
||||
objectToString = Object.prototype.toString,
|
||||
paper = {},
|
||||
push = "push",
|
||||
ISURL = R._ISURL = /^url\(['"]?([^\)]+?)['"]?\)$/i,
|
||||
ISURL = R._ISURL = /^url\(['"]?(.+?)['"]?\)$/i,
|
||||
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,
|
||||
isnan = {"NaN": 1, "Infinity": 1, "-Infinity": 1},
|
||||
bezierrg = /^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,
|
||||
@@ -771,7 +771,7 @@
|
||||
* Raphael.is
|
||||
[ method ]
|
||||
**
|
||||
* Handfull replacement for `typeof` operator.
|
||||
* Handful of replacements for `typeof` operator.
|
||||
> Parameters
|
||||
- o (…) any object or primitive
|
||||
- type (string) name of the type, i.e. “string”, “function”, “number”, etc.
|
||||
@@ -847,11 +847,11 @@
|
||||
**
|
||||
* Transform angle to degrees
|
||||
> Parameters
|
||||
- deg (number) angle in radians
|
||||
- rad (number) angle in radians
|
||||
= (number) angle in degrees.
|
||||
\*/
|
||||
R.deg = function (rad) {
|
||||
return rad * 180 / PI % 360;
|
||||
return Math.round ((rad * 180 / PI% 360)* 1000) / 1000;
|
||||
};
|
||||
/*\
|
||||
* Raphael.snapTo
|
||||
@@ -1070,8 +1070,8 @@
|
||||
if (this.is(h, "object") && "h" in h && "s" in h && "b" in h) {
|
||||
v = h.b;
|
||||
s = h.s;
|
||||
h = h.h;
|
||||
o = h.o;
|
||||
h = h.h;
|
||||
}
|
||||
h *= 360;
|
||||
var R, G, B, X, C;
|
||||
@@ -2362,11 +2362,11 @@
|
||||
attrs = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},
|
||||
attrs2 = {x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null},
|
||||
processPath = function (path, d, pcom) {
|
||||
var nx, ny;
|
||||
var nx, ny, tq = {T:1, Q:1};
|
||||
if (!path) {
|
||||
return ["C", d.x, d.y, d.x, d.y, d.x, d.y];
|
||||
}
|
||||
!(path[0] in {T:1, Q:1}) && (d.qx = d.qy = null);
|
||||
!(path[0] in tq) && (d.qx = d.qy = null);
|
||||
switch (path[0]) {
|
||||
case "M":
|
||||
d.X = path[1];
|
||||
@@ -2422,6 +2422,8 @@
|
||||
pp[i].shift();
|
||||
var pi = pp[i];
|
||||
while (pi.length) {
|
||||
pcoms1[i]="A"; // if created multiple C:s, their original seg is saved
|
||||
p2 && (pcoms2[i]="A"); // the same as above
|
||||
pp.splice(i++, 0, ["C"][concat](pi.splice(0, 6)));
|
||||
}
|
||||
pp.splice(i, 1);
|
||||
@@ -2437,12 +2439,40 @@
|
||||
a1.y = path1[i][2];
|
||||
ii = mmax(p.length, p2 && p2.length || 0);
|
||||
}
|
||||
};
|
||||
},
|
||||
pcoms1 = [], // path commands of original path p
|
||||
pcoms2 = [], // path commands of original path p2
|
||||
pfirst = "", // temporary holder for original path command
|
||||
pcom = ""; // holder for previous path command of original path
|
||||
for (var i = 0, ii = mmax(p.length, p2 && p2.length || 0); i < ii; i++) {
|
||||
p[i] = processPath(p[i], attrs);
|
||||
fixArc(p, i);
|
||||
p2 && (p2[i] = processPath(p2[i], attrs2));
|
||||
p2 && fixArc(p2, i);
|
||||
p[i] && (pfirst = p[i][0]); // save current path command
|
||||
|
||||
if (pfirst != "C") // C is not saved yet, because it may be result of conversion
|
||||
{
|
||||
pcoms1[i] = pfirst; // Save current path command
|
||||
i && ( pcom = pcoms1[i-1]); // Get previous path command pcom
|
||||
}
|
||||
p[i] = processPath(p[i], attrs, pcom); // Previous path command is inputted to processPath
|
||||
|
||||
if (pcoms1[i] != "A" && pfirst == "C") pcoms1[i] = "C"; // A is the only command
|
||||
// which may produce multiple C:s
|
||||
// so we have to make sure that C is also C in original path
|
||||
|
||||
fixArc(p, i); // fixArc adds also the right amount of A:s to pcoms1
|
||||
|
||||
if (p2) { // the same procedures is done to p2
|
||||
p2[i] && (pfirst = p2[i][0]);
|
||||
if (pfirst != "C")
|
||||
{
|
||||
pcoms2[i] = pfirst;
|
||||
i && (pcom = pcoms2[i-1]);
|
||||
}
|
||||
p2[i] = processPath(p2[i], attrs2, pcom);
|
||||
|
||||
if (pcoms2[i]!="A" && pfirst=="C") pcoms2[i]="C";
|
||||
|
||||
fixArc(p2, i);
|
||||
}
|
||||
fixM(p, p2, attrs, attrs2, i);
|
||||
fixM(p2, p, attrs2, attrs, i);
|
||||
var seg = p[i],
|
||||
@@ -3125,7 +3155,7 @@
|
||||
obj.removeEventListener(type, f, false);
|
||||
|
||||
if (supportsTouch && touchMap[type])
|
||||
obj.removeEventListener(touchMap[type], f, false);
|
||||
obj.removeEventListener(touchMap[type], _f, false);
|
||||
|
||||
return true;
|
||||
};
|
||||
@@ -3455,7 +3485,7 @@
|
||||
[ method ]
|
||||
**
|
||||
* Adds or retrieves given value asociated with given key.
|
||||
**
|
||||
**
|
||||
* See also @Element.removeData
|
||||
> Parameters
|
||||
- key (string) key to store data
|
||||
@@ -3563,8 +3593,8 @@
|
||||
- mcontext (object) #optional context for moving handler
|
||||
- scontext (object) #optional context for drag start handler
|
||||
- econtext (object) #optional context for drag end handler
|
||||
* Additionaly following `drag` events will be triggered: `drag.start.<id>` on start,
|
||||
* `drag.end.<id>` on end and `drag.move.<id>` on every move. When element will be dragged over another element
|
||||
* Additionaly following `drag` events will be triggered: `drag.start.<id>` on start,
|
||||
* `drag.end.<id>` on end and `drag.move.<id>` on every move. When element will be dragged over another element
|
||||
* `drag.over.<id>` will be fired as well.
|
||||
*
|
||||
* Start event and start handler will be called in specified context or in context of the element with following parameters:
|
||||
@@ -3848,6 +3878,21 @@
|
||||
delete this.__set__;
|
||||
return out;
|
||||
};
|
||||
/*\
|
||||
* Paper.getSize
|
||||
[ method ]
|
||||
**
|
||||
* Obtains current paper actual size.
|
||||
**
|
||||
= (object)
|
||||
\*/
|
||||
paperproto.getSize = function () {
|
||||
var container = this.canvas.parentNode;
|
||||
return {
|
||||
width: container.offsetWidth,
|
||||
height: container.offsetHeight
|
||||
};
|
||||
};
|
||||
/*\
|
||||
* Paper.setSize
|
||||
[ method ]
|
||||
@@ -3866,7 +3911,7 @@
|
||||
* Paper.setViewBox
|
||||
[ method ]
|
||||
**
|
||||
* Sets the view box of the paper. Practically it gives you ability to zoom and pan whole paper surface by
|
||||
* Sets the view box of the paper. Practically it gives you ability to zoom and pan whole paper surface by
|
||||
* specifying new boundaries.
|
||||
**
|
||||
> Parameters
|
||||
@@ -4339,7 +4384,7 @@
|
||||
elproto.getPath = function () {
|
||||
var path,
|
||||
getPath = R._getPath[this.type];
|
||||
|
||||
|
||||
if (this.type == "text" || this.type == "set") {
|
||||
return;
|
||||
}
|
||||
@@ -4625,8 +4670,8 @@
|
||||
}
|
||||
}
|
||||
return element;
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// var a = params ? R.animation(params, ms, easing, callback) : anim,
|
||||
// status = element.status(anim);
|
||||
// return this.animate(a).status(a, status * anim.ms / a.ms);
|
||||
@@ -4982,7 +5027,21 @@
|
||||
p[attr] = params[attr];
|
||||
}
|
||||
if (!json) {
|
||||
return new Animation(params, ms);
|
||||
// if percent-like syntax is used and end-of-all animation callback used
|
||||
if(callback){
|
||||
// find the last one
|
||||
var lastKey = 0;
|
||||
for(var i in params){
|
||||
var percent = toInt(i);
|
||||
if(params[has](i) && percent > lastKey){
|
||||
lastKey = percent;
|
||||
}
|
||||
}
|
||||
lastKey += '%';
|
||||
// if already defined callback in the last keyframe, skip
|
||||
!params[lastKey].callback && (params[lastKey].callback = callback);
|
||||
}
|
||||
return new Animation(params, ms);
|
||||
} else {
|
||||
easing && (p.easing = easing);
|
||||
callback && (p.callback = callback);
|
||||
@@ -5254,7 +5313,7 @@
|
||||
* Set.clear
|
||||
[ method ]
|
||||
**
|
||||
* Removeds all elements from the set
|
||||
* Removes all elements from the set
|
||||
\*/
|
||||
setproto.clear = function () {
|
||||
while (this.length) {
|
||||
@@ -5412,7 +5471,6 @@
|
||||
var isPointInside = false;
|
||||
this.forEach(function (el) {
|
||||
if (el.isPointInside(x, y)) {
|
||||
console.log('runned');
|
||||
isPointInside = true;
|
||||
return false; // stop loop
|
||||
}
|
||||
@@ -5732,6 +5790,11 @@
|
||||
| paper.set(paper.circle(100, 100, 20), paper.circle(110, 100, 20)).red();
|
||||
\*/
|
||||
R.st = setproto;
|
||||
|
||||
eve.on("raphael.DOMload", function () {
|
||||
loaded = true;
|
||||
});
|
||||
|
||||
// Firefox <3.6 fix: http://webreflection.blogspot.com/2009/11/195-chars-to-help-lazy-loading.html
|
||||
(function (doc, loaded, f) {
|
||||
if (doc.readyState == null && doc.addEventListener){
|
||||
@@ -5747,10 +5810,6 @@
|
||||
isLoaded();
|
||||
})(document, "DOMContentLoaded");
|
||||
|
||||
eve.on("raphael.DOMload", function () {
|
||||
loaded = true;
|
||||
});
|
||||
|
||||
// ┌─────────────────────────────────────────────────────────────────────┐ \\
|
||||
// │ Raphaël - JavaScript Vector Library │ \\
|
||||
// ├─────────────────────────────────────────────────────────────────────┤ \\
|
||||
@@ -5854,7 +5913,7 @@
|
||||
return null;
|
||||
}
|
||||
id = id.replace(/[\(\)\s,\xb0#]/g, "_");
|
||||
|
||||
|
||||
if (element.gradient && id != element.gradient.id) {
|
||||
SVG.defs.removeChild(element.gradient);
|
||||
delete element.gradient;
|
||||
@@ -5883,7 +5942,7 @@
|
||||
}
|
||||
}
|
||||
$(o, {
|
||||
fill: "url(#" + id + ")",
|
||||
fill: "url('" + document.location + "#" + id + "')",
|
||||
opacity: 1,
|
||||
"fill-opacity": 1
|
||||
});
|
||||
@@ -5960,7 +6019,7 @@
|
||||
}
|
||||
if (type != "none") {
|
||||
var pathId = "raphael-marker-" + type,
|
||||
markerId = "raphael-marker-" + se + type + w + h;
|
||||
markerId = "raphael-marker-" + se + type + w + h + "-obj" + o.id;
|
||||
if (!R._g.doc.getElementById(pathId)) {
|
||||
p.defs.appendChild($($("path"), {
|
||||
"stroke-linecap": "round",
|
||||
@@ -6078,13 +6137,20 @@
|
||||
case "blur":
|
||||
o.blur(value);
|
||||
break;
|
||||
case "href":
|
||||
case "title":
|
||||
var hl = $("title");
|
||||
var val = R._g.doc.createTextNode(value);
|
||||
hl.appendChild(val);
|
||||
node.appendChild(hl);
|
||||
var title = node.getElementsByTagName("title");
|
||||
|
||||
// Use the existing <title>.
|
||||
if (title.length && (title = title[0])) {
|
||||
title.firstChild.nodeValue = value;
|
||||
} else {
|
||||
title = $("title");
|
||||
var val = R._g.doc.createTextNode(value);
|
||||
title.appendChild(val);
|
||||
node.appendChild(title);
|
||||
}
|
||||
break;
|
||||
case "href":
|
||||
case "target":
|
||||
var pn = node.parentNode;
|
||||
if (pn.tagName.toLowerCase() != "a") {
|
||||
@@ -6210,9 +6276,6 @@
|
||||
if (o._.sx != 1 || o._.sy != 1) {
|
||||
value /= mmax(abs(o._.sx), abs(o._.sy)) || 1;
|
||||
}
|
||||
if (o.paper._vbSize) {
|
||||
value *= o.paper._vbSize;
|
||||
}
|
||||
node.setAttribute(att, value);
|
||||
if (attrs["stroke-dasharray"]) {
|
||||
addDashes(o, attrs["stroke-dasharray"], params);
|
||||
@@ -6353,6 +6416,13 @@
|
||||
dif = a.y - (bb.y + bb.height / 2);
|
||||
dif && R.is(dif, "finite") && $(tspans[0], {dy: dif});
|
||||
},
|
||||
getRealNode = function (node) {
|
||||
if (node.parentNode && node.parentNode.tagName.toLowerCase() === "a") {
|
||||
return node.parentNode;
|
||||
} else {
|
||||
return node;
|
||||
}
|
||||
},
|
||||
Element = function (node, svg) {
|
||||
var X = 0,
|
||||
Y = 0;
|
||||
@@ -6388,7 +6458,7 @@
|
||||
* Element.id
|
||||
[ property (number) ]
|
||||
**
|
||||
* Unique id of the element. Especially usesful when you want to listen to events of the element,
|
||||
* Unique id of the element. Especially useful when you want to listen to events of the element,
|
||||
* because all events are fired in format `<module>.<action>.<id>`. Also useful for @Paper.getById method.
|
||||
\*/
|
||||
this.id = R._oid++;
|
||||
@@ -6593,7 +6663,7 @@
|
||||
this.clip && $(this.clip, {transform: this.matrix.invert()});
|
||||
this.pattern && updatePosition(this);
|
||||
this.node && $(this.node, {transform: this.matrix});
|
||||
|
||||
|
||||
if (_.sx != 1 || _.sy != 1) {
|
||||
var sw = this.attrs[has]("stroke-width") ? this.attrs["stroke-width"] : 1;
|
||||
this.attr({"stroke-width": sw});
|
||||
@@ -6630,7 +6700,8 @@
|
||||
* Removes element from the paper.
|
||||
\*/
|
||||
elproto.remove = function () {
|
||||
if (this.removed || !this.node.parentNode) {
|
||||
var node = getRealNode(this.node);
|
||||
if (this.removed || !node.parentNode) {
|
||||
return;
|
||||
}
|
||||
var paper = this.paper;
|
||||
@@ -6640,11 +6711,12 @@
|
||||
paper.defs.removeChild(this.gradient);
|
||||
}
|
||||
R._tear(this, paper);
|
||||
if (this.node.parentNode.tagName.toLowerCase() == "a") {
|
||||
this.node.parentNode.parentNode.removeChild(this.node.parentNode);
|
||||
} else {
|
||||
this.node.parentNode.removeChild(this.node);
|
||||
}
|
||||
|
||||
node.parentNode.removeChild(node);
|
||||
|
||||
// Remove custom data for element
|
||||
this.removeData();
|
||||
|
||||
for (var i in this) {
|
||||
this[i] = typeof this[i] == "function" ? R._removedFactory(i) : null;
|
||||
}
|
||||
@@ -6655,13 +6727,35 @@
|
||||
this.show();
|
||||
var hide = true;
|
||||
}
|
||||
var canvasHidden = false,
|
||||
containerStyle;
|
||||
if (this.paper.canvas.parentElement) {
|
||||
containerStyle = this.paper.canvas.parentElement.style;
|
||||
} //IE10+ can't find parentElement
|
||||
else if (this.paper.canvas.parentNode) {
|
||||
containerStyle = this.paper.canvas.parentNode.style;
|
||||
}
|
||||
|
||||
if(containerStyle && containerStyle.display == "none") {
|
||||
canvasHidden = true;
|
||||
containerStyle.display = "";
|
||||
}
|
||||
var bbox = {};
|
||||
try {
|
||||
bbox = this.node.getBBox();
|
||||
} catch(e) {
|
||||
// Firefox 3.0.x plays badly here
|
||||
// Firefox 3.0.x, 25.0.1 (probably more versions affected) play badly here - possible fix
|
||||
bbox = {
|
||||
x: this.node.clientLeft,
|
||||
y: this.node.clientTop,
|
||||
width: this.node.clientWidth,
|
||||
height: this.node.clientHeight
|
||||
}
|
||||
} finally {
|
||||
bbox = bbox || {};
|
||||
if(canvasHidden){
|
||||
containerStyle.display = "none";
|
||||
}
|
||||
}
|
||||
hide && this.hide();
|
||||
return bbox;
|
||||
@@ -6818,11 +6912,8 @@
|
||||
if (this.removed) {
|
||||
return this;
|
||||
}
|
||||
if (this.node.parentNode.tagName.toLowerCase() == "a") {
|
||||
this.node.parentNode.parentNode.appendChild(this.node.parentNode);
|
||||
} else {
|
||||
this.node.parentNode.appendChild(this.node);
|
||||
}
|
||||
var node = getRealNode(this.node);
|
||||
node.parentNode.appendChild(node);
|
||||
var svg = this.paper;
|
||||
svg.top != this && R._tofront(this, svg);
|
||||
return this;
|
||||
@@ -6838,12 +6929,9 @@
|
||||
if (this.removed) {
|
||||
return this;
|
||||
}
|
||||
var parent = this.node.parentNode;
|
||||
if (parent.tagName.toLowerCase() == "a") {
|
||||
parent.parentNode.insertBefore(this.node.parentNode, this.node.parentNode.parentNode.firstChild);
|
||||
} else if (parent.firstChild != this.node) {
|
||||
parent.insertBefore(this.node, this.node.parentNode.firstChild);
|
||||
}
|
||||
var node = getRealNode(this.node);
|
||||
var parentNode = node.parentNode;
|
||||
parentNode.insertBefore(node, parentNode.firstChild);
|
||||
R._toback(this, this.paper);
|
||||
var svg = this.paper;
|
||||
return this;
|
||||
@@ -6856,14 +6944,16 @@
|
||||
= (object) @Element
|
||||
\*/
|
||||
elproto.insertAfter = function (element) {
|
||||
if (this.removed) {
|
||||
if (this.removed || !element) {
|
||||
return this;
|
||||
}
|
||||
var node = element.node || element[element.length - 1].node;
|
||||
if (node.nextSibling) {
|
||||
node.parentNode.insertBefore(this.node, node.nextSibling);
|
||||
|
||||
var node = getRealNode(this.node);
|
||||
var afterNode = getRealNode(element.node || element[element.length - 1].node);
|
||||
if (afterNode.nextSibling) {
|
||||
afterNode.parentNode.insertBefore(node, afterNode.nextSibling);
|
||||
} else {
|
||||
node.parentNode.appendChild(this.node);
|
||||
afterNode.parentNode.appendChild(node);
|
||||
}
|
||||
R._insertafter(this, element, this.paper);
|
||||
return this;
|
||||
@@ -6876,11 +6966,13 @@
|
||||
= (object) @Element
|
||||
\*/
|
||||
elproto.insertBefore = function (element) {
|
||||
if (this.removed) {
|
||||
if (this.removed || !element) {
|
||||
return this;
|
||||
}
|
||||
var node = element.node || element[0].node;
|
||||
node.parentNode.insertBefore(this.node, node);
|
||||
|
||||
var node = getRealNode(this.node);
|
||||
var beforeNode = getRealNode(element.node || element[0].node);
|
||||
beforeNode.parentNode.insertBefore(node, beforeNode);
|
||||
R._insertbefore(this, element, this.paper);
|
||||
return this;
|
||||
};
|
||||
@@ -6920,7 +7012,7 @@
|
||||
var el = $("rect");
|
||||
svg.canvas && svg.canvas.appendChild(el);
|
||||
var res = new Element(el, svg);
|
||||
res.attrs = {x: x, y: y, width: w, height: h, r: r || 0, rx: r || 0, ry: r || 0, fill: "none", stroke: "#000"};
|
||||
res.attrs = {x: x, y: y, width: w, height: h, rx: r || 0, ry: r || 0, fill: "none", stroke: "#000"};
|
||||
res.type = "rect";
|
||||
$(el, res.attrs);
|
||||
return res;
|
||||
@@ -6953,7 +7045,8 @@
|
||||
y: y,
|
||||
"text-anchor": "middle",
|
||||
text: text,
|
||||
font: R._availableAttrs.font,
|
||||
"font-family": R._availableAttrs["font-family"],
|
||||
"font-size": R._availableAttrs["font-size"],
|
||||
stroke: "none",
|
||||
fill: "#000"
|
||||
};
|
||||
@@ -6992,7 +7085,8 @@
|
||||
height: height,
|
||||
version: 1.1,
|
||||
width: width,
|
||||
xmlns: "http://www.w3.org/2000/svg"
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
||||
});
|
||||
if (container == 1) {
|
||||
cnvs.style.cssText = css + "position:absolute;left:" + x + "px;top:" + y + "px";
|
||||
@@ -7018,9 +7112,10 @@
|
||||
};
|
||||
R._engine.setViewBox = function (x, y, w, h, fit) {
|
||||
eve("raphael.setViewBox", this, this._viewBox, [x, y, w, h, fit]);
|
||||
var size = mmax(w / this.width, h / this.height),
|
||||
var paperSize = this.getSize(),
|
||||
size = mmax(w / paperSize.width, h / paperSize.height),
|
||||
top = this.top,
|
||||
aspectRatio = fit ? "meet" : "xMinYMin",
|
||||
aspectRatio = fit ? "xMidYMid meet" : "xMinYMin",
|
||||
vb,
|
||||
sw;
|
||||
if (x == null) {
|
||||
@@ -7154,7 +7249,7 @@
|
||||
bites = /([clmz]),?([^clmz]*)/gi,
|
||||
blurregexp = / progid:\S+Blur\([^\)]+\)/g,
|
||||
val = /-?[^,\s-]+/g,
|
||||
cssDot = "position:absolute;left:0;top:0;width:1px;height:1px",
|
||||
cssDot = "position:absolute;left:0;top:0;width:1px;height:1px;behavior:url(#default#VML)",
|
||||
zoom = 21600,
|
||||
pathTypes = {path: 1, rect: 1, image: 1},
|
||||
ovalTypes = {circle: 1, ellipse: 1},
|
||||
@@ -7298,6 +7393,7 @@
|
||||
"blur" in params && o.blur(params.blur);
|
||||
if (params.path && o.type == "path" || newpath) {
|
||||
node.path = path2vml(~Str(a.path).toLowerCase().indexOf("r") ? R._pathToAbsolute(a.path) : a.path);
|
||||
o._.dirty = 1;
|
||||
if (o.type == "image") {
|
||||
o._.fillpos = [a.x, a.y];
|
||||
o._.fillsize = [a.width, a.height];
|
||||
@@ -7433,7 +7529,7 @@
|
||||
params["stroke-linejoin"] && (stroke.joinstyle = params["stroke-linejoin"] || "miter");
|
||||
stroke.miterlimit = params["stroke-miterlimit"] || 8;
|
||||
params["stroke-linecap"] && (stroke.endcap = params["stroke-linecap"] == "butt" ? "flat" : params["stroke-linecap"] == "square" ? "square" : "round");
|
||||
if (params["stroke-dasharray"]) {
|
||||
if ("stroke-dasharray" in params) {
|
||||
var dasharray = {
|
||||
"-": "shortdash",
|
||||
".": "shortdot",
|
||||
@@ -7623,7 +7719,10 @@
|
||||
skew.matrix = Str(matrix);
|
||||
skew.offset = matrix.offset();
|
||||
}
|
||||
oldt && (this._.transform = oldt);
|
||||
if (oldt !== null) { // empty string value is true as well
|
||||
this._.transform = oldt;
|
||||
R._extractTransform(this, oldt);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
elproto.rotate = function (deg, cx, cy) {
|
||||
@@ -7699,6 +7798,26 @@
|
||||
!this.removed && (this.node.style.display = E);
|
||||
return this;
|
||||
};
|
||||
// Needed to fix the vml setViewBox issues
|
||||
elproto.auxGetBBox = R.el.getBBox;
|
||||
elproto.getBBox = function(){
|
||||
var b = this.auxGetBBox();
|
||||
if (this.paper && this.paper._viewBoxShift)
|
||||
{
|
||||
var c = {};
|
||||
var z = 1/this.paper._viewBoxShift.scale;
|
||||
c.x = b.x - this.paper._viewBoxShift.dx;
|
||||
c.x *= z;
|
||||
c.y = b.y - this.paper._viewBoxShift.dy;
|
||||
c.y *= z;
|
||||
c.width = b.width * z;
|
||||
c.height = b.height * z;
|
||||
c.x2 = c.x + c.width;
|
||||
c.y2 = c.y + c.height;
|
||||
return c;
|
||||
}
|
||||
return b;
|
||||
};
|
||||
elproto._getBBox = function () {
|
||||
if (this.removed) {
|
||||
return {};
|
||||
@@ -7988,9 +8107,9 @@
|
||||
};
|
||||
R._engine.setViewBox = function (x, y, w, h, fit) {
|
||||
R.eve("raphael.setViewBox", this, this._viewBox, [x, y, w, h, fit]);
|
||||
var width = this.width,
|
||||
height = this.height,
|
||||
size = 1 / mmax(w / width, h / height),
|
||||
var paperSize = this.getSize(),
|
||||
width = paperSize.width,
|
||||
height = paperSize.height,
|
||||
H, W;
|
||||
if (fit) {
|
||||
H = height / h;
|
||||
@@ -8006,7 +8125,7 @@
|
||||
this._viewBoxShift = {
|
||||
dx: -x,
|
||||
dy: -y,
|
||||
scale: size
|
||||
scale: paperSize
|
||||
};
|
||||
this.forEach(function (el) {
|
||||
el.transform("...");
|
||||
@@ -8016,7 +8135,13 @@
|
||||
var createNode;
|
||||
R._engine.initWin = function (win) {
|
||||
var doc = win.document;
|
||||
doc.createStyleSheet().addRule(".rvml", "behavior:url(#default#VML)");
|
||||
if (doc.styleSheets.length < 31) {
|
||||
doc.createStyleSheet().addRule(".rvml", "behavior:url(#default#VML)");
|
||||
} else {
|
||||
// no more room, add to the existing one
|
||||
// http://msdn.microsoft.com/en-us/library/ms531194%28VS.85%29.aspx
|
||||
doc.styleSheets[0].addRule(".rvml", "behavior:url(#default#VML)");
|
||||
}
|
||||
try {
|
||||
!doc.namespaces.rvml && doc.namespaces.add("rvml", "urn:schemas-microsoft-com:vml");
|
||||
createNode = function (tagName) {
|
||||
@@ -8107,5 +8232,8 @@
|
||||
// Even with AMD, Raphael should be defined globally
|
||||
oldRaphael.was ? (g.win.Raphael = R) : (Raphael = R);
|
||||
|
||||
if(typeof exports == "object"){
|
||||
module.exports = R;
|
||||
}
|
||||
return R;
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user