Core: Move version and creation of the ui namespace into its own module

Ref #9647
This commit is contained in:
Alexander Schmitz 2015-07-15 18:26:12 -04:00
parent cd6c751b88
commit 3d71fb83fe
39 changed files with 60 additions and 17 deletions

View File

@ -23,6 +23,7 @@
define( [ define( [
"jquery", "jquery",
"./core", "./core",
"./version",
"./widget" "./widget"
], factory ); ], factory );
} else { } else {

View File

@ -25,6 +25,7 @@
"./core", "./core",
"./widget", "./widget",
"./position", "./position",
"./version",
"./menu" "./menu"
], factory ); ], factory );
} else { } else {

View File

@ -23,6 +23,7 @@
define([ define([
"jquery", "jquery",
"./core", "./core",
"./version",
"./widget" "./widget"
], factory ); ], factory );
} else { } else {

View File

@ -18,7 +18,9 @@
if ( typeof define === "function" && define.amd ) { if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ "jquery" ], factory ); define( [
"jquery",
"./version" ], factory );
} else { } else {
// Browser globals // Browser globals
@ -26,11 +28,7 @@
} }
}( function( $ ) { }( function( $ ) {
// $.ui might exist from components with no dependencies, e.g., $.ui.position
$.ui = $.ui || {};
$.extend( $.ui, { $.extend( $.ui, {
version: "@VERSION",
keyCode: { keyCode: {
BACKSPACE: 8, BACKSPACE: 8,

View File

@ -22,7 +22,8 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define([ define([
"jquery", "jquery",
"./core" "./core",
"./version"
], factory ); ], factory );
} else { } else {

View File

@ -28,7 +28,8 @@
"./draggable", "./draggable",
"./mouse", "./mouse",
"./position", "./position",
"./resizable" "./resizable",
"./version"
], factory ); ], factory );
} else { } else {

View File

@ -21,6 +21,7 @@
define([ define([
"jquery", "jquery",
"./core", "./core",
"./version",
"./mouse", "./mouse",
"./widget" "./widget"
], factory ); ], factory );

View File

@ -19,7 +19,7 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define([ define([
"jquery", "jquery",
"./core", "./version",
"./widget", "./widget",
"./mouse", "./mouse",
"./draggable" "./draggable"

View File

@ -19,6 +19,7 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ define( [
"jquery", "jquery",
"./version",
"./effect" "./effect"
], factory ); ], factory );
} else { } else {

View File

@ -19,6 +19,7 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ define( [
"jquery", "jquery",
"./version",
"./effect" "./effect"
], factory ); ], factory );
} else { } else {

View File

@ -19,6 +19,7 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ define( [
"jquery", "jquery",
"./version",
"./effect" "./effect"
], factory ); ], factory );
} else { } else {

View File

@ -19,6 +19,7 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ define( [
"jquery", "jquery",
"./version",
"./effect" "./effect"
], factory ); ], factory );
} else { } else {

View File

@ -19,6 +19,7 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ define( [
"jquery", "jquery",
"./version",
"./effect" "./effect"
], factory ); ], factory );
} else { } else {

View File

@ -19,6 +19,7 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ define( [
"jquery", "jquery",
"./version",
"./effect" "./effect"
], factory ); ], factory );
} else { } else {

View File

@ -19,6 +19,7 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ define( [
"jquery", "jquery",
"./version",
"./effect" "./effect"
], factory ); ], factory );
} else { } else {

View File

@ -19,6 +19,7 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ define( [
"jquery", "jquery",
"./version",
"./effect" "./effect"
], factory ); ], factory );
} else { } else {

View File

@ -19,6 +19,7 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ define( [
"jquery", "jquery",
"./version",
"./effect", "./effect",
"./effect-scale" "./effect-scale"
], factory ); ], factory );

View File

@ -19,6 +19,7 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ define( [
"jquery", "jquery",
"./version",
"./effect" "./effect"
], factory ); ], factory );
} else { } else {

View File

@ -19,6 +19,7 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ define( [
"jquery", "jquery",
"./version",
"./effect", "./effect",
"./effect-size" "./effect-size"
], factory ); ], factory );

View File

