User:Technical 13/Scripts/editTemplateNoDoc.js‎‎

if( mw.config.get('wgNamespaceNumber') === 10 && mw.config.get('wgAction') === 'edit' && $( '.template-documentation' ).length !== -1){

$( '.template-documentation' ).css( 'display', 'none');

var tnd = mw.util.addPortletLink(

'p-tb',

'#',

'View doc',

'pt-temp-doc',

'View template documentation',

null,

null

);

$( tnd ).click( function ( e ) {

e.preventDefault();

/* Toggle documentation display */

$( '.template-documentation' ).css( 'display', function (i, val) {

return val === 'none' ? '' : 'none';

});

/* Toggle the link */

$( 'li#pt-temp-doc a' ).html( function (i, val) {

return val === 'View doc' ? 'Hide doc' : 'View doc';

});

/* Toggle the description */

$( 'li#pt-temp-doc a' ).attr( 'title', function (i, val) {

return val === 'View template documentation' ? 'Hide template documentation' : 'View template documentation';

});

});

} else {

/* Do nothing */

}