MediaWiki:Common.js: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 78: | Line 78: | ||
Tables[i].setAttribute( 'id', 'hideableTable' + tableIndex ); | Tables[i].setAttribute( 'id', 'hideableTable' + tableIndex ); | ||
var Button = document.createElement( 'span' ); | if ( 0 ) { | ||
linkImage.setAttribute( 'href', '#' ); | |||
$( linkImage ).on( 'click', $.proxy( handlelinkImage, linkImage , tableIndex ) ); | |||
} | |||
if ( 1 ) { | |||
var Button = document.createElement( 'span' ); | |||
var ButtonLink = document.createElement( 'a' ); | |||
var ButtonText = document.createTextNode( expandCaption ); | |||
Button.className = 'hideButton'; /* Styles are declared in Common.css */ | |||
ButtonLink.style.color = Header.style.color; | |||
ButtonLink.setAttribute( 'id', 'hideButton' + tableIndex ); | |||
ButtonLink.setAttribute( 'href', '#' ); | |||
$( ButtonLink ).on( 'click', $.proxy( handleButtonLink, ButtonLink, tableIndex ) ); | |||
ButtonLink.appendChild( ButtonText ); | |||
Button.appendChild( document.createTextNode( '[' ) ); | |||
Button.appendChild( ButtonLink ); | |||
Button.appendChild( document.createTextNode( ']' ) ); | |||
Header.insertBefore( Button, Header.firstChild ); | |||
if ( linkImage ) linkImage.appendChild( Button ); | |||
if ( 0 ) linkImage.insertBefore( Button, linkImage.firstChild ); | |||
} | |||
tableIndex++; | tableIndex++; | ||
} | } | ||