r40311 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40310‎ | r40311 | r40312 >
Date:19:15, 1 September 2008
Author:simetrical
Status:old
Tags:
Comment:
(bug 15399) Disable odd/even classes for sortable tables

These might or might not be useful, but if they are useful they should be added in PHP, not JavaScript. There have been reports of significant slowness for large tables due to the row numbering. This also fixes a bug where setting ts_alternate_row_colors = false would only work until the user tried sorting the table.

Patch by Mike Horvath.
Modified paths:
  • /trunk/phase3/CREDITS (modified) (history)
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/skins/common/wikibits.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/wikibits.js
@@ -518,7 +518,7 @@
519519 var ts_image_down = "sort_down.gif";
520520 var ts_image_none = "sort_none.gif";
521521 var ts_europeandate = wgContentLanguage != "en"; // The non-American-inclined can change to "true"
522 -var ts_alternate_row_colors = true;
 522+var ts_alternate_row_colors = false;
523523 var SORT_COLUMN_INDEX;
524524
525525 function sortables_init() {
@@ -661,7 +661,9 @@
662662 }
663663 span.innerHTML = arrowHTML;
664664
665 - ts_alternate(table);
 665+ if (ts_alternate_row_colors) {
 666+ ts_alternate(table);
 667+ }
666668 }
667669
668670 function ts_dateToSortKey(date) {
Index: trunk/phase3/CREDITS
@@ -43,6 +43,7 @@
4444 * Jeremy Baron
4545 * Louperivois
4646 * Max Semenik
 47+* Mike Horvath
4748 * Mormegil
4849 * RememberTheDot
4950 * Soxred93
Index: trunk/phase3/RELEASE-NOTES
@@ -173,6 +173,8 @@
174174 Use a separate database connection for the objectcache table to avoid
175175 long-lasting locks on that table.
176176 * Respect file restrictions in the file history list
 177+* (bug 15399) Odd/even classes on sortable tables' rows could be slow for large
 178+ tables, and have been disabled by default.
177179
178180
179181 === API changes in 1.14 ===

Follow-up revisions

RevisionCommit summaryAuthorDate
r40322Remove unused and uninitialized variable in wikibits.js...simetrical02:11, 2 September 2008