From: Raimond Spekking Date: Fri, 26 Dec 2008 22:00:15 +0000 (+0000) Subject: * (bug 16754) Making arbitrary rows of sortable tables sticky: X-Git-Tag: 1.31.0-rc.0~43762 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%22http:/wikimediafoundation.org/fundraising/%7B%7B%20url_for%28%27user_settings%27%2C%20userid=session.userid%29%20%7D%7D?a=commitdiff_plain;h=83e561fe7432402b648547d717910567c966f4b6;p=lhc%2Fweb%2Fwiklou.git * (bug 16754) Making arbitrary rows of sortable tables sticky: |- class="unsortable" Patch by René Kijewski --- diff --git a/CREDITS b/CREDITS index 9a51f84d02..6590f090e8 100644 --- a/CREDITS +++ b/CREDITS @@ -74,6 +74,7 @@ following names for their contribution to the product. * Olaf Lenz * Paul Copperman * RememberTheDot +* René Kijewski * ST47 == Translators == diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 70ad4bf672..2c04efc972 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -250,6 +250,8 @@ The following extensions are migrated into MediaWiki 1.14: * Special:Log: Add 'change protection' link for unprotected pages too * Special:Log: Add log type specific CSS classes 'mw-logline-$logtype' to 'li' elements +* (bug 16754) Making arbitrary rows of sortable tables sticky: + |- class="unsortable" === Bug fixes in 1.14 === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 2b12f1c1ea..efe1b2f0df 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1444,7 +1444,7 @@ $wgCacheEpoch = '20030516000000'; * to ensure that client-side caches don't keep obsolete copies of global * styles. */ -$wgStyleVersion = '192'; +$wgStyleVersion = '193'; # Server-side caching: diff --git a/skins/common/wikibits.js b/skins/common/wikibits.js index 8ad57c02e3..3421aeec20 100644 --- a/skins/common/wikibits.js +++ b/skins/common/wikibits.js @@ -637,13 +637,16 @@ function ts_resortTable(lnk) { var reverse = (span.getAttribute("sortdir") == 'down'); var newRows = new Array(); + var staticRows = new Array(); for (var j = rowStart; j < table.rows.length; j++) { var row = table.rows[j]; - var keyText = ts_getInnerText(row.cells[column]); - var oldIndex = (reverse ? -j : j); - var preprocessed = preprocessor( keyText ); + if((" "+row.className+" ").indexOf(" unsortable ") < 0) { + var keyText = ts_getInnerText(row.cells[column]); + var oldIndex = (reverse ? -j : j); + var preprocessed = preprocessor( keyText ); - newRows[newRows.length] = new Array(row, preprocessed, oldIndex); + newRows[newRows.length] = new Array(row, preprocessed, oldIndex); + } else staticRows[staticRows.length] = new Array(row, false, j-rowStart); } newRows.sort(sortfn); @@ -658,6 +661,11 @@ function ts_resortTable(lnk) { span.setAttribute('sortdir','down'); } + for(var i in staticRows) { + var row = staticRows[i]; + newRows.splice(row[2], 0, row); + } + // We appendChild rows that already exist to the tbody, so it moves them rather than creating new ones // don't do sortbottom rows for (var i = 0; i < newRows.length; i++) {