r105556 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105555‎ | r105556 | r105557 >
Date:15:24, 8 December 2011
Author:hashar
Status:ok
Tags:
Comment:
clean whitespaces in jquery.tablesorter.test.js
Modified paths:
  • /trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js
@@ -3,10 +3,11 @@
44 module( 'jquery.tablesorter' );
55
66 // setup hack
7 -mw.config.set( 'wgMonthNames', ['', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']);
8 -mw.config.set( 'wgMonthNamesShort', ['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']);
 7+mw.config.set( 'wgMonthNames', [ '', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ] );
 8+mw.config.set( 'wgMonthNamesShort', ['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] );
99 mw.config.set( 'wgDefaultDateFormat', 'dmy' );
1010
 11+
1112 test( '-- Initial check', function() {
1213 expect(1);
1314 ok( $.tablesorter, '$.tablesorter defined' );
@@ -23,8 +24,9 @@
2425 var tableCreate = function( header, data ) {
2526 var $table = $( '<table class="sortable"><thead></thead><tbody></tbody></table>' ),
2627 $thead = $table.find( 'thead' ),
27 - $tbody = $table.find( 'tbody' );
28 - var $tr = $( '<tr>' );
 28+ $tbody = $table.find( 'tbody' ),
 29+ $tr = $( '<tr>' );
 30+
2931 $.each( header, function( i, str ) {
3032 var $th = $( '<th>' );
3133 $th.text( str ).appendTo( $tr );
@@ -50,6 +52,7 @@
5153 */
5254 var tableExtract = function( $table ) {
5355 var data = [];
 56+
5457 $table.find( 'tbody' ).find( 'tr' ).each( function( i, tr ) {
5558 var row = [];
5659 $( tr ).find( 'td,th' ).each( function( i, td ) {
@@ -93,18 +96,18 @@
9497 return arr2;
9598 };
9699
97 -// Sample data set: some planets!
98 -var header = ['Planet', 'Radius (km)'],
99 - mercury = ['Mercury', '2439.7'],
100 - venus = ['Venus', '6051.8'],
101 - earth = ['Earth', '6371.0'],
102 - mars = ['Mars', '3390.0'],
103 - jupiter = ['Jupiter', '69911'],
104 - saturn = ['Saturn', '58232'];
 100+// Sample data set using planets named and their radius
 101+var header = [ 'Planet' , 'Radius (km)'],
 102+ mercury = [ 'Mercury', '2439.7' ],
 103+ venus = [ 'Venus' , '6051.8' ],
 104+ earth = [ 'Earth' , '6371.0' ],
 105+ mars = [ 'Mars' , '3390.0' ],
 106+ jupiter = [ 'Jupiter', '69911' ],
 107+ saturn = [ 'Saturn' , '58232' ];
105108
106109 // Initial data set
107 -var planets = [mercury, venus, earth, mars, jupiter, saturn];
108 -var ascendingName = [earth, jupiter, mars, mercury, saturn, venus];
 110+var planets = [mercury, venus, earth, mars, jupiter, saturn];
 111+var ascendingName = [earth, jupiter, mars, mercury, saturn, venus];
109112 var ascendingRadius = [mercury, mars, venus, earth, saturn, jupiter];
110113
111114 tableTest(
@@ -161,18 +164,16 @@
162165
163166 // Regression tests!
164167 tableTest(
165 - 'Bug 28775: German-style short numeric dates',
 168+ 'Bug 28775: German-style (dmy) short numeric dates',
166169 ['Date'],
167 - [
168 - // German-style dates are day-month-year
 170+ [ // German-style dates are day-month-year
169171 ['11.11.2011'],
170172 ['01.11.2011'],
171173 ['02.10.2011'],
172174 ['03.08.2011'],
173175 ['09.11.2011']
174176 ],
175 - [
176 - // Sorted by ascending date
 177+ [ // Sorted by ascending date
177178 ['03.08.2011'],
178179 ['02.10.2011'],
179180 ['01.11.2011'],
@@ -186,19 +187,18 @@
187188 $table.find( '.headerSort:eq(0)' ).click();
188189 }
189190 );
 191+
190192 tableTest(
191 - 'Bug 28775: American-style short numeric dates',
 193+ 'Bug 28775: American-style (mdy) short numeric dates',
192194 ['Date'],
193 - [
194 - // American-style dates are month-day-year
 195+ [ // American-style dates are month-day-year
195196 ['11.11.2011'],
196197 ['01.11.2011'],
197198 ['02.10.2011'],
198199 ['03.08.2011'],
199200 ['09.11.2011']
200201 ],
201 - [
202 - // Sorted by ascending date
 202+ [ // Sorted by ascending date
203203 ['01.11.2011'],
204204 ['02.10.2011'],
205205 ['03.08.2011'],
@@ -235,6 +235,7 @@
236236 ['204.204.132.158'],
237237 ['247.240.82.209']
238238 ];
 239+
239240 tableTest(
240241 'Bug 17141: IPv4 address sorting',
241242 ['IP'],
@@ -288,7 +289,7 @@
289290 function( $table ) {
290291 mw.config.set( 'tableSorterCollation', {
291292 'ä': 'ae',
292 - 'ö' : 'oe',
 293+ 'ö': 'oe',
293294 'ß': 'ss',
294295 'ü':'ue'
295296 } );
@@ -302,7 +303,7 @@
303304 var planetsRowspanII = [jupiter, mercury, saturn, ['Venus', '6371.0'], venus, ['Venus', '3390.0']];
304305
305306 tableTest(
306 - 'Basic planet table: Same value for multiple rows via rowspan',
 307+ 'Basic planet table: same value for multiple rows via rowspan',
307308 header,
308309 planets,
309310 planetsRowspan,

Status & tagging log