Commit 630eb142 by Marat Dreizin

Improved build flow and also added support of webpack/browserify

parent 07715d15
...@@ -15,77 +15,45 @@ module.exports = function(grunt) { ...@@ -15,77 +15,45 @@ module.exports = function(grunt) {
banner: "<%= banner %>" banner: "<%= banner %>"
}, },
dist: { dist: {
src: "<%= build.dist.dest %>", src: "<%= concat.dist.dest %>",
dest: "../raphael-min.js" dest: "../raphael-min.js"
} }
}, },
build: { replace: {
dist: {
options: { options: {
banner: "<%= banner %>" patterns: [{
match: "VERSION",
replacement: "<%= pkg.version %>"
}]
},
files: [{
expand: true,
flatten: true,
src: "<%= concat.dist.dest %>",
dest: "../"
}]
}
}, },
concat: {
dist: { dist: {
dest: "../raphael.js", dest: "../<%= pkg.name %>.js",
src: [ src: [
"../eve/eve.js", "../eve/eve.js",
"raphael.core.js", "raphael.core.js",
"raphael.svg.js", "raphael.svg.js",
"raphael.vml.js" "raphael.vml.js",
"raphael.amd.js"
] ]
} }
} }
}); });
// These plugins provide necessary tasks. // These plugins provide necessary tasks.
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-uglify"); grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-replace");
// Special concat/build task to handle Raphael's build requirements
grunt.registerMultiTask(
"build",
"Concatenate source, remove individual closures, embed version",
function() {
var data = this.data,
name = data.dest,
src = data.src,
options = this.options({
banner: ""
}),
// Start with banner
compiled = options.banner,
svgorvmlRegex = /\.(svg|vml)\.js/,
closureRegex = /window\.Raphael.*\(R\)\s*\{/,
closureEndRegex = /\}\(window\.Raphael\);\s*$/,
exposeRegex = /(\r?\n\s*\/\/\s*EXPOSE(?:\r|\n|.)*\}\)\);)/;
// Concatenate src
src.forEach(function(path) {
var source = grunt.file.read(path);
var match = svgorvmlRegex.exec(path);
// If either SVG or VML,
// remove the closure and add an early return if not required
if (match) {
source = "\n\n" +
source.replace(closureRegex,
"(function(){\n" +
" if (!R." + match[1] + ") {\n" +
" return;\n" +
" }"
)
.replace( closureEndRegex, "})();" );
// Add source before EXPOSE line
compiled = compiled.replace(exposeRegex, source + "$1");
} else {
compiled += source;
}
});
grunt.file.write( name, compiled );
grunt.log.ok("Built file " + name);
});
// Default task. // Default task.
grunt.registerTask("default", ["build", "uglify"]); grunt.registerTask("default", ["concat", "replace", "uglify"]);
}; };
require(['../raphael'], function(Raphael){ 'use strict';
require.config({
paths: {
raphael: '../raphael'
}
});
require(['raphael'], function(Raphael) {
var paper = Raphael(0, 0, 640, 720, "container"); var paper = Raphael(0, 0, 640, 720, "container");
// Work here
}); });
\ No newline at end of file
{ {
"name": "raphael", "name": "raphael",
"version": "2.1.2", "version": "2.1.3",
"description": "JavaScript Vector Library", "description": "JavaScript Vector Library",
"main": "raphael.js", "main": "raphael.js",
"scripts": { "scripts": {
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
"gitHead": "52bff469f60988f1391e8b3d7cb5349163df8ba1", "gitHead": "52bff469f60988f1391e8b3d7cb5349163df8ba1",
"devDependencies": { "devDependencies": {
"grunt": "~0.4.1", "grunt": "~0.4.1",
"grunt-contrib-uglify": "~0.2.0" "grunt-contrib-concat": "^0.5.0",
"grunt-contrib-uglify": "~0.2.0",
"grunt-replace": "^0.8.0"
} }
} }
// ┌────────────────────────────────────────────────────────────────────┐ \\
// │ Raphaël @VERSION - JavaScript Vector Library │ \\
// ├────────────────────────────────────────────────────────────────────┤ \\
// │ Copyright © 2008-2012 Dmitry Baranovskiy (http://raphaeljs.com) │ \\
// │ Copyright © 2008-2012 Sencha Labs (http://sencha.com) │ \\
// ├────────────────────────────────────────────────────────────────────┤ \\
// │ Licensed under the MIT (http://raphaeljs.com/license.html) license.│ \\
// └────────────────────────────────────────────────────────────────────┘ \\
(function (glob, factory) {
if (typeof define === "function" && define.amd) {
define("raphael", ["raphael.core", "raphael.svg", "raphael.vml"], function(Raphael) {
return (glob.Raphael = factory(Raphael));
});
} else if (typeof exports === "object") {
var raphael = require("raphael.core");
require("raphael.svg");
require("raphael.vml");
module.exports = factory(raphael);
} else {
glob.Raphael = factory(glob.Raphael);
}
}(window || this, function (Raphael) {
return Raphael.ninja();
}));
\ No newline at end of file
// ┌────────────────────────────────────────────────────────────────────┐ \\ // ┌────────────────────────────────────────────────────────────────────┐ \\
// │ "Raphaël 2.1.2" - JavaScript Vector Library │ \\ // │ Raphaël @@VERSION - JavaScript Vector Library │ \\
// ├────────────────────────────────────────────────────────────────────┤ \\ // ├────────────────────────────────────────────────────────────────────┤ \\
// │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://raphaeljs.com) │ \\ // │ Core Module │ \\
// │ Copyright (c) 2008-2011 Sencha Labs (http://sencha.com) │ \\ // ├────────────────────────────────────────────────────────────────────┤ \\
// │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\ // │ Licensed under the MIT (http://raphaeljs.com/license.html) license.│ \\
// └────────────────────────────────────────────────────────────────────┘ \\ // └────────────────────────────────────────────────────────────────────┘ \\
(function (glob, factory) { (function (glob, factory) {
// AMD support
if (typeof define === "function" && define.amd) { if (typeof define === "function" && define.amd) {
// Define as an anonymous module define("raphael.core", ["eve"], function(eve) {
define(["eve"], function( eve ) { return factory(eve);
return factory(glob, eve);
}); });
} else if (typeof exports === "object") {
module.exports = factory(require("eve"));
} else { } else {
// Browser globals (glob is window) glob.Raphael = factory(glob.eve);
// Raphael adds itself to window
factory(glob, glob.eve || (typeof require == "function" && require('eve')) );
} }
}(this, function (window, eve) { }(window || this, function (eve) {
/*\ /*\
* Raphael * Raphael
[ method ] [ method ]
...@@ -86,7 +84,7 @@ ...@@ -86,7 +84,7 @@
} }
} }
} }
R.version = "2.1.2"; R.version = "@@VERSION";
R.eve = eve; R.eve = eve;
var loaded, var loaded,
separator = /[, ]+/, separator = /[, ]+/,
...@@ -5371,13 +5369,5 @@ ...@@ -5371,13 +5369,5 @@
loaded = true; loaded = true;
}); });
// EXPOSE
// SVG and VML are appended just before the EXPOSE line
// 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; return R;
})); }));
// ┌─────────────────────────────────────────────────────────────────────┐ \\ // ┌─────────────────────────────────────────────────────────────────────┐ \\
// │ Raphaël - JavaScript Vector Library │ \\ // │ Raphaël @@VERSION - JavaScript Vector Library │ \\
// ├─────────────────────────────────────────────────────────────────────┤ \\ // ├─────────────────────────────────────────────────────────────────────┤ \\
// │ SVG Module │ \\ // │ SVG Module │ \\
// ├─────────────────────────────────────────────────────────────────────┤ \\ // ├─────────────────────────────────────────────────────────────────────┤ \\
...@@ -8,7 +8,21 @@ ...@@ -8,7 +8,21 @@
// │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\ // │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\
// └─────────────────────────────────────────────────────────────────────┘ \\ // └─────────────────────────────────────────────────────────────────────┘ \\
window.Raphael && window.Raphael.svg && function(R) { (function (glob, factory) {
if (typeof define === "function" && define.amd) {
define("raphael.svg", ["raphael.core"], function(raphael) {
factory(raphael);
});
} else if (typeof exports === "object") {
factory(require("raphael.core"));
} else {
factory(glob.Raphael);
}
}(window || this, function(R) {
if (R && !R.svg) {
return;
}
var has = "hasOwnProperty", var has = "hasOwnProperty",
Str = String, Str = String,
toFloat = parseFloat, toFloat = parseFloat,
...@@ -1371,4 +1385,4 @@ window.Raphael && window.Raphael.svg && function(R) { ...@@ -1371,4 +1385,4 @@ window.Raphael && window.Raphael.svg && function(R) {
}; };
})(method); })(method);
} }
}(window.Raphael); }));
// ┌─────────────────────────────────────────────────────────────────────┐ \\ // ┌─────────────────────────────────────────────────────────────────────┐ \\
// │ Raphaël - JavaScript Vector Library │ \\ // │ Raphaël @@VERSION - JavaScript Vector Library │ \\
// ├─────────────────────────────────────────────────────────────────────┤ \\ // ├─────────────────────────────────────────────────────────────────────┤ \\
// │ VML Module │ \\ // │ VML Module │ \\
// ├─────────────────────────────────────────────────────────────────────┤ \\ // ├─────────────────────────────────────────────────────────────────────┤ \\
...@@ -8,7 +8,21 @@ ...@@ -8,7 +8,21 @@
// │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\ // │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\
// └─────────────────────────────────────────────────────────────────────┘ \\ // └─────────────────────────────────────────────────────────────────────┘ \\
window.Raphael && window.Raphael.vml && function(R) { (function (glob, factory) {
if (typeof define === "function" && define.amd) {
define("raphael.vml", ["raphael.core"], function(raphael) {
factory(raphael);
});
} else if (typeof exports === "object") {
factory(require("raphael"));
} else {
factory(glob.Raphael);
}
}(window || this, function(R) {
if (R && !R.vml) {
return;
}
var has = "hasOwnProperty", var has = "hasOwnProperty",
Str = String, Str = String,
toFloat = parseFloat, toFloat = parseFloat,
...@@ -973,4 +987,4 @@ window.Raphael && window.Raphael.vml && function(R) { ...@@ -973,4 +987,4 @@ window.Raphael && window.Raphael.vml && function(R) {
}; };
})(method); })(method);
} }
}(window.Raphael); }));
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<script type="text/javascript" src="raphael.core.js"></script> <script type="text/javascript" src="raphael.core.js"></script>
<script type="text/javascript" src="raphael.svg.js"></script> <script type="text/javascript" src="raphael.svg.js"></script>
<script type="text/javascript" src="raphael.vml.js"></script> <script type="text/javascript" src="raphael.vml.js"></script>
<script type="text/javascript" src="raphael.amd.js"></script>
<script type="text/javascript"> <script type="text/javascript">
// Initialize container when document is loaded // Initialize container when document is loaded
......
This source diff could not be displayed because it is too large. You can view the blob instead.
// ┌────────────────────────────────────────────────────────────────────┐ \\
// │ Raphaël 2.1.2 - JavaScript Vector Library │ \\
// ├────────────────────────────────────────────────────────────────────┤ \\
// │ Copyright © 2008-2012 Dmitry Baranovskiy (http://raphaeljs.com) │ \\
// │ Copyright © 2008-2012 Sencha Labs (http://sencha.com) │ \\
// ├────────────────────────────────────────────────────────────────────┤ \\
// │ Licensed under the MIT (http://raphaeljs.com/license.html) license.│ \\
// └────────────────────────────────────────────────────────────────────┘ \\
// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved. // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
...@@ -20,15 +12,25 @@ ...@@ -20,15 +12,25 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// ┌────────────────────────────────────────────────────────────┐ \\ // ┌────────────────────────────────────────────────────────────┐ \\
// │ Eve 0.4.2 - JavaScript Events Library │ \\ // │ Eve 0.5.1 - JavaScript Events Library │ \\
// ├────────────────────────────────────────────────────────────┤ \\ // ├────────────────────────────────────────────────────────────┤ \\
// │ Author Dmitry Baranovskiy (http://dmitry.baranovskiy.com/) │ \\ // │ Author Dmitry Baranovskiy (http://dmitry.baranovskiy.com/) │ \\
// └────────────────────────────────────────────────────────────┘ \\ // └────────────────────────────────────────────────────────────┘ \\
(function (glob, factory) {
(function (glob) { if (typeof define === "function" && define.amd) {
var version = "0.4.2", define("eve", [], function() {
return factory();
});
} else if (typeof exports === "object") {
module.exports = factory();
} else {
glob.eve = factory();
}
}(window || this, function() {
var version = "0.5.1",
has = "hasOwnProperty", has = "hasOwnProperty",
separator = /[\.\/]/, separator = /[\.\/]/,
comaseparator = /\s*,\s*/,
wildcard = "*", wildcard = "*",
fun = function () {}, fun = function () {},
numsort = function (a, b) { numsort = function (a, b) {
...@@ -37,6 +39,26 @@ ...@@ -37,6 +39,26 @@
current_event, current_event,
stop, stop,
events = {n: {}}, events = {n: {}},
firstDefined = function () {
for (var i = 0, ii = this.length; i < ii; i++) {
if (typeof this[i] != "undefined") {
return this[i];
}
}
},
lastDefined = function () {
var i = this.length;
while (--i) {
if (typeof this[i] != "undefined") {
return this[i];
}
}
},
objtos = Object.prototype.toString,
Str = String,
isArray = Array.isArray || function (ar) {
return ar instanceof Array || objtos.call(ar) == "[object Array]";
};
/*\ /*\
* eve * eve
[ method ] [ method ]
...@@ -49,10 +71,9 @@ ...@@ -49,10 +71,9 @@
- scope (object) context for the event handlers - scope (object) context for the event handlers
- varargs (...) the rest of arguments will be sent to event handlers - varargs (...) the rest of arguments will be sent to event handlers
= (object) array of returned values from the listeners = (object) array of returned values from the listeners. Array has two methods `.firstDefined()` and `.lastDefined()` to get first or last not `undefined` value.
\*/ \*/
eve = function (name, scope) { var eve = function (name, scope) {
name = String(name);
var e = events, var e = events,
oldstop = stop, oldstop = stop,
args = Array.prototype.slice.call(arguments, 2), args = Array.prototype.slice.call(arguments, 2),
...@@ -65,6 +86,8 @@ ...@@ -65,6 +86,8 @@
out = [], out = [],
ce = current_event, ce = current_event,
errors = []; errors = [];
out.firstDefined = firstDefined;
out.lastDefined = lastDefined;
current_event = name; current_event = name;
stop = 0; stop = 0;
for (var i = 0, ii = listeners.length; i < ii; i++) if ("zIndex" in listeners[i]) { for (var i = 0, ii = listeners.length; i < ii; i++) if ("zIndex" in listeners[i]) {
...@@ -110,7 +133,7 @@ ...@@ -110,7 +133,7 @@
} }
stop = oldstop; stop = oldstop;
current_event = ce; current_event = ce;
return out.length ? out : null; return out;
}; };
// Undocumented. Debug only. // Undocumented. Debug only.
eve._events = events; eve._events = events;
...@@ -127,7 +150,7 @@ ...@@ -127,7 +150,7 @@
= (array) array of event handlers = (array) array of event handlers
\*/ \*/
eve.listeners = function (name) { eve.listeners = function (name) {
var names = name.split(separator), var names = isArray(name) ? name : name.split(separator),
e = events, e = events,
item, item,
items, items,
...@@ -157,7 +180,25 @@ ...@@ -157,7 +180,25 @@
} }
return out; return out;
}; };
/*\
* eve.separator
[ method ]
* If for some reasons you don’t like default separators (`.` or `/`) you can specify yours
* here. Be aware that if you pass a string longer than one character it will be treated as
* a list of characters.
- separator (string) new separator. Empty string resets to default: `.` or `/`.
\*/
eve.separator = function (sep) {
if (sep) {
sep = Str(sep).replace(/(?=[\.\^\]\[\-])/g, "\\");
sep = "[" + sep + "]";
separator = new RegExp(sep);
} else {
separator = /[\.\/]/;
}
};
/*\ /*\
* eve.on * eve.on
[ method ] [ method ]
...@@ -167,37 +208,44 @@ ...@@ -167,37 +208,44 @@
| eve("mouse.under.floor"); // triggers f | eve("mouse.under.floor"); // triggers f
* Use @eve to trigger the listener. * Use @eve to trigger the listener.
** **
> Arguments
**
- name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards - name (string) name of the event, dot (`.`) or slash (`/`) separated, with optional wildcards
- f (function) event handler function - f (function) event handler function
** **
- name (array) if you don’t want to use separators, you can use array of strings
- f (function) event handler function
**
= (function) returned function accepts a single numeric parameter that represents z-index of the handler. It is an optional feature and only used when you need to ensure that some subset of handlers will be invoked in a given order, despite of the order of assignment. = (function) returned function accepts a single numeric parameter that represents z-index of the handler. It is an optional feature and only used when you need to ensure that some subset of handlers will be invoked in a given order, despite of the order of assignment.
> Example: > Example:
| eve.on("mouse", eatIt)(2); | eve.on("mouse", eatIt)(2);
| eve.on("mouse", scream); | eve.on("mouse", scream);
| eve.on("mouse", catchIt)(1); | eve.on("mouse", catchIt)(1);
* This will ensure that `catchIt()` function will be called before `eatIt()`. * This will ensure that `catchIt` function will be called before `eatIt`.
* *
* If you want to put your handler before non-indexed handlers, specify a negative value. * If you want to put your handler before non-indexed handlers, specify a negative value.
* Note: I assume most of the time you don’t need to worry about z-index, but it’s nice to have this feature “just in case”. * Note: I assume most of the time you don’t need to worry about z-index, but it’s nice to have this feature “just in case”.
\*/ \*/
eve.on = function (name, f) { eve.on = function (name, f) {
name = String(name);
if (typeof f != "function") { if (typeof f != "function") {
return function () {}; return function () {};
} }
var names = name.split(separator), var names = isArray(name) ? (isArray(name[0]) ? name : [name]) : Str(name).split(comaseparator);
e = events; for (var i = 0, ii = names.length; i < ii; i++) {
(function (name) {
var names = isArray(name) ? name : Str(name).split(separator),
e = events,
exist;
for (var i = 0, ii = names.length; i < ii; i++) { for (var i = 0, ii = names.length; i < ii; i++) {
e = e.n; e = e.n;
e = e.hasOwnProperty(names[i]) && e[names[i]] || (e[names[i]] = {n: {}}); e = e.hasOwnProperty(names[i]) && e[names[i]] || (e[names[i]] = {n: {}});
} }
e.f = e.f || []; e.f = e.f || [];
for (i = 0, ii = e.f.length; i < ii; i++) if (e.f[i] == f) { for (i = 0, ii = e.f.length; i < ii; i++) if (e.f[i] == f) {
return fun; exist = true;
break;
}
!exist && e.f.push(f);
}(names[i]));
} }
e.f.push(f);
return function (zIndex) { return function (zIndex) {
if (+zIndex == +zIndex) { if (+zIndex == +zIndex) {
f.zIndex = +zIndex; f.zIndex = +zIndex;
...@@ -250,10 +298,11 @@ ...@@ -250,10 +298,11 @@
= (boolean) `true`, if current event’s name contains `subname` = (boolean) `true`, if current event’s name contains `subname`
\*/ \*/
eve.nt = function (subname) { eve.nt = function (subname) {
var cur = isArray(current_event) ? current_event.join(".") : current_event;
if (subname) { if (subname) {
return new RegExp("(?:\\.|\\/|^)" + subname + "(?:\\.|\\/|$)").test(current_event); return new RegExp("(?:\\.|\\/|^)" + subname + "(?:\\.|\\/|$)").test(cur);
} }
return current_event; return cur;
}; };
/*\ /*\
* eve.nts * eve.nts
...@@ -265,7 +314,7 @@ ...@@ -265,7 +314,7 @@
= (array) names of the event = (array) names of the event
\*/ \*/
eve.nts = function () { eve.nts = function () {
return current_event.split(separator); return isArray(current_event) ? current_event : current_event.split(separator);
}; };
/*\ /*\
* eve.off * eve.off
...@@ -290,8 +339,15 @@ ...@@ -290,8 +339,15 @@
eve._events = events = {n: {}}; eve._events = events = {n: {}};
return; return;
} }
var names = name.split(separator), var names = isArray(name) ? (isArray(name[0]) ? name : [name]) : Str(name).split(comaseparator);
e, if (names.length > 1) {
for (var i = 0, ii = names.length; i < ii; i++) {
eve.off(names[i], f);
}
return;
}
names = isArray(name) ? name : Str(name).split(separator);
var e,
key, key,
splice, splice,
i, ii, j, jj, i, ii, j, jj,
...@@ -360,7 +416,7 @@ ...@@ -360,7 +416,7 @@
\*/ \*/
eve.once = function (name, f) { eve.once = function (name, f) {
var f2 = function () { var f2 = function () {
eve.unbind(name, f2); eve.off(name, f2);
return f.apply(this, arguments); return f.apply(this, arguments);
}; };
return eve.on(name, f2); return eve.on(name, f2);
...@@ -375,29 +431,29 @@ ...@@ -375,29 +431,29 @@
eve.toString = function () { eve.toString = function () {
return "You are running Eve " + version; 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));
})(window || this); return eve;
// ┌─────────────────────────────────────────────────────────────────────┐ \\ }));
// │ "Raphaël 2.1.2" - JavaScript Vector Library │ \\
// ├─────────────────────────────────────────────────────────────────────┤ \\ // ┌────────────────────────────────────────────────────────────────────┐ \\
// │ Copyright (c) 2008-2011 Dmitry Baranovskiy (http://raphaeljs.com) │ \\ // │ Raphaël 2.1.3 - JavaScript Vector Library │ \\
// │ Copyright (c) 2008-2011 Sencha Labs (http://sencha.com) │ \\ // ├────────────────────────────────────────────────────────────────────┤ \\
// │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\ // │ Core Module │ \\
// └─────────────────────────────────────────────────────────────────────┘ \\ // ├────────────────────────────────────────────────────────────────────┤ \\
// │ Licensed under the MIT (http://raphaeljs.com/license.html) license.│ \\
// └────────────────────────────────────────────────────────────────────┘ \\
(function (glob, factory) { (function (glob, factory) {
// AMD support
if (typeof define === "function" && define.amd) { if (typeof define === "function" && define.amd) {
// Define as an anonymous module define("raphael.core", ["eve"], function(eve) {
define(["eve"], function( eve ) { return factory(eve);
return factory(glob, eve);
}); });
} else if (typeof exports === "object") {
module.exports = factory(require("eve"));
} else { } else {
// Browser globals (glob is window) glob.Raphael = factory(glob.eve);
// Raphael adds itself to window
factory(glob, glob.eve);
} }
}(this, function (window, eve) { }(window || this, function (eve) {
/*\ /*\
* Raphael * Raphael
[ method ] [ method ]
...@@ -465,7 +521,7 @@ ...@@ -465,7 +521,7 @@
} }
} }
} }
R.version = "2.1.2"; R.version = "2.1.3";
R.eve = eve; R.eve = eve;
var loaded, var loaded,
separator = /[, ]+/, separator = /[, ]+/,
...@@ -5750,8 +5806,11 @@ ...@@ -5750,8 +5806,11 @@
loaded = true; loaded = true;
}); });
return R;
}));
// ┌─────────────────────────────────────────────────────────────────────┐ \\ // ┌─────────────────────────────────────────────────────────────────────┐ \\
// │ Raphaël - JavaScript Vector Library │ \\ // │ Raphaël 2.1.3 - JavaScript Vector Library │ \\
// ├─────────────────────────────────────────────────────────────────────┤ \\ // ├─────────────────────────────────────────────────────────────────────┤ \\
// │ SVG Module │ \\ // │ SVG Module │ \\
// ├─────────────────────────────────────────────────────────────────────┤ \\ // ├─────────────────────────────────────────────────────────────────────┤ \\
...@@ -5760,10 +5819,21 @@ ...@@ -5760,10 +5819,21 @@
// │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\ // │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\
// └─────────────────────────────────────────────────────────────────────┘ \\ // └─────────────────────────────────────────────────────────────────────┘ \\
(function(){ (function (glob, factory) {
if (!R.svg) { if (typeof define === "function" && define.amd) {
define("raphael.svg", ["raphael.core"], function(raphael) {
factory(raphael);
});
} else if (typeof exports === "object") {
factory(require("raphael.core"));
} else {
factory(glob.Raphael);
}
}(window || this, function(R) {
if (R && !R.svg) {
return; return;
} }
var has = "hasOwnProperty", var has = "hasOwnProperty",
Str = String, Str = String,
toFloat = parseFloat, toFloat = parseFloat,
...@@ -7126,10 +7196,10 @@ ...@@ -7126,10 +7196,10 @@
}; };
})(method); })(method);
} }
})(); }));
// ┌─────────────────────────────────────────────────────────────────────┐ \\ // ┌─────────────────────────────────────────────────────────────────────┐ \\
// │ Raphaël - JavaScript Vector Library │ \\ // │ Raphaël 2.1.3 - JavaScript Vector Library │ \\
// ├─────────────────────────────────────────────────────────────────────┤ \\ // ├─────────────────────────────────────────────────────────────────────┤ \\
// │ VML Module │ \\ // │ VML Module │ \\
// ├─────────────────────────────────────────────────────────────────────┤ \\ // ├─────────────────────────────────────────────────────────────────────┤ \\
...@@ -7138,10 +7208,21 @@ ...@@ -7138,10 +7208,21 @@
// │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\ // │ Licensed under the MIT (http://raphaeljs.com/license.html) license. │ \\
// └─────────────────────────────────────────────────────────────────────┘ \\ // └─────────────────────────────────────────────────────────────────────┘ \\
(function(){ (function (glob, factory) {
if (!R.vml) { if (typeof define === "function" && define.amd) {
define("raphael.vml", ["raphael.core"], function(raphael) {
factory(raphael);
});
} else if (typeof exports === "object") {
factory(require("raphael"));
} else {
factory(glob.Raphael);
}
}(window || this, function(R) {
if (R && !R.vml) {
return; return;
} }
var has = "hasOwnProperty", var has = "hasOwnProperty",
Str = String, Str = String,
toFloat = parseFloat, toFloat = parseFloat,
...@@ -8106,12 +8187,32 @@ ...@@ -8106,12 +8187,32 @@
}; };
})(method); })(method);
} }
})(); }));
// ┌────────────────────────────────────────────────────────────────────┐ \\
// │ Raphaël @VERSION - JavaScript Vector Library │ \\
// ├────────────────────────────────────────────────────────────────────┤ \\
// │ Copyright © 2008-2012 Dmitry Baranovskiy (http://raphaeljs.com) │ \\
// │ Copyright © 2008-2012 Sencha Labs (http://sencha.com) │ \\
// ├────────────────────────────────────────────────────────────────────┤ \\
// │ Licensed under the MIT (http://raphaeljs.com/license.html) license.│ \\
// └────────────────────────────────────────────────────────────────────┘ \\
// EXPOSE (function (glob, factory) {
// SVG and VML are appended just before the EXPOSE line if (typeof define === "function" && define.amd) {
// Even with AMD, Raphael should be defined globally define("raphael", ["raphael.core", "raphael.svg", "raphael.vml"], function(Raphael) {
oldRaphael.was ? (g.win.Raphael = R) : (Raphael = R); return (glob.Raphael = factory(Raphael));
});
} else if (typeof exports === "object") {
var raphael = require("raphael.core");
return R; require("raphael.svg");
require("raphael.vml");
module.exports = factory(raphael);
} else {
glob.Raphael = factory(glob.Raphael);
}
}(window || this, function (Raphael) {
return Raphael.ninja();
})); }));
\ No newline at end of file
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