r90678 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90677‎ | r90678 | r90679 >
Date:21:26, 23 June 2011
Author:hartman
Status:reverted (Comments)
Tags:
Comment:
Switch jquery.sortable to use mw-sortable and mw-unsortable classes, to be in line with makeCollapsible. Support for legacy .sortable remains.
Follow up to r86088
Modified paths:
  • /trunk/phase3/resources/jquery/jquery.tablesorter.js (modified) (history)
  • /trunk/phase3/resources/mediawiki.page/mediawiki.page.ready.js (modified) (history)
  • /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
@@ -21,7 +21,7 @@
2222 * @return jQuery
2323 */
2424 var tableCreate = function( header, data ) {
25 - var $table = $('<table class="sortable"><thead></thead><tbody></tbody></table>'),
 25+ var $table = $('<table class="mw-sortable"><thead></thead><tbody></tbody></table>'),
2626 $thead = $table.find('thead'),
2727 $tbody = $table.find('tbody');
2828 var $tr = $('<tr>');
Index: trunk/phase3/resources/jquery/jquery.tablesorter.js
@@ -287,7 +287,7 @@
288288 this.order = 0;
289289 this.count = 0;
290290
291 - if ( $( this ).is( '.unsortable' ) ) this.sortDisabled = true;
 291+ if ( $( this ).is( '.unsortable, .mw-unsortable' ) ) this.sortDisabled = true;
292292
293293 if ( !this.sortDisabled ) {
294294 var $th = $( this ).addClass( table.config.cssHeader ).attr( 'title', msg[1] );
Index: trunk/phase3/resources/mediawiki.page/mediawiki.page.ready.js
@@ -9,9 +9,9 @@
1010 $( '.mw-collapsible' ).makeCollapsible();
1111
1212 /* Lazy load jquery.tablesorter */
13 - if ( $( 'table.sortable' ).length ) {
 13+ if ( $( 'table.mw-sortable, table.sortable' ).length ) {
1414 mw.loader.using( 'jquery.tablesorter', function() {
15 - $( 'table.sortable' ).tablesorter();
 15+ $( 'table.mw-sortable, table.sortable' ).tablesorter();
1616 });
1717 }
1818

Follow-up revisions

RevisionCommit summaryAuthorDate
r91429Revert r90678 per CRkrinkle23:36, 4 July 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86088Completely rewritten table sorting script....diebuche21:47, 14 April 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   21:28, 23 June 2011

Needs test case for rows marked unsortable / mw-unsortable. :D

#Comment by DieBuche (talk | contribs)   07:20, 24 June 2011

I'm not yet convinced of the benefits of using mw-sortable. Is there a possible clash like with the header IDs? Without good arguments we probably won't get the community to switch all uses. As long as there are still uses of sortable, the only thing gained is a more fragmented wikitext base.

#Comment by DieBuche (talk | contribs)   07:22, 24 June 2011

With mw-collapsible it's a different case: Previously there was no native collapse-system in MW, and as to avoid clashes with previous scripts on the wikis, Krinkle had to name it mw- .

#Comment by Krinkle (talk | contribs)   01:21, 25 June 2011

I agree, there is no need to deprecate "sortable".

Status & tagging log