Skip to content

Commit

Permalink
All: Support CommonJS and Node.
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Horowitz <jhorowitz@firedrum.com>
  • Loading branch information
Invader444 committed Feb 27, 2017
1 parent 278d1e1 commit b28c375
Show file tree
Hide file tree
Showing 131 changed files with 2,425 additions and 815 deletions.
8 changes: 7 additions & 1 deletion ui/.jshintrc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@


"globals": { "globals": {
"define": false, "define": false,
"Globalize": false "Globalize": false,
"require": false,
"exports": false,
"module": false,
"global": false,
"self": false,
"window": false
} }
} }
62 changes: 44 additions & 18 deletions ui/core.js
Original file line number Original file line Diff line number Diff line change
@@ -1,21 +1,47 @@
// This file is deprecated in 1.12.0 to be removed in 1.13 // This file is deprecated in 1.12.0 to be removed in 1.13
( function() { ( function() {
define( [ if (
"jquery", typeof require === "function" &&
"./data", typeof exports === "object" &&
"./disable-selection", typeof module === "object" ) {
"./focusable",
"./form", // CommonJS or Node
"./ie", require( "jquery" );
"./keycode", require( "./data" );
"./labels", require( "./disable-selection" );
"./jquery-1-7", require( "./focusable" );
"./plugin", require( "./form" );
"./safe-active-element", require( "./ie" );
"./safe-blur", require( "./keycode" );
"./scroll-parent", require( "./labels" );
"./tabbable", require( "./jquery-1-7" );
"./unique-id", require( "./plugin" );
"./version" require( "./safe-active-element" );
] ); require( "./safe-blur" );
require( "./scroll-parent" );
require( "./tabbable" );
require( "./unique-id" );
require( "./version" );
} else if ( typeof define === "function" && define.amd ) {

// AMD
define( [
"jquery",
"./data",
"./disable-selection",
"./focusable",
"./form",
"./ie",
"./keycode",
"./labels",
"./jquery-1-7",
"./plugin",
"./safe-active-element",
"./safe-blur",
"./scroll-parent",
"./tabbable",
"./unique-id",
"./version"
] );
}
} )(); } )();
24 changes: 18 additions & 6 deletions ui/data.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,17 +12,24 @@
//>>description: Selects elements which have data stored under the specified key. //>>description: Selects elements which have data stored under the specified key.
//>>docs: http://api.jqueryui.com/data-selector/ //>>docs: http://api.jqueryui.com/data-selector/


