Skip to content

Commit 4f5a83c

Browse files
committed
Mask/Timepicker: Lint fixes. Units still fail.
1 parent 4929eed commit 4f5a83c

File tree

6 files changed

+34
-36
lines changed

6 files changed

+34
-36
lines changed

tests/unit/mask/mask_methods.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ test( "value: able to get (and set) raw values", function() {
2828
test( "value: able to get (and set) raw values with optional section", function() {
2929
expect( 5 );
3030
var input = $( "#mask1" ).val("1234").mask({
31-
mask: "(999) 999-9999?x9999",
31+
mask: "(999) 999-9999?x9999"
3232
});
3333

3434
equal( input.mask('value'), "1234", "Reading initial value" );

tests/unit/mask/mask_options.js

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ module( "mask: options" );
55
test( "clearEmpty", function() {
66
expect( 4 );
77
var input = $( "#mask1" ).val( "" ).mask({
8-
mask: "99/99/99",
9-
placeholder: "_",
10-
clearEmpty: true
11-
}),
12-
mask = input.data( "mask" );
8+
mask: "99/99/99",
9+
placeholder: "_",
10+
clearEmpty: true
11+
});
1312

1413
equal( input.val(), "", "Empty value with clearEmpty displays no mask" );
1514
TestHelpers.focus( input );
@@ -48,7 +47,7 @@ test( "mask", function() {
4847
test( "mask with optional input", function() {
4948
expect( 1 );
5049
var input = $( "#mask1" ).val( "1234" ).mask({
51-
mask: "(999) 999-9999?x9999",
50+
mask: "(999) 999-9999?x9999"
5251
});
5352

5453
equal( input.val(), "(123) 4__-____", "Initial value" );
@@ -57,7 +56,7 @@ test( "mask with optional input", function() {
5756
test( "mask with multiple optional inputs", function() {
5857
expect( 1 );
5958
var input = $( "#mask1" ).val( "1234" ).mask({
60-
mask: "(999) 999-9999?x9?9?9?9",
59+
mask: "(999) 999-9999?x9?9?9?9"
6160
});
6261

6362
equal( input.val(), "(123) 4__-____", "Initial value" );
@@ -66,7 +65,7 @@ test( "mask with multiple optional inputs", function() {
6665
test( "mask with escaped characters", function() {
6766
expect( 1 );
6867
var input = $( "#mask1" ).val( "1234" ).mask({
69-
mask: "(\\9\\9\\9)\\\\ 999-99\\a\\*\\?x9999",
68+
mask: "(\\9\\9\\9)\\\\ 999-99\\a\\*\\?x9999"
7069
});
7170

7271
equal( input.val(), "(999)\\ 123-4_a*?x____", "Initial value" );
@@ -75,7 +74,7 @@ test( "mask with escaped characters", function() {
7574
test( "escaped use of custom mask with wrapper ", function() {
7675
expect( 1 );
7776
var input = $( "#mask1" ).val( "1" ).mask({
78-
mask: "9\\<xyz\\>",
77+
mask: "9\\<xyz\\>"
7978
});
8079

8180
equal( input.val(), "1<xyz>", "Initial value" );
@@ -90,23 +89,23 @@ test( "custom mask with wrapper and escape", function() {
9089
if ( $.inArray(value, [ "mon", "tue", "wed", "thu", "fri", "sat", "sun" ]) ) {
9190
return value;
9291
} else if ( $.inArray(value, [ "m", "mo" ])) {
93-
return "mon";
92+
return "mon";
9493
} else if ( value === "t" ) {
95-
return "t";
94+
return "t";
9695
} else if ( value === "tu" ) {
97-
return "tue";
96+
return "tue";
9897
} else if ( value === "thu" ) {
99-
return "thu";
98+
return "thu";
10099
} else if ( $.inArray(value, [ "w", "we" ]) ) {
101-
return "wed";
100+
return "wed";
102101
} else if ( $.inArray(value, [ "f", "fr" ]) ) {
103-
return "fri";
102+
return "fri";
104103
} else if ( value === "s" ) {
105-
return "s";
104+
return "s";
106105
} else if ( value === "sa" ) {
107-
return "sat";
106+
return "sat";
108107
} else if ( value === "su" ) {
109-
return "sun";
108+
return "sun";
110109
}
111110
},
112111
d: /[0-9]/
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
(function( $ ) {
1+
(function() {
22

33
module( "timepicker: core" );
44

5-
}( jQuery ) );
5+
}());

tests/unit/timepicker/timepicker_methods.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ module( "timepicker: methods" );
55
test( "value - get and set value", function() {
66
expect( 3 );
77

8-
var i,
9-
input = $( "#timepicker1" ).val( "12:00:00 AM" ).timepicker();
8+
var input = $( "#timepicker1" ).val( "12:00:00 AM" ).timepicker();
109

1110
equal( input.timepicker( "value" ), "00:00:00", "Expected value for 12am" );
1211

@@ -17,7 +16,7 @@ test( "value - get and set value", function() {
1716

1817
input.timepicker( "value", "12:34:56" );
1918
equal( input.val(), "12:34:56 PM", "Expected val() for 12:34:56" );
20-
19+
2120
});
2221

2322
}( jQuery ) );

ui/jquery.ui.mask.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ $.widget( "ui.mask", {
161161
return value;
162162
},
163163
_events: {
164-
focus: function( event ) {
164+
focus: function() {
165165
this.lastUnsavedValue = this.element.val();
166166
this._paint( true );
167167
this._caretSelect( this._seekRight( this._parseValue() ) );
@@ -171,18 +171,18 @@ $.widget( "ui.mask", {
171171
this._justFocused = false;
172172
}, 100);
173173
},
174-
click: function( event ) {
175-
/* Normally, the call to handle this in the focus event handler would be
176-
sufficient, but Chrome fires the focus events before positioning the
177-
cursor based on where the user clicked (and then fires the click event). */
174+
click: function() {
175+
// Normally, the call to handle this in the focus event handler would be
176+
// sufficient, but Chrome fires the focus events before positioning the
177+
// cursor based on where the user clicked (and then fires the click event).
178178

179179
// We only want to move the caret on clicks that resulted in focus
180180
if ( this._justFocused ) {
181181
this._caretSelect( this._seekRight( this._parseValue() ) );
182182
this._justFocused = false;
183183
}
184184
},
185-
blur: function( event ) {
185+
blur: function() {
186186
this._justFocused = false;
187187

188188
// because we are constantly setting the value of the input, the change event
@@ -311,7 +311,7 @@ $.widget( "ui.mask", {
311311
}
312312
return true;
313313
},
314-
_paste: function(event) {
314+
_paste: function() {
315315
this._delay( function() {
316316
var position = this._parseValue();
317317
this._paint();
@@ -342,7 +342,7 @@ $.widget( "ui.mask", {
342342
return true;
343343
},
344344
_removeCharacter: function( mask, index ) {
345-
var x, bufferObject;
345+
var x, bufferObject;
346346

347347
for ( x = index ; x < mask.length - 1 ; x++ ) {
348348
bufferObject = this.buffer[ x + 1 ];
@@ -361,7 +361,7 @@ $.widget( "ui.mask", {
361361
return mask.substring( 0, index ) + mask.substring( index + 1 );
362362
},
363363
_parseMask: function() {
364-
var key, x, bufferObject, optionalPosition, builder,
364+
var key, x, optionalPosition,
365365
index = -1,
366366
options = this.options,
367367
mask = options.mask,
@@ -375,7 +375,7 @@ $.widget( "ui.mask", {
375375
// search for escaped reserved characters
376376
for ( index = 0 ; index < mask.length - 1 ; index++ ) {
377377
if ( mask.charAt( index ) === "\\" &&
378-
$.inArray( mask.charAt( index + 1 ), reservedChars ) !== -1 ) {
378+
$.inArray( mask.charAt( index + 1 ), reservedChars ) !== -1 ) {
379379
// remove escape character
380380
mask = mask.substring( 0, index ) + mask.substring( index + 1 );
381381

ui/jquery.ui.timepicker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ $.widget( "ui.timepicker", {
193193

194194
return mask;
195195
},
196-
_highlightField: function( field ) {
196+
_highlightField: function() {
197197
this.mask._caretSelect( this.currentField * 3 );
198198
},
199199
_setField: function( field ) {
@@ -267,4 +267,4 @@ $.widget( "ui.timepicker", {
267267
}
268268
});
269269

270-
}( jQuery ));
270+
}( jQuery ));

0 commit comments

Comments
 (0)