Skip to content

Commit

Permalink
raphael.amd.js to work with Browserify
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasAlabes committed Aug 11, 2015
1 parent f7744d0 commit 3236fa6
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 73 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ You need to have NPM installed to build the library.
* [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`
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
Check [Raphael-boilerplate](https://github.com/tomasAlabes/raphael-boilerplate) to see examples of loading.
Expand Down
2 changes: 1 addition & 1 deletion dev/raphael.svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
return factory(raphael);
});
} else if (typeof exports === "object") {
factory(require("raphael.core"));
factory(require("./raphael.core"));
} else {
factory(glob.Raphael);
}
Expand Down
2 changes: 1 addition & 1 deletion dev/raphael.vml.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
return factory(raphael);
});
} else if (typeof exports === "object") {
factory(require("raphael"));
factory(require("./raphael.core"));
} else {
factory(glob.Raphael);
}
Expand Down
4 changes: 3 additions & 1 deletion dev/raphaelTest.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
<!--<script type="text/javascript" src="raphael.svg.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 -->
<!--<script type="text/javascript">
// Initialize container when document is loaded
Expand All @@ -31,7 +33,7 @@

<!-- Use amdDev.js to work with AMD and Raphael -->
<!-- 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>
<body>
Expand Down
1 change: 1 addition & 0 deletions history.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
2.2.0 • WIP
------------------

* 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
Expand Down
4 changes: 2 additions & 2 deletions raphael-min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions raphael-nodeps-min.js

Large diffs are not rendered by default.

32 changes: 2 additions & 30 deletions raphael-nodeps.js
Original file line number Diff line number Diff line change
Expand Up @@ -5429,7 +5429,7 @@
return factory(raphael);
});
} else if (typeof exports === "object") {
factory(require("raphael.core"));
factory(require("./raphael.core"));
} else {
factory(glob.Raphael);
}
Expand Down Expand Up @@ -6848,7 +6848,7 @@
return factory(raphael);
});
} else if (typeof exports === "object") {
factory(require("raphael"));
factory(require("./raphael.core"));
} else {
factory(glob.Raphael);
}
Expand Down Expand Up @@ -7852,31 +7852,3 @@
})(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();
}));
10 changes: 5 additions & 5 deletions dev/raphael.amd.js → raphael.amd.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@

(function (glob, factory) {
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);
});
} else if (typeof exports === "object") {
var raphael = require("raphael.core");
var raphael = require("./dev/raphael.core");

require("raphael.svg");
require("raphael.vml");
require("./dev/raphael.svg");
require("./dev/raphael.vml");

module.exports = factory(raphael);
} else {
//glob.Raphael = factory(glob.Raphael);
glob.Raphael = factory(glob.Raphael);
}
}(this, function (Raphael) {
return Raphael.ninja();
Expand Down
32 changes: 2 additions & 30 deletions raphael.js
Original file line number Diff line number Diff line change
Expand Up @@ -5811,7 +5811,7 @@
return factory(raphael);
});
} else if (typeof exports === "object") {
factory(require("raphael.core"));
factory(require("./raphael.core"));
} else {
factory(glob.Raphael);
}
Expand Down Expand Up @@ -7230,7 +7230,7 @@
return factory(raphael);
});
} else if (typeof exports === "object") {
factory(require("raphael"));
factory(require("./raphael.core"));
} else {
factory(glob.Raphael);
}
Expand Down Expand Up @@ -8234,31 +8234,3 @@
})(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();
}));

0 comments on commit 3236fa6

Please sign in to comment.