MediaWiki:Common.js: Difference between revisions

From The Pokemon Insurgence Wiki
No edit summary
No edit summary
 
Line 1: Line 1:
// 11:29, January 1, 2015 (UTC)
/* <pre> */
// <source lang="JavaScript">
/* Any JavaScript here will be loaded for all users on every page load. */
 
// Test if an Element has a Certain Class
if ( wgIsArticle || window.location.href.indexOf( 'action=submit' ) > -1 )
importScriptPage('MediaWiki:Common.js/elementClass.js', 'admintools');
{
// END Test if an Element has a Certain Class
  var script = document.createElement( 'script' );
  script.src = '/w/index.php?title=User:Poke/CollapsibleTables.js&action=raw&ctype=text/javascript&smaxage=18000&action=raw&maxage=18000';
// Cookie accessor functions
  script.type = 'text/javascript';
importScriptPage('MediaWiki:Common.js/cookieAccessor.js', 'admintools');
  document.getElementsByTagName( 'head' )[0].appendChild( script );
// END Cookie accessor functions
 
  addOnloadHook(function () { new CollapsibleTables(); });
// Redesign of ProfileMastheads (included for statustop)
importScriptPage('MediaWiki:Common.js/profileRedesign.js', 'admintools');
// END Redesign of ProfileMastheads
// Custom edit buttons
importScriptPage('MediaWiki:Common.js/CEB.js', 'admintools');
// END of custom edit buttons
// Collapsible Tables
var autoCollapse = 2;
var collapseCaption = "hide";
var expandCaption = "show";
var maxHeight = 300;
importScriptPage('ShowHide/code.js', 'dev');
// END of Collapsible Tables
// Standard Edit Summaries
importScriptPage('MediaWiki:Common.js/standardeditsummaries.js', 'admintools');
// END of Standard Edit Summaries
// Ajax auto-refresh
var ajaxPages = ["Special:RecentChanges", "Special:WikiActivity",
                "Special:Log", "Special:Watchlist", "Special:NewFiles",
                "Special:NewPages", "Special:ListFiles", "Special:Videos"];
var AjaxRCRefreshText = 'Auto-refresh';
importScriptPage('AjaxRC/code.js', 'dev');
// END of ajax auto-refresh
// Added SiteNotice Functionality
importScriptPage('MediaWiki:Common.js/sitenotice.js', 'admintools');
// END of added SiteNotice functionality
   
// Fix Edit Summary Prompt for UNDO
importScriptPage('MediaWiki:Common.js/undoSummary.js', 'admintools');
// END Fix Edit Summary Prompt for UNDO
// Skin Redirect Code
importScriptPage('MediaWiki:Common.js/skinRedirect.js', 'admintools');
// END of Skin Redirect Code
// Extra Rollback Buttons
importScriptPage('MediaWiki:Common.js/extraRollbacks.js', 'admintools');
// END Extra Rollback Buttons
// AjaxRollback - works with Extra Rollback Buttons
importScriptPage('MediaWiki:Common.js/ajaxRollback.js', 'admintools');
// END AjaxRollback
   
// FastDelete Buttons for Administrators
importScriptPage('MediaWiki:Common.js/fastDelete.js', 'admintools');
// END FastDelete Buttons for Administrators
// Adds DisplayClock
importScriptPage('MediaWiki:Common.js/displayClock.js', 'admintools');
// END Adds DisplayClock
// JS for Template:CSS
importScriptPage('MediaWiki:Common.js/userCSS.js', 'admintools');
// END JS for Template:CSS
// Adds PURGE button for both skins
var PurgeButtonText = 'Purge';
importScriptPage('PurgeButton/code.js', 'dev');
// END Adds PURGE button for both skins
// For UserGroup-only messages
importScriptPage('MediaWiki:Common.js/UserGroupMessages.js', 'admintools');
// END For UserGroup-only messages
// Add "Edit Intro" Button/Tab
importScriptPage('EditIntroButton/code.js', 'dev');
// END Add "Edit Intro" Button/Tab
// Adds PopupsNavigation
importScriptPage('MediaWiki:Common.js/popupsNav.js', 'admintools');
// END Adds PopupsNavigation
// Add Template:Information to Special:Upload
importScriptPage('MediaWiki:Common.js/uploadTemp.js', 'admintools');
// END Add Template:Information to Special:Upload
// Locate Main Page "Buttons" into Headers
importScriptPage('MediaWiki:Common.js/mainPageButtons.js', 'admintools');
// END Locate Main Page "Buttons" into Headers
// Renders SVGs as PNGs in Multiple Resolutions
importScriptPage('MediaWiki:Common.js/SvgToPng.js', 'admintools');
// END Renders SVGs as PNGs in Multiple Resolutions
// Add Inactive User Icon to MastheadProfiles
importScriptPage('InactiveUsers/code.js', 'dev');
// END Add Inactive User Icon to MastheadProfiles
// Render “Wikia contributor” as IP address
window.RevealAnonIP = { permissions : ['user'] };
importScriptPage('RevealAnonIP/code.js', 'dev');
// END Render "Wikia contributor" as IP address
// Check that user has signed talkpage post
importScriptPage('SignatureCheck/code.js', 'dev');
// END Check that user has signed talkpage post
// Duplicate image detector
importScriptPage('DupImageList/code.js', 'dev');
// END duplicate image detector
// File lister
importScriptPage('ListFiles/code.js', 'dev');
// END File lister
// username class for Template:USERNAME
importScriptPage('MediaWiki:Common.js/userName.js', 'admintools');
// END username class for Template:USERNAME
// IP Range Calculator
importScriptPage('MediaWiki:Common.js/iprange.js', 'admintools');
// End IP Range Calculator
// Adds floating style TOC
// importScriptPage('FloatingToc/code.js', 'dev');
// END Adds floating style TOC
// Add social networking buttons to wiki
var SocialMediaButtons = { position: "top", colorScheme: "color" };
importScriptPage('SocialIcons/code.js', 'dev');
// END Add social networking buttons to wiki
// Add NullEdit button
importScriptPage('NullEditButton/code.js', 'dev');
// END NullEdit button
// Add WhatLeavesHere
importScriptPage('MediaWiki:Common.js/WhatLeavesHere.js', 'admintools');
// END Add WhatLeavesHere
// Fixes NewPage Patrol Issues
importScriptPage('AjaxPatrol/code.js', 'dev');
// END Fixes NewPage Patrol Issues
// Add ImageMapEdit functionality
importScriptURI('//tools.wmflabs.org/imagemapedit/ime.js');
// END Add ImageMapEdit functionality
// Add Reference Popups
importScriptPage('ReferencePopups/code.js', 'dev');
// END ADD Reference Popups
// Hide redirects at PrefixIndex & AllPages
importScriptPage('AllPagesHideRedirect/code.js', 'dev');
// END redirects at PrefixIndex & AllPages
// Last edit details on articles
window.lastEdited = {
    avatar: false,
    size: true,
    diff: true,
    comment: true,
    time: true
};
importScriptPage('LastEdited/code.js', 'dev');
// END Last edit details on articles
// Add Countdown Timer code
// importScriptPage('Countdown/code.js', 'dev');
// END Add Countdown Timer code
// Add snow
// importScriptPage('MediaWiki:Snow.js', 'callofduty');
// END Add snow
// Add AjaxRedirect for quick redirections
if (mw.config.get('wgUserGroups').indexOf('sysop') > -1) {
    importScriptPage('AjaxRedirect/code.js', 'dev');
}
}
// END Add AjaxRedirect for quick redirections
 
