Utente:Melos/monobookadmin.js

Da Wikizionario, il dizionario a contenuto aperto.

Nota: dopo aver pubblicato, potrebbe essere necessario pulire la cache del proprio browser per vedere i cambiamenti.

  • Firefox / Safari: tieni premuto il tasto delle maiuscole Shift e fai clic su Ricarica, oppure premi Ctrl-F5 o Ctrl-R (⌘-R su Mac)
  • Google Chrome: premi Ctrl-Shift-R (⌘-Shift-R su un Mac)
  • Internet Explorer / Edge: tieni premuto il tasto Ctrl e fai clic su Aggiorna, oppure premi Ctrl-F5
  • Opera: premi Ctrl-F5.
// SCRIPT PER IL REVERT DI [[wikipedia:user:Lorian|Lorian]] TRADOTTO E RIADATTATO [[utente:wim b|Wim b]]
// Revert tools by Lorian<br />
//Riadattato per gli admin di wiktionary da [[utente:Wim_b|Wim b]]<br />
// VERSIONE PER ADMIN
//<pre><nowiki>
//FUNZIONI RISERVATE AI SYSOP 
//Grazie  [[w:utente:Salvatore_Ingala]]
function isSysop(){
  if (wgUserGroups)
    for(var i = 0; i < wgUserGroups.length; i++)
      if (wgUserGroups[i] == "sysop")
        return true;
  return false;
}

function getElementsByClass(searchClass,node,tag) {
  // Function from http://www.dustindiaz.com/getelementsbyclass/
  var classElements = new Array();
  if ( node == null )
    node = document;
  if ( tag == null )
    tag = '*';
  var els = node.getElementsByTagName(tag);
  var elsLen = els.length;
  var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
  for (i = 0, j = 0; i < elsLen; i++) {
    if ( pattern.test(els[i].className) ) {
      classElements[j] = els[i];
      j++;
    }
  }
  return classElements;
}

// _GET code from NoGray JS Library http://www.nogray.com/new_site/
var _GET = new Array();
var _uri = location.href;

var _temp_get_arr = _uri.substring(_uri.indexOf('?')+1, _uri.length).split("&");

var _temp_get_arr_1 = new Array();

for(_get_arr_i=0; _get_arr_i<_temp_get_arr.length; _get_arr_i++){
  _temp_get_arr_1 = _temp_get_arr[_get_arr_i].split("=");
  _GET[decodeURI(_temp_get_arr_1[0])] = decodeURI(_temp_get_arr_1[1]);
}

delete _uri; delete _temp_get_arr; delete _temp_get_arr_1;

function getMessage (where, user1) {
  var message = prompt ('Scrivi un messaggio nella cronologia', '');
  window.location = 'http://it.wiktionary.org/w/index.php?title=' + _GET['title'] + '&action=edit&oldid=' + _GET['oldid'] + '&'+where+'=2&user1='+user1+'&message='+message;
}

