Commit c472a261 by Dmitry Baranovskiy

2.0.2

parent 300aa589
2.0.2 * 2011-11-18
------------------
* 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
------------------
......
#!/usr/bin/env node
var setup = {
input: {
core: "raphael.core.js",
svg: "raphael.svg.js",
vml: "raphael.vml.js",
eve: "../mywork/eve/eve.js",
copy: "copy.js"
},
output: {
"raphael-min.js": function () {
return this.copy + "\n" + minify(this.eve + this.core + this.svg + this.vml);
},
"raphael.js": function () {
return this.copy + "\n" + this.eve + "\n\n" + this.core + "\n\n" + this.svg + "\n\n" + this.vml;
},
"raphael.pro-min.js": function () {
return this.copy + "\n" + minify(this.eve + this.core + this.svg);
},
"raphael.pro.js": function () {
return this.copy + "\n" + this.eve + "\n\n" + this.core + "\n\n" + this.svg ;
},
}
},
ujs = require("/Users/dmitry/Sites/UglifyJS/uglify-js.js"),
jsp = ujs.parser,
pro = ujs.uglify,
fs = require("fs"),
rxdr = /\/\*\\[\s\S]+?\\\*\//g;
function minify(code) {
return pro.gen_code(pro.ast_squeeze(pro.ast_mangle(jsp.parse(code))));
}
var files = {};
for (var file in setup.input) {
files[file] = String(fs.readFileSync(setup.input[file], "utf8")).replace(rxdr, "");
}
for (file in setup.output) {
(function (file) {
fs.writeFile(file, setup.output[file].call(files), function () {
console.log("Saved to \033[32m" + file + "\033[0m\n");
});
})(file);
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -227,8 +227,8 @@ window.Raphael.svg && function (R) {
});
use = $($("use"), {
"xlink:href": "#" + pathId,
transform: (isEnd ? " rotate(180 " + w / 2 + " " + h / 2 + ") " : S) + "scale(" + w / t + "," + h / t + ")",
"stroke-width": 1 / ((w / t + h / t) / 2)
transform: (isEnd ? "rotate(180 " + w / 2 + " " + h / 2 + ") " : E) + "scale(" + w / t + "," + h / t + ")",
"stroke-width": (1 / ((w / t + h / t) / 2)).toFixed(4)
});
marker.appendChild(use);
p.defs.appendChild(marker);
......@@ -331,8 +331,8 @@ window.Raphael.svg && function (R) {
hl.appendChild(node);
pn = hl;
}
if (att == "target" && value == "blank") {
pn.setAttributeNS(xlink, "show", "new");
if (att == "target") {
pn.setAttributeNS(xlink, "show", value == "blank" ? "new" : value);
} else {
pn.setAttributeNS(xlink, att, value);
}
......@@ -483,7 +483,6 @@ window.Raphael.svg && function (R) {
});
})(el);
o.paper.defs.appendChild(el);
node.style.fill = "url(#" + el.id + ")";
$(node, {fill: "url(#" + el.id + ")"});
o.pattern = el;
o.pattern && updatePosition(o);
......@@ -876,7 +875,11 @@ window.Raphael.svg && function (R) {
paper.defs.removeChild(this.gradient);
}
R._tear(this, paper);
this.node.parentNode.removeChild(this.node);
if (this.node.parentNode.tagName.toLowerCase() == "a") {
this.node.parentNode.parentNode.removeChild(this.node.parentNode);
} else {
this.node.parentNode.removeChild(this.node);
}
for (var i in this) {
this[i] = typeof this[i] == "function" ? R._removedFactory(i) : null;
}
......@@ -1177,7 +1180,6 @@ window.Raphael.svg && function (R) {
};
R._engine.text = function (svg, x, y, text) {
var el = $("text");
// $(el, {x: x, y: y, "text-anchor": "middle"});
svg.canvas && svg.canvas.appendChild(el);
var res = new Element(el, svg);
res.attrs = {
......@@ -1242,7 +1244,6 @@ window.Raphael.svg && function (R) {
container.width = width;
container.height = height;
container.canvas = cnvs;
// plugins.call(container, container, R.fn);
container.clear();
container._left = container._top = 0;
isFloating && (container.renderfix = function () {});
......@@ -1293,8 +1294,13 @@ window.Raphael.svg && function (R) {
R.prototype.renderfix = function () {
var cnvs = this.canvas,
s = cnvs.style,
pos = cnvs.getScreenCTM() || cnvs.createSVGMatrix(),
left = -pos.e % 1,
pos;
try {
pos = cnvs.getScreenCTM() || cnvs.createSVGMatrix();
} catch (e) {
pos = cnvs.createSVGMatrix();
}
var left = -pos.e % 1,
top = -pos.f % 1;
if (left || top) {
if (left) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment