Skip to content

Commit e273345

Browse files
committed
Wrap source files with UMD jqueryPlugin
1 parent 4ed52cb commit e273345

37 files changed

+491
-72
lines changed

ui/.jshintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"jquery": true,
1818

1919
"globals": {
20+
"define": false,
2021
"Globalize": false
2122
}
2223
}

ui/jquery.ui.accordion.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,19 @@
1212
* jquery.ui.core.js
1313
* jquery.ui.widget.js
1414
*/
15-
(function( $, undefined ) {
15+
(function( factory ) {
16+
if ( typeof define === "function" && define.amd ) {
17+
// AMD. Register as an anonymous module.
18+
define([
19+
"jquery",
20+
"jqueryui/jquery.ui.core",
21+
"jqueryui/jquery.ui.widget"
22+
], factory );
23+
} else {
24+
// Browser globals
25+
factory( jQuery );
26+
}
27+
}(function( $ ) {
1628

1729
var uid = 0,
1830
hideProps = {},
@@ -570,4 +582,4 @@ $.widget( "ui.accordion", {
570582
}
571583
});
572584

573-
})( jQuery );
585+
}));

ui/jquery.ui.autocomplete.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,21 @@
1414
* jquery.ui.position.js
1515
* jquery.ui.menu.js
1616
*/
17-
(function( $, undefined ) {
17+
(function( factory ) {
18+
if ( typeof define === "function" && define.amd ) {
19+
// AMD. Register as an anonymous module.
20+
define([
21+
"jquery",
22+
"jqueryui/jquery.ui.core",
23+
"jqueryui/jquery.ui.widget",
24+
"jqueryui/jquery.ui.position",
25+
"jqueryui/jquery.ui.menu"
26+
], factory );
27+
} else {
28+
// Browser globals
29+
factory( jQuery );
30+
}
31+
}(function( $ ) {
1832

1933
$.widget( "ui.autocomplete", {
2034
version: "@VERSION",
@@ -602,4 +616,4 @@ $.widget( "ui.autocomplete", $.ui.autocomplete, {
602616
}
603617
});
604618

605-
}( jQuery ));
619+
}));

ui/jquery.ui.button.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,19 @@
1212
* jquery.ui.core.js
1313
* jquery.ui.widget.js
1414
*/
15-
(function( $, undefined ) {
15+
(function( factory ) {
16+
if ( typeof define === "function" && define.amd ) {
17+
// AMD. Register as an anonymous module.
18+
define([
19+
"jquery",
20+
"jqueryui/jquery.ui.core",
21+
"jqueryui/jquery.ui.widget"
22+
], factory );
23+
} else {
24+
// Browser globals
25+
factory( jQuery );
26+
}
27+
}(function( $ ) {
1628

1729
var lastActive, startXPos, startYPos, clickDragged,
1830
baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
@@ -413,4 +425,4 @@ $.widget( "ui.buttonset", {
413425
}
414426
});
415427

416-
}( jQuery ) );
428+
}));

ui/jquery.ui.core.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@
88
*
99
* http://api.jqueryui.com/category/ui-core/
1010
*/
11-
(function( $, undefined ) {
11+
(function( factory ) {
12+
if ( typeof define === "function" && define.amd ) {
13+
// AMD. Register as an anonymous module.
14+
define( [ "jquery" ], factory );
15+
} else {
16+
// Browser globals
17+
factory( jQuery );
18+
}
19+
}(function( $ ) {
1220

1321
var uuid = 0,
1422
runiqueId = /^ui-id-\d+$/;
@@ -290,4 +298,4 @@ $.ui.plugin = {
290298
}
291299
};
292300

293-
})( jQuery );
301+
}));

ui/jquery.ui.datepicker.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,18 @@
1111
* Depends:
1212
* jquery.ui.core.js
1313
*/
14-
(function( $, undefined ) {
14+
(function( factory ) {
15+
if ( typeof define === "function" && define.amd ) {
16+
// AMD. Register as an anonymous module.
17+
define([
18+
"jquery",
19+
"jqueryui/jquery.ui.core"
20+
], factory );
21+
} else {
22+
// Browser globals
23+
factory( jQuery );
24+
}
25+
}(function( $ ) {
1526

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

@@ -2057,4 +2068,4 @@ $.datepicker.initialized = false;
20572068
$.datepicker.uuid = new Date().getTime();
20582069
$.datepicker.version = "@VERSION";
20592070

2060-
})(jQuery);
2071+
}));

ui/jquery.ui.dialog.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,24 @@
1717
* jquery.ui.position.js
1818
* jquery.ui.resizable.js
1919
*/
20-
(function( $, undefined ) {
20+
(function( factory ) {
21+
if ( typeof define === "function" && define.amd ) {
22+
// AMD. Register as an anonymous module.
23+
define([
24+
"jquery",
25+
"jqueryui/jquery.ui.core",
26+
"jqueryui/jquery.ui.widget",
27+
"jqueryui/jquery.ui.button",
28+
"jqueryui/jquery.ui.draggable",
29+
"jqueryui/jquery.ui.mouse",
30+
"jqueryui/jquery.ui.position",
31+
"jqueryui/jquery.ui.resizable"
32+
], factory );
33+
} else {
34+
// Browser globals
35+
factory( jQuery );
36+
}
37+
}(function( $ ) {
2138

2239
var sizeRelatedOptions = {
2340
buttons: true,
@@ -772,4 +789,4 @@ $.widget( "ui.dialog", {
772789

773790
$.ui.dialog.overlayInstances = 0;
774791

775-
}( jQuery ) );
792+
}));

ui/jquery.ui.draggable.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,20 @@
1313
* jquery.ui.mouse.js
1414
* jquery.ui.widget.js
1515
*/
16-
(function( $, undefined ) {
16+
(function( factory ) {
17+
if ( typeof define === "function" && define.amd ) {
18+
// AMD. Register as an anonymous module.
19+
define([
20+
"jquery",
21+
"jqueryui/jquery.ui.core",
22+
"jqueryui/jquery.ui.mouse",
23+
"jqueryui/jquery.ui.widget"
24+
], factory );
25+
} else {
26+
// Browser globals
27+
factory( jQuery );
28+
}
29+
}(function( $ ) {
1730

1831
$.widget("ui.draggable", $.ui.mouse, {
1932
version: "@VERSION",
@@ -971,4 +984,4 @@ $.ui.plugin.add("draggable", "zIndex", {
971984
}
972985
});
973986

974-
})(jQuery);
987+
}));

ui/jquery.ui.droppable.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,21 @@
1414
* jquery.ui.mouse.js
1515
* jquery.ui.draggable.js
1616
*/
17-
(function( $, undefined ) {
17+
(function( factory ) {
18+
if ( typeof define === "function" && define.amd ) {
19+
// AMD. Register as an anonymous module.
20+
define([
21+
"jquery",
22+
"jqueryui/jquery.ui.core",
23+
"jqueryui/jquery.ui.widget",
24+
"jqueryui/jquery.ui.mouse",
25+
"jqueryui/jquery.ui.draggable"
26+
], factory );
27+
} else {
28+
// Browser globals
29+
factory( jQuery );
30+
}
31+
}(function( $ ) {
1832

1933
function isOverAxis( x, reference, size ) {
2034
return ( x >= reference ) && ( x < ( reference + size ) );
@@ -386,4 +400,4 @@ $.ui.ddmanager = {
386400
}
387401
};
388402

389-
})( jQuery );
403+
}));

ui/jquery.ui.effect-blind.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,18 @@
1111
* Depends:
1212
* jquery.ui.effect.js
1313
*/
14-
(function( $, undefined ) {
14+
(function( factory ) {
15+
if ( typeof define === "function" && define.amd ) {
16+
// AMD. Register as an anonymous module.
17+
define([
18+
"jquery",
19+
"jqueryui/jquery.ui.effect"
20+
], factory );
21+
} else {
22+
// Browser globals
23+
factory( jQuery );
24+
}
25+
}(function( $ ) {
1526

1627
var rvertical = /up|down|vertical/,
1728
rpositivemotion = /up|left|vertical|horizontal/;
@@ -79,4 +90,4 @@ $.effects.effect.blind = function( o, done ) {
7990

8091
};
8192

82-
})(jQuery);
93+
}));

ui/jquery.ui.effect-bounce.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,18 @@
1111
* Depends:
1212
* jquery.ui.effect.js
1313
*/
14-
(function( $, undefined ) {
14+
(function( factory ) {
15+
if ( typeof define === "function" && define.amd ) {
16+
// AMD. Register as an anonymous module.
17+
define([
18+
"jquery",
19+
"jqueryui/jquery.ui.effect"
20+
], factory );
21+
} else {
22+
// Browser globals
23+
factory( jQuery );
24+
}
25+
}(function( $ ) {
1526

1627
$.effects.effect.bounce = function( o, done ) {
1728
var el = $( this ),
@@ -110,4 +121,4 @@ $.effects.effect.bounce = function( o, done ) {
110121

111122
};
112123

113-
})(jQuery);
124+
}));

ui/jquery.ui.effect-clip.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,18 @@
1111
* Depends:
1212
* jquery.ui.effect.js
1313
*/
14-
(function( $, undefined ) {
14+
(function( factory ) {
15+
if ( typeof define === "function" && define.amd ) {
16+
// AMD. Register as an anonymous module.
17+
define([
18+
"jquery",
19+
"jqueryui/jquery.ui.effect"
20+
], factory );
21+
} else {
22+
// Browser globals
23+
factory( jQuery );
24+
}
25+
}(function( $ ) {
1526

1627
$.effects.effect.clip = function( o, done ) {
1728
// Create element
@@ -64,4 +75,4 @@ $.effects.effect.clip = function( o, done ) {
6475

6576
};
6677

67-
})(jQuery);
78+
}));

ui/jquery.ui.effect-drop.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,18 @@
1111
* Depends:
1212
* jquery.ui.effect.js
1313
*/
14-
(function( $, undefined ) {
14+
(function( factory ) {
15+
if ( typeof define === "function" && define.amd ) {
16+
// AMD. Register as an anonymous module.
17+
define([
18+
"jquery",
19+
"jqueryui/jquery.ui.effect"
20+
], factory );
21+
} else {
22+
// Browser globals
23+
factory( jQuery );
24+
}
25+
}(function( $ ) {
1526

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

@@ -62,4 +73,4 @@ $.effects.effect.drop = function( o, done ) {
6273
});
6374
};
6475

65-
})(jQuery);
76+
}));

ui/jquery.ui.effect-explode.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,18 @@
1111
* Depends:
1212
* jquery.ui.effect.js
1313
*/
14-
(function( $, undefined ) {
14+
(function( factory ) {
15+
if ( typeof define === "function" && define.amd ) {
16+
// AMD. Register as an anonymous module.
17+
define([
18+
"jquery",
19+
"jqueryui/jquery.ui.effect"
20+
], factory );
21+
} else {
22+
// Browser globals
23+
factory( jQuery );
24+
}
25+
}(function( $ ) {
1526

1627
$.effects.effect.explode = function( o, done ) {
1728

@@ -94,4 +105,4 @@ $.effects.effect.explode = function( o, done ) {
94105
}
95106
};
96107

97-
})(jQuery);
108+
}));

ui/jquery.ui.effect-fade.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,18 @@
1111
* Depends:
1212
* jquery.ui.effect.js
1313
*/
14-
(function( $, undefined ) {
14+
(function( factory ) {
15+
if ( typeof define === "function" && define.amd ) {
16+
// AMD. Register as an anonymous module.
17+
define([
18+
"jquery",
19+
"jqueryui/jquery.ui.effect"
20+
], factory );
21+
} else {
22+
// Browser globals
23+
factory( jQuery );
24+
}
25+
}(function( $ ) {
1526

1627
$.effects.effect.fade = function( o, done ) {
1728
var el = $( this ),
@@ -27,4 +38,4 @@ $.effects.effect.fade = function( o, done ) {
2738
});
2839
};
2940

30-
})( jQuery );
41+
}));

0 commit comments

Comments
 (0)