MediaWiki:EditIntroButton2/code.js

// /* * Adds a button next to the header which acts as a "section edit" button for the intro * Written by Grunny (http://www.wikia.com/wiki/User:Grunny) * Uses PurgeButton/code.js as a basis for jQuery layout * */ if ( wgNamespaceNumber != -1 && !window.EditIntroButtonLoaded ) { addOnloadHook( addEditIntroButton ); }

var EditIntroButtonLoaded = true;

function addEditIntroButton { var theText = 'edit intro'; if ( typeof EditIntroButtonText == "string" ) { theText = EditIntroButtonText; }

switch( skin ) { case 'answers': case 'awesome': case 'monaco_old': case 'monaco': $('span.editsection-upper').after(' ['+ theText + '] '); break;

case 'uncyclopedia': case 'wowwiki': case 'lostbook': case 'monobook': appendCSS( '.editsection-upper { margin-left: 16px; position: relative; margin-bottom: -2px; top: -3px; font-size: 67%; }' ); $('h1.firstHeading').append(' ['+ theText + '] '); break;

} }

//