function formatDate(t)
// Add screen resolution tester
{
importScriptPage('MediaWiki:Common.js/screenResolution.js', 'admintools');
var month = new Array();
// END Add screen resolution tester
month[0] = 'January';
month[1] = 'February';
// Add MassCategorization for (de)categorization en masse
month[2] = 'March';
if (mw.config.get('wgUserGroups').indexOf('sysop') > -1) {
month[3] = 'April';
    massCategorizationDelay = 1000;
month[4] = 'May';
    importScriptPage('MassCategorization/code.js', 'dev');
month[5] = 'June';
month[6] = 'July';
month[7] = 'August';
month[8] = 'September';
month[9] = 'October';
month[10] = 'November';
month[11] = 'December';
y = t.getUTCFullYear();
M = t.getUTCMonth();
D = t.getUTCDate();
h = t.getUTCHours();
m = t.getUTCMinutes();
s = t.getUTCSeconds();
if (h > 0 || m > 0 || s > 0)
{
hms = '';
if (s > 10)
hms = ':' + s;
else if (s > 0)
hms = ':0' + s;
if (m > 10)
hms = ':' + m + hms;
else if (m > 0)
hms = ':0' + m + hms;
if (h > 12)
hms = (h - 12) + hms + ' PM';
else if (h > 0)
hms = h + hms + ' AM';
else
hms = '12' + hms + ' AM';
return hms + ', ' + month[M] + ' ' + D + ', ' + y;
} else {
return month[M] + ' ' + D + ', ' + y;
}
}
}
// END Add MassCategorization for (de)categorization en masse
 
   
function formatTime(h, m, s)
// </source>
{
var o = '';
if (h != 1)
{
o = h + ' hours ';
} else {
o = '1 hour ';
}
if (m != 1)
{
o += m + ' minutes ';
} else {
o += '1 minute ';
}
if (s != 1)
{
o += s + ' seconds';
} else {
o += '1 second';
}
return o;
}
 
