User:Thediypal/vector.js

jQuery( function( $ ) { /** * Add a toolbox link to enable/disable my scripts * * @source: http://www.mediawiki.org/wiki/Snippets/Toggle_user_scripts * @rev: 1 */ var enableMyScripts = $.cookie( 'enable-my-scripts' ) !== 'false'; $(document).ready( function { var $portlet, label = { 'true': 'Disable scripts', 'false': 'Enable scripts' },               cookieOptions = { expires: 1, path: '/' };       if ( $('#ca-toggle-js').length ) { return; }       $portlet = $( mw.util.addPortletLink( 'p-tb', '#',               label[ enableMyScripts ], '#ca-toggle-js', 'Turn my scripts on or off and reload the page' ) );       $portlet.click( function (e) {                e.preventDefault; // prevent '#' from appearing in URL bar                $.cookie( 'enable-my-scripts', !enableMyScripts, cookieOptions );                document.location.reload( false ); // Reloads the document (from the cache)        } ); } ); if (enableMyScripts) { /* Begin user scripts */

/* * Section Edit Links for skin Vector * @source:Code snippet copied from EXtension:Vector * license:GPL v2 * authors: User:Trevor Parscal, User:Catrope */		// Move the link over to be next to the heading text and style it with an icon $( 'span.mw-headline' ).each( function {			$(this)				.after( $( ' ' )						.append(							$(this)								.prev( 'span.editsection' )								.find( 'a' )									.each( function { var text = $(this).text; $(this).text(											text.substr( 0, 1 ).toUpperCase + text.substr( 1 )										); } )									.detach						) )				.prev( 'span.editsection' )					.remove;		} );

/* End user scripts */ } else { mw.log( 'Note: Scripts are disabled.' ); } });//end jQuery