User:Zzo38/cologneblue.js

(function{

window.onerror=function{}; //document.removeEventListener=document.__proto__.removeEventListener; //window.removeEventListener=window.__proto__.removeEventListener; _paq={push:function(x){throw "ERROR";}}; var GotoPage=document.createElement("a"); GotoPage.onclick=function(e){ var x; e.preventDefault; x=prompt("Goto?",mw.config.get('wgPageName')); if(x) window.location=mw.util.getUrl(x); }; GotoPage.accessKey="g"; document.body.appendChild(GotoPage); //NREUM.noticeError=function{}; //NREUM.info={}; //NREUM={}; window.NREUM={};

if(document.body.classList.contains("ns-talk")) { var SendPage=document.createElement("a"); SendPage.onclick=function(e){ var p=document.evaluate("//div[contains(@class,'flow-ui-editorWidget-focused')]//span[contains(@class,'saveButton')]/a",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null); if(p.snapshotLength) p.snapshotItem(0).click; }; SendPage.accessKey="s"; document.body.appendChild(SendPage); var PreviewBox=document.createElement("div"); PreviewBox.setAttribute("class","TalkPreviewBox"); var PreviewKey=document.createElement("a"); var IsPreviewing=false; var api; PreviewKey.onclick=function(e){ if(IsPreviewing) { PreviewBox.parentElement.removeChild(PreviewBox); IsPreviewing=false; } else { var p=document.evaluate("//div[contains(@class,'flow-ui-editorWidget-focused')]//textarea[@class='oo-ui-inputWidget-input oo-ui-textInputWidget-autosized']",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null); if(p.snapshotLength) { var w=p.snapshotItem(0); PreviewBox.innerHTML="(Loading...)"; w.parentElement.appendChild(PreviewBox); api=new mw.Api; api.post({         action: "parse",          text: w.value,          prop: "text",          disableeditsection: true,          preview: true,          contentmodel: "wikitext",        }).done(function(d){          PreviewBox.innerHTML=d.parse.text["*"];        }); IsPreviewing=true; }   }  };  PreviewKey.accessKey="p"; document.body.appendChild(PreviewKey); }

});