Jump to content

MediaWiki:Common.js: Difference between revisions

Jehan (talk | contribs)
No edit summary
Jehan (talk | contribs)
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 78: Line 78:
Tables[i].setAttribute( 'id', 'hideableTable' + tableIndex );
Tables[i].setAttribute( 'id', 'hideableTable' + tableIndex );
var Button    = document.createElement( 'span' );
if ( 0 ) {
var ButtonLink = document.createElement( 'a' );
                                    $( linkImage ).on( 'click', $.proxy( handlelinkImage, linkImage , tableIndex ) );
var ButtonText = document.createTextNode( expandCaption );
                                }
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 */
    Button.className = 'hideButton';  /* Styles are declared in Common.css */
 
 
ButtonLink.style.color = Header.style.color;
    ButtonLink.style.color = Header.style.color;
ButtonLink.setAttribute( 'id', 'hideButton' + tableIndex );
    ButtonLink.setAttribute( 'id', 'hideButton' + tableIndex );
ButtonLink.setAttribute( 'href', '#' );
    ButtonLink.setAttribute( 'href', '#' );
$( ButtonLink ).on( 'click', $.proxy( handleButtonLink, ButtonLink, tableIndex ) );
    $( ButtonLink ).on( 'click', $.proxy( handleButtonLink, ButtonLink, tableIndex ) );
ButtonLink.appendChild( ButtonText );
    ButtonLink.appendChild( ButtonText );
 
 
Button.appendChild( document.createTextNode( '[' ) );
    Button.appendChild( document.createTextNode( '[' ) );
Button.appendChild( ButtonLink );
    Button.appendChild( ButtonLink );
Button.appendChild( document.createTextNode( ']' ) );
    Button.appendChild( document.createTextNode( ']' ) );
 
 
Header.insertBefore( Button, Header.firstChild );
    Header.insertBefore( Button, Header.firstChild );
if ( linkImage ) linkImage.appendChild( Button );
    if ( linkImage ) linkImage.appendChild( Button );
if ( 0 ) linkImage.insertBefore( Button, linkImage.firstChild );
    if ( 0 ) linkImage.insertBefore( Button, linkImage.firstChild );
                                }
tableIndex++;
tableIndex++;
}
}
Line 176: Line 181:
             ButtonLink.setAttribute( 'href', '#' );
             ButtonLink.setAttribute( 'href', '#' );
             $( ButtonLink ).on( 'click', $.proxy( handleButtonLink, ButtonLink, tableIndex ) );
             $( ButtonLink ).on( 'click', $.proxy( handleButtonLink, ButtonLink, tableIndex ) );
            $( linkImage ).on( 'click', $.proxy( handleButtonLink, ButtonLink, tableIndex ) );
 
    ButtonLink.appendChild( ButtonText );
    ButtonLink.appendChild( ButtonText );