Commit 3236fa65 by Tomas Alabes

raphael.amd.js to work with Browserify

parent f7744d0e
...@@ -13,7 +13,8 @@ You need to have NPM installed to build the library. ...@@ -13,7 +13,8 @@ You need to have NPM installed to build the library.
* [eve](https://github.com/adobe-webplatform/eve) * [eve](https://github.com/adobe-webplatform/eve)
You have the `raphael/raphael-min.js` files that has `eve` bundled inside, and `raphael-nodeps/raphael-nodeps-min.js` You have the `raphael/raphael-min.js` files that has `eve` bundled inside, and `raphael-nodeps/raphael-nodeps-min.js`
where `eve` must be loaded by you first (you can try with the one in the `dev/` folder). where `eve` must be loaded by you first (you can try with the one in the `dev/` folder).
For AMD loading like Browserify, you can use raphael.amd.js.
## Where to start ## Where to start
Check [Raphael-boilerplate](https://github.com/tomasAlabes/raphael-boilerplate) to see examples of loading. Check [Raphael-boilerplate](https://github.com/tomasAlabes/raphael-boilerplate) to see examples of loading.
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
return factory(raphael); return factory(raphael);
}); });
} else if (typeof exports === "object") { } else if (typeof exports === "object") {
factory(require("raphael.core")); factory(require("./raphael.core"));
} else { } else {
factory(glob.Raphael); factory(glob.Raphael);
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
return factory(raphael); return factory(raphael);
}); });
} else if (typeof exports === "object") { } else if (typeof exports === "object") {
factory(require("raphael")); factory(require("./raphael.core"));
} else { } else {
factory(glob.Raphael); factory(glob.Raphael);
} }
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
<!--<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 src="raphaelBrowserify.js"></script>
<!-- Comment this script tag if you are testing with AMD --> <!-- Comment this script tag if you are testing with AMD -->
<!--<script type="text/javascript"> <!--<script type="text/javascript">
// Initialize container when document is loaded // Initialize container when document is loaded
...@@ -31,7 +33,7 @@ ...@@ -31,7 +33,7 @@
<!-- Use amdDev.js to work with AMD and Raphael --> <!-- Use amdDev.js to work with AMD and Raphael -->
<!-- You need to do a 'bower install -D' first to get requirejs --> <!-- You need to do a 'bower install -D' first to get requirejs -->
<script data-main="amdDev" src="../bower_components/requirejs/require.js"></script> <!--<script data-main="amdDev" src="../bower_components/requirejs/require.js"></script>-->
</head> </head>
<body> <body>
......
2.2.0 • WIP 2.2.0 • WIP
------------------ ------------------
* raphael.amd.js version to work with Browserify.
* Can't set glow with opacity 0 * Can't set glow with opacity 0
* Using origin and pathname with gradient urls, urls with # weren't being resolved correctly * Using origin and pathname with gradient urls, urls with # weren't being resolved correctly
* Defined nodeps version, and changed how raphael is loaded * Defined nodeps version, and changed how raphael is loaded
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -5429,7 +5429,7 @@ ...@@ -5429,7 +5429,7 @@
return factory(raphael); return factory(raphael);
}); });
} else if (typeof exports === "object") { } else if (typeof exports === "object") {
factory(require("raphael.core")); factory(require("./raphael.core"));
} else { } else {
factory(glob.Raphael); factory(glob.Raphael);
} }
...@@ -6848,7 +6848,7 @@ ...@@ -6848,7 +6848,7 @@
return factory(raphael); return factory(raphael);
}); });
} else if (typeof exports === "object") { } else if (typeof exports === "object") {
factory(require("raphael")); factory(require("./raphael.core"));
} else { } else {
factory(glob.Raphael); factory(glob.Raphael);
} }
...@@ -7852,31 +7852,3 @@ ...@@ -7852,31 +7852,3 @@
})(method); })(method);
} }
})); }));
// ┌────────────────────────────────────────────────────────────────────┐ \\
// │ Raphaël 2.1.4 - 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 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);
}
}(this, function (Raphael) {
return Raphael.ninja();
}));
\ No newline at end of file
...@@ -9,18 +9,18 @@ ...@@ -9,18 +9,18 @@
(function (glob, factory) { (function (glob, factory) {
if (typeof define === "function" && define.amd) { if (typeof define === "function" && define.amd) {
define("raphael", ["raphael.core", "raphael.svg", "raphael.vml"], function(Raphael) { define("raphael", ["dev/raphael.core.js", "raphael.svg", "raphael.vml"], function(Raphael) {
return factory(Raphael); return factory(Raphael);
}); });
} else if (typeof exports === "object") { } else if (typeof exports === "object") {
var raphael = require("raphael.core"); var raphael = require("./dev/raphael.core");
require("raphael.svg"); require("./dev/raphael.svg");
require("raphael.vml"); require("./dev/raphael.vml");
module.exports = factory(raphael); module.exports = factory(raphael);
} else { } else {
//glob.Raphael = factory(glob.Raphael); glob.Raphael = factory(glob.Raphael);
} }
}(this, function (Raphael) { }(this, function (Raphael) {
return Raphael.ninja(); return Raphael.ninja();
......
...@@ -5811,7 +5811,7 @@ ...@@ -5811,7 +5811,7 @@
return factory(raphael); return factory(raphael);
}); });
} else if (typeof exports === "object") { } else if (typeof exports === "object") {
factory(require("raphael.core")); factory(require("./raphael.core"));
} else { } else {
factory(glob.Raphael); factory(glob.Raphael);
} }
...@@ -7230,7 +7230,7 @@ ...@@ -7230,7 +7230,7 @@
return factory(raphael); return factory(raphael);
}); });
} else if (typeof exports === "object") { } else if (typeof exports === "object") {
factory(require("raphael")); factory(require("./raphael.core"));
} else { } else {
factory(glob.Raphael); factory(glob.Raphael);
} }
...@@ -8234,31 +8234,3 @@ ...@@ -8234,31 +8234,3 @@
})(method); })(method);
} }
})); }));
// ┌────────────────────────────────────────────────────────────────────┐ \\
// │ Raphaël 2.1.4 - 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 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);
}
}(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