All: Moved version numbers into prototypes. Fixed #7436 - Widget: Store version numbers on instances.

This commit is contained in:
Scott González 2011-05-28 15:39:55 -04:00
parent 2f3284811c
commit 6a5b21fda2
19 changed files with 19 additions and 46 deletions

View File

@ -15,6 +15,7 @@
// TODO: use ui-accordion-header-active class and fix styling
$.widget( "ui.accordion", {
version: "@VERSION",
options: {
active: 0,
animated: "slide",
@ -432,7 +433,6 @@ $.widget( "ui.accordion", {
});
$.extend( $.ui.accordion, {
version: "@VERSION",
animations: {
slide: function( options, additions ) {
var showOverflow = options.toShow.css( "overflow" ),

View File

@ -19,6 +19,7 @@
var requestIndex = 0;
$.widget( "ui.autocomplete", {
version: "@VERSION",
defaultElement: "<input>",
options: {
appendTo: "body",
@ -475,7 +476,6 @@ $.widget( "ui.autocomplete", {
});
$.extend( $.ui.autocomplete, {
version: "@VERSION",
escapeRegex: function( value ) {
return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
},

View File

@ -41,6 +41,7 @@ var lastActive, startXPos, startYPos, clickDragged,
};
$.widget( "ui.button", {
version: "@VERSION",
defaultElement: "<button>",
options: {
disabled: null,
@ -412,6 +413,4 @@ $.widget( "ui.buttonset", {
}
});
$.ui.buttonset.version = "@VERSION";
}( jQuery ) );

View File

@ -36,6 +36,7 @@ var uiDialogClasses = "ui-dialog ui-widget ui-widget-content ui-corner-all ",
};
$.widget("ui.dialog", {
version: "@VERSION",
options: {
autoOpen: true,
buttons: {},
@ -655,8 +656,6 @@ $.widget("ui.dialog", {
});
$.extend($.ui.dialog, {
version: "@VERSION",
uuid: 0,
maxZ: 0,

View File

@ -15,6 +15,7 @@
(function( $, undefined ) {
$.widget("ui.draggable", $.ui.mouse, {
version: "@VERSION",
widgetEventPrefix: "drag",
options: {
addClasses: true,
@ -502,10 +503,6 @@ $.widget("ui.draggable", $.ui.mouse, {
});
$.extend($.ui.draggable, {
version: "@VERSION"
});
$.ui.plugin.add("draggable", "connectToSortable", {
start: function(event, ui) {

View File

@ -16,6 +16,7 @@
(function( $, undefined ) {
$.widget("ui.droppable", {
version: "@VERSION",
widgetEventPrefix: "drop",
options: {
accept: '*',
@ -146,10 +147,6 @@ $.widget("ui.droppable", {
});
$.extend($.ui.droppable, {
version: "@VERSION"
});
$.ui.intersect = function(draggable, droppable, toleranceMode) {
if (!droppable.offset) return false;

View File

@ -16,6 +16,7 @@
var idIncrement = 0;
$.widget("ui.menu", {
version: "@VERSION",
defaultElement: "<ul>",
delay: 150,
options: {
@ -420,6 +421,4 @@ $.widget("ui.menu", {
}
});
$.ui.menu.version = "@VERSION";
}( jQuery ));

View File

@ -18,6 +18,7 @@
// TODO when mixing clicking menus and keyboard navigation, focus handling is broken
// there has to be just one item that has tabindex
$.widget( "ui.menubar", {
version: "@VERSION",
options: {
buttons: false,
menuIcon: false

View File

@ -18,6 +18,7 @@ $(document).mousedown(function(e) {
});
$.widget("ui.mouse", {
version: "@VERSION",
options: {
cancel: ':input,option',
distance: 1,

View File

@ -17,6 +17,7 @@
var idIncrement = 0;
$.widget( "ui.popup", {
version: "@VERSION",
options: {
position: {
my: "left top",

View File

@ -14,6 +14,7 @@
(function( $, undefined ) {
$.widget( "ui.progressbar", {
version: "@VERSION",
options: {
value: 0,
max: 100
@ -100,8 +101,4 @@ $.widget( "ui.progressbar", {
}
});
$.extend( $.ui.progressbar, {
version: "@VERSION"
});
})( jQuery );

View File

@ -15,6 +15,7 @@
(function( $, undefined ) {
$.widget("ui.resizable", $.ui.mouse, {
version: "@VERSION",
widgetEventPrefix: "resize",
options: {
alsoResize: false,
@ -548,10 +549,6 @@ $.widget("ui.resizable", $.ui.mouse, {
});
$.extend($.ui.resizable, {
version: "@VERSION"
});
/*
* Resizable Extensions
*/

View File

@ -15,6 +15,7 @@
(function( $, undefined ) {
$.widget("ui.selectable", $.ui.mouse, {
version: "@VERSION",
options: {
appendTo: 'body',
autoRefresh: true,
@ -259,8 +260,4 @@ $.widget("ui.selectable", $.ui.mouse, {
});
$.extend($.ui.selectable, {
version: "@VERSION"
});
})(jQuery);

View File

@ -19,7 +19,7 @@
var numPages = 5;
$.widget( "ui.slider", $.ui.mouse, {
version: "@VERSION",
widgetEventPrefix: "slide",
options: {
@ -659,8 +659,4 @@ $.widget( "ui.slider", $.ui.mouse, {
});
$.extend( $.ui.slider, {
version: "@VERSION"
});
}(jQuery));

View File

@ -15,6 +15,7 @@
(function( $, undefined ) {
$.widget("ui.sortable", $.ui.mouse, {
version: "@VERSION",
widgetEventPrefix: "sort",
options: {
appendTo: "parent",
@ -1069,8 +1070,4 @@ $.widget("ui.sortable", $.ui.mouse, {
});
$.extend($.ui.sortable, {
version: "@VERSION"
});
})(jQuery);

View File

@ -14,6 +14,7 @@
(function( $ ) {
$.widget( "ui.spinner", {
version: "@VERSION",
defaultElement: "<input>",
widgetEventPrefix: "spin",
options: {
@ -368,6 +369,4 @@ $.widget( "ui.spinner", {
}
});
$.ui.spinner.version = "@VERSION";
}( jQuery ) );

View File

@ -19,6 +19,7 @@ function getNextTabId() {
}
$.widget( "ui.tabs", {
version: "@VERSION",
options: {
active: null,
collapsible: false,
@ -577,10 +578,6 @@ $.widget( "ui.tabs", {
}
});
$.extend( $.ui.tabs, {
version: "@VERSION"
});
// DEPRECATED
if ( $.uiBackCompat !== false ) {

View File

@ -17,6 +17,7 @@
var increments = 0;
$.widget( "ui.tooltip", {
version: "@VERSION",
options: {
tooltipClass: null,
items: "[title]",
@ -155,6 +156,4 @@ $.widget( "ui.tooltip", {
}
});
$.ui.tooltip.version = "@VERSION";
}( jQuery ) );

View File

@ -49,7 +49,7 @@ $.widget = function( name, base, prototype ) {
if ( arguments.length ) {
this._createWidget( options, element );
}
}, $[ namespace ][ name ] );
}, $[ namespace ][ name ], { version: prototype.version } );
var basePrototype = new base();
// we need to make the options hash a property directly on the new instance