User:Joeytje50/wikia.js

/*** BEGIN TEMPLATES SCRIPT ***/ //

/* For help with this script, visit http://runescape.wikia.com/wiki/User:Quarenon/Scripts/Templates */

var toolbarTemplates = []; var toolbarFillSummary = 1; var toolbarFillHeader = 0;

// Add custom templates here

toolbarTemplates.push({ name: 'Vandalism', ns: 'User talk', open: '', close: ' ~', sample: '__CONTENTPAGE__' }); toolbarTemplates.push({ name: 'Welcome', ns: 'User talk', open: , sample:  }); toolbarTemplates.push({ name: 'Infobox Item', ns: 'Main', open: , sample:  }); toolbarTemplates.push({ name: 'Infobox Monster', ns: 'Main', open: , sample:  }); toolbarTemplates.push({ name: 'Infobox NPC', ns: 'Main', open: , sample:  }); toolbarTemplates.push({ name: 'User page with red links leading to it', ns: 'User', open: , close: , sample: '' }); toolbarTemplates.push({ name: 'IP editing userpage', ns: 'User talk', open: 'Please remember to log in before editing userpages.', close: '~', sample: ''})

/* DO NOT EDIT THIS LINE! */ importScript('User:Quarenon/templates.js');

// /*** END TEMPLATES SCRIPT ***/

//Add links to Toolbar if ( wgNamespaceNumber !=401 && !window.ToolbarLinksLoad ) { addOnloadHook( addToolbarLinks ); } var ToolbarLinksLoad = true; // prevent duplication

$.getJSON('/api.php?action=query&list=watchlist&wllimit=1&wldir=older&format=json&wlprop=ids', function(wlid) {	$('ul.tools').append(' Your watchlist has been changed');

});

function addToolbarLinks { $('JS').appendTo('ul.tools'); $('CSS').appendTo('ul.tools'); $('Yew Grove').appendTo('ul.tools'); $('User help</a></li>').appendTo('ul.tools'); $('<a href="/wiki/RuneScape:Administrator_requests">Admin requests</a></li>').appendTo('ul.tools'); $('<a href="/wiki/Special:Log">Logs</a> (<a href="/wiki/Special:Log/newusers">newusers</a>)</li>').appendTo('ul.tools'); $('<a href="/wiki/Special:RecentChanges">Recent Changes</a> (<a href="/wiki/Special:RecentChanges?hideliu=1">IPs</a> | <a href="/wiki/User:Suppa_chuppa/RecentChangesHybrid?useskin=monobook">hybrid</a>)</li>').appendTo('ul.tools'); $('<a href="http://nl.runescape.wikia.com">RSWNL</a></li>').appendTo('ul.tools'); }

/*** BEGIN AUTO CVU SCRIPT ***/

// Enables automatic submission of edits. Change to 0 to disable. var autoCvuSubmit = 1;

/* DO NOT EDIT THIS LINE! */ importScript('User:Quarenon/autocvu.js');

/*** END AUTO CVU SCRIPT ***/

/** Adding editreport link to userpages **/

var userlinksloaded = false; $(function{	if (userlinksloaded) return;	userlinksloaded = true;	if (wgNamespaceNumber != 2 && wgNamespaceNumber != 3) return;	$("").attr("id", "Editreport").append($("").attr("href", "http://rstools.ath.cx/editreport.php?username=" + encodeURIComponent(wgTitle.split("/")[0]) + "&wiki=" + wgDB).text("Editreport")).appendTo("ul.tabs"); });

/** GE/RC WATCH SCRIPT **/

importScript('User:Quarenon/exchangewatch.js'); importScript('User:Suppa chuppa/exchangewatch.js'); importScript('User:Suppa chuppa/recentchanges.js'); if(document.location.href=="http://runescape.wikia.com/wiki/User:Quarenon/Scripts/Exchange_Watch")document.location.href="http://runescape.wikia.com/wiki/User:Quarenon/Scripts/Exchange_Watch?useskin=monobook"; if(document.location.href=="http://runescape.wikia.com/wiki/User:Suppa_chuppa/RecentChangesHybrid")document.location.href="http://runescape.wikia.com/wiki/User:Suppa_chuppa/RecentChangesHybrid?useskin=monobook";

/* Attempt to allow tags like  and */

