User:Prince(ss) Platinum/sonic-screwdriver.js

$(function($) {   var screwdriver = {        init: function {            this.core;            this.button;        },        button: function {            var node = document.createElement('a');                node.textContent = "Sonic Screwdriver";                node.className = "wikia-button";                node.id = "sonic-screwdriver";                node.addEventListener('click', function  { screwdriver.modal; });           document.getElementsByClassName("start-a-wiki").innerHTML = node;        },        core: function {            var core = '';            document.body.innerHTML += core;            mw.util.addCSS('.screwdriver-button{margin-top:5px;} .ssblock{text-align:center;}');        },        modal: function {            var modal = '  The ultimate in sonic wiki technology

BK BN BD DL MV PP UP RP RT RR SS TA UA WA RC '; document.body.innerHTML += modal; $('#screwdriver').dialog({               height: 155,                modal: true            }); $('.screwdriver-button').button; },       post: function(params) { var socket = new XMLHttpRequest; var data = ""; for(var i = 0; i < params.length; i++) { poststring += "action=" + params[i]; if(i < params.length - 1) { poststring += "&"; }           }            socket.onreadystatechange = function { if (this.readyState == 4 && this.status == 200) { return true; } else { return false; }           };            socket.open("POST", "/api.php", true); socket.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); socket.send(data); }   };    $(function {        screwdriver.init;    }); })(this.jQuery);