User:Ruud Koot/developer.js

importScript( "User:Ruud Koot/scripts/common.js" ); importScript( "User:Ruud Koot/scripts/dominspector.js" ); addOnloadHook( addPurgeTool ); addOnloadHook( addRawTextTool ); addOnloadHook( addValidatorTool ); addOnloadHook( addDOMInspectionTool ); addOnloadHook( addCookieInspectionTool ); function addPurgeTool { addLinkToToolbox( "Purge cache", "t-purge", mw.config.get('wgServer') + mw.config.get('wgScriptPath') + "/index.php?title=" + wgPageName + "&action=purge" ); } function addRawTextTool { addLinkToToolbox( "Display raw text", "t-rawtext", mw.config.get('wgServer') + mw.config.get('wgScriptPath') + "/index.php?title=" + wgPageName + "&action=raw" ); }

function addValidatorTool { addLinkToToolbox( "Validate HTML", "t-validate", "http://validator.w3.org/check?uri=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FHungary&charset=%28detect+automatically%29&doctype=Inline&verbose=1" ); }

function addDOMInspectionTool { addItemToToolbox( "Inspect DOM", "t-inspectdom", "inspectDOM" ); }

function addCookieInspectionTool { addItemToToolbox( "Inspect cookie", "t-inspectcookie", "inspectCookie" ); }

function inspectCookie { alert( document.cookie ); }