function updateClocks()
{
var t = new Date();
 
setTimeout(updateClocks, 1000);
D = t.getUTCDate();
M = t.getUTCMonth();
y = t.getUTCFullYear();
h = t.getUTCHours();
m = t.getUTCMinutes();
s = t.getUTCSeconds();
 
t = Date.UTC(y, M, D, h, m, s);
 
t = (T - t) / 1000;
if (t < 0 && t > -86400 && (h > 0 || m > 0 || s > 0))
{
document.getElementById('countdown-big').innerHTML = 'Today';
document.getElementById('countdown-small').innerHTML = '';
document.getElementById('countdown-target').innerHTML = 'is ' + formatDate(new Date(T + tzOffset)) + ' ' + tz;
return;
} else if (t < 0) {
document.getElementById('countdown-big').innerHTML = 'Past';
document.getElementById('countdown-target').innerHTML = formatDate(new Date(T + tzOffset)) + ' ' + tz;
return;
}
D = Math.floor(t / 86400.0);
h = Math.floor(t % 86400.0 / 3600.0);
m = Math.floor(t % 3600.0 / 60.0);
s = Math.floor(t % 60.0)
 
if (D == 1)
{
document.getElementById('countdown-big').innerHTML = '1 day';
} else if (D == 0) {
document.getElementById('countdown-big').innerHTML = '';
} else {
document.getElementById('countdown-big').innerHTML = D + ' days';
}
document.getElementById('countdown-small').innerHTML = formatTime(h, m, s);
}
 
function startCountdown()
{
document.getElementById('countdown-target').innerHTML = 'to ' + formatDate(new Date(T + tzOffset)) + ' ' + tz;
document.getElementById('countdown').style.display = 'block';
updateClocks();
}
 
// Webmaster staff icons
addOnloadHook(function () {
if(
window.location.href.indexOf("/wiki/User:") == -1
) {
if(
  window.location.href.indexOf("/wiki/User_talk:") == -1
  ) {
return;
  }
};
 
// create div and set innerHTML to link
var divContainer = document.createElement("div");
divContainer.innerHTML = '<div class="stafflink-WM" style="float:right; display:none;"><a href="/wiki/Bulbapedia:Webmasters" title="This user is a Webmaster of Bulbagarden."><img src="http://cdn.bulbagarden.net/media/upload/0/01/IconBPWebmaster.png"></a></div>';
 
// insert divContainer into the DOM below the h1
if(window.location.href.indexOf("&action=edit") == -1) {
document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
}
 
});
 
