User:I18n/vector.js

(function {	/**	 * Add a toolbox link to enable/disable my scripts	 *	 * @sources www.mediawiki.org/wiki/Snippets/Toggle_user_scripts	 * @rev 3	 */	var enableMyScripts = $.cookie( 'enable-my-scripts' ) !== 'false';	$(function  { var label = { // Current state <-> Label of toggle button (opposite state) 'true': 'Disable my scripts', 'false': 'Enable my scripts' },			cookieOptions = { expires: 1, path: '/' };

if ( $('#ca-toggle-js').length ) { return; }

$( mw.util.addPortletLink( 'p-tb', '#',			label[ enableMyScripts ], '#ca-toggle-js', 'Turn my scripts on or off and reload the page' ) )			.on( 'click', function (e) {				// Prevent '#' from appearing in address bar				e.preventDefault;				$.cookie( 'enable-my-scripts', !enableMyScripts, cookieOptions );				// Reloads the document (from cache)				document.location.reload( false );			} ); } );

if (!enableMyScripts) { mw.log( 'Note: Your scripts are disabled.' ); return; }

/* Begin user scripts */

// Your scripts here

$(function{ 	var curid = mw.config.get('wgArticleId');	if (curid != 0){		 var url = mw.config.get('wgServer') + '?curid=' + curid;		 mw.util.addPortletLink('p-tb', url, 'Link by ID', 't-curlink', 'Show link to this page by its ID');	} })

/* End user scripts */ });