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).

Difference between revisions of "MediaWiki:Common.js"

From RuneGlory
Jump to: navigation, search
Line 37: Line 37:
 
$( "<span>" + title[ title.length - 1 ] + "</span>" ).appendTo( "span.subpages" );
 
$( "<span>" + title[ title.length - 1 ] + "</span>" ).appendTo( "span.subpages" );
 
}
 
}
$( "<div id='customFooter'><p>Hello<br>A message here.</p></div>" ).insertAfter( "ul#footer-info" );
+
$( "<div id='customFooter'><p>Hello<br>A message here.</p></div>" ).insertBefore( "ul#footer-places" );
  
 
$( "div#index" ).insertAfter( "div#content-contentSub-wrap" );
 
$( "div#index" ).insertAfter( "div#content-contentSub-wrap" );

Revision as of 04:41, 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" );
} 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>Hello<br>A message here.</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" );

});