User:RheingoldRiver/common.js

/* add edit buttons for recent changes & categories */

( function {	'use strict';	var $changeList = $( '.mw-changeslist' );       var $catList = $('.mw-category-generated');	if ( !$changeList.length && !$catList.length) {		return;	}	mw.loader.using( 'mediawiki.util' ).then( function { $changeList.find( '.mw-title' ).each( function {			var title = $( this ).find( '.mw-changeslist-title' ).attr( 'title' );			if ( title ) {				$( '' ).addClass( 'rc-editlink' ).attr( { href: mw.util.getUrl( title, { action: 'edit' } ), title: 'Edit this page' } ).text( ' ✎' ).insertAfter( this );			}		} ); $catList.find('.mw-content-ltr ul li a').each(function {                       var title = $(this).text;                        if (title) {							if ($(this).hasClass("CategoryTreeLabel")) {								title = "Category:" + title;							}							$('').addClass('cat-editlink').attr( { href: mw.util.getUrl(title, { action: 'edit' }), title: 'Edit this page' }).text(' ✎').insertAfter(this);                       }                }); }); } );

/* disable displaytitle when it's doing something other than lowercasing first letter of a page (for easier copy-pasting of scoreboard page names for concepts mostly) */

$(function { if ($("#firstHeading").text.toLowerCase!=mw.config.get("wgTitle").toLowerCase) {	if (mw.config.get("wgCanonicalNamespace") == "") {		$("#firstHeading").text(mw.config.get("wgTitle"));	}	else {		$("#firstHeading").text(mw.config.get("wgCanonicalNamespace") + ":" + mw.config.get("wgTitle"));	} } });