Skip to content

Commit e36a9cb

Browse files
committed
Core: Style fixes powered by esformatter
Closes jquery-archivegh-8095
1 parent 215d53f commit e36a9cb

File tree

17 files changed

+2343
-2328
lines changed

17 files changed

+2343
-2328
lines changed

js/core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
// Browser globals
2323
factory( jQuery );
2424
}
25-
})( function(){} );
25+
} )( function() {} );

tests/integration/collapsible/collapsible_core.js

Lines changed: 370 additions & 370 deletions
Large diffs are not rendered by default.

tests/integration/core/core_scroll.js

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,60 @@
22
* mobile core unit tests
33
*/
44

5-
(function($){
6-
var libName = "core",
7-
scrollTimeout = 70, // TODO expose timing as an attribute
8-
scrollStartEnabledTimeout = 150;
9-
10-
module(libName, {
11-
setup: function() {
12-
$( "<div id='scroll-testing' " +
13-
"style='height: " + ( screen.height * 3 ) + "px'></div>").appendTo( "body" );
14-
},
15-
16-
teardown: function(){
17-
$("#scroll-testing").remove();
18-
}
19-
});
20-
21-
var scrollUp = function( pos ){
22-
$( window ).scrollTop( screen.height );
23-
deepEqual( $( window ).scrollTop() > 0, true,
24-
"After setting scrollTop, it is " + $( window ).scrollTop() );
25-
$.mobile.silentScroll(pos);
26-
};
27-
28-
asyncTest( "silent scroll scrolls the page to the top by default", function(){
29-
scrollUp();
30-
31-
setTimeout(function(){
32-
deepEqual( $(window).scrollTop(), $.mobile.defaultHomeScroll,
33-
"After parameterless silentScroll(), scrollTop is $.mobile.defaultHomescroll: " +
34-
$.mobile.defaultHomeScroll );
35-
start();
36-
}, scrollTimeout);
37-
});
38-
39-
asyncTest( "silent scroll scrolls the page to the passed y position", function(){
40-
var pos = 10;
41-
scrollUp(pos);
42-
43-
setTimeout(function(){
44-
deepEqual($(window).scrollTop(), pos);
45-
start();
46-
}, scrollTimeout);
47-
});
48-
49-
asyncTest( "scrolling marks scrollstart as disabled for 150 ms", function(){
50-
$.event.special.scrollstart.enabled = true;
51-
scrollUp();
52-
ok(!$.event.special.scrollstart.enabled);
53-
54-
setTimeout(function(){
55-
ok($.event.special.scrollstart.enabled);
56-
start();
57-
}, scrollStartEnabledTimeout);
58-
});
59-
60-
//TODO test that silentScroll is called on window load
61-
})(jQuery);
5+
( function( $ ) {
6+
var libName = "core",
7+
scrollTimeout = 70, // TODO expose timing as an attribute
8+
scrollStartEnabledTimeout = 150;
9+
10+
module( libName, {
11+
setup: function() {
12+
$( "<div id='scroll-testing' " +
13+
"style='height: " + ( screen.height * 3 ) + "px'></div>" ).appendTo( "body" );
14+
},
15+
16+
teardown: function() {
17+
$( "#scroll-testing" ).remove();
18+
}
19+
} );
20+
21+
var scrollUp = function( pos ) {
22+
$( window ).scrollTop( screen.height );
23+
deepEqual( $( window ).scrollTop() > 0, true,
24+
"After setting scrollTop, it is " + $( window ).scrollTop() );
25+
$.mobile.silentScroll( pos );
26+
};
27+
28+
asyncTest( "silent scroll scrolls the page to the top by default", function() {
29+
scrollUp();
30+
31+
setTimeout( function() {
32+
deepEqual( $( window ).scrollTop(), $.mobile.defaultHomeScroll,
33+
"After parameterless silentScroll(), scrollTop is $.mobile.defaultHomescroll: " +
34+
$.mobile.defaultHomeScroll );
35+
start();
36+
}, scrollTimeout );
37+
} );
38+
39+
asyncTest( "silent scroll scrolls the page to the passed y position", function() {
40+
var pos = 10;
41+
scrollUp( pos );
42+
43+
setTimeout( function() {
44+
deepEqual( $( window ).scrollTop(), pos );
45+
start();
46+
}, scrollTimeout );
47+
} );
48+
49+
asyncTest( "scrolling marks scrollstart as disabled for 150 ms", function() {
50+
$.event.special.scrollstart.enabled = true;
51+
scrollUp();
52+
ok( !$.event.special.scrollstart.enabled );
53+
54+
setTimeout( function() {
55+
ok( $.event.special.scrollstart.enabled );
56+
start();
57+
}, scrollStartEnabledTimeout );
58+
} );
59+
60+
//TODO test that silentScroll is called on window load
61+
} )( jQuery );