// Editorial Board staff icons
addOnloadHook(function () {
if(
window.location.href.indexOf("/wiki/User:") == -1
) {
if(
  window.location.href.indexOf("/wiki/User_talk:") == -1
  ) {
return;
  }
};
 
// create div and set innerHTML to link
var divContainer = document.createElement("div");
divContainer.innerHTML = '<div class="stafflink-EB" style="float:right; display:none;"><a href="/wiki/Bulbapedia:Editorial_Board" title="This user is a member of the Bulbapedia Editorial Board."><img src="http://cdn.bulbagarden.net/media/upload/3/3d/IconBPEditorialBoard.png"></a></div>';
 
// insert divContainer into the DOM below the h1
if(window.location.href.indexOf("&action=edit") == -1) {
document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
}
 
});
 
// Bureaucrat staff icons
addOnloadHook(function () {
if(
window.location.href.indexOf("/wiki/User:") == -1
) {
if(
  window.location.href.indexOf("/wiki/User_talk:") == -1
  ) {
return;
  }
};
 
// create div and set innerHTML to link
var divContainer = document.createElement("div");
divContainer.innerHTML = '<div class="stafflink-BC" style="float:right; display:none;"><a href="/wiki/Bulbapedia:Bureaucrats" title="This user is a Bulbapedia Bureaucrat."><img src="http://cdn.bulbagarden.net/media/upload/1/18/IconBPBureaucrat.png"></a></div>';
 
// insert divContainer into the DOM below the h1
if(window.location.href.indexOf("&action=edit") == -1) {
document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
}
 
});
 
// Senior Administrator staff icons
addOnloadHook(function () {
if(
window.location.href.indexOf("/wiki/User:") == -1
) {
if(
  window.location.href.indexOf("/wiki/User_talk:") == -1
  ) {
return;
  }
};
 
// create div and set innerHTML to link
var divContainer = document.createElement("div");
divContainer.innerHTML = '<div class="stafflink-SA" style="float:right; display:none;"><a href="/wiki/Bulbapedia:Senior_Administrators" title="This user is a Bulbapedia Senior Administrator."><img src="http://cdn.bulbagarden.net/media/upload/d/d5/IconBPSeniorAdministrator.png"></a></div>';
 
// insert divContainer into the DOM below the h1
if(window.location.href.indexOf("&action=edit") == -1) {
document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
}
 
});
 
// Administrator staff icons
addOnloadHook(function () {
if(
window.location.href.indexOf("/wiki/User:") == -1
) {
if(
  window.location.href.indexOf("/wiki/User_talk:") == -1
  ) {
return;
  }
};
 
// create div and set innerHTML to link
var divContainer = document.createElement("div");
divContainer.innerHTML = '<div class="stafflink-AD" style="float:right; display:none;"><a href="/wiki/Bulbapedia:Administrators" title="This user is a Bulbapedia Administrator."><img src="http://cdn.bulbagarden.net/media/upload/8/81/IconBPAdministrator.png"></a></div>';
 
// insert divContainer into the DOM below the h1
if(window.location.href.indexOf("&action=edit") == -1) {
document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
}
 
});
 
// Junior Administrator staff icons
addOnloadHook(function () {
if(
window.location.href.indexOf("/wiki/User:") == -1
) {
if(
  window.location.href.indexOf("/wiki/User_talk:") == -1
  ) {
return;
  }
};
 
// create div and set innerHTML to link
var divContainer = document.createElement("div");
divContainer.innerHTML = '<div class="stafflink-JA" style="float:right; display:none;"><a href="/wiki/Bulbapedia:Junior_Administrators" title="This user is a Bulbapedia Junior Administrator."><img src="http://cdn.bulbagarden.net/media/upload/5/5f/IconBPJuniorAdministrator.png"></a></div>';
 
// insert divContainer into the DOM below the h1
if(window.location.href.indexOf("&action=edit") == -1) {
document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
}
 
});
 
