Permalink
Browse files

Convert to AMD

  • Loading branch information...
1 parent 5fad2d6 commit 7d64771e96551a25606777adb7013a0bac4faa5c @kriszyp committed Apr 1, 2011
Showing with 17 additions and 14 deletions.
  1. +8 −4 Source/Slick.Finder.js
  2. +9 −10 Source/Slick.Parser.js
View
@@ -7,7 +7,8 @@ requires: Slick.Parser
...
*/
-;(function(){
+;(function(define){
+define(["./Slick.Parser"], function(Slick){
var local = {},
featuresCache = {},
@@ -888,7 +889,7 @@ local.attributeGetters = {
// Slick
-var Slick = local.Slick = (this.Slick || {});
+local.Slick = Slick;
Slick.version = '1.1.5';
@@ -965,6 +966,9 @@ Slick.uidOf = function(node){
return local.getUIDHTML(node);
};
-if (!this.Slick) this.Slick = Slick;
+});
+})(typeof define != "undefined" ? define: function(factory){
+ // Slick NS
+ factory(this.Slick || (this.Slick = {}));
+});
-}).apply(/*<CommonJS>*/(typeof exports != 'undefined') ? exports : /*</CommonJS>*/this);
View
@@ -6,7 +6,8 @@ provides: Slick.Parser
...
*/
-;(function(){
+;(function(define){
+define(["exports"], function(exports){
var parsed,
separatorIndex,
@@ -215,16 +216,14 @@ function parser(
return '';
};
-// Slick NS
-
-var Slick = (this.Slick || {});
-
-Slick.parse = function(expression){
+exports.parse = function(expression){
return parse(expression);
};
-Slick.escapeRegExp = escapeRegExp;
-
-if (!this.Slick) this.Slick = Slick;
+exports.escapeRegExp = escapeRegExp;
-}).apply(/*<CommonJS>*/(typeof exports != 'undefined') ? exports : /*</CommonJS>*/this);
+});
+})(typeof define != "undefined" ? define: function(factory){
+ // Slick NS
+ factory(this.Slick || (this.Slick = {}));
+});

0 comments on commit 7d64771

Please sign in to comment.