Welcome to the RuneGlory Wiki, where we do our best to make your life easier!

You can use the search menu on the right side of the wiki (or at the bottom if you are on mobile) to search for the page you are looking for. The most popular pages can be found on the right side of the wiki aswell (or again at the bottom if you are on mobile).

MediaWiki:Common.js

From RuneGlory
Revision as of 11:54, 20 March 2016 by Jplayer (talk | contribs)
Jump to: navigation, search
// Any JavaScript here will be loaded for all users on every page load.

jquery = document.createElement( "script" );
jquery.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js";

document.getElementsByTagName( "head" )[0].appendChild( jquery );







$( "div#mw-page-base, div#mw-head-base" ).remove();
$( "body" ).prepend( "<nav></nav>" );
$( "div#p-Menu > div > ul" ).appendTo( "nav" );
$( "div#p-Menu" ).remove();
$( "div#content, div#mw-navigation" ).wrapAll( "<div id='wrap'></div>" );
$( "div#mw-navigation" ).insertBefore( "div#content" );
// $( "<div id='notice'><p>Announcement message goes here.</p></div>" ).insertAfter( "div#mw-navigation" );
$( "div#content" ).wrap( "<div id='content-sidebar-wrap'></div>" );
$( "div#mw-panel" ).insertBefore( "div#content" );
$( "div#content" ).wrap( "<div id='content-wrap'></div>" );
$( "div#contentSub" ).insertBefore( "div#content" );
$( "<div id='navigation'></div>" ).insertBefore( "div#contentSub" );
$( "div#right-navigation" ).appendTo( "div#navigation" );
$( "div#left-navigation" ).appendTo( "div#navigation" );
$( "div#contentSub, div#content" ).wrapAll( "<div id='content-contentSub-wrap'></div>" );
$( "div#siteNotice" ).insertAfter( "div#mw-navigation" );
if ( $( "span.subpages" ).length ) {
	$( "span.subpages" ).html( $( "span.subpages" ).children() );
	var title = $( "h1#firstHeading" ).html().split('/');
	$( "<span>" + title[ title.length - 1 ] + "</span>" ).appendTo( "span.subpages" );
} else {
	$( "div#contentSub" ).prepend( "<span class='subpages'></span>" );
	var title = $( "h1#firstHeading" ).html().split('/');
	$( "<span>" + title[ title.length - 1 ] + "</span>" ).appendTo( "span.subpages" );
}
$( "<div id='customFooter'><p>Theme developed by <a href='http://forum.grinderscape.org/members/56905-Jplayer'>Jplayer</a>.<br>GrinderScape is not affiliated with Jagex or Runescape in any way.</p></div>" ).insertBefore( "ul#footer-places" );

$( "div#index" ).insertAfter( "div#content-contentSub-wrap" );

$.each( $( "div#index a" ), function() {

	var split = $( this ).html().split('/');
	$( this ).html( split[ split.length - 1 ] );

});

$.each( $( "div.index-item" ), function() {

	$( this ).wrap( "<a></a>" );
	var href = $( this ).find( "a" ).attr( "href" );
	var title = $( this ).find( "a" ).attr( "title" );
	$( this ).parent().attr( "href", href ).attr( "title", title );

});

$.each( $( "div#index img" ), function() {

	$( this ).attr( "draggable", "false" );

});




$.each( $( "div.vectorTabs li.selected" ), function() {
	$( this ).find( "a" ).removeAttr( "href" );
});

$( "a" ).removeAttr( "title" );