$(function (){
  if (location.href.match(/diff=/)) {
    // Get username of submitter
    var user1 = getElementsByClass('diff-otitle',null,'td'); user1 = user1[0].getElementsByTagName('a')[2].innerHTML;
    var user2 = getElementsByClass('diff-ntitle',null,'td'); user2 = user2[0].getElementsByTagName('a')[3].innerHTML;
    
var t='(<a href="http://it.wiktionary.org/w/index.php?title=' + _GET['title'] + '&action=edit&oldid=' + _GET['oldid'] + '&revert=1&user1='+user1+'">Ripristina</a> / <a href="javascript:var message = getMessage(\'revert\', \''+user1+'\');">Messaggio</a>) (<a href="http://it.wiktionary.org/w/index.php?title=' + _GET['title'] + '&action=edit&oldid=' + _GET['oldid'] + '&vandalism=1&user1='+user1+'">Vandalismo</a> / <a href="javascript:var message = getMessage(\'revert\', \''+user1+'\');">Messaggio</a>) (Avvisi: <a href="http://it.wiktionary.org/w/index.php?title=User_talk:'+user1+'&action=edit&section=new&warn=1">Test</a> / <a href="http://it.wiktionary.org/w/index.php?title=User_talk:'+user1+'&action=edit&section=new&warn=2">Vandalismo</a> / <a href="http://it.wiktionary.org/w/index.php?title=User_talk:'+user1+'&action=edit&section=new&warn=3">Spam</a> / <a href="http://it.wiktionary.org/w/index.php?title=User_talk:'+user1+'&action=edit&section=new&warn=4">WNF</a> / <a href="http://it.wiktionary.org/w/index.php?title=User_talk:'+user1+'&action=edit&section=new&warn=5">WNB</a>/ <a href="http://it.wiktionary.org/w/index.php?title=User_talk:'+user1+'&action=edit&section=new&warn=6">IP Vandalismo</a>/ <a href="http://it.wiktionary.org/w/index.php?title=User_talk:'+user1+'&action=edit&section=new&warn=7">Yc</a>)';

var regIP = /([0-9]+\.){3}[0-9]+/;
var isIP = regIP.test(user2);
 
if (isSysop()) {
t += ' (Admin: <a href="http://it.wikibooks.org/wiki/Speciale:Blocca/'+user2+'">Blocca</a> / <a href="http://tools.wikimedia.de/~luxo/contributions/contributions.php?user='+user2+'&blocks=true&lang=it">Interedits</a> / <a href="http://it.wikibooks.org/w/index.php?title=Speciale%3ADeletedContributions&target='+user2+'">Contributi cancellati</a> / <a href="http://it.wikibooks.org/w/index.php?title=' + _GET['title'] + '&action=protect">Proteggi</a> / <a href="http://it.wikibooks.org/w/index.php?title=' + _GET['title'] + '&action=delete">Cancella</a> )';
if (isIP == true ) t += ' (IP: <a href="http://whois.domaintools.com/'+ user2 + '">Whois</a> / <a href="http://hemlock.ts.wikimedia.org/~krimpet/torcheck.php?ip='+user2+'">TOR</a>)';
}

document.getElementById('contentSub').innerHTML =t;
  } else if (location.href.match(/revert=1/)) {
    document.getElementById('wpSummary').value = 'Ripristinata la versione ' + _GET['oldid']+' di [[Special:Contributions/'+_GET['user1']+'|'+_GET['user1']+']]';
    document.getElementById('editform').submit();
  } else if (location.href.match(/revert=2/)) {
    document.getElementById('wpSummary').value = 'Ripristinata la versione ' + _GET['oldid']+' di [[Special:Contributions/'+_GET['user1']+'|'+_GET['user1']+']] ('+_GET['message']+')';
    document.getElementById('editform').submit();
  } else if (location.href.match(/vandalism=1/)) {
    document.getElementById('wpSummary').value = 'Ripristinata la versione ' + _GET['oldid']+' di [[Special:Contributions/'+_GET['user1']+'|'+_GET['user1']+']] per vandalismo';
    document.getElementById('editform').submit();
  } else if (location.href.match(/vandalism=2/)) {
    document.getElementById('wpSummary').value = 'Ripristinata la versione ' + _GET['oldid']+' di [[Special:Contributions/'+_GET['user1']+'|'+_GET['user1']+']] ('+_GET['message']+') per vandalismo';
    document.getElementById('editform').submit();
  } else if (location.href.match(/warn=1/)) {
    document.getElementById('wpSummary').value = 'Avviso test';
    document.getElementById('wpTextbox1').value = '{{test}} ~~'+'~~';
    document.getElementById('editform').submit();
  } else if (location.href.match(/warn=2/)) {
    document.getElementById('wpSummary').value = 'Avviso vandalismo';
    document.getElementById('wpTextbox1').value = '{{vandalismo}} ~~'+'~~';
    document.getElementById('editform').submit();
  } else if (location.href.match(/warn=3/)) {
    document.getElementById('wpSummary').value = 'spam';
    document.getElementById('wpTextbox1').value = '{{Spam}} ~~'+'~~';
    document.getElementById('editform').submit();
  } else if (location.href.match(/warn=4/)) {
    document.getElementById('wpSummary').value = 'WNF';
    document.getElementById('wpTextbox1').value = '{{WNF}} ~~'+'~~';
    document.getElementById('editform').submit();
  } else if (location.href.match(/warn=5/)) {
    document.getElementById('wpSummary').value = 'WNB';
    document.getElementById('wpTextbox1').value = '{{WNB}} ~~'+'~~';
    document.getElementById('editform').submit();
  } else if (location.href.match(/warn=6/)) {
    document.getElementById('wpSummary').value = 'IP Vandalismo';
    document.getElementById('wpTextbox1').value = '{{IP Vandalismo}} ~~'+'~~';
    document.getElementById('editform').submit();
  } else if (location.href.match(/warn=6/)) {
    document.getElementById('wpSummary').value = 'Yc';
    document.getElementById('wpTextbox1').value = '{{Yc|~~~~}}';
    document.getElementById('editform').submit();
  }
});

