Current Dev State

This commit is contained in:
Tim Lorsbach
2025-06-23 20:13:54 +02:00
parent b4f9bb277d
commit ded50edaa2
22617 changed files with 4345095 additions and 174 deletions

View File

@ -0,0 +1,22 @@
## Want to contribute?
All changes in code must go to `raphael.core`, `raphael.svg` or `raphael.vml`.
The rest are generated files, generated after running `npm run build`.
To run tests you need to open `dev/test/index.html` in your browser, there's no automated way right now.
After changing the core/vml/svg files, execute `npm run build` to generate all versions, make a commit and you are ready to make a pull request!
Remember that if you want to add a functionality it must be present in the vml and svg versions, **no svg-only features will be accepted.**
## Found an issue?
First search for similar issues to make sure you don't repeat an existing one.
Then please create a fiddle ([jsfiddle](http://jsfiddle.net/SSJJT/)) recreating the bug so we can find out what the problem is more easily (or be a hero and find it yourself and send a pull request!). You can also use the [raphael playground](http://raphaeljs.com/playground.html) to reproduce your issues.
Remember to add all the info that can be useful such as
* error details
* steps to reproduce
* browser and its version
* any suggestion of what do you think the problem could be

72
static/js/ketcher2/node_modules/raphael/Gruntfile.js generated vendored Normal file
View File

@ -0,0 +1,72 @@
"use strict";
module.exports = function(grunt) {
var pkg = grunt.file.readJSON("package.json");
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: pkg,
banner: grunt.file.read("dev/copy.js").replace(/@VERSION/, pkg.version),
// Task configuration.
uglify: {
options: {
banner: "<%= banner %>"
},
dist: {
src: "<%= concat.dist.dest %>",
dest: "<%= pkg.name %>-min.js"
},
nodeps: {
src: "<%= concat.nodeps.dest %>",
dest: "<%= pkg.name %>-nodeps-min.js"
}
},
replace: {
dist: {
options: {
patterns: [{
match: "VERSION",
replacement: "<%= pkg.version %>"
}]
},
files: [{
expand: true,
flatten: true,
src: ["<%= concat.dist.dest %>", "<%= concat.nodeps.dest %>"],
dest: "./"
}]
}
},
concat: {
dist: {
dest: "<%= pkg.name %>.js",
src: [
"dev/eve.js",
"dev/raphael.core.js",
"dev/raphael.svg.js",
"dev/raphael.vml.js",
"dev/raphael.amd.js"
]
},
nodeps: {
dest: "<%= pkg.name %>-nodeps.js",
src: [
"dev/raphael.core.js",
"dev/raphael.svg.js",
"dev/raphael.vml.js",
"dev/raphael.amd.js"
]
}
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-replace");
// Default task.
grunt.registerTask("default", ["concat", "replace", "uglify"]);
};

75
static/js/ketcher2/node_modules/raphael/README.md generated vendored Normal file
View File

@ -0,0 +1,75 @@
# Raphaël: Cross-browser vector graphics the easy way.
Visit the library website for more information: ~~[http://raphaeljs.com](http://raphaeljs.com/)~~ [http://dmitrybaranovskiy.github.io/raphael/](http://dmitrybaranovskiy.github.io/raphael/)
## Quickstart guide
You need to have NPM installed to build the library.
* `git clone https://github.com/DmitryBaranovskiy/raphael.git`
* `npm run start`
* `npm run build`
To run tests you need to open `dev/test/index.html` in your browser, there's no automated way right now.
## Dependencies
* [eve](https://github.com/adobe-webplatform/eve)
## Distributable
All files are UMD compliant.
You can use:
* `raphael.min.js` (includes `eve` and it's minified)
* `raphael.js` (includes `eve` and it's not minified)
* `raphael.no-deps.js` (doesn't include `eve` it's not minified)
* `raphael.no-deps.min.js` (doesn't include `eve` it's minified)
## Where to start
Check [Raphael-boilerplate](https://github.com/tomasAlabes/raphael-boilerplate) to see examples of loading.
Raphael can be loaded in a script tag or with AMD:
```js
define([ "path/to/raphael" ], function( Raphael ) {
console.log( Raphael );
});
```
## Development
Versions will be released as we gather and test new PRs.
As there are a lot of browsers being supported it might take a while to accept a PR, we will use the feedback from other users too.
You can use the `raphaelTest.html` to try things, you need to start a server in the root dir to start testing things there.
Something like running `python -m SimpleHTTPServer` in the `raphael` directory and hitting `http://localhost:8000/dev/raphaelTest.html` with the browser. You should run `npm run start` before this can work.
## Collaborators
* [tomasAlabes](https://github.com/tomasAlabes)
## Related Projects
* [graphael](https://github.com/DmitryBaranovskiy/g.raphael/tree/master)
* [raphael.boilerplate](https://github.com/tomasAlabes/raphael-boilerplate)
* [backbone.raphael](https://github.com/tomasAlabes/backbone.raphael)
* [mapael](https://github.com/neveldo/jQuery-Mapael)
* [snap](https://github.com/adobe-webplatform/Snap.svg)
## Books
* [Learning Raphael JS Vector Graphics](http://shop.oreilly.com/product/9781782169161.do)
* [RaphaelJS](http://shop.oreilly.com/product/0636920029601.do)
* [Instant RaphaelJS Starter](http://shop.oreilly.com/product/9781782169857.do)
## Copyright and license
Copyright © 2008-2013 Dmitry Baranovskiy (http://dmitrybaranovskiy.github.io/raphael/)
Copyright © 2008-2013 Sencha Labs (http://sencha.com)
Licensed under the **MIT** (http://dmitrybaranovskiy.github.io/raphael/license.html) license.

31
static/js/ketcher2/node_modules/raphael/bower.json generated vendored Normal file
View File

@ -0,0 +1,31 @@
{
"name": "raphael",
"main": "raphael.min.js",
"description": "JavaScript Vector Library",
"dependencies": {
"eve-raphael": "0.5.0"
},
"devDependencies": {
"requirejs": "2.3.2"
},
"moduleType": [
"amd",
"globals",
"node"
],
"keywords": ["svg", "vml", "javascript"],
"authors": [
"Dmitry Baranovskiy"
],
"license": "MIT",
"ignore": [
"**/.*",
"*.html",
"*.json",
"*.markdown",
"*.md",
"copy.js",
"Gruntfile.js",
"reference.js"
]
}

View File

@ -0,0 +1,8 @@
// ┌───────────────────────────────────────────────────────────────────────────────────────────────────────┐ \\
// │ Raphaël 2.2.0 - JavaScript Vector Library │ \\
// ├───────────────────────────────────────────────────────────────────────────────────────────────────────┤ \\
// │ Copyright © 2008-2016 Dmitry Baranovskiy (http://raphaeljs.com) │ \\
// │ Copyright © 2008-2016 Sencha Labs (http://sencha.com) │ \\
// ├───────────────────────────────────────────────────────────────────────────────────────────────────────┤ \\
// │ Licensed under the MIT (https://github.com/DmitryBaranovskiy/raphael/blob/master/license.txt) license.│ \\
// └───────────────────────────────────────────────────────────────────────────────────────────────────────┘ \\

View File

@ -0,0 +1,5 @@
define(["./raphael.core", "./raphael.svg", "./raphael.vml"], function(R) {
return R;
});

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,999 @@
define(["./raphael.core"], function(R) {
if (R && !R.vml) {
return;
}
var has = "hasOwnProperty",
Str = String,
toFloat = parseFloat,
math = Math,
round = math.round,
mmax = math.max,
mmin = math.min,
abs = math.abs,
fillString = "fill",
separator = /[, ]+/,
eve = R.eve,
ms = " progid:DXImageTransform.Microsoft",
S = " ",
E = "",
map = {M: "m", L: "l", C: "c", Z: "x", m: "t", l: "r", c: "v", z: "x"},
bites = /([clmz]),?([^clmz]*)/gi,
blurregexp = / progid:\S+Blur\([^\)]+\)/g,
val = /-?[^,\s-]+/g,
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},
path2vml = function (path) {
var total = /[ahqstv]/ig,
command = R._pathToAbsolute;
Str(path).match(total) && (command = R._path2curve);
total = /[clmz]/g;
if (command == R._pathToAbsolute && !Str(path).match(total)) {
var res = Str(path).replace(bites, function (all, command, args) {
var vals = [],
isMove = command.toLowerCase() == "m",
res = map[command];
args.replace(val, function (value) {
if (isMove && vals.length == 2) {
res += vals + map[command == "m" ? "l" : "L"];
vals = [];
}
vals.push(round(value * zoom));
});
return res + vals;
});
return res;
}
var pa = command(path), p, r;
res = [];
for (var i = 0, ii = pa.length; i < ii; i++) {
p = pa[i];
r = pa[i][0].toLowerCase();
r == "z" && (r = "x");
for (var j = 1, jj = p.length; j < jj; j++) {
r += round(p[j] * zoom) + (j != jj - 1 ? "," : E);
}
res.push(r);
}
return res.join(S);
},
compensation = function (deg, dx, dy) {
var m = R.matrix();
m.rotate(-deg, .5, .5);
return {
dx: m.x(dx, dy),
dy: m.y(dx, dy)
};
},
setCoords = function (p, sx, sy, dx, dy, deg) {
var _ = p._,
m = p.matrix,
fillpos = _.fillpos,
o = p.node,
s = o.style,
y = 1,
flip = "",
dxdy,
kx = zoom / sx,
ky = zoom / sy;
s.visibility = "hidden";
if (!sx || !sy) {
return;
}
o.coordsize = abs(kx) + S + abs(ky);
s.rotation = deg * (sx * sy < 0 ? -1 : 1);
if (deg) {
var c = compensation(deg, dx, dy);
dx = c.dx;
dy = c.dy;
}
sx < 0 && (flip += "x");
sy < 0 && (flip += " y") && (y = -1);
s.flip = flip;
o.coordorigin = (dx * -kx) + S + (dy * -ky);
if (fillpos || _.fillsize) {
var fill = o.getElementsByTagName(fillString);
fill = fill && fill[0];
o.removeChild(fill);
if (fillpos) {
c = compensation(deg, m.x(fillpos[0], fillpos[1]), m.y(fillpos[0], fillpos[1]));
fill.position = c.dx * y + S + c.dy * y;
}
if (_.fillsize) {
fill.size = _.fillsize[0] * abs(sx) + S + _.fillsize[1] * abs(sy);
}
o.appendChild(fill);
}
s.visibility = "visible";
};
R.toString = function () {
return "Your browser doesn\u2019t support SVG. Falling down to VML.\nYou are running Rapha\xebl " + this.version;
};
var addArrow = function (o, value, isEnd) {
var values = Str(value).toLowerCase().split("-"),
se = isEnd ? "end" : "start",
i = values.length,
type = "classic",
w = "medium",
h = "medium";
while (i--) {
switch (values[i]) {
case "block":
case "classic":
case "oval":
case "diamond":
case "open":
case "none":
type = values[i];
break;
case "wide":
case "narrow": h = values[i]; break;
case "long":
case "short": w = values[i]; break;
}
}
var stroke = o.node.getElementsByTagName("stroke")[0];
stroke[se + "arrow"] = type;
stroke[se + "arrowlength"] = w;
stroke[se + "arrowwidth"] = h;
},
setFillAndStroke = function (o, params) {
// o.paper.canvas.style.display = "none";
o.attrs = o.attrs || {};
var node = o.node,
a = o.attrs,
s = node.style,
xy,
newpath = pathTypes[o.type] && (params.x != a.x || params.y != a.y || params.width != a.width || params.height != a.height || params.cx != a.cx || params.cy != a.cy || params.rx != a.rx || params.ry != a.ry || params.r != a.r),
isOval = ovalTypes[o.type] && (a.cx != params.cx || a.cy != params.cy || a.r != params.r || a.rx != params.rx || a.ry != params.ry),
res = o;
for (var par in params) if (params[has](par)) {
a[par] = params[par];
}
if (newpath) {
a.path = R._getPath[o.type](o);
o._.dirty = 1;
}
params.href && (node.href = params.href);
params.title && (node.title = params.title);
params.target && (node.target = params.target);
params.cursor && (s.cursor = params.cursor);
"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];
setCoords(o, 1, 1, 0, 0, 0);
}
}
"transform" in params && o.transform(params.transform);
if (isOval) {
var cx = +a.cx,
cy = +a.cy,
rx = +a.rx || +a.r || 0,
ry = +a.ry || +a.r || 0;
node.path = R.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x", round((cx - rx) * zoom), round((cy - ry) * zoom), round((cx + rx) * zoom), round((cy + ry) * zoom), round(cx * zoom));
o._.dirty = 1;
}
if ("clip-rect" in params) {
var rect = Str(params["clip-rect"]).split(separator);
if (rect.length == 4) {
rect[2] = +rect[2] + (+rect[0]);
rect[3] = +rect[3] + (+rect[1]);
var div = node.clipRect || R._g.doc.createElement("div"),
dstyle = div.style;
dstyle.clip = R.format("rect({1}px {2}px {3}px {0}px)", rect);
if (!node.clipRect) {
dstyle.position = "absolute";
dstyle.top = 0;
dstyle.left = 0;
dstyle.width = o.paper.width + "px";
dstyle.height = o.paper.height + "px";
node.parentNode.insertBefore(div, node);
div.appendChild(node);
node.clipRect = div;
}
}
if (!params["clip-rect"]) {
node.clipRect && (node.clipRect.style.clip = "auto");
}
}
if (o.textpath) {
var textpathStyle = o.textpath.style;
params.font && (textpathStyle.font = params.font);
params["font-family"] && (textpathStyle.fontFamily = '"' + params["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g, E) + '"');
params["font-size"] && (textpathStyle.fontSize = params["font-size"]);
params["font-weight"] && (textpathStyle.fontWeight = params["font-weight"]);
params["font-style"] && (textpathStyle.fontStyle = params["font-style"]);
}
if ("arrow-start" in params) {
addArrow(res, params["arrow-start"]);
}
if ("arrow-end" in params) {
addArrow(res, params["arrow-end"], 1);
}
if (params.opacity != null ||
params.fill != null ||
params.src != null ||
params.stroke != null ||
params["stroke-width"] != null ||
params["stroke-opacity"] != null ||
params["fill-opacity"] != null ||
params["stroke-dasharray"] != null ||
params["stroke-miterlimit"] != null ||
params["stroke-linejoin"] != null ||
params["stroke-linecap"] != null) {
var fill = node.getElementsByTagName(fillString),
newfill = false;
fill = fill && fill[0];
!fill && (newfill = fill = createNode(fillString));
if (o.type == "image" && params.src) {
fill.src = params.src;
}
params.fill && (fill.on = true);
if (fill.on == null || params.fill == "none" || params.fill === null) {
fill.on = false;
}
if (fill.on && params.fill) {
var isURL = Str(params.fill).match(R._ISURL);
if (isURL) {
fill.parentNode == node && node.removeChild(fill);
fill.rotate = true;
fill.src = isURL[1];
fill.type = "tile";
var bbox = o.getBBox(1);
fill.position = bbox.x + S + bbox.y;
o._.fillpos = [bbox.x, bbox.y];
R._preload(isURL[1], function () {
o._.fillsize = [this.offsetWidth, this.offsetHeight];
});
} else {
fill.color = R.getRGB(params.fill).hex;
fill.src = E;
fill.type = "solid";
if (R.getRGB(params.fill).error && (res.type in {circle: 1, ellipse: 1} || Str(params.fill).charAt() != "r") && addGradientFill(res, params.fill, fill)) {
a.fill = "none";
a.gradient = params.fill;
fill.rotate = false;
}
}
}
if ("fill-opacity" in params || "opacity" in params) {
var opacity = ((+a["fill-opacity"] + 1 || 2) - 1) * ((+a.opacity + 1 || 2) - 1) * ((+R.getRGB(params.fill).o + 1 || 2) - 1);
opacity = mmin(mmax(opacity, 0), 1);
fill.opacity = opacity;
if (fill.src) {
fill.color = "none";
}
}
node.appendChild(fill);
var stroke = (node.getElementsByTagName("stroke") && node.getElementsByTagName("stroke")[0]),
newstroke = false;
!stroke && (newstroke = stroke = createNode("stroke"));
if ((params.stroke && params.stroke != "none") ||
params["stroke-width"] ||
params["stroke-opacity"] != null ||
params["stroke-dasharray"] ||
params["stroke-miterlimit"] ||
params["stroke-linejoin"] ||
params["stroke-linecap"]) {
stroke.on = true;
}
(params.stroke == "none" || params.stroke === null || stroke.on == null || params.stroke == 0 || params["stroke-width"] == 0) && (stroke.on = false);
var strokeColor = R.getRGB(params.stroke);
stroke.on && params.stroke && (stroke.color = strokeColor.hex);
opacity = ((+a["stroke-opacity"] + 1 || 2) - 1) * ((+a.opacity + 1 || 2) - 1) * ((+strokeColor.o + 1 || 2) - 1);
var width = (toFloat(params["stroke-width"]) || 1) * .75;
opacity = mmin(mmax(opacity, 0), 1);
params["stroke-width"] == null && (width = a["stroke-width"]);
params["stroke-width"] && (stroke.weight = width);
width && width < 1 && (opacity *= width) && (stroke.weight = 1);
stroke.opacity = opacity;
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 ("stroke-dasharray" in params) {
var dasharray = {
"-": "shortdash",
".": "shortdot",
"-.": "shortdashdot",
"-..": "shortdashdotdot",
". ": "dot",
"- ": "dash",
"--": "longdash",
"- .": "dashdot",
"--.": "longdashdot",
"--..": "longdashdotdot"
};
stroke.dashstyle = dasharray[has](params["stroke-dasharray"]) ? dasharray[params["stroke-dasharray"]] : E;
}
newstroke && node.appendChild(stroke);
}
if (res.type == "text") {
res.paper.canvas.style.display = E;
var span = res.paper.span,
m = 100,
fontSize = a.font && a.font.match(/\d+(?:\.\d*)?(?=px)/);
s = span.style;
a.font && (s.font = a.font);
a["font-family"] && (s.fontFamily = a["font-family"]);
a["font-weight"] && (s.fontWeight = a["font-weight"]);
a["font-style"] && (s.fontStyle = a["font-style"]);
fontSize = toFloat(a["font-size"] || fontSize && fontSize[0]) || 10;
s.fontSize = fontSize * m + "px";
res.textpath.string && (span.innerHTML = Str(res.textpath.string).replace(/</g, "&#60;").replace(/&/g, "&#38;").replace(/\n/g, "<br>"));
var brect = span.getBoundingClientRect();
res.W = a.w = (brect.right - brect.left) / m;
res.H = a.h = (brect.bottom - brect.top) / m;
// res.paper.canvas.style.display = "none";
res.X = a.x;
res.Y = a.y + res.H / 2;
("x" in params || "y" in params) && (res.path.v = R.format("m{0},{1}l{2},{1}", round(a.x * zoom), round(a.y * zoom), round(a.x * zoom) + 1));
var dirtyattrs = ["x", "y", "text", "font", "font-family", "font-weight", "font-style", "font-size"];
for (var d = 0, dd = dirtyattrs.length; d < dd; d++) if (dirtyattrs[d] in params) {
res._.dirty = 1;
break;
}
// text-anchor emulation
switch (a["text-anchor"]) {
case "start":
res.textpath.style["v-text-align"] = "left";
res.bbx = res.W / 2;
break;
case "end":
res.textpath.style["v-text-align"] = "right";
res.bbx = -res.W / 2;
break;
default:
res.textpath.style["v-text-align"] = "center";
res.bbx = 0;
break;
}
res.textpath.style["v-text-kern"] = true;
}
// res.paper.canvas.style.display = E;
},
addGradientFill = function (o, gradient, fill) {
o.attrs = o.attrs || {};
var attrs = o.attrs,
pow = Math.pow,
opacity,
oindex,
type = "linear",
fxfy = ".5 .5";
o.attrs.gradient = gradient;
gradient = Str(gradient).replace(R._radial_gradient, function (all, fx, fy) {
type = "radial";
if (fx && fy) {
fx = toFloat(fx);
fy = toFloat(fy);
pow(fx - .5, 2) + pow(fy - .5, 2) > .25 && (fy = math.sqrt(.25 - pow(fx - .5, 2)) * ((fy > .5) * 2 - 1) + .5);
fxfy = fx + S + fy;
}
return E;
});
gradient = gradient.split(/\s*\-\s*/);
if (type == "linear") {
var angle = gradient.shift();
angle = -toFloat(angle);
if (isNaN(angle)) {
return null;
}
}
var dots = R._parseDots(gradient);
if (!dots) {
return null;
}
o = o.shape || o.node;
if (dots.length) {
o.removeChild(fill);
fill.on = true;
fill.method = "none";
fill.color = dots[0].color;
fill.color2 = dots[dots.length - 1].color;
var clrs = [];
for (var i = 0, ii = dots.length; i < ii; i++) {
dots[i].offset && clrs.push(dots[i].offset + S + dots[i].color);
}
fill.colors = clrs.length ? clrs.join() : "0% " + fill.color;
if (type == "radial") {
fill.type = "gradientTitle";
fill.focus = "100%";
fill.focussize = "0 0";
fill.focusposition = fxfy;
fill.angle = 0;
} else {
// fill.rotate= true;
fill.type = "gradient";
fill.angle = (270 - angle) % 360;
}
o.appendChild(fill);
}
return 1;
},
Element = function (node, vml) {
this[0] = this.node = node;
node.raphael = true;
this.id = R._oid++;
node.raphaelid = this.id;
this.X = 0;
this.Y = 0;
this.attrs = {};
this.paper = vml;
this.matrix = R.matrix();
this._ = {
transform: [],
sx: 1,
sy: 1,
dx: 0,
dy: 0,
deg: 0,
dirty: 1,
dirtyT: 1
};
!vml.bottom && (vml.bottom = this);
this.prev = vml.top;
vml.top && (vml.top.next = this);
vml.top = this;
this.next = null;
};
var elproto = R.el;
Element.prototype = elproto;
elproto.constructor = Element;
elproto.transform = function (tstr) {
if (tstr == null) {
return this._.transform;
}
var vbs = this.paper._viewBoxShift,
vbt = vbs ? "s" + [vbs.scale, vbs.scale] + "-1-1t" + [vbs.dx, vbs.dy] : E,
oldt;
if (vbs) {
oldt = tstr = Str(tstr).replace(/\.{3}|\u2026/g, this._.transform || E);
}
R._extractTransform(this, vbt + tstr);
var matrix = this.matrix.clone(),
skew = this.skew,
o = this.node,
split,
isGrad = ~Str(this.attrs.fill).indexOf("-"),
isPatt = !Str(this.attrs.fill).indexOf("url(");
matrix.translate(1, 1);
if (isPatt || isGrad || this.type == "image") {
skew.matrix = "1 0 0 1";
skew.offset = "0 0";
split = matrix.split();
if ((isGrad && split.noRotation) || !split.isSimple) {
o.style.filter = matrix.toFilter();
var bb = this.getBBox(),
bbt = this.getBBox(1),
dx = bb.x - bbt.x,
dy = bb.y - bbt.y;
o.coordorigin = (dx * -zoom) + S + (dy * -zoom);
setCoords(this, 1, 1, dx, dy, 0);
} else {
o.style.filter = E;
setCoords(this, split.scalex, split.scaley, split.dx, split.dy, split.rotate);
}
} else {
o.style.filter = E;
skew.matrix = Str(matrix);
skew.offset = matrix.offset();
}
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) {
if (this.removed) {
return this;
}
if (deg == null) {
return;
}
deg = Str(deg).split(separator);
if (deg.length - 1) {
cx = toFloat(deg[1]);
cy = toFloat(deg[2]);
}
deg = toFloat(deg[0]);
(cy == null) && (cx = cy);
if (cx == null || cy == null) {
var bbox = this.getBBox(1);
cx = bbox.x + bbox.width / 2;
cy = bbox.y + bbox.height / 2;
}
this._.dirtyT = 1;
this.transform(this._.transform.concat([["r", deg, cx, cy]]));
return this;
};
elproto.translate = function (dx, dy) {
if (this.removed) {
return this;
}
dx = Str(dx).split(separator);
if (dx.length - 1) {
dy = toFloat(dx[1]);
}
dx = toFloat(dx[0]) || 0;
dy = +dy || 0;
if (this._.bbox) {
this._.bbox.x += dx;
this._.bbox.y += dy;
}
this.transform(this._.transform.concat([["t", dx, dy]]));
return this;
};
elproto.scale = function (sx, sy, cx, cy) {
if (this.removed) {
return this;
}
sx = Str(sx).split(separator);
if (sx.length - 1) {
sy = toFloat(sx[1]);
cx = toFloat(sx[2]);
cy = toFloat(sx[3]);
isNaN(cx) && (cx = null);
isNaN(cy) && (cy = null);
}
sx = toFloat(sx[0]);
(sy == null) && (sy = sx);
(cy == null) && (cx = cy);
if (cx == null || cy == null) {
var bbox = this.getBBox(1);
}
cx = cx == null ? bbox.x + bbox.width / 2 : cx;
cy = cy == null ? bbox.y + bbox.height / 2 : cy;
this.transform(this._.transform.concat([["s", sx, sy, cx, cy]]));
this._.dirtyT = 1;
return this;
};
elproto.hide = function () {
!this.removed && (this.node.style.display = "none");
return this;
};
elproto.show = function () {
!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 {};
}
return {
x: this.X + (this.bbx || 0) - this.W / 2,
y: this.Y - this.H,
width: this.W,
height: this.H
};
};
elproto.remove = function () {
if (this.removed || !this.node.parentNode) {
return;
}
this.paper.__set__ && this.paper.__set__.exclude(this);
R.eve.unbind("raphael.*.*." + this.id);
R._tear(this, this.paper);
this.node.parentNode.removeChild(this.node);
this.shape && this.shape.parentNode.removeChild(this.shape);
for (var i in this) {
this[i] = typeof this[i] == "function" ? R._removedFactory(i) : null;
}
this.removed = true;
};
elproto.attr = function (name, value) {
if (this.removed) {
return this;
}
if (name == null) {
var res = {};
for (var a in this.attrs) if (this.attrs[has](a)) {
res[a] = this.attrs[a];
}
res.gradient && res.fill == "none" && (res.fill = res.gradient) && delete res.gradient;
res.transform = this._.transform;
return res;
}
if (value == null && R.is(name, "string")) {
if (name == fillString && this.attrs.fill == "none" && this.attrs.gradient) {
return this.attrs.gradient;
}
var names = name.split(separator),
out = {};
for (var i = 0, ii = names.length; i < ii; i++) {
name = names[i];
if (name in this.attrs) {
out[name] = this.attrs[name];
} else if (R.is(this.paper.customAttributes[name], "function")) {
out[name] = this.paper.customAttributes[name].def;
} else {
out[name] = R._availableAttrs[name];
}
}
return ii - 1 ? out : out[names[0]];
}
if (this.attrs && value == null && R.is(name, "array")) {
out = {};
for (i = 0, ii = name.length; i < ii; i++) {
out[name[i]] = this.attr(name[i]);
}
return out;
}
var params;
if (value != null) {
params = {};
params[name] = value;
}
value == null && R.is(name, "object") && (params = name);
for (var key in params) {
eve("raphael.attr." + key + "." + this.id, this, params[key]);
}
if (params) {
for (key in this.paper.customAttributes) if (this.paper.customAttributes[has](key) && params[has](key) && R.is(this.paper.customAttributes[key], "function")) {
var par = this.paper.customAttributes[key].apply(this, [].concat(params[key]));
this.attrs[key] = params[key];
for (var subkey in par) if (par[has](subkey)) {
params[subkey] = par[subkey];
}
}
// this.paper.canvas.style.display = "none";
if (params.text && this.type == "text") {
this.textpath.string = params.text;
}
setFillAndStroke(this, params);
// this.paper.canvas.style.display = E;
}
return this;
};
elproto.toFront = function () {
!this.removed && this.node.parentNode.appendChild(this.node);
this.paper && this.paper.top != this && R._tofront(this, this.paper);
return this;
};
elproto.toBack = function () {
if (this.removed) {
return this;
}
if (this.node.parentNode.firstChild != this.node) {
this.node.parentNode.insertBefore(this.node, this.node.parentNode.firstChild);
R._toback(this, this.paper);
}
return this;
};
elproto.insertAfter = function (element) {
if (this.removed) {
return this;
}
if (element.constructor == R.st.constructor) {
element = element[element.length - 1];
}
if (element.node.nextSibling) {
element.node.parentNode.insertBefore(this.node, element.node.nextSibling);
} else {
element.node.parentNode.appendChild(this.node);
}
R._insertafter(this, element, this.paper);
return this;
};
elproto.insertBefore = function (element) {
if (this.removed) {
return this;
}
if (element.constructor == R.st.constructor) {
element = element[0];
}
element.node.parentNode.insertBefore(this.node, element.node);
R._insertbefore(this, element, this.paper);
return this;
};
elproto.blur = function (size) {
var s = this.node.runtimeStyle,
f = s.filter;
f = f.replace(blurregexp, E);
if (+size !== 0) {
this.attrs.blur = size;
s.filter = f + S + ms + ".Blur(pixelradius=" + (+size || 1.5) + ")";
s.margin = R.format("-{0}px 0 0 -{0}px", round(+size || 1.5));
} else {
s.filter = f;
s.margin = 0;
delete this.attrs.blur;
}
return this;
};
R._engine.path = function (pathString, vml) {
var el = createNode("shape");
el.style.cssText = cssDot;
el.coordsize = zoom + S + zoom;
el.coordorigin = vml.coordorigin;
var p = new Element(el, vml),
attr = {fill: "none", stroke: "#000"};
pathString && (attr.path = pathString);
p.type = "path";
p.path = [];
p.Path = E;
setFillAndStroke(p, attr);
vml.canvas && vml.canvas.appendChild(el);
var skew = createNode("skew");
skew.on = true;
el.appendChild(skew);
p.skew = skew;
p.transform(E);
return p;
};
R._engine.rect = function (vml, x, y, w, h, r) {
var path = R._rectPath(x, y, w, h, r),
res = vml.path(path),
a = res.attrs;
res.X = a.x = x;
res.Y = a.y = y;
res.W = a.width = w;
res.H = a.height = h;
a.r = r;
a.path = path;
res.type = "rect";
return res;
};
R._engine.ellipse = function (vml, x, y, rx, ry) {
var res = vml.path(),
a = res.attrs;
res.X = x - rx;
res.Y = y - ry;
res.W = rx * 2;
res.H = ry * 2;
res.type = "ellipse";
setFillAndStroke(res, {
cx: x,
cy: y,
rx: rx,
ry: ry
});
return res;
};
R._engine.circle = function (vml, x, y, r) {
var res = vml.path(),
a = res.attrs;
res.X = x - r;
res.Y = y - r;
res.W = res.H = r * 2;
res.type = "circle";
setFillAndStroke(res, {
cx: x,
cy: y,
r: r
});
return res;
};
R._engine.image = function (vml, src, x, y, w, h) {
var path = R._rectPath(x, y, w, h),
res = vml.path(path).attr({stroke: "none"}),
a = res.attrs,
node = res.node,
fill = node.getElementsByTagName(fillString)[0];
a.src = src;
res.X = a.x = x;
res.Y = a.y = y;
res.W = a.width = w;
res.H = a.height = h;
a.path = path;
res.type = "image";
fill.parentNode == node && node.removeChild(fill);
fill.rotate = true;
fill.src = src;
fill.type = "tile";
res._.fillpos = [x, y];
res._.fillsize = [w, h];
node.appendChild(fill);
setCoords(res, 1, 1, 0, 0, 0);
return res;
};
R._engine.text = function (vml, x, y, text) {
var el = createNode("shape"),
path = createNode("path"),
o = createNode("textpath");
x = x || 0;
y = y || 0;
text = text || "";
path.v = R.format("m{0},{1}l{2},{1}", round(x * zoom), round(y * zoom), round(x * zoom) + 1);
path.textpathok = true;
o.string = Str(text);
o.on = true;
el.style.cssText = cssDot;
el.coordsize = zoom + S + zoom;
el.coordorigin = "0 0";
var p = new Element(el, vml),
attr = {
fill: "#000",
stroke: "none",
font: R._availableAttrs.font,
text: text
};
p.shape = el;
p.path = path;
p.textpath = o;
p.type = "text";
p.attrs.text = Str(text);
p.attrs.x = x;
p.attrs.y = y;
p.attrs.w = 1;
p.attrs.h = 1;
setFillAndStroke(p, attr);
el.appendChild(o);
el.appendChild(path);
vml.canvas.appendChild(el);
var skew = createNode("skew");
skew.on = true;
el.appendChild(skew);
p.skew = skew;
p.transform(E);
return p;
};
R._engine.setSize = function (width, height) {
var cs = this.canvas.style;
this.width = width;
this.height = height;
width == +width && (width += "px");
height == +height && (height += "px");
cs.width = width;
cs.height = height;
cs.clip = "rect(0 " + width + " " + height + " 0)";
if (this._viewBox) {
R._engine.setViewBox.apply(this, this._viewBox);
}
return this;
};
R._engine.setViewBox = function (x, y, w, h, fit) {
R.eve("raphael.setViewBox", this, this._viewBox, [x, y, w, h, fit]);
var paperSize = this.getSize(),
width = paperSize.width,
height = paperSize.height,
H, W;
if (fit) {
H = height / h;
W = width / w;
if (w * H < width) {
x -= (width - w * H) / 2 / H;
}
if (h * W < height) {
y -= (height - h * W) / 2 / W;
}
}
this._viewBox = [x, y, w, h, !!fit];
this._viewBoxShift = {
dx: -x,
dy: -y,
scale: paperSize
};
this.forEach(function (el) {
el.transform("...");
});
return this;
};
var createNode;
R._engine.initWin = function (win) {
var doc = win.document;
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) {
return doc.createElement('<rvml:' + tagName + ' class="rvml">');
};
} catch (e) {
createNode = function (tagName) {
return doc.createElement('<' + tagName + ' xmlns="urn:schemas-microsoft.com:vml" class="rvml">');
};
}
};
R._engine.initWin(R._g.win);
R._engine.create = function () {
var con = R._getContainer.apply(0, arguments),
container = con.container,
height = con.height,
s,
width = con.width,
x = con.x,
y = con.y;
if (!container) {
throw new Error("VML container not found.");
}
var res = new R._Paper,
c = res.canvas = R._g.doc.createElement("div"),
cs = c.style;
x = x || 0;
y = y || 0;
width = width || 512;
height = height || 342;
res.width = width;
res.height = height;
width == +width && (width += "px");
height == +height && (height += "px");
res.coordsize = zoom * 1e3 + S + zoom * 1e3;
res.coordorigin = "0 0";
res.span = R._g.doc.createElement("span");
res.span.style.cssText = "position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;";
c.appendChild(res.span);
cs.cssText = R.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden", width, height);
if (container == 1) {
R._g.doc.body.appendChild(c);
cs.left = x + "px";
cs.top = y + "px";
cs.position = "absolute";
} else {
if (container.firstChild) {
container.insertBefore(c, container.firstChild);
} else {
container.appendChild(c);
}
}
res.renderfix = function () {};
return res;
};
R.prototype.clear = function () {
R.eve("raphael.clear", this);
this.canvas.innerHTML = E;
this.span = R._g.doc.createElement("span");
this.span.style.cssText = "position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";
this.canvas.appendChild(this.span);
this.bottom = this.top = null;
};
R.prototype.remove = function () {
R.eve("raphael.remove", this);
this.canvas.parentNode.removeChild(this.canvas);
for (var i in this) {
this[i] = typeof this[i] == "function" ? R._removedFactory(i) : null;
}
return true;
};
var setproto = R.st;
for (var method in elproto) if (elproto[has](method) && !setproto[has](method)) {
setproto[method] = (function (methodname) {
return function () {
var arg = arguments;
return this.forEach(function (el) {
el[methodname].apply(el, arg);
});
};
})(method);
}
});

View File

@ -0,0 +1,39 @@
<!DOCTYPE html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<title>Raphael Dev testing html</title>
<!-- HTML to try new developments in Raphael -->
<!-- Global use -->
<!-- To work with full version -->
<script type="text/javascript" src="../bower_components/requirejs/require.js"></script>
<script type="text/javascript" src="../bower_components/eve/eve.js"></script>
<!-- To work with minified version -->
<!--<script type="text/javascript" src="../raphael-min.js"></script>-->
<!-- Comment this script tag if you are testing with AMD -->
<script type="text/javascript">
// Initialize container when document is loaded
window.onload = function () {
require(['../raphael'], function(Raphael) {
var paper = Raphael("container", 640, 720);
paper.circle(100, 100, 100).attr({'fill':'270-#FAE56B:0-#E56B6B:100'}); //example
});
};
//Work here, in a separate script file or via command line
</script>
<!-- Use amdDev.js to work with AMD and Raphael -->
<!-- You need to do a 'bower install -D' first to get requirejs -->
</head>
<body>
<!-- Container for svg/vml root element -->
<div id="container"></div>
</body>
</html>

View File

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Raphael Test Suite</title>
<link rel="stylesheet" href="../../node_modules/qunitjs/qunit/qunit.css" />
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script type="text/javascript" src="../../node_modules/qunitjs/qunit/qunit.js"></script>
<script type="text/javascript" src="../../raphael.js"></script>
<script type="text/javascript">
(function() {
var tests = [
"dom"
];
var typeFolder = Raphael.type.toLowerCase();
for (var i = 0; i < tests.length; i++) {
var s = document.createElement('script');
s.type = "text/javascript";
s.src = typeFolder + "/" + tests[i] + ".js";
document.body.appendChild(s);
}
})();
</script>
</body>
</html>

View File

@ -0,0 +1,317 @@
(function() {
var paper,
url = 'http://raphaeljs.com';
module('DOM', {
setup: function() {
paper = new Raphael(document.getElementById('qunit-fixture'), 1000, 1000);
},
teardown: function() {
paper.remove();
}
});
var equalNodePosition = function(node, expectedParent, expectedPreviousSibling, expectedNextSibling) {
equal(node.parentNode, expectedParent);
equal(node.previousSibling, expectedPreviousSibling);
equal(node.nextSibling, expectedNextSibling);
};
var equalNodePositionWrapped = function(node, anchor, expectedParent, expectedPreviousSibling, expectedNextSibling) {
equal(node.parentNode, anchor);
equalNodePosition(anchor, expectedParent, expectedPreviousSibling, expectedNextSibling);
};
// Element#insertBefore
// --------------------
test('insertBefore: no element', function() {
var el = paper.rect();
el.insertBefore(null);
equalNodePosition(el.node, paper.canvas, paper.defs, null);
});
test('insertBefore: first element', function() {
var x = paper.rect();
var el = paper.rect();
el.insertBefore(x);
equalNodePosition(el.node, paper.canvas, paper.defs, x.node);
});
test('insertBefore: middle element', function() {
var x = paper.rect();
var y = paper.rect();
var el = paper.rect();
el.insertBefore(y);
equalNodePosition(el.node, paper.canvas, x.node, y.node);
});
test('insertBefore: no element when wrapped in <a>', function() {
var el = paper.rect().attr('href', url),
anchor = el.node.parentNode;
el.insertBefore(null);
equalNodePositionWrapped(el.node, anchor, paper.canvas, paper.defs, null);
});
test('insertBefore: first element when wrapped in <a>', function() {
var x = paper.rect();
var el = paper.rect().attr('href', url),
anchor = el.node.parentNode;
el.insertBefore(x);
equalNodePositionWrapped(el.node, anchor, paper.canvas, paper.defs, x.node);
});
test('insertBefore: first element wrapped in <a> and wrapped in <a>', function() {
var x = paper.rect().attr('href', url),
xAnchor = x.node.parentNode;
var el = paper.rect().attr('href', url),
anchor = el.node.parentNode;
el.insertBefore(x);
equalNodePositionWrapped(el.node, anchor, paper.canvas, paper.defs, xAnchor);
});
test('insertBefore: middle element when wrapped in <a>', function() {
var x = paper.rect();
var y = paper.rect();
var el = paper.rect().attr('href', url),
anchor = el.node.parentNode;
el.insertBefore(y);
equalNodePositionWrapped(el.node, anchor, paper.canvas, x.node, y.node);
});
test('insertBefore: middle element wrapped in <a> and wrapped in <a>', function() {
var x = paper.rect().attr('href', url),
xAnchor = x.node.parentNode;
var y = paper.rect().attr('href', url),
yAnchor = y.node.parentNode;
var el = paper.rect().attr('href', url),
anchor = el.node.parentNode;
el.insertBefore(y);
equalNodePositionWrapped(el.node, anchor, paper.canvas, xAnchor, yAnchor);
});
// TODO...
// insertBefore: with set
// insertBefore: with nested set.
// Element#insertAfter
// -------------------
test('insertAfter: no element', function() {
var el = paper.rect();
el.insertAfter(null);
equalNodePosition(el.node, paper.canvas, paper.defs, null);
});
test('insertAfter: last element', function() {
var x = paper.rect();
var el = paper.rect();
el.insertAfter(x);
equalNodePosition(el.node, paper.canvas, x.node, null);
});
test('insertAfter: middle element', function() {
var x = paper.rect();
var y = paper.rect();
var el = paper.rect();
el.insertAfter(x);
equalNodePosition(el.node, paper.canvas, x.node, y.node);
});
test('insertAfter: no element when wrapped in <a>', function() {
var el = paper.rect().attr('href', url),
anchor = el.node.parentNode;
el.insertAfter(null);
equalNodePositionWrapped(el.node, anchor, paper.canvas, paper.defs, null);
});
test('insertAfter: last element when wrapped in <a>', function() {
var x = paper.rect();
var el = paper.rect().attr('href', url),
anchor = el.node.parentNode;
el.insertAfter(x);
equalNodePositionWrapped(el.node, anchor, paper.canvas, x.node, null);
});
test('insertAfter: last element wrapped in <a> and wrapped in <a>', function() {
var x = paper.rect().attr('href', url),
xAnchor = x.node.parentNode;
var el = paper.rect().attr('href', url),
anchor = el.node.parentNode;
el.insertAfter(x);
equalNodePositionWrapped(el.node, anchor, paper.canvas, xAnchor, null);
});
test('insertAfter: middle element when wrapped in <a>', function() {
var x = paper.rect();
var y = paper.rect();
var el = paper.rect().attr('href', url),
anchor = el.node.parentNode;
el.insertAfter(x);
equalNodePositionWrapped(el.node, anchor, paper.canvas, x.node, y.node);
});
test('insertAfter: middle element wrapped in <a> and wrapped in <a>', function() {
var x = paper.rect().attr('href', url),
xAnchor = x.node.parentNode;
var y = paper.rect().attr('href', url),
yAnchor = y.node.parentNode;
var el = paper.rect().attr('href', url),
anchor = el.node.parentNode;
el.insertAfter(x);
equalNodePositionWrapped(el.node, anchor, paper.canvas, xAnchor, yAnchor);
});
// TODO...
// insertAfter: with set
// insertAfter: with nested set.
// Element#remove
// --------------
test('remove: after added', function() {
var el = paper.rect(),
node = el.node;
el.remove();
equal(el.node, null);
equal(node.parentNode, null);
});
test('remove: when wrapped in <a>', function() {
var el = paper.rect().attr('href', url),
node = el.node,
anchor = node.parentNode;
el.remove();
equal(el.node, null);
equal(node.parentNode, anchor);
equal(anchor.parentNode, null);
});
test('remove: when already removed', function() {
var el = paper.rect(),
node = el.node;
el.remove();
el.remove();
equal(el.node, null);
equal(node.parentNode, null);
});
test('remove: when the canvas is removed', function() {
var el = paper.rect(),
node = el.node;
paper.remove();
el.remove();
equal(el.node, null);
equal(node.parentNode, null);
});
// Element#toFront
// --------------
test('toFront: normal', function() {
var el = paper.rect();
var x = paper.rect();
el.toFront();
equalNodePosition(el.node, paper.canvas, x.node, null);
});
test('toFront: when wrapped in <a>', function() {
var el = paper.rect().attr('href', url),
anchor = el.node.parentNode;
var x = paper.rect();
el.toFront();
equalNodePositionWrapped(el.node, anchor, paper.canvas, x.node, null);
});
// Element#toBack
// --------------
test('toBack: normal', function() {
var x = paper.rect();
var el = paper.rect();
el.toBack();
equalNodePosition(el.node, paper.canvas, null, paper.desc);
equalNodePosition(x.node, paper.canvas, paper.defs, null);
});
test('toBack: when wrapped in <a>', function() {
var x = paper.rect();
var el = paper.rect().attr('href', url),
anchor = el.node.parentNode;
el.toBack();
equalNodePositionWrapped(el.node, anchor, paper.canvas, null, paper.desc);
equalNodePosition(x.node, paper.canvas, paper.defs, null);
});
// Element#attrs
// -------------
// #x
// #y
// #rx
// #ry
// #transform
// #title
// #href
//keep adding and testing!
})();

View File

@ -0,0 +1,5 @@
(function() {
module('DOM');
})();

155
static/js/ketcher2/node_modules/raphael/history.md generated vendored Normal file
View File

@ -0,0 +1,155 @@
2.2.7
------------------
* Updating package.json dependencies
* Using custom eve instead of old eve in npm
* Fixed class as a reserved word in old browsers
2.2.5 - 2.2.6
------------------
Duplicated tag by mistake.
* Using custom repo for eve in bower to avoid using a short sha in it.
2.2.4
------------------
* Fixed no-deps version with eve.
2.2.3
------------------
* Changed eve dependencies avoiding short sha and github url
2.2.2
------------------
* Improved elements ids, so multiple raphael instances are more reliable
2.2.1
------------------
* Removed name of amd module
2.2.0
------------------
* Webpack build
* Added tests! (thanks @TheCloudlessSky)
* Strict error on method R.ninja
* Cross-browser gradient fixes
* Reduce transform string to avoid long parsing times after several transformations
* raphael.amd.js as main in package.json.
* raphael.amd.js version to work with Browserify.
* Can't set glow with opacity 0
* Using origin and pathname with gradient urls, urls with # weren't being resolved correctly
* Defined nodeps version, and changed how raphael is loaded
* Set stop-opacity in gradient defs
* Fixed rounding issue in RGB formatter
2.1.4 • 2015-03-09
------------------
* Wrong position in ie7 when rotate image #612
* Gradients become black in some cases
2.1.3 • 2015-02-03
------------------
* Fix wrong variable used in VML setViewBox().
* Missing comma in file
* set-viewbox-variable fix by @TheCloudlessSky
2.1.2 • 2015-08-26
------------------
* isPointInside fix from @drbombay14
* Allow Raphael to work in pages with a Content Security Policy that disallows 'unsafe-eval'
2.1.1 • 2013-08-11
------------------
* Dragging Text under iOS By @vitorhsb
* Dev folder
* Fix to make IE9 display tooltips when setting the title attribute on an element. By @samcrang
* Fix Wrong position after scale path in IE. By @sarvaje
* isPointInside incorrectly caches the path used to calculate its value. By @lvanderbijl
* Raphael.path2curve does not honor original shape. By @timo22345
* IsPointInside fix for transformed paths
2.1.0 • 2012-03-14
------------------
* Put all Eve events into “raphael.” namespace
* Refactored path caching
* Added x2 and y2 to returning bounding box values
* Fixed bug with matrix.f in animation
* Method [Paper.print](http://raphaeljs.com/reference.html#Paper.print) now returns all letters as one path without any transformations applied and supports multiline text
* New methods
* [Element.isPointInside](http://raphaeljs.com/reference.html#Element.isPointInside)
* [Paper.getElementsByPoint](http://raphaeljs.com/reference.html#Paper.getElementsByPoint)
* [Raphael.bezierBBox](http://raphaeljs.com/reference.html#Raphael.bezierBBox)
* [Raphael.isBBoxIntersect](http://raphaeljs.com/reference.html#Raphael.isBBoxIntersect)
* [Raphael.isPointInsideBBox](http://raphaeljs.com/reference.html#Raphael.isPointInsideBBox)
* [Raphael.isPointInsidePath](http://raphaeljs.com/reference.html#Raphael.isPointInsidePath)
* [Raphael.pathBBox](http://raphaeljs.com/reference.html#Raphael.pathBBox)
* [Raphael.pathIntersection](http://raphaeljs.com/reference.html#Raphael.pathIntersection)
* [Raphael.toMatrix](http://raphaeljs.com/reference.html#Raphael.toMatrix)
* [Raphael.transformPath](http://raphaeljs.com/reference.html#Raphael.transformPath)
2.0.2 • 2012-02-08
------------------
* Removing of linked element now removes `<a>` as well
* Fixed white space recognition in passed strings
* Added special case for path that has only one Catmull-Rom curve
* Fixed toTransformString method
* Fixed animateWith method
* Fixed “target” attribute clearing
* Fixed bug with changing fill from image to solid colour
* fixed renderfix method
2.0.1 • 2011-11-18
------------------
* Global variables leakage fix
* `toFront` fix for elements with links
* Gradient clean up
* Added `letter-spacing` attribute
* Fixed hsb methods
* Fixed image flickering
* Improved `toTransformString` method on `matrix`
* Fixed drag'n'drop
* New method [Paper.add](http://raphaeljs.com/reference.html#Paper.add)
* Fix for `clip-path`
* Doc update
2.0.0 • 2011-10-03
------------------
* Completely changed transformation handling:
* `translate()`, `rotate()` and `scale()` are deprecated
* `translation`, `rotation` and `scale` attributes are removed (!)
* new method `transform()` and new attribute `transform` were introduced
* chaining of transformations now allowed
* matrix transformation introduced
* see [docs](http://raphaeljs.com/reference.html#Element.transform)
* Animation API was updated (see [docs](http://raphaeljs.com/reference.html#Raphael.animation))
* delay, repeat, [setTime](http://raphaeljs.com/reference.html#Element.status), [status](http://raphaeljs.com/reference.html#Element.setTime)
* New methods:
* [Paper.setViewBox](http://raphaeljs.com/reference.html#Paper.setViewBox)
* [Paper.setStart](http://raphaeljs.com/reference.html#Paper.setStart)
* [Paper.setFinish](http://raphaeljs.com/reference.html#Paper.setFinish)
* [Paper.forEach](http://raphaeljs.com/reference.html#Paper.forEach)
* [Paper.getById](http://raphaeljs.com/reference.html#Paper.getById)
* [Paper.getElementByPoint](http://raphaeljs.com/reference.html#Paper.getElementByPoint)
* [Element.data](http://raphaeljs.com/reference.html#Element.data)
* [Element.glow](http://raphaeljs.com/reference.html#Element.glow)
* [Element.onDragOver](http://raphaeljs.com/reference.html#Element.onDragOver)
* [Element.removeData](http://raphaeljs.com/reference.html#Element.removeData)
* [Raphael.fullfill](http://raphaeljs.com/reference.html#Raphael.fullfill)
* [Raphael.matrix](http://raphaeljs.com/reference.html#Raphael.matrix)
* [Raphael.parseTransformString](http://raphaeljs.com/reference.html#Raphael.parseTransformString)
* [Set.clear](http://raphaeljs.com/reference.html#Set.clear)
* [Set.exclude](http://raphaeljs.com/reference.html#Set.exclude)
* [Set.forEach](http://raphaeljs.com/reference.html#Set.forEach)
* [Set.splice](http://raphaeljs.com/reference.html#Set.splice)
* VML completely rewritten
* `getBBox` was fixed to take transformations into account
* [eve](http://raphaeljs.com/reference.html#eve) was added to the project
* Whole new [documentation](http://raphaeljs.com/reference.html)
* Various bug fixes

21
static/js/ketcher2/node_modules/raphael/license.txt generated vendored Normal file
View File

@ -0,0 +1,21 @@
The MIT License
Copyright (c) 2008-2010 Dmitry Baranovskiy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

72
static/js/ketcher2/node_modules/raphael/package.json generated vendored Normal file
View File

@ -0,0 +1,72 @@
{
"_from": "raphael@2.2.7",
"_id": "raphael@2.2.7",
"_inBundle": false,
"_integrity": "sha1-IxsZFB+NCGmG2PrOtm+LVi7iyBA=",
"_location": "/raphael",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "raphael@2.2.7",
"name": "raphael",
"escapedName": "raphael",
"rawSpec": "2.2.7",
"saveSpec": null,
"fetchSpec": "2.2.7"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/raphael/-/raphael-2.2.7.tgz",
"_shasum": "231b19141f8d086986d8faceb66f8b562ee2c810",
"_spec": "raphael@2.2.7",
"_where": "/home/manfred/enviPath/ketcher2/ketcher",
"author": {
"name": "Dmitry Baranovskiy"
},
"bugs": {
"url": "https://github.com/DmitryBaranovskiy/raphael/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Tomas Alabes",
"url": "https://github.com/tomasAlabes"
}
],
"dependencies": {
"eve-raphael": "0.5.0"
},
"deprecated": false,
"description": "JavaScript Vector Library",
"devDependencies": {
"bower": "1.8.0",
"eslint": "3.10.0",
"eslint-config-standard": "6.2.1",
"eslint-loader": "1.6.1",
"eslint-plugin-promise": "3.3.2",
"eslint-plugin-standard": "2.0.1",
"qunitjs": "2.0.1",
"webpack": "1.13.3"
},
"homepage": "http://dmitrybaranovskiy.github.io/raphael/",
"keywords": [
"svg",
"vml",
"javascript"
],
"license": "MIT",
"main": "raphael.min.js",
"name": "raphael",
"repository": {
"type": "git",
"url": "git://github.com/DmitryBaranovskiy/raphael.git"
},
"scripts": {
"build": "webpack && webpack --min && webpack --no-deps && webpack --no-deps --min",
"start": "npm install && bower install",
"test": "echo \"Open dev/test/index.html with your browser\" && exit 1"
},
"version": "2.2.7"
}

8353
static/js/ketcher2/node_modules/raphael/raphael.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,64 @@
"use strict";
const webpack = require("webpack");
const fs = require("fs");
const args = process.argv;
let plugins = [
new webpack.BannerPlugin(fs.readFileSync('./dev/banner.txt', 'utf8'), { raw: true, entryOnly: true })
];
let externals = [];
let filename = "raphael";
if(args.indexOf('--no-deps') !== -1){
console.log('Building version without deps');
externals.push("eve");
filename += ".no-deps"
}
if(args.indexOf('--min') !== -1){
console.log('Building minified version');
plugins.push(
new webpack.optimize.UglifyJsPlugin({
compress:{
dead_code: false,
unused: false
}
})
);
filename += ".min"
}
module.exports = {
entry: './dev/raphael.amd.js',
output: {
filename: filename + ".js",
libraryTarget: "umd",
library: "Raphael"
},
externals: externals,
plugins: plugins,
loaders: [
{
test: /\.js$/,
loader: "eslint-loader",
include: "./dev/"
}
],
eslint: {
configFile: './.eslintrc'
},
resolve: {
modulesDirectories: ["bower_components"],
alias: {
"eve": "eve-raphael/eve"
}
}
};

2012
static/js/ketcher2/node_modules/raphael/yarn.lock generated vendored Normal file

File diff suppressed because it is too large Load Diff