Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/* * Documentation: This script adds a link to the personal tools * with information about the latest Help desk post. * Clicking the tab will show the latest Help desk diff. * * * This script is based on the script * * http://no.wikipedia.org/wiki/MediaWiki:Gadget-HurtigSlett.js * * In this script, the query string and links are modified to check the Help desk revision info. * In the function names, 'qd' is replaced with 'helpdesk'. * * An unused function (function displayQuickDelete()) is removed from this script. * *//* Memo to self, den som skal sjekkes mot er denne *//* http://no.wikipedia.org/w/api.php?action=query&list=categorymembers&cmtitle=Kategori:Sider%20som%20er%20foresl%E5tt%20raskt%20slettet&format=xml *//* Vi har to mulige valg å legge denne på: *//* <div id="p-cactions" class="portlet"> <-- Brukerside, diskusjon, overvåk, etc. *//* <div class="portlet" id="p-personal"> <-- Brukernavn, min diskusjonsside, innstillinger, etc. *//* (function displayQuickDelete() removed) *//* init ajax */functionhelpdesk_create_request(){try{helpdesk_http=newXMLHttpRequest();}catch(e){try{helpdesk_http=newActiveXObject("Msxml2.XMLHTTP");}catch(e){try{helpdesk_http=newActiveXObject("Microsoft.XMLHTTP");}catch(e){alert("Your browser does not support AJAX!");returnfalse;}}}helpdesk_http.onreadystatechange=function(){if(helpdesk_http.readyState==4)helpdesk_ajax_response();}returntrue;}/* make a request */functionhelpdesk_ajax_request(){varapi_link=mw.config.get('wgServer')+mw.config.get('wgScriptPath')+'/api.php?action=query&prop=revisions&titles=Wikipedia:Help%20desk&format=xml';if(helpdesk_create_request()==false){return;}// Then make the requesthelpdesk_http.open("GET",api_link,true);helpdesk_http.send(null);}/* we have received a response */functionhelpdesk_ajax_response(){varrefresh_time=60;varlink=mw.config.get('wgServer')+mw.config.get('wgScript')+'?title=Wikipedia:Help_desk&diff=cur';varitems=helpdesk_http.responseXML.getElementsByTagName('rev')[0].getAttribute('comment');varuser=helpdesk_http.responseXML.getElementsByTagName('rev')[0].getAttribute('user');//items.length;varaNode=document.createElement('a');varliNode=document.createElement('li');aNode.appendChild(document.createTextNode('Latest Help desk post (by '+user+')'+(items.length>0?': ':'')+items));aNode.setAttribute('href',link);aNode.setAttribute('id','pt-helpdesk');liNode.appendChild(aNode);liNode.className='plainlinks';document.getElementById('p-personal').getElementsByTagName('ul')[0].insertBefore(liNode,document.getElementById('p-personal').getElementsByTagName('ul')[0].getElementsByTagName('li')[0]);/* Repeat *//* Actually, I think we should not repeat, check if it is updated on page refresh, and if that is enough */// setTimeout("helpdesk_ajax_request()", refresh_time * 1000);}$(helpdesk_ajax_request);