[HOME PAGE] [STORES] [CLASSICISTRANIERI.COM] [FOTO] [YOUTUBE CHANNEL]


Bug 9134 – sorttable.js fails to init for sortable table

Last modified: 2010-05-15 15:48:27 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 9134 - sorttable.js fails to init for sortable table
sorttable.js fails to init for sortable table
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.9.x
PC Windows XP
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
http://codex.gallery2.org/Gallery2:Te...
: patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-28 19:56 UTC by Alan Harder
Modified: 2010-05-15 15:48 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Alan Harder 2007-02-28 19:56:35 UTC
I see a couple other bug reports/feature requests about sortable tables, so
clearly it works for some people.. however, on codex.gallery2.org we got errors
about undefined variables (at least with firefox2).  For some reason,
sorttable.js couldn't see any vars/funcs from outside when document.write was
used in wikibits.js to include sorttable.js.  I changed this to use DOM to
include the script and this was fixed.  Then sorttable.js uses hookEvent to
initialize.. but the file isn't included until another hook event is being
processed.. seems like this is too late to register a new hook event.  I changed
this to just call the init function.  Seems to work now.

Patch below (revision 941 is our own local svn, you can ignore that.. it's
mediawiki 1.9.3).

Index: skins/common/wikibits.js
===================================================================
--- skins/common/wikibits.js    (revision 941)
+++ skins/common/wikibits.js    (working copy)
@@ -853,7 +853,9 @@

 function sortableTables() {
        if (getElementsByClassName(document, "table", "sortable").length != 0) {
-               document.write('<script type="text/javascript"
src="'+stylepath+'/common/sorttable.js?1"></script>');
+// Use XHTML to include js.. with document.write sorttable.js doesn't see
vars/funcs from outside
+//             document.write('<script type="text/javascript"
src="'+stylepath+'/common/sorttable.js?1"></script>');
+var e = document.createElement('script');
e.src=stylepath+'/common/sorttable.js?1';
document.getElementsByTagName('body')[0].appendChild(e);
        }
 }

Index: skins/common/sorttable.js
===================================================================
--- skins/common/sorttable.js   (revision 941)
+++ skins/common/sorttable.js   (working copy)
@@ -19,7 +19,10 @@
 var alternate_row_colors = true;


-hookEvent( "load", sortables_init);
+//This js file is included from an onload handler, adding a handler now won't
get it invoked.
+//hookEvent( "load", sortables_init);
+//Just call the function:
+sortables_init();

 var SORT_COLUMN_INDEX;
 var thead = false;
Comment 1 Alan Harder 2007-02-28 20:47:06 UTC
Oops, just looked at current svn and see this is obsolete.. table sorting stuff
is now all in wikibits.js.  Closing.

Note You need to log in before you can comment on or make changes to this bug.


Contents Listing Alphabetical by Author:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Unknown Other

Contents Listing Alphabetical by Title:
# A B C D E F G H I J K L M N O P Q R S T U V W Y Z Other

Medical Encyclopedia

Browse by first letter of topic:


A-Ag Ah-Ap Aq-Az B-Bk Bl-Bz C-Cg Ch-Co
Cp-Cz D-Di Dj-Dz E-Ep Eq-Ez F G
H-Hf Hg-Hz I-In Io-Iz J K L-Ln
Lo-Lz M-Mf Mg-Mz N O P-Pl Pm-Pz
Q R S-Sh Si-Sp Sq-Sz T-Tn To-Tz
U V W X Y Z 0-9

Biblioteca - SPANISH

Biblioteca Solidaria - SPANISH

Bugzilla

Ebooks Gratuits

Encyclopaedia Britannica 1911 - PDF

Project Gutenberg: DVD-ROM 2007

Project Gutenberg ENGLISH Selection

Project Gutenberg SPANISH Selection

Standard E-books

Wikipedia Articles Indexes

Wikipedia for Schools - ENGLISH

Wikipedia for Schools - FRENCH

Wikipedia for Schools - SPANISH

Wikipedia for Schools - PORTUGUESE

Wikipedia 2016 - FRENCH

Wikipedia HTML - CATALAN

Wikipedia Picture of the Year 2006

Wikipedia Picture of the Year 2007

Wikipedia Picture of the Year 2008

Wikipedia Picture of the Year 2009

Wikipedia Picture of the Year 2010

Wikipedia Picture of the Year 2011