From 96e027e4b14345722cc39589f59ce2ce5e94b991 Mon Sep 17 00:00:00 2001 From: Rafael Xavier de Souza Date: Fri, 12 Jul 2013 13:40:48 -0300 Subject: All: Wrap source files with UMD return exports Ref #9464 Ref gh-1029 --- ui/.jshintrc | 1 + ui/jquery.ui.accordion.js | 20 +++++++++++++++++--- ui/jquery.ui.autocomplete.js | 22 ++++++++++++++++++++-- ui/jquery.ui.button.js | 20 ++++++++++++++++++-- ui/jquery.ui.core.js | 14 ++++++++++++-- ui/jquery.ui.datepicker.js | 19 +++++++++++++++++-- ui/jquery.ui.dialog.js | 25 ++++++++++++++++++++++--- ui/jquery.ui.draggable.js | 21 +++++++++++++++++++-- ui/jquery.ui.droppable.js | 22 ++++++++++++++++++++-- ui/jquery.ui.effect-blind.js | 19 ++++++++++++++++--- ui/jquery.ui.effect-bounce.js | 19 ++++++++++++++++--- ui/jquery.ui.effect-clip.js | 19 ++++++++++++++++--- ui/jquery.ui.effect-drop.js | 19 ++++++++++++++++--- ui/jquery.ui.effect-explode.js | 19 ++++++++++++++++--- ui/jquery.ui.effect-fade.js | 19 ++++++++++++++++--- ui/jquery.ui.effect-fold.js | 19 ++++++++++++++++--- ui/jquery.ui.effect-highlight.js | 19 ++++++++++++++++--- ui/jquery.ui.effect-puff.js | 20 +++++++++++++++++--- ui/jquery.ui.effect-pulsate.js | 19 ++++++++++++++++--- ui/jquery.ui.effect-scale.js | 20 +++++++++++++++++--- ui/jquery.ui.effect-shake.js | 19 ++++++++++++++++--- ui/jquery.ui.effect-size.js | 19 ++++++++++++++++--- ui/jquery.ui.effect-slide.js | 19 ++++++++++++++++--- ui/jquery.ui.effect-transfer.js | 19 ++++++++++++++++--- ui/jquery.ui.effect.js | 16 ++++++++++++++-- ui/jquery.ui.menu.js | 21 ++++++++++++++++++--- ui/jquery.ui.mouse.js | 19 ++++++++++++++++--- ui/jquery.ui.position.js | 17 +++++++++++++++-- ui/jquery.ui.progressbar.js | 20 +++++++++++++++++--- ui/jquery.ui.resizable.js | 21 +++++++++++++++++++-- ui/jquery.ui.selectable.js | 21 ++++++++++++++++++--- ui/jquery.ui.selectmenu.js | 2 +- ui/jquery.ui.slider.js | 21 ++++++++++++++++++--- ui/jquery.ui.sortable.js | 21 ++++++++++++++++++--- ui/jquery.ui.spinner.js | 21 ++++++++++++++++++--- ui/jquery.ui.tabs.js | 20 +++++++++++++++++--- ui/jquery.ui.tooltip.js | 21 ++++++++++++++++++--- ui/jquery.ui.widget.js | 16 ++++++++++++++-- 38 files changed, 609 insertions(+), 99 deletions(-) (limited to 'ui') diff --git a/ui/.jshintrc b/ui/.jshintrc index 073418812..98a79b5db 100644 --- a/ui/.jshintrc +++ b/ui/.jshintrc @@ -18,6 +18,7 @@ "jquery": true, "globals": { + "define": false, "Globalize": false } } diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index c63c807ba..b2a3c2021 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -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 ); +})); diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index e40e703b9..e5545abc0 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -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; + +})); diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index 6bde7863f..659ecbf37 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -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; + +})); diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js index 6340c6d64..cb6760017 100644 --- a/ui/jquery.ui.core.js +++ b/ui/jquery.ui.core.js @@ -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 ); +})); diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index e4961a1df..19bc61f8f 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -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; + +})); diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index 7f90908bd..857bdaffe 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -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 )); +})); diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 2de1d0162..7393de28c 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -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; + +})); diff --git a/ui/jquery.ui.droppable.js b/ui/jquery.ui.droppable.js index f9f2620da..e78ff1f8c 100644 --- a/ui/jquery.ui.droppable.js +++ b/ui/jquery.ui.droppable.js @@ -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; + +})); diff --git a/ui/jquery.ui.effect-blind.js b/ui/jquery.ui.effect-blind.js index 26aeab05c..1648a9ad3 100644 --- a/ui/jquery.ui.effect-blind.js +++ b/ui/jquery.ui.effect-blind.js @@ -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); +})); diff --git a/ui/jquery.ui.effect-bounce.js b/ui/jquery.ui.effect-bounce.js index 107a6ea94..01a83861c 100644 --- a/ui/jquery.ui.effect-bounce.js +++ b/ui/jquery.ui.effect-bounce.js @@ -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); +})); diff --git a/ui/jquery.ui.effect-clip.js b/ui/jquery.ui.effect-clip.js index 34f6d7f99..9be25434b 100644 --- a/ui/jquery.ui.effect-clip.js +++ b/ui/jquery.ui.effect-clip.js @@ -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); +})); diff --git a/ui/jquery.ui.effect-drop.js b/ui/jquery.ui.effect-drop.js index 2d19c91c4..aad87a0db 100644 --- a/ui/jquery.ui.effect-drop.js +++ b/ui/jquery.ui.effect-drop.js @@ -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); +})); diff --git a/ui/jquery.ui.effect-explode.js b/ui/jquery.ui.effect-explode.js index e81ad9be0..6cfc47115 100644 --- a/ui/jquery.ui.effect-explode.js +++ b/ui/jquery.ui.effect-explode.js @@ -11,9 +11,22 @@ * Depends: * jquery.ui.effect.js */ -(function( $, undefined ) { +(function( factory ) { + if ( typeof define === "function" && define.amd ) { -$.effects.effect.explode = function( o, done ) { + // AMD. Register as an anonymous module. + define([ + "jquery", + "./jquery.ui.effect" + ], factory ); + } else { + + // Browser globals + factory( jQuery ); + } +}(function( $ ) { + +return $.effects.effect.explode = function( o, done ) { var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3, cells = rows, @@ -94,4 +107,4 @@ $.effects.effect.explode = function( o, done ) { } }; -})(jQuery); +})); diff --git a/ui/jquery.ui.effect-fade.js b/ui/jquery.ui.effect-fade.js index b44140025..543a5210d 100644 --- a/ui/jquery.ui.effect-fade.js +++ b/ui/jquery.ui.effect-fade.js @@ -11,9 +11,22 @@ * Depends: * jquery.ui.effect.js */ -(function( $, undefined ) { +(function( factory ) { + if ( typeof define === "function" && define.amd ) { -$.effects.effect.fade = function( o, done ) { + // AMD. Register as an anonymous module. + define([ + "jquery", + "./jquery.ui.effect" + ], factory ); + } else { + + // Browser globals + factory( jQuery ); + } +}(function( $ ) { + +return $.effects.effect.fade = function( o, done ) { var el = $( this ), mode = $.effects.setMode( el, o.mode || "toggle" ); @@ -27,4 +40,4 @@ $.effects.effect.fade = function( o, done ) { }); }; -})( jQuery ); +})); diff --git a/ui/jquery.ui.effect-fold.js b/ui/jquery.ui.effect-fold.js index fdb6e5fae..677b93406 100644 --- a/ui/jquery.ui.effect-fold.js +++ b/ui/jquery.ui.effect-fold.js @@ -11,9 +11,22 @@ * Depends: * jquery.ui.effect.js */ -(function( $, undefined ) { +(function( factory ) { + if ( typeof define === "function" && define.amd ) { -$.effects.effect.fold = function( o, done ) { + // AMD. Register as an anonymous module. + define([ + "jquery", + "./jquery.ui.effect" + ], factory ); + } else { + + // Browser globals + factory( jQuery ); + } +}(function( $ ) { + +return $.effects.effect.fold = function( o, done ) { // Create element var el = $( this ), @@ -73,4 +86,4 @@ $.effects.effect.fold = function( o, done ) { }; -})(jQuery); +})); diff --git a/ui/jquery.ui.effect-highlight.js b/ui/jquery.ui.effect-highlight.js index 2dc72082e..9c0f2d315 100644 --- a/ui/jquery.ui.effect-highlight.js +++ b/ui/jquery.ui.effect-highlight.js @@ -11,9 +11,22 @@ * Depends: * jquery.ui.effect.js */ -(function( $, undefined ) { +(function( factory ) { + if ( typeof define === "function" && define.amd ) { -$.effects.effect.highlight = function( o, done ) { + // AMD. Register as an anonymous module. + define([ + "jquery", + "./jquery.ui.effect" + ], factory ); + } else { + + // Browser globals + factory( jQuery ); + } +}(function( $ ) { + +return $.effects.effect.highlight = function( o, done ) { var elem = $( this ), props = [ "backgroundImage", "backgroundColor", "opacity" ], mode = $.effects.setMode( elem, o.mode || "show" ), @@ -47,4 +60,4 @@ $.effects.effect.highlight = function( o, done ) { }); }; -})(jQuery); +})); diff --git a/ui/jquery.ui.effect-puff.js b/ui/jquery.ui.effect-puff.js index a910defb2..4940ca390 100644 --- a/ui/jquery.ui.effect-puff.js +++ b/ui/jquery.ui.effect-puff.js @@ -12,9 +12,23 @@ * jquery.ui.effect.js * jquery.ui.effect-scale.js */ -(function( $, undefined ) { +(function( factory ) { + if ( typeof define === "function" && define.amd ) { -$.effects.effect.puff = function( o, done ) { + // AMD. Register as an anonymous module. + define([ + "jquery", + "./jquery.ui.effect", + "./jquery.ui.effect-scale" + ], factory ); + } else { + + // Browser globals + factory( jQuery ); + } +}(function( $ ) { + +return $.effects.effect.puff = function( o, done ) { var elem = $( this ), mode = $.effects.setMode( elem, o.mode || "hide" ), hide = mode === "hide", @@ -47,4 +61,4 @@ $.effects.effect.puff = function( o, done ) { elem.effect( o ); }; -})(jQuery); +})); diff --git a/ui/jquery.ui.effect-pulsate.js b/ui/jquery.ui.effect-pulsate.js index 61d86df13..5bbff1e3d 100644 --- a/ui/jquery.ui.effect-pulsate.js +++ b/ui/jquery.ui.effect-pulsate.js @@ -11,9 +11,22 @@ * Depends: * jquery.ui.effect.js */ -(function( $, undefined ) { +(function( factory ) { + if ( typeof define === "function" && define.amd ) { -$.effects.effect.pulsate = function( o, done ) { + // AMD. Register as an anonymous module. + define([ + "jquery", + "./jquery.ui.effect" + ], factory ); + } else { + + // Browser globals + factory( jQuery ); + } +}(function( $ ) { + +return $.effects.effect.pulsate = function( o, done ) { var elem = $( this ), mode = $.effects.setMode( elem, o.mode || "show" ), show = mode === "show", @@ -60,4 +73,4 @@ $.effects.effect.pulsate = function( o, done ) { elem.dequeue(); }; -})(jQuery); +})); diff --git a/ui/jquery.ui.effect-scale.js b/ui/jquery.ui.effect-scale.js index 42dc2281c..233e318c4 100644 --- a/ui/jquery.ui.effect-scale.js +++ b/ui/jquery.ui.effect-scale.js @@ -12,9 +12,23 @@ * jquery.ui.effect.js * jquery.ui.effect-size.js */ -(function( $, undefined ) { +(function( factory ) { + if ( typeof define === "function" && define.amd ) { -$.effects.effect.scale = function( o, done ) { + // AMD. Register as an anonymous module. + define([ + "jquery", + "./jquery.ui.effect", + "./jquery.ui.effect-size" + ], factory ); + } else { + + // Browser globals + factory( jQuery ); + } +}(function( $ ) { + +return $.effects.effect.scale = function( o, done ) { // Create element var el = $( this ), @@ -76,4 +90,4 @@ $.effects.effect.scale = function( o, done ) { }; -})(jQuery); +})); diff --git a/ui/jquery.ui.effect-shake.js b/ui/jquery.ui.effect-shake.js index 1e7e827e7..ef03a103f 100644 --- a/ui/jquery.ui.effect-shake.js +++ b/ui/jquery.ui.effect-shake.js @@ -11,9 +11,22 @@ * Depends: * jquery.ui.effect.js */ -(function( $, undefined ) { +(function( factory ) { + if ( typeof define === "function" && define.amd ) { -$.effects.effect.shake = function( o, done ) { + // AMD. Register as an anonymous module. + define([ + "jquery", + "./jquery.ui.effect" + ], factory ); + } else { + + // Browser globals + factory( jQuery ); + } +}(function( $ ) { + +return $.effects.effect.shake = function( o, done ) { var el = $( this ), props = [ "position", "top", "bottom", "left", "right", "height", "width" ], @@ -71,4 +84,4 @@ $.effects.effect.shake = function( o, done ) { }; -})(jQuery); +})); diff --git a/ui/jquery.ui.effect-size.js b/ui/jquery.ui.effect-size.js index 6bdbd433d..1b01bf49a 100644 --- a/ui/jquery.ui.effect-size.js +++ b/ui/jquery.ui.effect-size.js @@ -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.size = function( o, done ) { +return $.effects.effect.size = function( o, done ) { // Create element var original, baseline, factor, @@ -220,4 +233,4 @@ $.effects.effect.size = function( o, done ) { }; -})(jQuery); +})); diff --git a/ui/jquery.ui.effect-slide.js b/ui/jquery.ui.effect-slide.js index 3fa63433e..4f4fd4f69 100644 --- a/ui/jquery.ui.effect-slide.js +++ b/ui/jquery.ui.effect-slide.js @@ -11,9 +11,22 @@ * Depends: * jquery.ui.effect.js */ -(function( $, undefined ) { +(function( factory ) { + if ( typeof define === "function" && define.amd ) { -$.effects.effect.slide = function( o, done ) { + // AMD. Register as an anonymous module. + define([ + "jquery", + "./jquery.ui.effect" + ], factory ); + } else { + + // Browser globals + factory( jQuery ); + } +}(function( $ ) { + +return $.effects.effect.slide = function( o, done ) { // Create element var el = $( this ), @@ -61,4 +74,4 @@ $.effects.effect.slide = function( o, done ) { }); }; -})(jQuery); +})); diff --git a/ui/jquery.ui.effect-transfer.js b/ui/jquery.ui.effect-transfer.js index 31fbfa219..da7351f6d 100644 --- a/ui/jquery.ui.effect-transfer.js +++ b/ui/jquery.ui.effect-transfer.js @@ -11,9 +11,22 @@ * Depends: * jquery.ui.effect.js */ -(function( $, undefined ) { +(function( factory ) { + if ( typeof define === "function" && define.amd ) { -$.effects.effect.transfer = function( o, done ) { + // AMD. Register as an anonymous module. + define([ + "jquery", + "./jquery.ui.effect" + ], factory ); + } else { + + // Browser globals + factory( jQuery ); + } +}(function( $ ) { + +return $.effects.effect.transfer = function( o, done ) { var elem = $( this ), target = $( o.to ), targetFixed = target.css( "position" ) === "fixed", @@ -44,4 +57,4 @@ $.effects.effect.transfer = function( o, done ) { }); }; -})(jQuery); +})); diff --git a/ui/jquery.ui.effect.js b/ui/jquery.ui.effect.js index 3852cf5be..570561421 100644 --- a/ui/jquery.ui.effect.js +++ b/ui/jquery.ui.effect.js @@ -8,7 +8,17 @@ * * http://api.jqueryui.com/category/effects-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( $ ) { var dataSpace = "ui-effects-"; @@ -1282,4 +1292,6 @@ $.each( baseEasings, function( name, easeIn ) { })(); -})(jQuery); +return $.effects; + +})); diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index 8c9f5a9be..597ed01e7 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -13,9 +13,24 @@ * jquery.ui.widget.js * jquery.ui.position.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" + ], factory ); + } else { + + // Browser globals + factory( jQuery ); + } +}(function( $ ) { -$.widget( "ui.menu", { +return $.widget( "ui.menu", { version: "@VERSION", defaultElement: "