User:Pathoschild/Scripts/AJAX transclusion table
From Meta, a Wikimedia project coordination wiki
| ←Scripts | User:Pathoschild (Scripts > AJAX transclusion table) |
The AJAX transclusion table script adds a "[show]" link in the first cell of every row in tables with the "attable" class. Clicking the link will display the linked page below (see screenshots at right). No show/hide link will be shown in rows that don't contain a link, like headings.
[edit] Installation
- If you want to use this script on Meta, you don't need to do anything (it is already installed).
- If you want to use it elsewhere:
- Add your name to the user list below to get code updates. (If you're not on the list, the script might unexpectedly stop working for you one day if there's a major change.)
- Add the following code to User:your user name/common.js. To enable it for all users on a wiki, add it to MediaWiki:Common.js instead.
- Refresh your browser to reload the JavaScript. (In Chrome or Firefox, press [CTRL] and [R] at the same time.)
/************* *** AJAX transclusion table <http://meta.wikimedia.org/wiki/User:Pathoschild/Scripts/AJAX_transclusion_table> *** by [[m:user:Pathoschild]] *************/ function attLoader() { if(getElementsByClassName(document.getElementsByTagName('body')[0],'table','attable').length) { document.write('<script type="text/javascript" src="' + 'http://meta.wikimedia.org/w/index.php?title=User:Pathoschild/Scripts/AJAX_transclusion_table.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></script>'); } } addOnloadHook(attLoader);
[edit] Current bugs
- Does not work in Internet Explorer (working on it).
Does not recognize(fixed in next version).<th>element as possible first cell
[edit] See also
- source code
- Template:Welcome/attable - example of use
- users
- wikis using the script
- Collapsible Tables