User:Samwilson/common.js

From Wikisource
Jump to navigation Jump to search
Note: After saving, changes may not occur immediately. Click here to learn how to bypass your browser's cache.
  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Cmd-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (Cmd-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Clear the cache in Tools → Preferences

For details and instructions about other browsers, see Wikipedia:Bypass your cache.

mw.loader.load('//en.wikisource.org/w/index.php?title=User:Samwilson/CurlyQuotes.js&action=raw&ctype=text/javascript');
mw.loader.load('//en.wikisource.org/w/index.php?title=User:Samwilson/PageCleanUp.js&action=raw&ctype=text/javascript');
//mw.loader.load('//en.wikisource.org/w/index.php?title=User:Samwilson/FullScreenEditing.js&action=raw&ctype=text/javascript');
mw.loader.load('//en.wikisource.org/w/index.php?title=User:Samwilson/LinkIndexToWikidata.js&action=raw&ctype=text/javascript');
//mw.loader.load('//en.wikisource.org/w/index.php?title=User:Samwilson/prerenderPages.js&action=raw&ctype=text/javascript');
//mw.loader.load('//en.wikisource.org/w/index.php?title=User:Samwilson/PagelistOnEditForm.js&action=raw&ctype=text/javascript');
//mw.loader.load('//en.wikisource.org/w/index.php?title=User:Samwilson/NopInserter.js&action=raw&ctype=text/javascript');
//mw.loader.load('//en.wikisource.org/w/index.php?title=User:Samwilson/MarkProofread.js&action=raw&ctype=text/javascript');

$(function($) {

	// Add PotM link to the top of the page.
	mw.util.addPortletLink(
		'p-personal',
		'//en.wikisource.org/wiki/Wikisource:Proofread_of_the_Month',
		'POTM',
		'p-potm',
		'Proofread of the Month'
	);

	// Add my current proofreading index to the top of the page.
	var currentWork = "Gissing - Workers in the Dawn, vol. I, 1880.djvu";
	mw.util.addPortletLink(
		'p-personal',
		'//en.wikisource.org/wiki/Index:' + currentWork,
		'Current Work',
		'p-currentwork',
		currentWork
	);

	// Add the {{nop}} inserter to the .editCheckboxes
	if( mw.config.get( 'wgCanonicalNamespace' ) == 'Page' && NopInserter !== undefined ) {
		mw.loader.using( [ 'oojs-ui-widgets' ], function () {
		var nopButton = new OO.ui.ButtonWidget( { label: 'Prev. page {{nop}}' } );
			nopButton.connect( nopButton, { click: function () {
				var nopInserter = new NopInserter();
				nopInserter.get_raw_page( nopInserter.prev_page, nopInserter.check_nop );
			} } );
			$( '.editButtons' ).append( nopButton.$element );
		} );
	}

} );