We do our best to give you all information you need. Use the Search menu to search for the page you are looking for. The most used pages are on the side menu or in the Popular Pages page.

Do you miss important stuff or do you have suggestions? Let us know via Discord or in-game. Thank you for using our Wiki!

Difference between revisions of "MediaWiki:Common.js"

From GrinderScape Wiki
Jump to: navigation, search
Line 70: Line 70:
 
$( this ).find( "a" ).removeAttr( "href" );
 
$( this ).find( "a" ).removeAttr( "href" );
 
});
 
});
 
$( "li#n-Wiki > a" ).removeAttr( "href" );
 
  
 
$( "a" ).removeAttr( "title" );
 
$( "a" ).removeAttr( "title" );

Revision as of 13:46, 20 March 2016

// 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" );
	$( "<span>&nbsp;&nbsp;/&nbsp;&nbsp;</span>" ).insertAfter( "span.subpages > a" );
} 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" );