Skip to content

Commit fdfa535

Browse files
committed
Grid: Finish merge from master: Upgrade to jQuery 1.7.2, fix most lint errors
1 parent 6c2e4b3 commit fdfa535

27 files changed

+79
-80
lines changed

grid-editing/csv-editor.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Grid: Editing, Inline Grid</title>
66
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css">
77
<link rel="stylesheet" href="../demos/demos.css">
8-
<script src="../jquery-1.7.1.js"></script>
8+
<script src="../jquery-1.7.2.js"></script>
99
<script src="../external/globalize.js"></script>
1010
<script src="../external/jquery.tmpl.js"></script>
1111
<script src="../external/jquery.mousewheel-3.0.4.js"></script>

grid-editing/editor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $.widget( "ui.editor", {
2020
},
2121
_create: function() {
2222
this.inner = this.element.wrapInner( "<div class='editor-wrapper'></div>" ).children();
23-
this._bind({
23+
this._on({
2424
dblclick: function( event ) {
2525
if ( this.input.is(":visible") ) {
2626
return;
@@ -38,7 +38,7 @@ $.widget( "ui.editor", {
3838
}
3939
this.inputWrapper.hide().appendTo( this.element );
4040

41-
this._bind( this.inputWrapper, {
41+
this._on( this.inputWrapper, {
4242
focusin: function() {
4343
clearTimeout( this.timer );
4444
},

grid-editing/grid-editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $.widget( "ui.gridEditor", {
2121
_create: function() {
2222
var grid = this.element.data("grid");
2323

24-
this._bind({
24+
this._on({
2525
dblclick: function( event ) {
2626
var that = this;
2727
var target = $( event.target ).closest( this.options.items );

grid-editing/grid-selectable.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Grid: Selectable Editing</title>
66
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css">
77
<link rel="stylesheet" href="../demos/demos.css">
8-
<script src="../jquery-1.7.1.js"></script>
8+
<script src="../jquery-1.7.2.js"></script>
99
<script src="../external/globalize.js"></script>
1010
<script src="../external/jquery.tmpl.js"></script>
1111
<script src="../external/jquery.mousewheel-3.0.4.js"></script>

grid-editing/grid.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
<title>Grid: Editing, Inline Grid</title>
66
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css">
77
<link rel="stylesheet" href="../demos/demos.css">
8-
<script src="../jquery-1.7.1.js"></script>
8+
<script src="../jquery-1.7.2.js"></script>
99
<script src="../external/globalize.js"></script>
1010
<script src="../external/globalize.culture.de-DE.js"></script>
1111
<script src="../external/jquery.tmpl.js"></script>
12-
<script src="../external/jquery.mousewheel-3.0.4.js"></script>
12+
<script src="../external/jquery.mousewheel.js"></script>
1313
<script src="../ui/jquery.ui.core.js"></script>
1414
<script src="../ui/jquery.ui.widget.js"></script>
1515
<script src="../ui/jquery.ui.button.js"></script>

grid-editing/master-detail.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>Grid: Editing, Master/Detail</title>
77
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css">
88
<link rel="stylesheet" href="../demos/demos.css">
9-
<script src="../jquery-1.7.1.js"></script>
9+
<script src="../jquery-1.7.2.js"></script>
1010
<script src="../external/jquery.tmpl.js"></script>
1111
<script src="../external/jquery.mousewheel-3.0.4.js"></script>
1212
<script src="../ui/jquery.ui.core.js"></script>

grid-editing/navigator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ $.widget( "ui.navigator", {
1010
_create: function() {
1111
this.active = $();
1212
this.element.attr( "tabIndex", 0 );
13-
this._bind({
13+
this._on({
1414
focusin: "activate",
1515
focusout: "deactivate",
1616
keydown: "move",

grid-editing/todo-app.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>Grid: Editing, Todo app</title>
77
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css">
88
<link rel="stylesheet" href="../demos/demos.css">
9-
<script src="../jquery-1.7.1.js"></script>
9+
<script src="../jquery-1.7.2.js"></script>
1010
<script src="../external/jquery.tmpl.js"></script>
1111
<script src="../ui/jquery.ui.core.js"></script>
1212
<script src="../ui/jquery.ui.widget.js"></script>

grid-spf/autocomplete.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Grid: Autocomplete</title>
66
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css">
77
<link rel="stylesheet" href="../demos/demos.css">
8-
<script src="../jquery-1.7.1.js"></script>
8+
<script src="../jquery-1.7.2.js"></script>
99
<script src="../external/jquery.tmpl.js"></script>
1010
<script src="../ui/jquery.ui.core.js"></script>
1111
<script src="../ui/jquery.ui.widget.js"></script>

grid-spf/dataview-preloader-tests.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8">
55
<title>jQuery UI Preloader Dataview Tests</title>
6-
<script src="../jquery-1.7.1.js"></script>
6+
<script src="../jquery-1.7.2.js"></script>
77
<script src="../ui/jquery.ui.core.js"></script>
88
<script src="../ui/jquery.ui.widget.js"></script>
99
<script src="../ui/jquery.ui.observable.js"></script>

grid-spf/developers-grid.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Grid: Sorting, Paging, Filtering</title>
66
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css">
77
<link rel="stylesheet" href="../demos/demos.css">
8-
<script src="../jquery-1.7.1.js"></script>
8+
<script src="../jquery-1.7.2.js"></script>
99
<script src="../external/jquery.tmpl.js"></script>
1010
<script src="../ui/jquery.ui.core.js"></script>
1111
<script src="../ui/jquery.ui.widget.js"></script>

grid-spf/ebay.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Product Browsing</title>
66
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css">
77
<link rel="stylesheet" href="../demos/demos.css">
8-
<script src="../jquery-1.7.1.js"></script>
8+
<script src="../jquery-1.7.2.js"></script>
99
<script src="../external/jquery.tmpl.js"></script>
1010
<script src="../ui/jquery.ui.core.js"></script>
1111
<script src="../ui/jquery.ui.widget.js"></script>

grid-spf/grid-plain.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Grid: Featureless</title>
66
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css">
77
<link rel="stylesheet" href="../demos/demos.css">
8-
<script src="../jquery-1.7.1.js"></script>
8+
<script src="../jquery-1.7.2.js"></script>
99
<script src="../external/jquery.tmpl.js"></script>
1010
<script src="../ui/jquery.ui.core.js"></script>
1111
<script src="../ui/jquery.ui.widget.js"></script>

grid-spf/grid.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Grid: Sorting, Paging, Filtering</title>
66
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css">
77
<link rel="stylesheet" href="../demos/demos.css">
8-
<script src="../jquery-1.7.1.js"></script>
8+
<script src="../jquery-1.7.2.js"></script>
99
<script src="../external/jquery.tmpl.js"></script>
1010
<script src="../ui/jquery.ui.core.js"></script>
1111
<script src="../ui/jquery.ui.widget.js"></script>

grid-spf/movies-preloader.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Grid: Sorting, Paging, Filtering</title>
66
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css">
77
<link rel="stylesheet" href="../demos/demos.css">
8-
<script src="../jquery-1.7.1.js"></script>
8+
<script src="../jquery-1.7.2.js"></script>
99
<script src="../external/jquery.tmpl.js"></script>
1010
<script src="../ui/jquery.ui.core.js"></script>
1111
<script src="../ui/jquery.ui.widget.js"></script>

grid-spf/movies.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Grid: Sorting, Paging, Filtering</title>
66
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css">
77
<link rel="stylesheet" href="../demos/demos.css">
8-
<script src="../jquery-1.7.1.js"></script>
8+
<script src="../jquery-1.7.2.js"></script>
99
<script src="../external/jquery.tmpl.js"></script>
1010
<script src="../ui/jquery.ui.core.js"></script>
1111
<script src="../ui/jquery.ui.widget.js"></script>

grid-spf/pager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $.widget( "spf.pager", {
1515
_create: function() {
1616
var that = this;
1717

18-
this._bind( this.options.source, {
18+
this._on( this.options.source, {
1919
dataviewresponse: "refresh"
2020
});
2121

grid-spf/products-grid.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Grid: Sorting, Paging, Filtering</title>
66
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css">
77
<link rel="stylesheet" href="../demos/demos.css">
8-
<script src="../jquery-1.7.1.js"></script>
8+
<script src="../jquery-1.7.2.js"></script>
99
<script src="../external/jquery.tmpl.js"></script>
1010
<script src="../ui/jquery.ui.core.js"></script>
1111
<script src="../ui/jquery.ui.widget.js"></script>

grid-spf/products-scrolling.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Grid: Sorting, Paging, Filtering</title>
66
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css">
77
<link rel="stylesheet" href="../demos/demos.css">
8-
<script src="../jquery-1.7.1.js"></script>
8+
<script src="../jquery-1.7.2.js"></script>
99
<script src="../external/jquery.tmpl.js"></script>
1010
<script src="../ui/jquery.ui.core.js"></script>
1111
<script src="../ui/jquery.ui.widget.js"></script>

grid-spf/slideshow-local.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Photo Slideshow</title>
66
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css">
77
<link rel="stylesheet" href="../demos/demos.css">
8-
<script src="../jquery-1.7.1.js"></script>
8+
<script src="../jquery-1.7.2.js"></script>
99
<script src="../external/jquery.tmpl.js"></script>
1010
<script src="../ui/jquery.ui.core.js"></script>
1111
<script src="../ui/jquery.ui.widget.js"></script>

grid-spf/slideshow-preloader.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Photo Slideshow</title>
66
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css">
77
<link rel="stylesheet" href="../demos/demos.css">
8-
<script src="../jquery-1.7.1.js"></script>
8+
<script src="../jquery-1.7.2.js"></script>
99
<script src="../external/jquery.tmpl.js"></script>
1010
<script src="../ui/jquery.ui.core.js"></script>
1111
<script src="../ui/jquery.ui.widget.js"></script>

grid-spf/slideshow-remote.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Photo Slideshow</title>
66
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css">
77
<link rel="stylesheet" href="../demos/demos.css">
8-
<script src="../jquery-1.7.1.js"></script>
8+
<script src="../jquery-1.7.2.js"></script>
99
<script src="../external/jquery.tmpl.js"></script>
1010
<script src="../ui/jquery.ui.core.js"></script>
1111
<script src="../ui/jquery.ui.widget.js"></script>

grid-spf/tablesorter.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Grid: Sorting, Paging, Filtering</title>
66
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css">
77
<link rel="stylesheet" href="../demos/demos.css">
8-
<script src="../jquery-1.7.1.js"></script>
8+
<script src="../jquery-1.7.2.js"></script>
99
<script src="../external/jquery.tmpl.js"></script>
1010
<script src="../external/globalize.js"></script>
1111
<script src="../external/globalize.culture.de-DE.js"></script>

ui/jquery.ui.dataview.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ $.widget( "ui.dataview", {
6666
this._trigger( "request" );
6767

6868
var request = $.extend( {}, this.options, {
69-
page: this.page()
70-
});
69+
page: this.page()
70+
}),
71+
that = this;
7172

72-
var that = this;
7373
this.options.source( request, function( data, totalCount ) {
7474
that.totalCount = parseInt(totalCount, 10);
7575
$.observable( that.result ).replaceAll( data );

ui/jquery.ui.dataviewlocal.js

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ $.widget( "ui.dataviewlocal", $.ui.dataview, {
1414
input: null
1515
},
1616
_create: function() {
17-
var that = this;
17+
var properties,
18+
that = this;
1819
this.options.source = function( request, response) {
1920
var sortedItems = that._sort( that._filter( that.options.input ) );
2021
response( that._page( sortedItems ), sortedItems.length );
@@ -26,7 +27,7 @@ $.widget( "ui.dataviewlocal", $.ui.dataview, {
2627
}
2728
this.properties = {};
2829
if ( this.options.properties ) {
29-
var properties = this.properties;
30+
properties = this.properties;
3031
$.each( this.options.properties, function( index, definition ) {
3132
properties[ definition.property ] = definition;
3233
});
@@ -39,12 +40,12 @@ $.widget( "ui.dataviewlocal", $.ui.dataview, {
3940
var property,
4041
filter,
4142
match = true;
42-
for ( property in that.options.filter ) {
43+
for ( property in that.options.filter ) {
4344
filter = that.options.filter[ property ];
4445
match &= that._match( item[ property ], filter, property );
4546
}
4647
return match;
47-
});
48+
});
4849
}
4950
return items;
5051
},
@@ -53,15 +54,15 @@ $.widget( "ui.dataviewlocal", $.ui.dataview, {
5354
operator = filter.operator || (typeof operand === "string" ? "like" : "==");
5455
value = this._extract( value, property );
5556
switch (operator) {
56-
case "==": return value == operand;
57-
case "!=": return value != operand;
58-
case "<": return value < operand;
59-
case "<=": return value <= operand;
60-
case ">": return value > operand;
61-
case ">=": return value >= operand;
62-
case "like": return new RegExp( operand.replace( /[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&" ), "i" ).test( value );
63-
default: throw "Unrecognized filter operator: " + operator + " for operand " + operand;
64-
}
57+
case "==": return value == operand;
58+
case "!=": return value != operand;
59+
case "<": return value < operand;
60+
case "<=": return value <= operand;
61+
case ">": return value > operand;
62+
case ">=": return value >= operand;
63+
case "like": return new RegExp( operand.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ), "i" ).test( value );
64+
default: throw "Unrecognized filter operator: " + operator + " for operand " + operand;
65+
}
6566
},
6667
_extract: function( text, propertyName ) {
6768
var property = this.properties[ propertyName ];
@@ -77,34 +78,36 @@ $.widget( "ui.dataviewlocal", $.ui.dataview, {
7778
}
7879
},
7980
_sort: function( items ) {
80-
var that = this;
81+
var sorts, first,
82+
that = this;
8183
function sorter( property, secondary ) {
8284
var order = 1;
8385
if (property.charAt( 0 ) === "-") {
8486
order = -1;
8587
property = property.slice( 1 );
8688
}
8789
return function ( item1, item2 ) {
88-
var value1 = item1[ property ],
89-
value2 = item2[ property ];
90-
if ( value1 === value2 ) {
90+
var next,
91+
value1 = item1[ property ],
92+
value2 = item2[ property ];
93+
if ( value1 === value2 ) {
9194
if ( secondary.length ) {
92-
var next = secondary[ 0 ];
95+
next = secondary[ 0 ];
9396
return sorter( next, secondary.slice( 1 ) )( item1, item2 );
9497
}
9598
return 0;
9699
}
97100
return order * ( that._extract( value1, property ) > that._extract( value2, property ) ? 1 : -1 );
98-
};
101+
};
99102
}
100103
if ( this.options.sort.length ) {
101104
// if unfiltered, make a copy to not sort the input
102105
if ( items === this.options.input ) {
103106
items = items.slice( 0 );
104107
}
105-
var sorts = this.options.sort;
106-
var first = sorts[ 0 ];
107-
return items.sort( sorter( first, sorts.slice( 1 ) ) );
108+
sorts = this.options.sort;
109+
first = sorts[ 0 ];
110+
return items.sort( sorter( first, sorts.slice( 1 ) ) );
108111
}
109112
return items;
110113
},

0 commit comments

Comments
 (0)