User:Callofduty4/wikia.js

var buttonLayout = true;

function FileTemplateAdder { if (buttonLayout == false) { var options = { '': '.JPG', '': 'Needs trans', '': 'Poor quality' };		var optstr = ''; for(i in options) { optstr += '' + options[i] + ' '; } 		var html = '' + optstr + ' Add template'; $('#filetoc').append(html); $('#aSubmit').click(function(event) {			this.innerHTML = '';			$.getJSON("/api.php", {action: "query", prop: "info", titles: wgPageName, intoken: "edit", format: "json", indexpageids: 1}, function(json) { var pageid = json.query.pageids[0]; var tk = json.query.pages[pageid].edittoken; $.post("/api.php", {action: "edit", title: wgPageName, token: tk, prependtext: $('#FileTemplateAdder').val + "\n"}, function (result) {$(".TemplateAdder").remove;}); });		});	}	if (buttonLayout) { var template = ''; var html = 'JPEG Trans Imagequality '; $('#filetoc').append(html); $('#submitOne').click(function(event) {			this.innerHTML = '';			$.getJSON("/api.php", {action: "query", prop: "info", titles: wgPageName, intoken: "edit", format: "json", indexpageids: 1}, function(json) { var pageid = json.query.pageids[0]; var tk = json.query.pages[pageid].edittoken; $.post("/api.php", {action: "edit", title: wgPageName, token: tk, prependtext: $('#submitOne').val + "\n"}, function (result) {$(".TemplateAdder").remove;}); });		});		$('#submitTwo').click(function(event) {			this.innerHTML = '';			$.getJSON("/api.php", {action: "query", prop: "info", titles: wgPageName, intoken: "edit", format: "json", indexpageids: 1}, function(json) { var pageid = json.query.pageids[0]; var tk = json.query.pages[pageid].edittoken; $.post("/api.php", {action: "edit", title: wgPageName, token: tk, prependtext: $('#submitTwo').val + "\n"}, function (result) {$(".TemplateAdder").remove;}); });		});		$('#submitThree').click(function(event) {			this.innerHTML = '';			$.getJSON("/api.php", {action: "query", prop: "info", titles: wgPageName, intoken: "edit", format: "json", indexpageids: 1}, function(json) { var pageid = json.query.pageids[0]; var tk = json.query.pages[pageid].edittoken; $.post("/api.php", {action: "edit", title: wgPageName, token: tk, prependtext: $('#submitThree').val + "\n"}, function (result) {$(".TemplateAdder").remove;}); });		});	} }

if (wgCanonicalNamespace == 'File') { addOnloadHook(FileTemplateAdder); }

var category = "Call of Duty: Modern Warfare 3 Title images"

function CategoryAdder { var cathtml = '' + category + ''; $('#filetoc').append(cathtml); $('#categorySubmit').click(function(event) {		this.innerHTML = '<img src="http://images2.wikia.nocookie.net/dev/images/8/82/Facebook_throbber.gif" style="vertical-align: baseline;" border="0" />';		$.getJSON("/api.php", {action: "query", prop: "info", titles: wgPageName, intoken: "edit", format: "json", indexpageids: 1}, function(json) { var pageid = json.query.pageids[0]; var tk = json.query.pages[pageid].edittoken; $.post("/api.php", {action: "edit", title: wgPageName, token: tk, appendtext: "" + "\n"}, function (result) {$(".CategoryAdder").remove;}); });		}); }

if (wgCanonicalNamespace == 'File') { addOnloadHook(CategoryAdder); }

function kickUserButton { var kickuser = prompt('Enter Username here','User'); if (kickuser.length != 0) { mainRoom.kick({name:kickuser}); } } $('<div onclick="kickUserButton" style="left:50%; margin-left:2px;margin-right:2px; display:inline; text-align: center; cursor: pointer;" align="center">Kick</a> ').prependTo('.Rail');