Permalink
Browse files

All: Wrap source files with UMD return exports

Ref #9464
Ref gh-1029
  • Loading branch information...
rxaviers committed Jul 12, 2013
1 parent 2651f45 commit 96e027e4b14345722cc39589f59ce2ce5e94b991
View
@@ -18,6 +18,7 @@
"jquery": true,
"globals": {
"define": false,
"Globalize": false
}
}
View
@@ -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,
@@ -562,4 +576,4 @@ $.widget( "ui.accordion", {
}
});
})( jQuery );
}));
@@ -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",
@@ -602,4 +618,6 @@ $.widget( "ui.autocomplete", $.ui.autocomplete, {
}
});
}( jQuery ));
return $.ui.autocomplete;
}));
View
@@ -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",
@@ -390,4 +404,6 @@ $.widget( "ui.buttonset", {
}
});
}( jQuery ) );
return $.ui.button;
}));
View
@@ -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 || {};
@@ -286,4 +296,4 @@ $.ui.plugin = {
}
};
})( jQuery );
}));
View
@@ -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" } });
@@ -2056,4 +2069,6 @@ $.datepicker.initialized = false;
$.datepicker.uuid = new Date().getTime();
$.datepicker.version = "@VERSION";
})(jQuery);
return $.datepicker;
}));
View
@@ -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",
@@ -841,4 +860,4 @@ $.widget( "ui.dialog", {
}
});
}( jQuery ));
}));
View
@@ -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",
@@ -1004,4 +1019,6 @@ $.ui.plugin.add("draggable", "zIndex", {
}
});
})(jQuery);
return $.ui.draggable;
}));
View
@@ -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",
@@ -401,4 +417,6 @@ $.ui.ddmanager = {
}
};
})( jQuery );
return $.ui.droppable;
}));
@@ -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/,
@@ -77,4 +90,4 @@ $.effects.effect.blind = function( o, done ) {
});
};
})(jQuery);
}));
@@ -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" ],
@@ -110,4 +123,4 @@ $.effects.effect.bounce = function( o, done ) {
};
})(jQuery);
}));
@@ -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" ],
@@ -64,4 +77,4 @@ $.effects.effect.clip = function( o, done ) {
};
})(jQuery);
}));
@@ -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" ],
@@ -62,4 +75,4 @@ $.effects.effect.drop = function( o, done ) {
});
};
})(jQuery);
}));
Oops, something went wrong.

0 comments on commit 96e027e

Please sign in to comment.