Skip to content

Commit 6a5b21f

Browse files
committed
All: Moved version numbers into prototypes. Fixed #7436 - Widget: Store version numbers on instances.
1 parent 2f32848 commit 6a5b21f

19 files changed

+19
-46
lines changed

ui/jquery.ui.accordion.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
// TODO: use ui-accordion-header-active class and fix styling
1717
$.widget( "ui.accordion", {
18+
version: "@VERSION",
1819
options: {
1920
active: 0,
2021
animated: "slide",
@@ -432,7 +433,6 @@ $.widget( "ui.accordion", {
432433
});
433434

434435
$.extend( $.ui.accordion, {
435-
version: "@VERSION",
436436
animations: {
437437
slide: function( options, additions ) {
438438
var showOverflow = options.toShow.css( "overflow" ),

ui/jquery.ui.autocomplete.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
var requestIndex = 0;
2020

2121
$.widget( "ui.autocomplete", {
22+
version: "@VERSION",
2223
defaultElement: "<input>",
2324
options: {
2425
appendTo: "body",
@@ -475,7 +476,6 @@ $.widget( "ui.autocomplete", {
475476
});
476477

477478
$.extend( $.ui.autocomplete, {
478-
version: "@VERSION",
479479
escapeRegex: function( value ) {
480480
return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
481481
},

ui/jquery.ui.button.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ var lastActive, startXPos, startYPos, clickDragged,
4141
};
4242

4343
$.widget( "ui.button", {
44+
version: "@VERSION",
4445
defaultElement: "<button>",
4546
options: {
4647
disabled: null,
@@ -412,6 +413,4 @@ $.widget( "ui.buttonset", {
412413
}
413414
});
414415

415-
$.ui.buttonset.version = "@VERSION";
416-
417416
}( jQuery ) );

ui/jquery.ui.dialog.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ var uiDialogClasses = "ui-dialog ui-widget ui-widget-content ui-corner-all ",
3636
};
3737

3838
$.widget("ui.dialog", {
39+
version: "@VERSION",
3940
options: {
4041
autoOpen: true,
4142
buttons: {},
@@ -655,8 +656,6 @@ $.widget("ui.dialog", {
655656
});
656657

657658
$.extend($.ui.dialog, {
658-
version: "@VERSION",
659-
660659
uuid: 0,
661660
maxZ: 0,
662661

ui/jquery.ui.draggable.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
(function( $, undefined ) {
1616

1717
$.widget("ui.draggable", $.ui.mouse, {
18+
version: "@VERSION",
1819
widgetEventPrefix: "drag",
1920
options: {
2021
addClasses: true,
@@ -502,10 +503,6 @@ $.widget("ui.draggable", $.ui.mouse, {
502503

503504
});
504505

505-
$.extend($.ui.draggable, {
506-
version: "@VERSION"
507-
});
508-
509506
$.ui.plugin.add("draggable", "connectToSortable", {
510507
start: function(event, ui) {
511508

ui/jquery.ui.droppable.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
(function( $, undefined ) {
1717

1818
$.widget("ui.droppable", {
19+
version: "@VERSION",
1920
widgetEventPrefix: "drop",
2021
options: {
2122
accept: '*',
@@ -146,10 +147,6 @@ $.widget("ui.droppable", {
146147

147148
});
148149

149-
$.extend($.ui.droppable, {
150-
version: "@VERSION"
151-
});
152-
153150
$.ui.intersect = function(draggable, droppable, toleranceMode) {
154151

155152
if (!droppable.offset) return false;

ui/jquery.ui.menu.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
var idIncrement = 0;
1717

1818
$.widget("ui.menu", {
19+
version: "@VERSION",
1920
defaultElement: "<ul>",
2021
delay: 150,
2122
options: {
@@ -420,6 +421,4 @@ $.widget("ui.menu", {
420421
}
421422
});
422423

423-
$.ui.menu.version = "@VERSION";
424-
425424
}( jQuery ));

ui/jquery.ui.menubar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// TODO when mixing clicking menus and keyboard navigation, focus handling is broken
1919
// there has to be just one item that has tabindex
2020
$.widget( "ui.menubar", {
21+
version: "@VERSION",
2122
options: {
2223
buttons: false,
2324
menuIcon: false

ui/jquery.ui.mouse.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ $(document).mousedown(function(e) {
1818
});
1919

2020
$.widget("ui.mouse", {
21+
version: "@VERSION",
2122
options: {
2223
cancel: ':input,option',
2324
distance: 1,

ui/jquery.ui.popup.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
var idIncrement = 0;
1818

1919
$.widget( "ui.popup", {
20+
version: "@VERSION",
2021
options: {
2122
position: {
2223
my: "left top",

ui/jquery.ui.progressbar.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
(function( $, undefined ) {
1515

1616
$.widget( "ui.progressbar", {
17+
version: "@VERSION",
1718
options: {
1819
value: 0,
1920
max: 100
@@ -100,8 +101,4 @@ $.widget( "ui.progressbar", {
100101
}
101102
});
102103

103-
$.extend( $.ui.progressbar, {
104-
version: "@VERSION"
105-
});
106-
107104
})( jQuery );

ui/jquery.ui.resizable.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
(function( $, undefined ) {
1616

1717
$.widget("ui.resizable", $.ui.mouse, {
18+
version: "@VERSION",
1819
widgetEventPrefix: "resize",
1920
options: {
2021
alsoResize: false,
@@ -548,10 +549,6 @@ $.widget("ui.resizable", $.ui.mouse, {
548549

549550
});
550551

551-
$.extend($.ui.resizable, {
552-
version: "@VERSION"
553-
});
554-
555552
/*
556553
* Resizable Extensions
557554
*/

ui/jquery.ui.selectable.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
(function( $, undefined ) {
1616

1717
$.widget("ui.selectable", $.ui.mouse, {
18+
version: "@VERSION",
1819
options: {
1920
appendTo: 'body',
2021
autoRefresh: true,
@@ -259,8 +260,4 @@ $.widget("ui.selectable", $.ui.mouse, {
259260

260261
});
261262

262-
$.extend($.ui.selectable, {
263-
version: "@VERSION"
264-
});
265-
266263
})(jQuery);

ui/jquery.ui.slider.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
var numPages = 5;
2020

2121
$.widget( "ui.slider", $.ui.mouse, {
22-
22+
version: "@VERSION",
2323
widgetEventPrefix: "slide",
2424

2525
options: {
@@ -659,8 +659,4 @@ $.widget( "ui.slider", $.ui.mouse, {
659659

660660
});
661661

662-
$.extend( $.ui.slider, {
663-
version: "@VERSION"
664-
});
665-
666662
}(jQuery));

ui/jquery.ui.sortable.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
(function( $, undefined ) {
1616

1717
$.widget("ui.sortable", $.ui.mouse, {
18+
version: "@VERSION",
1819
widgetEventPrefix: "sort",
1920
options: {
2021
appendTo: "parent",
@@ -1069,8 +1070,4 @@ $.widget("ui.sortable", $.ui.mouse, {
10691070

10701071
});
10711072

1072-
$.extend($.ui.sortable, {
1073-
version: "@VERSION"
1074-
});
1075-
10761073
})(jQuery);

ui/jquery.ui.spinner.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
(function( $ ) {
1515

1616
$.widget( "ui.spinner", {
17+
version: "@VERSION",
1718
defaultElement: "<input>",
1819
widgetEventPrefix: "spin",
1920
options: {
@@ -368,6 +369,4 @@ $.widget( "ui.spinner", {
368369
}
369370
});
370371

371-
$.ui.spinner.version = "@VERSION";
372-
373372
}( jQuery ) );

ui/jquery.ui.tabs.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ function getNextTabId() {
1919
}
2020

2121
$.widget( "ui.tabs", {
22+
version: "@VERSION",
2223
options: {
2324
active: null,
2425
collapsible: false,
@@ -577,10 +578,6 @@ $.widget( "ui.tabs", {
577578
}
578579
});
579580

580-
$.extend( $.ui.tabs, {
581-
version: "@VERSION"
582-
});
583-
584581
// DEPRECATED
585582
if ( $.uiBackCompat !== false ) {
586583

ui/jquery.ui.tooltip.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
var increments = 0;
1818

1919
$.widget( "ui.tooltip", {
20+
version: "@VERSION",
2021
options: {
2122
tooltipClass: null,
2223
items: "[title]",
@@ -155,6 +156,4 @@ $.widget( "ui.tooltip", {
155156
}
156157
});
157158

158-
$.ui.tooltip.version = "@VERSION";
159-
160159
}( jQuery ) );

ui/jquery.ui.widget.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ $.widget = function( name, base, prototype ) {
4949
if ( arguments.length ) {
5050
this._createWidget( options, element );
5151
}
52-
}, $[ namespace ][ name ] );
52+
}, $[ namespace ][ name ], { version: prototype.version } );
5353

5454
var basePrototype = new base();
5555
// we need to make the options hash a property directly on the new instance

0 commit comments

Comments
 (0)