User:Killr833/achwall.js

/** * achwall.js * * Add a link to the toolbox that goes to your FunOrb achievement * wall. Logging in is required. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * * This script is a modification of Quarenon's purge.js and ezhiscores.js.

if (wgAction == 'view' && wgCanonicalNamespace != 'Special') { $(document).ready(function {		var list = null;

if (skin == 'monobook') { list = document.getElementById('p-tb').getElementsByTagName('ul')[0]; } else { var lists = document.getElementById('link_box').getElementsByTagName('ul'); if (lists[0].getElementsByTagName('li').length <= lists[1].getElementsByTagName('li').length) { list = lists[0]; } else { list = lists[1]; }		}

var li = document.createElement('li'); var a = document.createElement('a'); /* Add the external link icon */ $(a).css({'background': 'url(http://images.wikia.com/common/skins/monobook/external.png) center right no-repeat', 'padding-right': '13px'}); /* Fetch jagexPlayerName and find correct log */ a.href = 'http://achievements.funorb.com/wall.ws?game=-1&award=0&expand=-1&filter_members=false&filter_points=0&username=' + jagexPlayerName + '&game=-1&award=0&page2=1' /* Create the link */ a.appendChild(document.createTextNode('Achievement wall')); /* Create the tooltip for the link */ a.title = 'Your FunOrb achievement wall. When you click this link you will be prompted to log in.'; /* Place link at top of toolbox */ li.appendChild(a); list.insertBefore(li, list.firstChild); }); }