( function( factory ) { ( function( factory, global ) {
if ( typeof define === "function" && define.amd ) { if (
typeof require === "function" &&
typeof exports === "object" &&
typeof module === "object" ) {

// CommonJS or Node
factory( require( "jquery" ), require( "./version" ) );
} else if ( typeof define === "function" && define.amd ) {


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


// Browser globals // Globals
factory( jQuery ); factory( global.jQuery );
} }
} ( function( $ ) { }( function( $ ) {
return $.extend( $.expr[ ":" ], { return $.extend( $.expr[ ":" ], {
data: $.expr.createPseudo ? data: $.expr.createPseudo ?
$.expr.createPseudo( function( dataName ) { $.expr.createPseudo( function( dataName ) {
Expand All @@ -36,4 +43,9 @@ return $.extend( $.expr[ ":" ], {
return !!$.data( elem, match[ 3 ] ); return !!$.data( elem, match[ 3 ] );
} }
} ); } );
} ) ); },
typeof global !== "undefined" ? global :
typeof self !== "undefined" ? self :
typeof window !== "undefined" ? window :
{}
) );
24 changes: 18 additions & 6 deletions ui/disable-selection.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,17 +13,24 @@
//>>docs: http://api.jqueryui.com/disableSelection/ //>>docs: http://api.jqueryui.com/disableSelection/


// This file is deprecated // This file is deprecated
( function( factory ) { ( function( factory, global ) {
if ( typeof define === "function" && define.amd ) { if (
typeof require === "function" &&
typeof exports === "object" &&
typeof module === "object" ) {

// CommonJS or Node
factory( require( "jquery" ), require( "./version" ) );
} else if ( typeof define === "function" && define.amd ) {


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


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


return $.fn.extend( { return $.fn.extend( {
disableSelection: ( function() { disableSelection: ( function() {
Expand All @@ -43,4 +50,9 @@ return $.fn.extend( {
} }
} ); } );


} ) ); },
typeof global !== "undefined" ? global :
typeof self !== "undefined" ? self :
typeof window !== "undefined" ? window :
{}
) );
22 changes: 17 additions & 5 deletions ui/effect.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,15 +15,22 @@
//>>docs: http://api.jqueryui.com/category/effects-core/ //>>docs: http://api.jqueryui.com/category/effects-core/
//>>demos: http://jqueryui.com/effect/ //>>demos: http://jqueryui.com/effect/


( function( factory ) { ( function( factory, global ) {
if ( typeof define === "function" && define.amd ) { if (
typeof require === "function" &&
typeof exports === "object" &&
typeof module === "object" ) {

// CommonJS or Node
factory( require( "jquery" ), require( "./version" ) );
} else if ( typeof define === "function" && define.amd ) {


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


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


Expand Down Expand Up @@ -1632,4 +1639,9 @@ $.each( baseEasings, function( name, easeIn ) {


return $.effects; return $.effects;


} ) ); },
typeof global !== "undefined" ? global :
typeof self !== "undefined" ? self :
typeof window !== "undefined" ? window :
{}
) );
28 changes: 18 additions & 10 deletions ui/effects/effect-blind.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@
//>>docs: http://api.jqueryui.com/blind-effect/ //>>docs: http://api.jqueryui.com/blind-effect/
//>>demos: http://jqueryui.com/effect/ //>>demos: http://jqueryui.com/effect/


( function( factory ) { ( function( factory, global ) {
if ( typeof define === "function" && define.amd ) { if (
typeof require === "function" &&
typeof exports === "object" &&
typeof module === "object" ) {

// CommonJS or Node
factory( require( "jquery" ), require( "../version" ), require( "../effect" ) );
} else if ( typeof define === "function" && define.amd ) {


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


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


Expand Down Expand Up @@ -67,4 +70,9 @@ return $.effects.define( "blind", "hide", function( options, done ) {
} ); } );
} ); } );


} ) ); },
typeof global !== "undefined" ? global :
typeof self !== "undefined" ? self :
typeof window !== "undefined" ? window :
{}
) );
28 changes: 18 additions & 10 deletions ui/effects/effect-bounce.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@
//>>docs: http://api.jqueryui.com/bounce-effect/ //>>docs: http://api.jqueryui.com/bounce-effect/
//>>demos: http://jqueryui.com/effect/ //>>demos: http://jqueryui.com/effect/


( function( factory ) { ( function( factory, global ) {
if ( typeof define === "function" && define.amd ) { if (
typeof require === "function" &&
typeof exports === "object" &&
typeof module === "object" ) {

// CommonJS or Node
factory( require( "jquery" ), require( "../version" ), require( "../effect" ) );
} else if ( typeof define === "function" && define.amd ) {


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


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


Expand Down Expand Up @@ -107,4 +110,9 @@ return $.effects.define( "bounce", function( options, done ) {
$.effects.unshift( element, queuelen, anims + 1 ); $.effects.unshift( element, queuelen, anims + 1 );
} ); } );


} ) ); },
typeof global !== "undefined" ? global :
typeof self !== "undefined" ? self :
typeof window !== "undefined" ? window :
{}
) );
28 changes: 18 additions & 10 deletions ui/effects/effect-clip.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@
//>>docs: http://api.jqueryui.com/clip-effect/ //>>docs: http://api.jqueryui.com/clip-effect/
//>>demos: http://jqueryui.com/effect/ //>>demos: http://jqueryui.com/effect/


( function( factory ) { ( function( factory, global ) {
if ( typeof define === "function" && define.amd ) { if (
typeof require === "function" &&
typeof exports === "object" &&
typeof module === "object" ) {

// CommonJS or Node
factory( require( "jquery" ), require( "../version" ), require( "../effect" ) );
} else if ( typeof define === "function" && define.amd ) {


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


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


Expand Down Expand Up @@ -62,4 +65,9 @@ return $.effects.define( "clip", "hide", function( options, done ) {


} ); } );


} ) ); },
typeof global !== "undefined" ? global :
typeof self !== "undefined" ? self :
typeof window !== "undefined" ? window :
{}
) );
28 changes: 18 additions & 10 deletions ui/effects/effect-drop.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@
//>>docs: http://api.jqueryui.com/drop-effect/ //>>docs: http://api.jqueryui.com/drop-effect/
//>>demos: http://jqueryui.com/effect/ //>>demos: http://jqueryui.com/effect/


( function( factory ) { ( function( factory, global ) {
if ( typeof define === "function" && define.amd ) { if (
typeof require === "function" &&
typeof exports === "object" &&
typeof module === "object" ) {

// CommonJS or Node
factory( require( "jquery" ), require( "../version" ), require( "../effect" ) );
} else if ( typeof define === "function" && define.amd ) {


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


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


Expand Down Expand Up @@ -66,4 +69,9 @@ return $.effects.define( "drop", "hide", function( options, done ) {
} ); } );
} ); } );


} ) ); },
typeof global !== "undefined" ? global :
typeof self !== "undefined" ? self :
typeof window !== "undefined" ? window :
{}
) );
Loading

0 comments on commit b28c375

Please sign in to comment.