@ -19,6 +19,7 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ define( [
"jquery", "jquery",
"./version",
"./effect" "./effect"
], factory ); ], factory );
} else { } else {

View File

@ -19,6 +19,7 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ define( [
"jquery", "jquery",
"./version",
"./effect" "./effect"
], factory ); ], factory );
} else { } else {

View File

@ -19,6 +19,7 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ define( [
"jquery", "jquery",
"./version",
"./effect" "./effect"
], factory ); ], factory );
} else { } else {

View File

@ -19,6 +19,7 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ define( [
"jquery", "jquery",
"./version",
"./effect" "./effect"
], factory ); ], factory );
} else { } else {

View File

@ -17,7 +17,7 @@
if ( typeof define === "function" && define.amd ) { if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ "jquery" ], factory ); define( [ "jquery", "./version" ], factory );
} else { } else {
// Browser globals // Browser globals

View File

@ -4,7 +4,8 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ define( [
"jquery", "jquery",
"ui/core" "ui/core",
"./version"
], factory ); ], factory );
} else { } else {

View File

@ -23,6 +23,7 @@
define( [ define( [
"jquery", "jquery",
"./core", "./core",
"./version",
"./widget", "./widget",
"./position" "./position"
], factory ); ], factory );

View File

@ -18,6 +18,7 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define([ define([
"jquery", "jquery",
"./version",
"./widget" "./widget"
], factory ); ], factory );
} else { } else {

View File

@ -19,7 +19,7 @@
if ( typeof define === "function" && define.amd ) { if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ "jquery" ], factory ); define( [ "jquery", "./version" ], factory );
} else { } else {
// Browser globals // Browser globals
@ -27,9 +27,6 @@
} }
}( function( $ ) { }( function( $ ) {
( function() { ( function() {
$.ui = $.ui || {};
var cachedScrollbarWidth, supportsOffsetFractions, var cachedScrollbarWidth, supportsOffsetFractions,
max = Math.max, max = Math.max,
abs = Math.abs, abs = Math.abs,

View File

@ -22,7 +22,7 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ define( [
"jquery", "jquery",
"./core", "./version",
"./widget" "./widget"
], factory ); ], factory );
} else { } else {

View File

@ -23,6 +23,7 @@
define([ define([
"jquery", "jquery",
"./core", "./core",
"./version",
"./mouse", "./mouse",
"./widget" "./widget"
], factory ); ], factory );

View File

@ -20,7 +20,7 @@
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define([ define([
"jquery", "jquery",
"./core", "./version",
"./mouse", "./mouse",
"./widget" "./widget"
], factory ); ], factory );

View File

@ -23,6 +23,7 @@
define( [ define( [
"jquery", "jquery",
"./core", "./core",
"./version",
"./widget", "./widget",
"./position", "./position",
"./menu" "./menu"

View File

@ -24,6 +24,7 @@
"jquery", "jquery",
"./core", "./core",
"./mouse", "./mouse",
"./version",
"./widget" "./widget"
], factory ); ], factory );
} else { } else {

View File

@ -22,6 +22,7 @@
"jquery", "jquery",
"./core", "./core",
"./mouse", "./mouse",
"./version",
"./widget" "./widget"
], factory ); ], factory );
} else { } else {

View File

@ -23,6 +23,7 @@
define( [ define( [
"jquery", "jquery",
"./core", "./core",
"./version",
"./widget", "./widget",
"./button" "./button"
], factory ); ], factory );

View File

@ -23,6 +23,7 @@
define( [ define( [
"jquery", "jquery",
"./core", "./core",
"./version",
"./widget" "./widget"
], factory ); ], factory );
} else { } else {

View File

@ -23,6 +23,7 @@
define( [ define( [
"jquery", "jquery",
"./core", "./core",
"./version",
"./widget", "./widget",
"./position" "./position"
], factory ); ], factory );

17
ui/version.js Normal file
View File

@ -0,0 +1,17 @@
( function( factory ) {
if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.
define( [ "jquery" ], factory );
} else {
// Browser globals
factory( jQuery );
}
} ( function( $ ) {
$.ui = $.ui || {};
return $.ui.version = "@VERSION";
} ) );

View File

@ -17,7 +17,7 @@
if ( typeof define === "function" && define.amd ) { if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module. // AMD. Register as an anonymous module.
define( [ "jquery" ], factory ); define( [ "jquery", "./version" ], factory );
} else { } else {
// Browser globals // Browser globals