Skip to content

Commit

Permalink
All: Wrap source files with UMD return exports
Browse files Browse the repository at this point in the history
Ref #9464
Ref jquerygh-1029
  • Loading branch information
rxaviers committed Jan 24, 2014
1 parent 2651f45 commit 96e027e
Show file tree
Hide file tree
Showing 38 changed files with 609 additions and 99 deletions.
1 change: 1 addition & 0 deletions ui/.jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"jquery": true,

"globals": {
"define": false,
"Globalize": false
}
}
20 changes: 17 additions & 3 deletions ui/jquery.ui.accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,23 @@
* jquery.ui.core.js
* jquery.ui.widget.js
*/
(function( $, undefined ) {
(function( factory ) {
if ( typeof define === "function" && define.amd ) {

// AMD. Register as an anonymous module.
define([
"jquery",
"./jquery.ui.core",
"./jquery.ui.widget"
], factory );
} else {

// Browser globals
factory( jQuery );
}
}(function( $ ) {

$.widget( "ui.accordion", {
return $.widget( "ui.accordion", {
version: "@VERSION",
options: {
active: 0,
Expand Down Expand Up @@ -562,4 +576,4 @@ $.widget( "ui.accordion", {
}
});

})( jQuery );
}));
22 changes: 20 additions & 2 deletions ui/jquery.ui.autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,23 @@
* jquery.ui.position.js
* jquery.ui.menu.js
*/
(function( $, undefined ) {
(function( factory ) {
if ( typeof define === "function" && define.amd ) {

// AMD. Register as an anonymous module.
define([
"jquery",
"./jquery.ui.core",
"./jquery.ui.widget",
"./jquery.ui.position",
"./jquery.ui.menu"
], factory );
} else {

// Browser globals
factory( jQuery );
}
}(function( $ ) {

$.widget( "ui.autocomplete", {
version: "@VERSION",
Expand Down Expand Up @@ -602,4 +618,6 @@ $.widget( "ui.autocomplete", $.ui.autocomplete, {
}
});

}( jQuery ));
return $.ui.autocomplete;

}));
20 changes: 18 additions & 2 deletions ui/jquery.ui.button.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,21 @@
* jquery.ui.core.js
* jquery.ui.widget.js
*/
(function( $, undefined ) {
(function( factory ) {
if ( typeof define === "function" && define.amd ) {

// AMD. Register as an anonymous module.
define([
"jquery",
"./jquery.ui.core",
"./jquery.ui.widget"
], factory );
} else {

// Browser globals
factory( jQuery );
}
}(function( $ ) {

var lastActive,
baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
Expand Down Expand Up @@ -390,4 +404,6 @@ $.widget( "ui.buttonset", {
}
});

}( jQuery ) );
return $.ui.button;

}));
14 changes: 12 additions & 2 deletions ui/jquery.ui.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@
*
* http://api.jqueryui.com/category/ui-core/
*/
(function( $, undefined ) {
(function( factory ) {
if ( typeof define === "function" && define.amd ) {

// AMD. Register as an anonymous module.
define( [ "jquery" ], factory );
} else {

// Browser globals
factory( jQuery );
}
}(function( $ ) {

// $.ui might exist from components with no dependencies, e.g., $.ui.position
$.ui = $.ui || {};
Expand Down Expand Up @@ -286,4 +296,4 @@ $.ui.plugin = {
}
};

})( jQuery );
}));
19 changes: 17 additions & 2 deletions ui/jquery.ui.datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,20 @@
* Depends:
* jquery.ui.core.js
*/
(function( $, undefined ) {
(function( factory ) {
if ( typeof define === "function" && define.amd ) {

// AMD. Register as an anonymous module.
define([
"jquery",
"./jquery.ui.core"
], factory );
} else {

// Browser globals
factory( jQuery );
}
}(function( $ ) {

$.extend($.ui, { datepicker: { version: "@VERSION" } });

Expand Down Expand Up @@ -2056,4 +2069,6 @@ $.datepicker.initialized = false;
$.datepicker.uuid = new Date().getTime();
$.datepicker.version = "@VERSION";

})(jQuery);
return $.datepicker;

}));
25 changes: 22 additions & 3 deletions ui/jquery.ui.dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,28 @@
* jquery.ui.position.js
* jquery.ui.resizable.js
*/
(function( $, undefined ) {
(function( factory ) {
if ( typeof define === "function" && define.amd ) {

// AMD. Register as an anonymous module.
define([
"jquery",
"./jquery.ui.core",
"./jquery.ui.widget",
"./jquery.ui.button",
"./jquery.ui.draggable",
"./jquery.ui.mouse",
"./jquery.ui.position",
"./jquery.ui.resizable"
], factory );
} else {

// Browser globals
factory( jQuery );
}
}(function( $ ) {

$.widget( "ui.dialog", {
return $.widget( "ui.dialog", {
version: "@VERSION",
options: {
appendTo: "body",
Expand Down Expand Up @@ -841,4 +860,4 @@ $.widget( "ui.dialog", {
}
});

}( jQuery ));
}));
21 changes: 19 additions & 2 deletions ui/jquery.ui.draggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,22 @@
* jquery.ui.mouse.js
* jquery.ui.widget.js
*/
(function( $, undefined ) {
(function( factory ) {
if ( typeof define === "function" && define.amd ) {

// AMD. Register as an anonymous module.
define([
"jquery",
"./jquery.ui.core",
"./jquery.ui.mouse",
"./jquery.ui.widget"
], factory );
} else {

// Browser globals
factory( jQuery );
}
}(function( $ ) {

$.widget("ui.draggable", $.ui.mouse, {
version: "@VERSION",
Expand Down Expand Up @@ -1004,4 +1019,6 @@ $.ui.plugin.add("draggable", "zIndex", {
}
});

})(jQuery);
return $.ui.draggable;

}));
22 changes: 20 additions & 2 deletions ui/jquery.ui.droppable.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,23 @@
* jquery.ui.mouse.js
* jquery.ui.draggable.js
*/
(function( $, undefined ) {
(function( factory ) {
if ( typeof define === "function" && define.amd ) {

// AMD. Register as an anonymous module.
define([
"jquery",
"./jquery.ui.core",
"./jquery.ui.widget",
"./jquery.ui.mouse",
"./jquery.ui.draggable"
], factory );
} else {

// Browser globals
factory( jQuery );
}
}(function( $ ) {

$.widget( "ui.droppable", {
version: "@VERSION",
Expand Down Expand Up @@ -401,4 +417,6 @@ $.ui.ddmanager = {
}
};

})( jQuery );
return $.ui.droppable;

}));
19 changes: 16 additions & 3 deletions ui/jquery.ui.effect-blind.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,22 @@
* Depends:
* jquery.ui.effect.js
*/
(function( $, undefined ) {
(function( factory ) {
if ( typeof define === "function" && define.amd ) {

$.effects.effect.blind = function( o, done ) {
// AMD. Register as an anonymous module.
define([
"jquery",
"./jquery.ui.effect"
], factory );
} else {

// Browser globals
factory( jQuery );
}
}(function( $ ) {

return $.effects.effect.blind = function( o, done ) {
// Create element
var el = $( this ),
rvertical = /up|down|vertical/,
Expand Down Expand Up @@ -77,4 +90,4 @@ $.effects.effect.blind = function( o, done ) {
});
};

})(jQuery);
}));
19 changes: 16 additions & 3 deletions ui/jquery.ui.effect-bounce.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,22 @@
* Depends:
* jquery.ui.effect.js
*/
(function( $, undefined ) {
(function( factory ) {
if ( typeof define === "function" && define.amd ) {

// AMD. Register as an anonymous module.
define([
"jquery",
"./jquery.ui.effect"
], factory );
} else {

// Browser globals
factory( jQuery );
}
}(function( $ ) {

$.effects.effect.bounce = function( o, done ) {
return $.effects.effect.bounce = function( o, done ) {
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],

Expand Down Expand Up @@ -110,4 +123,4 @@ $.effects.effect.bounce = function( o, done ) {

};

})(jQuery);
}));
19 changes: 16 additions & 3 deletions ui/jquery.ui.effect-clip.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,22 @@
* Depends:
* jquery.ui.effect.js
*/
(function( $, undefined ) {
(function( factory ) {
if ( typeof define === "function" && define.amd ) {

$.effects.effect.clip = function( o, done ) {
// AMD. Register as an anonymous module.
define([
"jquery",
"./jquery.ui.effect"
], factory );
} else {

// Browser globals
factory( jQuery );
}
}(function( $ ) {

return $.effects.effect.clip = function( o, done ) {
// Create element
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
Expand Down Expand Up @@ -64,4 +77,4 @@ $.effects.effect.clip = function( o, done ) {

};

})(jQuery);
}));
19 changes: 16 additions & 3 deletions ui/jquery.ui.effect-drop.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,22 @@
* Depends:
* jquery.ui.effect.js
*/
(function( $, undefined ) {
(function( factory ) {
if ( typeof define === "function" && define.amd ) {

$.effects.effect.drop = function( o, done ) {
// AMD. Register as an anonymous module.
define([
"jquery",
"./jquery.ui.effect"
], factory );
} else {

// Browser globals
factory( jQuery );
}
}(function( $ ) {

return $.effects.effect.drop = function( o, done ) {

var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ],
Expand Down Expand Up @@ -62,4 +75,4 @@ $.effects.effect.drop = function( o, done ) {
});
};

})(jQuery);
}));
Loading

0 comments on commit 96e027e

Please sign in to comment.