// Inactive staff icons
addOnloadHook(function () {
if(
window.location.href.indexOf("/wiki/User:") == -1
) {
if(
  window.location.href.indexOf("/wiki/User_talk:") == -1
  ) {
return;
  }
};
 
// create div and set innerHTML to link
var divContainer = document.createElement("div");
divContainer.innerHTML = '<div class="stafflink-IN" style="float:right; display:none;"><a href="/wiki/Bulbapedia:Inactive_Staff" title="This user is an inactive Bulbapedia staff member. Please direct your inquiries to an active staff member."><img src="http://cdn.bulbagarden.net/media/upload/8/8d/IconBPInactive.png"></a></div>';
 
// insert divContainer into the DOM below the h1
if(window.location.href.indexOf("&action=edit") == -1) {
document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
}
 
});
 
// This will add an [edit] link at the top of all pages except preview pages and the main page
// by User:Pile0nades (blatantly stolen from Wikipedia by User:The dark lord trombonator
 
// Add an [edit] link to pages
addOnloadHook(function () {
// if this is preview page or generated page, stop
if(
document.getElementById("wikiPreview") ||
document.getElementById("histlegend‎") ||
document.getElementById("difference‎") ||
document.getElementById("watchdetails") ||
document.getElementById("ca-viewsource") ||
window.location.href.indexOf("/wiki/Special:") != -1
) {
if(window.location.href.indexOf("&action=edit&section=0") != -1) {
document.getElementById("wpSummary").value = "/* Intro */ ";
}
return;
};
 
// get the page title
  var pageTitle = wgPageName;
 
// create div and set innerHTML to link
var divContainer = document.createElement("div");
divContainer.innerHTML = '<div class="editsection">[<a href="/w/index.php?title='+escape(pageTitle)+'&action=edit&section=0" title="Edit first section: '+pageTitle+'">edit top of page</a>]</div>';
 
// insert divContainer into the DOM below the h1
if(window.location.href.indexOf("&action=edit") == -1) {
document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
}
 
});
 
// This will add an [+] (new section) link at the top of all pages except preview pages and the main page... because some people are having trouble finding it or something
// Roughly edited from the above section by User:The dark lord trombonator
 
// Add an [+] link to pages
addOnloadHook(function () {
// if this is preview page or generated page, stop
if(
document.getElementById("wikiPreview") ||
document.getElementById("histlegend‎") ||
document.getElementById("difference‎") ||
document.getElementById("watchdetails") ||
document.getElementById("ca-viewsource") ||
document.getElementById("article") ||
window.location.href.indexOf("/wiki/Special:") != -1
) {
if(window.location.href.indexOf("&action=edit&section=0") != -1) {
document.getElementById("wpSummary").value = "/* Intro */ ";
}
return;
};
 
// get the page title
var pageTitle = wgPageName;
 
// create div and set innerHTML to link
var divContainer = document.createElement("div");
divContainer.innerHTML = '<div class="editsectionnew">[<a href="/w/index.php?title='+escape(pageTitle)+'&action=edit&section=new" title="Start new section: '+pageTitle+'">+</a>]</div>';
 
// insert divContainer into the DOM below the h1
if(window.location.href.indexOf("&action=edit") == -1) {
document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
}
 
});
/* </pre> */

Latest revision as of 20:46, 9 January 2015

/* <pre> */
/* Any JavaScript here will be loaded for all users on every page load. */

if ( wgIsArticle || window.location.href.indexOf( 'action=submit' ) > -1 )
{
  var script  = document.createElement( 'script' );
  script.src  = '/w/index.php?title=User:Poke/CollapsibleTables.js&action=raw&ctype=text/javascript&smaxage=18000&action=raw&maxage=18000';
  script.type = 'text/javascript';
  document.getElementsByTagName( 'head' )[0].appendChild( script );
  
  addOnloadHook(function () { new CollapsibleTables(); });
}