//SCRIPT VPOPSPEED
document.write('<script type="text/javascript" src="'
+ 'http://it.wikipedia.org/w/index.php?title=Utente:Henna/VPopSpeed.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

document.write('<script type="text/javascript" src="'
+ 'http://nl.wikipedia.org/w/index.php?title=Gebruiker:Valhallasw/hennading.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
/////////////////////////////////////////////////////////////////////////////////////////////

//ADD AN "INVERT" BUTTON IN UNDELETION PAGE (SOURCE: HTTP://EN.WIKIPEDIA.ORG/WIKI/USER:CRYPTIC/TOGGLEUNDELETE.JS)
  if ((toLoad.indexOf("adtog")!=-1))
function toggle_undelete()
{
  var f = document.getElementById("undelete");
  if (f)
    {
      var inputs = f.getElementsByTagName("input");
      var i;
      for (i = 0; i < inputs.length; ++i)
        if (inputs[i].type == "checkbox")
          inputs[i].checked = !inputs[i].checked;
    }
}

function setup_toggle_undelete()
{
  if (document.title.indexOf("Vedi e recupera pagine cancellate") == 0)
    {
      var f = document.getElementById("undelete");
      if (f)
        {
          var h2 = f.getElementsByTagName("h2")[0];
          if (h2)
            {
              var button = document.createElement('input');
              button.type = "button";
              button.value = "Inverti";
              button.setAttribute('onClick', 'toggle_undelete()');
              f.insertBefore(button, h2);
            }
        }
    }
}

$(setup_toggle_undelete);

/*
  * '''Restauration Deluxe'''
  *
  * COCHER/DÉCOCHER RAPIDEMENT LES CASES POUR RESTAURER UN ARTICLE
  *
  * Auteur : GôTô
  * Dernière révision : 11 mai 2007
  */

// Code :<source lang="javascript" line="">
  if ((toLoad.indexOf("adrus")!=-1))
function UndeleteSelectAll()
{
        if(wgCanonicalSpecialPageName != 'Undelete') return;
        var title2 = document.getElementsByTagName('h2');
        var all = document.createElement('input');
        all.setAttribute('type', 'checkbox');
        all.setAttribute('onclick', 'SelectAllInputs(this.checked)');
        all.setAttribute('title', 'Seleziona/deseleziona tutte');
        title2[title2.length-1].appendChild(all);
        all.click();
}

function SelectAllInputs(bool)
{
        var inputs = document.getElementById('undelete').getElementsByTagName('input');
        for (var cpt = 0 ; cpt < inputs.length ; cpt++)
        {
                inputs[cpt].checked = bool;
        }
}

$(UndeleteSelectAll);



//TAB PER GLI ADMIN-----------------------------------



if ((toLoad.indexOf("adlink")!=-1))
$(function (){
var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
addlimenu(tabs, '_.Admin', 'Sysop'); //puoi cambiare 'Utilità' in qualcos'altro, ma non cambiare 'Sysop'
var Sysop = document.getElementById('Sysop').getElementsByTagName('ul')[0];

//Una riga per ogni voce del menu
addlilink(Sysop,'/wiki/Speciale:DeletedContributions','_.contributi eliminati', ''); // Esempio di collegamento nel menu
addlilink(Sysop,'/wiki/Speciale:Blocca','_.blocca utente', '');
addlilink(Sysop,'/wiki/Speciale:Importa','_.importa pagina', '');
addlilink(Sysop,'/wiki/Speciale:Ripristina','_.recupera pagina', '');
addlilink(Sysop,'/wiki/Speciale:ALinksearch','_.link esterni', '');
addlilink(Sysop,'/wiki/Speciale:Protectedpages','_.pagine bloccate', '');
addlilink(Sysop,'javascript:GetNomeUtente();','_.inter edit', '');
addlilink(Sysop,'javascript:deleteLinkify();','_.speedy del', '');
});

function GetNomeUtente(){
var prmtnome
prmtnome=prompt("Inserisci il nome utente","");
window.location =  'http://tools.wikimedia.de/~luxo/contributions/contributions.php?user='+  prmtnome +'&lang=it';
}



// Outline for an automatic delete link generator.
// Not highly tested. Started by Splarka @ test.wikipedia
// Written for & maintained by Mike_lifeguard @ en.wikibooks
 
//GO IF contribs or log or newpages or [article AND (submit|view|purge)]
 
function deleteLinkify() {
    var reason = prompt('Inserisci la ragione della cancellazione','in base alla [[Categoria:Da cancellare subito|policy di cancellazione immediata]]');
    if(!reason) return;
    var links = document.getElementById('bodyContent').getElementsByTagName('a');
    var arp = mw.config.get('wgServer') + mw.config.get('wgArticlePath').replace(/\$1/,'');
    if(links.length == 0) return
    for(var i=0;i<links.length;i++) {
        if(links[i].href.indexOf(arp)==0 && links[i].href.indexOf('action=delete') == -1 && links[i].href.indexOf('/Special:') == -1 ) {
            links[i].href += '?action=delete&submitdelete=true&deletetalkalso=true&wpReason=' + encodeURIComponent(reason);
            links[i].innerHTML += ' (delete)';
        }
    }
}
 
if(queryString('submitdelete') == 'true') addOnloadHook(function() {
    if(document.getElementById('ca-talk').className.indexOf('new')==-1 && queryString('deletetalkalso')=='true' && ( wgNamespaceNumber % 2 == 0 ) ) {//if the talk tab is redlinked and this is the first time 'round AND this is not a talk page then:
        document.getElementById('deleteconfirm').action += '&deletetalk=true&wpReason=' + queryString('wpReason');
    }
    document.getElementById('deleteconfirm').wpConfirmB.click();
})
 
if(wgAction == 'delete' && queryString('deletetalk') == 'true') addOnloadHook(function() {
    var url = document.getElementById('ca-talk').getElementsByTagName('a')[0].href + '?action=delete&submitdelete=true&wpReason=' + queryString('wpReason');
    document.location.href = url;
})
 
function queryString(p) {
var re = RegExp('[&?]' + p + '=([^&]*)');
var matches;
if (matches = re.exec(document.location)) {
try { 
return decodeURI(matches[1]);
} catch (e) {
}
}
return null;
}




//Add an "cancel text" button in deletion page (thanks Utente:Lusum)
   if ((toLoad.indexOf("canctxt")!=-1))
function cancel_text()
{
  var f = document.getElementById("deleteconfirm");
  if (f)
  {
    var input = document.getElementById("wpReason");
    input.value="";
  }
}
 
function setup_cancel_text()
{
  if (document.title.indexOf("Cancella") == 0)
  {
    var f = document.getElementById("deleteconfirm");
    if (f)
    {
      var h2 = f.getElementsByTagName("input")[2];
      if (h2)
      {
        var button = document.createElement('input');
        button.type = "button";
        button.value = "Cancella Testo";
        button.setAttribute('onClick', 'cancel_text()');
        f.appendChild(button, h2);
      }
    }
  }
}
 
$(setup_cancel_text);
 
function setup_motivazione() {
    if (document.title.indexOf("Cancella") == 0)
    {
        var p = document.getElementById("deleteconfirm");
        if (p)
        {
            var h2 = p.getElementsByTagName("input")[2];
            if (h2)
            {
                var i;
                arrayMotivation = new Array("Cancellazione Immediata ", "Test", "titolo errato (corretto: [[]])", "promozionale", "Senza senso", "SPAM", "pagina rinominata", " Template inutile", "Template orfano", "Pagina contenente solo frasi offensive e/o volgari", "Pagina totalmente scritta in una lingua straniera", "Tautologica", "Nessun riscontro", "Pagina contenente solo link esterni", "Categoria senza pagine né subcategorie", "Pagina già cancellata e reinserita senza discussione con lo stesso contenuto", " Redirect inutile", "Redirect orfano", "Non adatta a wiktionary", "Cancellazione ordinaria come risulta da [[Wikizionario:Pagine_da_cancellare/ |qui]]", "Copyviol da http://", "Tecnica per rimozione Copyviol ", " Recupero cronologia", "Vandalismo", "Wiktionary non è uno spazio hosting gratuito", "Trasferita su [[v:|Wikiversity]] ", "Trasferita su [[w:|Wikipedia]] ", "Trasferita su [[s:|Wikisource]] ", "Trasferita su [[w:|Wikipedia]]", "Trasferita su [[b:|Wikibooks]] ");
 
                var motivazione = document.createElement('select');
                motivazione.name = 'popupSelect';
                motivazione.id = 'motivazione';
                motivazione.size = 1;
                var option;
                // Carica nel combo box il contenuto della variabile globale
                for (i = 0; i < arrayMotivation.length; i++){
                    option = new Option(arrayMotivation[i],' ');
                    option.value = arrayMotivation[i];
                    motivazione.options[motivazione.length] = option;
                }
                p.appendChild(motivazione);
                var button = document.createElement('input');
                button.type = "button";
                button.value = "Ok";
                button.setAttribute('onClick', 'inserisci_motivazione()');
                p.appendChild(button);
            }
        }
    }
 
}
 
function inserisci_motivazione() {
    motivazione = document.getElementById('motivazione').value;
    var f = document.getElementById("deleteconfirm");
    if (f)
    {
        var input = document.getElementById("wpReason");
        input.value=motivazione;
    }
}
 
$(setup_motivazione);

/* Special:Contributions Wildcard/CIDR lookup, version [0.1.4]
Originally from: http://en.wikipedia.org/wiki/User:Splarka/contribsrange.js
 
Notes:
* Uses the API (Requires http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=31312), which is faster than most CIDR contrib tools.
* Currently uses a GET json via <script src=""> to avoid ajax problems.
* Only currently works if submitted (or called by URL parameter, eg Special:Contributions/User).
** Checks namespace and date options in form.
* Uses: Submit any IP CIDR range /16 or from /24 to /32. Submit any string (at least 3 characters) with a suffixed asterisk.
** eg: [123.123.123.0/24 ] or [123.123.123.* ] or [Willy* ].
** NOTE: Currently seems broken with spaces in the search string. Possibly a fault of the API. %20,+,_ don't work
 
To do:
* Sortable by address? (not useful until pagination is available).
* More like normal Special:Recentchanges (hist)(diff) blah blah blah (except talk page existence for red/blue link) with BiDi characters?
* Option to refresh on page? (not really needed, but might be more handy than onload action only).
* Respect limit in user prefs? frm.limit.value ?
*/
 
if(wgCanonicalSpecialPageName == 'Contributions') { 
  addOnloadHook(prefixContribsInit);
  var prefixlimit = 500;
  var frm = ''; //global
}
 
function prefixContribsInit() {
  var show = (document.getElementById('contentSub')) ? document.getElementById('contentSub') : document.getElementById('topbar')
  show.appendChild(document.createTextNode(' \u2022 Javascript contributi di ricerca potenziati è attivo. Devi inserire una gamma CIDR o aggiungere un asterisco a fare un prefisso di ricerca.'))
  frm = document.getElementsByTagName('form')[0];
  if(!frm.target) return;
 
  //general optionlets independant of type of search.
  var opt_ns = (parseInt(frm.namespace[frm.namespace.selectedIndex].value) > -1) ? '&ucnamespace=' + frm.namespace[frm.namespace.selectedIndex].value : '';
  var opt_ts = '';
  if(queryString('ucstart')) {
    opt_ts = '&ucstart=' + queryString('ucstart');
  } else {
    var m = '' + frm.month.selectedIndex; 
    var y = frm.year.value;
    if(m.length == 1) m = '0' + m
    if(y > 2000 && y < 2100) opt_ts = '&ucstart=' + y + '-' + m + '-01T00:00:00Z'
  }
  var options = opt_ns + opt_ts;
 
  var patternCIDR = /(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/(2[4-9]|3[0-2]|16)/i ;
  var patternWild = /^.{3,}\*$/i ;
  if(frm.target.value.search(patternCIDR) == 0) {
    prefixContribsStartbox(frm.parentNode);
    var cidr = frm.target.value.match(patternCIDR)[0];
    var range = cidr.match(/[^\/]\d{1,2}$/i)[0];
    if(range == 24 || range == 16) {
      //prefixable CIDR, lets do-er
      if(range == 24) {
        cidr = cidr.match(/\d{1,3}\.\d{1,3}\.\d{1,3}\./)[0];
      } else {
        cidr = cidr.match(/\d{1,3}\.\d{1,3}\./)[0];
      }
      var url = wgScriptPath + '/api.php?action=query&format=json&rawcontinue=&callback=prefixContribs&list=usercontribs' + options + '&uclimit=' + parseInt(prefixlimit) + '&ucuserprefix=' + cidr;
      prefixContribsCall(url);
    } else {
      //complex CIDR, lets figure it out
      var oct3 = cidr.match(/\.\d{1,3}\//i)[0].replace(/(\.|\/)/g,'');
      cidr = cidr.match(/\d{1,3}\.\d{1,3}\.\d{1,3}\./)[0];
      var num = Math.pow(2,32 - range);
      var start = oct3 - oct3 % num;
      var url = wgScriptPath + '/api.php?action=query&format=json&rawcontinue=&callback=prefixContribs&list=usercontribs' + options + '&uclimit=' + parseInt(prefixlimit) + '&ucuser=';
      for(var i=start;i<=start + num;i++) {
        url += '' + cidr + i;
        if(i != start + num) url += '|'
      }
      prefixContribsCall(url);
    }
  } else if(frm.target.value.search(patternWild) == 0) {
    //very simple wildcard, lets do-er
    prefixContribsStartbox(frm.parentNode);
    var prefix = frm.target.value.replace(/\*$/,'');
    prefix = prefix.substr(0,1).toUpperCase() + prefix.substr(1);
    var url = wgScriptPath + '/api.php?action=query&format=json&rawcontinue=&callback=prefixContribs&list=usercontribs' + options + '&uclimit=' + parseInt(prefixlimit) + '&ucuserprefix=' + prefix;
    prefixContribsCall(url);
  }
}
 
function prefixContribsStartbox(parent) {
  var res = document.createElement('div');
    res.setAttribute('id','results-from-CIDR');
    res.style.border = '1px solid black';
    res.style.padding = '.5em';
    var prog = document.createElement('img');
    prog.setAttribute('id','prefixcontribs-prog');
    prog.setAttribute('src',stylepath + '/common/images/spinner.gif');
    res.appendChild(prog);
  parent.appendChild(res);
}
 
function prefixContribsCall(url) {
  var scriptElem = document.createElement('script');
  scriptElem.setAttribute('src',url);
  scriptElem.setAttribute('type','text/javascript');
  document.getElementsByTagName('head')[0].appendChild(scriptElem);
}
 
function prefixContribs(obj) {
  if(!obj['query'] || !obj['query']['usercontribs']) return
  var prog = document.getElementById('prefixcontribs-prog');
  if(prog) prog.parentNode.removeChild(prog)
  cidr = obj['query']['usercontribs'];
  var res = document.getElementById('results-from-CIDR');
  res.appendChild(document.createElement('hr'));
  if(cidr.length == 0) {
    res.appendChild(document.createTextNode('Non ci sono modifiche per il range wildcard/CIDR.'));
    res.appendChild(document.createElement('hr'));
    return;
  }
  res.appendChild(document.createTextNode(cidr.length + ' risultati per la ricerca wildcard/CIDR  con il range specificato (in ordine cronologico): '));
  if(cidr.length == parseInt(prefixlimit)) {
    res.appendChild(document.createElement('br'));
    res.appendChild(document.createTextNode('Clicka '));
    var ns = (parseInt(frm.namespace[frm.namespace.selectedIndex].value) > -1) ? '&namespace=' + frm.namespace[frm.namespace.selectedIndex].value : '';
    var ts = (obj['query-continue']) ? obj['query-continue'].usercontribs.ucstart : cidr[cidr.length-1].timestamp;
    addlinkchild(res, wgScript + '?title=Special:Contributions&target=' + encodeURIComponent(frm.target.value) + ns + '&ucstart=' + ts, 'qui');
    res.appendChild(document.createTextNode(' per guardare i successivi ' + prefixlimit + ' risultati.'));
  }
  res.appendChild(document.createElement('hr'));
  for(var i=0;i<cidr.length;i++) {
    res.appendChild(document.createTextNode('\u2022 ' + cidr[i].timestamp.replace(/T[\d:]*Z/,' ')));
    addlinkchild(res, wgScript + '?title=Special:Contributions/' + cidr[i].user, cidr[i].user);
    res.appendChild(document.createTextNode(' edited ('));
    addlinkchild(res, wgScript + '?title=-&curid=' + cidr[i].pageid + '&diff=' + cidr[i].revid , 'diff');
    res.appendChild(document.createTextNode(') '));
    addlinkchild(res, wgScript + '?title=-&curid=' + cidr[i].pageid, cidr[i].title);
    if(cidr[i].comment) res.appendChild(document.createTextNode(' (' + cidr[i].comment + ')'));
    res.appendChild(document.createElement('br'));
  }
}
 
function addlinkchild(obj,href,text,id,classes) {
  if(!obj || !href || !text) return false;
  var a = document.createElement('a');
  a.setAttribute('href',href);
  a.appendChild(document.createTextNode(text));
  if(id) a.setAttribute('id',id);
  if(classes) a.setAttribute('class',classes);
  obj.appendChild(a);
}
 
function queryString(p) {
  var re = RegExp('[&?]' + p + '=([^&]*)');
  var matches;
  if (matches = re.exec(document.location)) {
    try { 
      return decodeURI(matches[1]);
    } catch (e) {
    }
  }
  return null;
}

//</nowiki></pre>