User:Bluefire2/cake.js

/* Cake button */

$(document).ready(function {	if(wgPageName == "Special:Chat") {		var b = document.createElement("button");		b.className += "wikia-button";		$(b).css({"position" : "absolute", "right" : "55px", "bottom" : "2px"});		b.innerHTML = "Cake";		$("#Write").append(b);		b.setAttribute("onclick", "cake");		/*b.on("focus", function { tmpStr = $('textarea[name=message]').val; $('textarea[name=message]').val(''); $('textarea[name=message]').val(tmpStr); });*/	} }); function cake { $('textarea[name=message]').val(function {		return this.value + "(chocolate cake)"	}); $('textarea[name=message]').focus; tmpStr = $('textarea[name=message]').val; $('textarea[name=message]').val(''); $('textarea[name=message]').val(tmpStr); var p = document.createElement("img"); p.setAttribute("src", "http://upload.wikimedia.org/wikipedia/commons/thumb/9/91/Pyramid.svg/100px-Pyramid.svg.png"); $("#Rail").append(p); }