tests/integration/forms/forms_core.js

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* mobile popup unit tests
33
*/
4-
(function($){
4+
( function( $ ) {
55

66
asyncTest( "Form resets correctly", function() {
77

@@ -20,7 +20,7 @@ asyncTest( "Form resets correctly", function() {
2020
};
2121

2222
for ( arIdx in arrays ) {
23-
for (idx in widgets[ arrays[ arIdx ] ] ) {
23+
for ( idx in widgets[ arrays[ arIdx ] ] ) {
2424
ret[ arrays[ arIdx ] ].push( widgets[ arrays[ arIdx ] ][ idx ].is( ":checked" ) );
2525
}
2626
}
@@ -32,7 +32,8 @@ asyncTest( "Form resets correctly", function() {
3232
var id = el.attr( "id" ),
3333
slider = el.next(),
3434
buttonStyle = slider.children().attr( "style" ).split( ";" ),
35-
styleItem, style = {};
35+
styleItem,
36+
style = {};
3637

3738
// Reconstruct the inline style of the object. The result will be stored in the variable "style"
3839
for ( idx in buttonStyle ) {
@@ -60,7 +61,7 @@ asyncTest( "Form resets correctly", function() {
6061
ok( wrapper.length === 1, prefix + id + " has a wrapper" );
6162
ok( wrapper.hasClass( "ui-select" ), prefix + id + "'s wrapper has class ui-select" );
6263
ok( anonySpan.length === 1, prefix + id + "'s wrapper contains a single span element as its first child" );
63-
ok( anonySpan.text() === el.children("[value='" + el.val() + "']").text(), prefix + id + "'s text is identical to the text inside the selected <option> element" );
64+
ok( anonySpan.text() === el.children( "[value='" + el.val() + "']" ).text(), prefix + id + "'s text is identical to the text inside the selected <option> element" );
6465
}
6566

6667
function verifyFlipswitch( prefix, el, value ) {
@@ -155,9 +156,11 @@ asyncTest( "Form resets correctly", function() {
155156
setTimeout( function() {
156157
runTest( e.target, function() {
157158
testComplete = true;
158-
setTimeout( function() { $( "#goToStartPage" ).click(); } );
159-
});
160-
});
159+
setTimeout( function() {
160+
$( "#goToStartPage" ).click();
161+
} );
162+
} );
163+
} );
161164
} else if ( e.target.id === "startPage" ) {
162165
if ( wentToTestPage ) {
163166
if ( testComplete ) {
@@ -168,18 +171,18 @@ asyncTest( "Form resets correctly", function() {
168171
setTimeout( maybeGoToTestPage );
169172
}
170173
}
171-
}
174+
}
172175

173176
$( document ).bind( "pageshow", handlePageShow );
174177

175178
setTimeout( maybeGoToTestPage );
176-
});
179+
} );
177180

178181
asyncTest( "form action is honored", function() {
179182

180183
expect( 1 );
181184

182-
$.testHelper.pageSequence([
185+
$.testHelper.pageSequence( [
183186
function() {
184187
$( "#default-submit" ).click();
185188
},
@@ -190,14 +193,14 @@ asyncTest( "form action is honored", function() {
190193
},
191194

192195
start
193-
]);
194-
});
196+
] );
197+
} );
195198

196199
asyncTest( "button's formaction attribute is honored", function() {
197200

198201
expect( 1 );
199202

200-
$.testHelper.pageSequence([
203+
$.testHelper.pageSequence( [
201204
function() {
202205
$( "#formaction-submit" ).click();
203206
},
@@ -208,7 +211,7 @@ asyncTest( "button's formaction attribute is honored", function() {
208211
},
209212

210213
start
211-
]);
212-
});
214+
] );
215+
} );
213216

214-
})( jQuery );
217+
} )( jQuery );

0 commit comments

Comments
 (0)