From ecb673a28559fcd4a23af7092615f4169775c90e Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 15 Jul 2005 04:27:06 +0000 Subject: [PATCH] * (bug 2866) Revert experimental, non-cross-platform sortable table hack --- RELEASE-NOTES | 5 +- includes/Skin.php | 1 - skins/MonoBook.php | 5 +- skins/common/sorttable.js | 210 -------------------------------------- 4 files changed, 3 insertions(+), 218 deletions(-) delete mode 100644 skins/common/sorttable.js diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 41c6332c9a..5147e1b359 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -153,10 +153,6 @@ External hooks: application is included. This may not be on by default in final release, depending on support. -Sortable tables: - Since beta4 you can have a client-side sortable table. To make a table - sortable use class="sortable" and give it a uniq id ( id="foo" ). - And... A bunch of stuff we forgot to mention. @@ -581,6 +577,7 @@ of MediaWiki:Newpagetext) to &action=edit, if page is new. * (bug 2001) Implement client-side sorting of table fields with JavaScript * Undo inconsistent editing behavior change * (bug 2835) Back out fix for bug 2802, caused regressions in category sort +* (bug 2866) Revert experimental, non-cross-platform sortable table hack === Caveats === diff --git a/includes/Skin.php b/includes/Skin.php index 3722a0fc9b..724415d891 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -176,7 +176,6 @@ class Skin extends Linker { function getHeadScripts() { global $wgStylePath, $wgUser, $wgContLang, $wgAllowUserJs, $wgJsMimeType; $r = "\n"; - $r.= "\n"; if( $wgAllowUserJs && $wgUser->isLoggedIn() ) { $userpage = $wgUser->getUserPage(); $userjs = htmlspecialchars( $this->makeUrl( diff --git a/skins/MonoBook.php b/skins/MonoBook.php index a89f00aedc..5d94cff2e0 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -64,9 +64,8 @@ class MonoBookTemplate extends QuickTemplate { data['jsvarurl' ]) { ?> - - - data['usercss' ]) { ?> + + data['usercss' ]) { ?> data['userjs' ]) { ?> data['userjsprev']) { ?> diff --git a/skins/common/sorttable.js b/skins/common/sorttable.js deleted file mode 100644 index 994154961b..0000000000 --- a/skins/common/sorttable.js +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Sorttable.js - * A script that let you sort table columns by clicking on the header. - * - * Grabbed from: http://www.kryogenix.org/code/browser/sorttable/ - * Authors: - * - Stuart Langridge - * - C. David Eagle ( http://books.mingovia.org/ ) - * - * getInnerText() function by Erik at http://webfx.eae.net/ - * - * Some changes probably have been made by Avar - * http://bugzilla.wikimedia.org/show_bug.cgi?id=2001 - * - * - * TODO: - * i18n numeric sort - * - * Licence: X11 - * - */ - -addEvent(window, "load", sortables_init); - -var SORT_COLUMN_INDEX; - -function sortables_init() { - // Find all tables with class sortable and make them sortable - if (!document.getElementsByTagName) return; - tbls = document.getElementsByTagName("table"); - for (ti=0;ti 0) { - var firstRow = table.rows[0]; - } - if (!firstRow) return; - - // We have a first row: assume it's the header, and make its contents clickable links - for (var i=0;i - var txt = ts_getInnerText(cell); -*/ - cell.innerHTML = cell.innerHTML+''; - } -} - -function ts_getInnerText(el) { - if (typeof el == "string") return el; - if (typeof el == "undefined") { return el }; - if (el.innerText) return el.innerText; //Not needed but it is faster - var str = ""; - - var cs = el.childNodes; - var l = cs.length; - for (var i = 0; i < l; i++) { - switch (cs[i].nodeType) { - case 1: //ELEMENT_NODE - str += ts_getInnerText(cs[i]); - break; - case 3: //TEXT_NODE - str += cs[i].nodeValue; - break; - } - } - return str; -} - -function ts_resortTable(lnk) { - // get the span - var span; - for (var ci=0;ci