r95424 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95423‎ | r95424 | r95425 >
Date:19:35, 24 August 2011
Author:krinkle
Status:ok
Tags:
Comment:
Add comments and fix whitespace for r90657, r86305
Modified paths:
  • /trunk/phase3/resources/jquery/jquery.tablesorter.js (modified) (history)
  • /trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/jquery/jquery.tablesorter.js
@@ -8,8 +8,9 @@
99 * http://www.opensource.org/licenses/mit-license.php
1010 * http://www.gnu.org/licenses/gpl.html
1111 *
12 - * @depends on mw.config (wgDigitTransformTable, wgMonthNames, wgMonthNamesShort,
 12+ * Depends on mw.config (wgDigitTransformTable, wgMonthNames, wgMonthNamesShort,
1313 * wgDefaultDateFormat, wgContentLanguage)
 14+ * Uses 'tableSorterCollation' in mw.config (if available)
1415 */
1516 /**
1617 *
@@ -222,7 +223,7 @@
223224 realCellIndex = 0,
224225 $tableHeaders = $( 'thead:eq(0) tr', table );
225226 if ( $tableHeaders.length > 1 ) {
226 - $tableHeaders.each(function() {
 227+ $tableHeaders.each( function() {
227228 if ( this.cells.length > maxSeen ) {
228229 maxSeen = this.cells.length;
229230 longest = this;
Index: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js
@@ -286,15 +286,20 @@
287287 umlautWords,
288288 umlautWordsSorted,
289289 function( $table ) {
290 - mw.config.set( 'tableSorterCollation', {'ä':'ae', 'ö' : 'oe', 'ß': 'ss', 'ü':'ue'});
 290+ mw.config.set( 'tableSorterCollation', {
 291+ 'ä': 'ae',
 292+ 'ö' : 'oe',
 293+ 'ß': 'ss',
 294+ 'ü':'ue'
 295+ } );
291296 $table.tablesorter();
292297 $table.find( '.headerSort:eq(0)' ).click();
293298 mw.config.set( 'tableSorterCollation', {} );
294299 }
295300 );
296301
297 -var planetsRowspan =[["Earth","6051.8"], jupiter, ["Mars","6051.8"], mercury, saturn, venus];
298 -var planetsRowspanII =[jupiter, mercury, saturn, ['Venus', '6371.0'], venus, ['Venus', '3390.0']];
 302+var planetsRowspan = [["Earth","6051.8"], jupiter, ["Mars","6051.8"], mercury, saturn, venus];
 303+var planetsRowspanII = [jupiter, mercury, saturn, ['Venus', '6371.0'], venus, ['Venus', '3390.0']];
299304
300305 tableTest(
301306 'Basic planet table: Same value for multiple rows via rowspan',
@@ -302,9 +307,13 @@
303308 planets,
304309 planetsRowspan,
305310 function( $table ) {
306 - //Quick&Dirty mod
 311+ // Modify the table to have a multiuple-row-spanning cell:
 312+ // - Remove 2nd cell of 4th row, and, 2nd cell or 5th row.
307313 $table.find( 'tr:eq(3) td:eq(1), tr:eq(4) td:eq(1)' ).remove();
 314+ // - Set rowspan for 2nd cell of 3rd row to 3.
 315+ // This covers the removed cell in the 4th and 5th row.
308316 $table.find( 'tr:eq(2) td:eq(1)' ).prop( 'rowspan', '3' );
 317+
309318 $table.tablesorter();
310319 $table.find( '.headerSort:eq(0)' ).click();
311320 }
@@ -315,9 +324,13 @@
316325 planets,
317326 planetsRowspanII,
318327 function( $table ) {
319 - //Quick&Dirty mod
 328+ // Modify the table to have a multiuple-row-spanning cell:
 329+ // - Remove 1st cell of 4th row, and, 1st cell or 5th row.
320330 $table.find( 'tr:eq(3) td:eq(0), tr:eq(4) td:eq(0)' ).remove();
 331+ // - Set rowspan for 1st cell of 3rd row to 3.
 332+ // This covers the removed cell in the 4th and 5th row.
321333 $table.find( 'tr:eq(2) td:eq(0)' ).prop( 'rowspan', '3' );
 334+
322335 $table.tablesorter();
323336 $table.find( '.headerSort:eq(0)' ).click();
324337 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86305Followup r86088 per CR: Move month array builder into language; use mw.config...diebuche12:54, 18 April 2011
r90657Adding rowspan tests to tablesorting & make it more stablediebuche08:31, 23 June 2011

Status & tagging log