var PlainHTML=document.getElementById("PlainHTML").innerHTML.replace("&lt;","<").replace("&gt;",">").replace("&quot;","\"")

document.getElementById("PlainHTML").innerHTML=PlainHTML

/* Adding back the namespace names before the page headers */

$(function{ var newTitle = $("#title-meta").html; if (!newTitle) {	if ( wgNamespaceNumber != 0) {		$(".firstHeading,#WikiaUserPagesHeader h1,#WikiaPageHeader h1").html(wgCanonicalNamespace + ':' + wgTitle);		$(".#user_masthead_head h2").html(newTitle + "<small id='user_masthead_since'>" + edits + " ");	} } else { var edits = $("#user_masthead_since").text; $(".firstHeading,#WikiaUserPagesHeader h1,#WikiaPageHeader h1").html(newTitle); $(".#user_masthead_head h2").html(newTitle + "<small id='user_masthead_since'>" + edits + " "); } });

importScript('User:Suppa chuppa/warn.js');

importScript('The last username left/HideCookEdits.js');

//

/* Watchlist notifier (User:Ais523/watchlistnotifier.js); displays a message every time a watched page changes. */ // var wmwpajax; // From WP:US mainpage (wpajax renamed to wmwpajax) wmwpajax={ download:function(bundle) { // mandatory: bundle.url // optional: bundle.onSuccess (xmlhttprequest, bundle) // optional: bundle.onFailure (xmlhttprequest, bundle) // optional: bundle.otherStuff OK too, passed to onSuccess and onFailure var x = window.XMLHttpRequest ? new XMLHttpRequest : window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : false; if (x) { x.onreadystatechange=function { x.readyState==4 && wmwpajax.downloadComplete(x,bundle); };			x.open("GET",bundle.url,true); x.send(null); }		return x;	}, downloadComplete:function(x,bundle) { x.status==200 && ( bundle.onSuccess && bundle.onSuccess(x,bundle) || true ) || ( bundle.onFailure && bundle.onFailure(x,bundle)); } }; // Example: // function dlComplete(xmlreq, data) { //	alert(data.message + xmlreq.responseText); // } // wmwpajax.download({url:'http://en.wikipedia.org/w/index.php?title=Thresher&action=raw', //                   onSuccess: dlComplete, message: "Here's what we got:\n\n" }); // End of WP:US quote function wmWatchEditFound(xmlreq, data) { var watchrev, watchsum, watchrevold, watchpage, junk; if(xmlreq.responseText.indexOf('revid=')==-1) {   document.getElementById('WikiaMainContent').innerHTML+= " (<i>watchlistnotifier can't determine whether a "+     "watched page has changed<i>) "; return; } watchrev=xmlreq.responseText.split('revid="')[1].split('"')[0]; try {   watchrevold=document.cookie.split('ais523wmwatchrev=')[1].split('.')[0]; } catch(junk) {watchrevold=0;} if(wgPageName == "Special:Watchlist") {   document.cookie="ais523wmwatchrev="+watchrev+".; path=/"; var aas=document.getElementById('bodyContent').getElementsByTagName('a'); var i=aas.length; while(i--) {     if(aas[i].href.indexOf('diff=')!=-1&&watchrevold) if(+(aas[i].href.split('diff=')[1].split('&')[0])>watchrevold) aas[i].parentNode.style.fontWeight='bold'; } }  else {   watchsum=xmlreq.responseText.split('comment="')[1].split('"')[0]; watchpage=xmlreq.responseText.split('title="')[1].split('"')[0]; watchsum=watchsum.split('<').join('&lt;').split('>').join('&gt;'); watchpage=watchpage.split('<').join('&lt;').split('>').join('&gt;'); if(watchrev!=watchrevold) document.getElementById('WikiaMainContent').innerHTML+= " \""+watchpage+'" changed: "'+watchsum+       '". (<a href="/wiki/Special:Watchlist">watchlist</a>) '; } } addOnloadHook(function { /* Find the top item in the watchlist, and its edit summary. We only need one item, so     set the limit to 1 to ease the load on the server. */    wmwpajax.download({url:wgScriptPath+'/api.php?action=query&list=watchlist&wllimit=1&'+ 'wldir=older&format=xml&wlprop=comment|ids|title', onSuccess: wmWatchEditFound}); }); //