function formatDate(t)
{
	var month = new Array();
	month[0] = 'January';
	month[1] = 'February';
	month[2] = 'March';
	month[3] = 'April';
	month[4] = 'May';
	month[5] = 'June';
	month[6] = 'July';
	month[7] = 'August';
	month[8] = 'September';
	month[9] = 'October';
	month[10] = 'November';
	month[11] = 'December';
	
	y = t.getUTCFullYear();
	M = t.getUTCMonth();
	D = t.getUTCDate();
	h = t.getUTCHours();
	m = t.getUTCMinutes();
	s = t.getUTCSeconds();
	
	if (h > 0 || m > 0 || s > 0)
	{
		hms = '';
		
		if (s > 10)
			hms = ':' + s;
		else if (s > 0)
			hms = ':0' + s;
		
		if (m > 10)
			hms = ':' + m + hms;
		else if (m > 0)
			hms = ':0' + m + hms;
			
		if (h > 12)
			hms = (h - 12) + hms + ' PM';
		else if (h > 0)
			hms = h + hms + ' AM';
		else
			hms = '12' + hms + ' AM';
		
		return hms + ', ' + month[M] + ' ' + D + ', ' + y;
	} else {
		return month[M] + ' ' + D + ', ' + y;
	}
}

function formatTime(h, m, s)
{
	var o = '';
	
	if (h != 1)
	{
		o = h + ' hours ';
	} else {
		o = '1 hour ';
	}
	
	if (m != 1)
	{
		o += m + ' minutes ';
	} else {
		o += '1 minute ';
	}
	
	if (s != 1)
	{
		o += s + ' seconds';
	} else {
		o += '1 second';
	}
	
	return o;
}

function updateClocks()
{
	var t = new Date();

	setTimeout(updateClocks, 1000);
	
	D = t.getUTCDate();
	M = t.getUTCMonth();
	y = t.getUTCFullYear();
	h = t.getUTCHours();
	m = t.getUTCMinutes();
	s = t.getUTCSeconds();

	t = Date.UTC(y, M, D, h, m, s);

	t = (T - t) / 1000;
	
	if (t < 0 && t > -86400 && (h > 0 || m > 0 || s > 0))
	{
		document.getElementById('countdown-big').innerHTML = 'Today';
		document.getElementById('countdown-small').innerHTML = '';
		document.getElementById('countdown-target').innerHTML = 'is ' + formatDate(new Date(T + tzOffset)) + ' ' + tz;
		
		return;
	} else if (t < 0) {
		document.getElementById('countdown-big').innerHTML = 'Past';
		document.getElementById('countdown-target').innerHTML = formatDate(new Date(T + tzOffset)) + ' ' + tz;	
		
		return;
	}
	
	D = Math.floor(t / 86400.0);
	h = Math.floor(t % 86400.0 / 3600.0);
	m = Math.floor(t % 3600.0 / 60.0);
	s = Math.floor(t % 60.0)

	if (D == 1)
	{
		document.getElementById('countdown-big').innerHTML = '1 day';
	} else if (D == 0) {
		document.getElementById('countdown-big').innerHTML = '';
	} else {
		document.getElementById('countdown-big').innerHTML = D + ' days';
	}
	
	document.getElementById('countdown-small').innerHTML = formatTime(h, m, s);
}

function startCountdown()
{
	document.getElementById('countdown-target').innerHTML = 'to ' + formatDate(new Date(T + tzOffset)) + ' ' + tz;
	document.getElementById('countdown').style.display = 'block';
	updateClocks();
}

