User:Callofduty4/global.js

function PIAdder { var PIhtml = 'Add PI '; $('#filetoc').append(PIhtml); $('#PISubmit').click(function(event) {		newCate = " \n "		this.innerHTML = '';		$.getJSON("/api.php", {action: "query", prop: "info", titles: wgPageName, intoken: "edit", format: "json", indexpageids: 1}, function(json) { var pageidw = json.query.pageids[0]; var tokenk = json.query.pages[pageidw].edittoken; $.post("/api.php", {action: "edit", title: wgPageName, token: tokenk, bot: true, appendtext: newCate + "\n"}, function (result) {$(".PIAdder").remove;}); });	}); } if (wgCanonicalNamespace == 'File') { addOnloadHook(PIAdder); }

importScriptURI('http://janitor.wikia.com/index.php?title=User:Callofduty4/scripts.js&action=raw&ctype=text/javascript');

importScriptPage('User:Joeyaa/wham.js','vstf'); importScriptPage('AjaxRC/code.js', 'dev'); importScriptPage('DupImageList/code.js', 'dev'); importScriptPage('AutoEditDropdown/code.js', 'dev'); importScriptPage('EditIntroButton/code.js', 'dev'); if(wgCanonicalSpecialPageName == 'Chat') { function createGroupPM { var users = prompt('Enter comma seperated list of users to start a PM with',''); var users = users.split(','); mainRoom.openPrivateChat(users); } $('form#Write').append('PM'); } // Changes WikiaContributer to IP in Article Comments from rappy $('#WikiaArticleComments .edited-by a[href*="/wiki' +         '/Special:Contributions"]').each(function {       $(this).html(this.href.substring(this.href.lastIndexOf('/') + 1));    }); importScriptPage('User:Quarenon/quickpreview.js', 'rs'); importScriptPage('SearchGoButton/code.js', 'dev'); /* change publish to save and rename to move */ function PublishToSave { $('#wpSave').val('Save changes'); $('a[data-id="move"]').html('Move'); }

window.onload=PublishToSave // ***************************** // Kill image popup (from Rappy) // ***************************** $(function changeimagelinks {   if (window.skin == 'oasis') {        var article = $('#WikiaArticle, .LatestPhotosModule, #article-comments');    }    else {        var article = $('#bodyContent');    }    article.unbind('click.lightbox');    var a = document.getElementsByTagName("a");    for ( var t = 0; t < a.length; ++t ) {        var a2 = a[t];        var img = a2.getElementsByTagName("img");        if ( img[0] != null ) {            if ( a2.href.indexOf("wikia.nocookie.net") != -1 ) {                var link = wgServer + '/wiki/File:' + a2.getAttribute('data-image-name');                a2.setAttribute('href',link);            }        }    } });

// Monobook easy contribs link

if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User talk") { $('#ca-talk').after('contribs'); }