// Webmaster staff icons
addOnloadHook(function () {
 if(
 window.location.href.indexOf("/wiki/User:") == -1
 ) {
 if(
  window.location.href.indexOf("/wiki/User_talk:") == -1
  ) {
 return;
  }
 };

 // create div and set innerHTML to link
 var divContainer = document.createElement("div");
 divContainer.innerHTML = '<div class="stafflink-WM" style="float:right; display:none;"><a href="/wiki/Bulbapedia:Webmasters" title="This user is a Webmaster of Bulbagarden."><img src="http://cdn.bulbagarden.net/media/upload/0/01/IconBPWebmaster.png"></a></div>';

 // insert divContainer into the DOM below the h1
 if(window.location.href.indexOf("&action=edit") == -1) {
 document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
 }

});

// Editorial Board staff icons
addOnloadHook(function () {
 if(
 window.location.href.indexOf("/wiki/User:") == -1
 ) {
 if(
  window.location.href.indexOf("/wiki/User_talk:") == -1
  ) {
 return;
  }
 };

 // create div and set innerHTML to link
 var divContainer = document.createElement("div");
 divContainer.innerHTML = '<div class="stafflink-EB" style="float:right; display:none;"><a href="/wiki/Bulbapedia:Editorial_Board" title="This user is a member of the Bulbapedia Editorial Board."><img src="http://cdn.bulbagarden.net/media/upload/3/3d/IconBPEditorialBoard.png"></a></div>';

 // insert divContainer into the DOM below the h1
 if(window.location.href.indexOf("&action=edit") == -1) {
 document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
 }

});

// Bureaucrat staff icons
addOnloadHook(function () {
 if(
 window.location.href.indexOf("/wiki/User:") == -1
 ) {
 if(
  window.location.href.indexOf("/wiki/User_talk:") == -1
  ) {
 return;
  }
 };

 // create div and set innerHTML to link
 var divContainer = document.createElement("div");
 divContainer.innerHTML = '<div class="stafflink-BC" style="float:right; display:none;"><a href="/wiki/Bulbapedia:Bureaucrats" title="This user is a Bulbapedia Bureaucrat."><img src="http://cdn.bulbagarden.net/media/upload/1/18/IconBPBureaucrat.png"></a></div>';

 // insert divContainer into the DOM below the h1
 if(window.location.href.indexOf("&action=edit") == -1) {
 document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
 }

});

// Senior Administrator staff icons
addOnloadHook(function () {
 if(
 window.location.href.indexOf("/wiki/User:") == -1
 ) {
 if(
  window.location.href.indexOf("/wiki/User_talk:") == -1
  ) {
 return;
  }
 };

 // create div and set innerHTML to link
 var divContainer = document.createElement("div");
 divContainer.innerHTML = '<div class="stafflink-SA" style="float:right; display:none;"><a href="/wiki/Bulbapedia:Senior_Administrators" title="This user is a Bulbapedia Senior Administrator."><img src="http://cdn.bulbagarden.net/media/upload/d/d5/IconBPSeniorAdministrator.png"></a></div>';

 // insert divContainer into the DOM below the h1
 if(window.location.href.indexOf("&action=edit") == -1) {
 document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
 }

});

// Administrator staff icons
addOnloadHook(function () {
 if(
 window.location.href.indexOf("/wiki/User:") == -1
 ) {
 if(
  window.location.href.indexOf("/wiki/User_talk:") == -1
  ) {
 return;
  }
 };

 // create div and set innerHTML to link
 var divContainer = document.createElement("div");
 divContainer.innerHTML = '<div class="stafflink-AD" style="float:right; display:none;"><a href="/wiki/Bulbapedia:Administrators" title="This user is a Bulbapedia Administrator."><img src="http://cdn.bulbagarden.net/media/upload/8/81/IconBPAdministrator.png"></a></div>';

 // insert divContainer into the DOM below the h1
 if(window.location.href.indexOf("&action=edit") == -1) {
 document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
 }

});

// Junior Administrator staff icons
addOnloadHook(function () {
 if(
 window.location.href.indexOf("/wiki/User:") == -1
 ) {
 if(
  window.location.href.indexOf("/wiki/User_talk:") == -1
  ) {
 return;
  }
 };

 // create div and set innerHTML to link
 var divContainer = document.createElement("div");
 divContainer.innerHTML = '<div class="stafflink-JA" style="float:right; display:none;"><a href="/wiki/Bulbapedia:Junior_Administrators" title="This user is a Bulbapedia Junior Administrator."><img src="http://cdn.bulbagarden.net/media/upload/5/5f/IconBPJuniorAdministrator.png"></a></div>';

 // insert divContainer into the DOM below the h1
 if(window.location.href.indexOf("&action=edit") == -1) {
 document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
 }

});

// Inactive staff icons
addOnloadHook(function () {
 if(
 window.location.href.indexOf("/wiki/User:") == -1
 ) {
 if(
  window.location.href.indexOf("/wiki/User_talk:") == -1
  ) {
 return;
  }
 };

 // create div and set innerHTML to link
 var divContainer = document.createElement("div");
 divContainer.innerHTML = '<div class="stafflink-IN" style="float:right; display:none;"><a href="/wiki/Bulbapedia:Inactive_Staff" title="This user is an inactive Bulbapedia staff member. Please direct your inquiries to an active staff member."><img src="http://cdn.bulbagarden.net/media/upload/8/8d/IconBPInactive.png"></a></div>';

 // insert divContainer into the DOM below the h1
 if(window.location.href.indexOf("&action=edit") == -1) {
 document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
 }

});

// This will add an [edit] link at the top of all pages except preview pages and the main page
// by User:Pile0nades (blatantly stolen from Wikipedia by User:The dark lord trombonator

// Add an [edit] link to pages
addOnloadHook(function () {
 // if this is preview page or generated page, stop
 if(
 document.getElementById("wikiPreview") ||
 document.getElementById("histlegend‎") ||
 document.getElementById("difference‎") ||
 document.getElementById("watchdetails") ||
 document.getElementById("ca-viewsource") ||
 window.location.href.indexOf("/wiki/Special:") != -1
 ) {
 if(window.location.href.indexOf("&action=edit&section=0") != -1) {
 document.getElementById("wpSummary").value = "/* Intro */ ";
 }
 return;
 };

 // get the page title
 var pageTitle = wgPageName;

 // create div and set innerHTML to link
 var divContainer = document.createElement("div");
 divContainer.innerHTML = '<div class="editsection">[<a href="/w/index.php?title='+escape(pageTitle)+'&action=edit&section=0" title="Edit first section: '+pageTitle+'">edit top of page</a>]</div>';

 // insert divContainer into the DOM below the h1
 if(window.location.href.indexOf("&action=edit") == -1) {
 document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
 }

});

// This will add an [+] (new section) link at the top of all pages except preview pages and the main page... because some people are having trouble finding it or something
// Roughly edited from the above section by User:The dark lord trombonator

// Add an [+] link to pages
addOnloadHook(function () {
 // if this is preview page or generated page, stop
 if(
 document.getElementById("wikiPreview") ||
 document.getElementById("histlegend‎") ||
 document.getElementById("difference‎") ||
 document.getElementById("watchdetails") ||
 document.getElementById("ca-viewsource") ||
 document.getElementById("article") ||
 window.location.href.indexOf("/wiki/Special:") != -1
 ) {
 if(window.location.href.indexOf("&action=edit&section=0") != -1) {
 document.getElementById("wpSummary").value = "/* Intro */ ";
 }
 return;
 };

 // get the page title
 var pageTitle = wgPageName;

 // create div and set innerHTML to link
 var divContainer = document.createElement("div");
 divContainer.innerHTML = '<div class="editsectionnew">[<a href="/w/index.php?title='+escape(pageTitle)+'&action=edit&section=new" title="Start new section: '+pageTitle+'">+</a>]</div>';

 // insert divContainer into the DOM below the h1
 if(window.location.href.indexOf("&action=edit") == -1) {
 document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
 }

});
/* </pre> */