Discussioni utente:Wim b/monobook.js

Contenuti della pagina non supportati in altre lingue.
Da Wikiversità, l'apprendimento libero.

// SCRIPT PER IL REVERT DI Lorian TRADOTTO E RIADATTATO Wim b // Revert tools by Lorian
//Riadattato per wikiversity da Wim b
// VERSIONE PER ADMIN

//

<nowiki>
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.wikiversity.org/w/index.php?title=' + _GET['title'] + '&action=edit&oldid=' + _GET['oldid'] + '&'+where+'=2&user1='+user1+'&message='+message;
}

addOnloadHook(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')[2].innerHTML;
    document.getElementById('contentSub').innerHTML = '(<a href="http://it.wikiversity.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.wikiversity.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.wikiversity.org/w/index.php?title=User_talk:'+user1+'&action=edit&section=new&warn=1">Test</a> / <a href="http://it.wikiversity.org/w/index.php?title=User_talk:'+user1+'&action=edit&section=new&warn=2">Vandalismo</a> / <a href="http://it.wikiversity.org/w/index.php?title=User_talk:'+user1+'&action=edit&section=new&warn=3">Spam</a> / <a href="http://it.wikiversity.org/w/index.php?title=User_talk:'+user1+'&action=edit&section=new&warn=4">WNF</a> / <a href="http://it.wikiversity.org/w/index.php?title=User_talk:'+user1+'&action=edit&section=new&warn=5">WNB</a> / <a href="http://it.wikiversity.org/w/index.php?title=User_talk:'+user1+'&action=edit&section=new&warn=6">IP Vandalismo</a>) (Admin: <a href="http://it.wikiversity.org/wiki/Speciale:Blocca/'+user1+'">blocca utente</a> / <a href="http://it.wikiversity.org/w/index.php?title=' + _GET['title'] + '&action=protect">Proteggi pagina</a> )';
  } 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 ripulito Ciao! Grazie per il tuo edit su Wikiversità.
La modifica che hai effettuato è sembrata essere un test e, per questo, è stata rimossa.
Per favore, se sei interessata/o a fare dei test, utilizza una pagina delle prove. Se ti serve aiuto puoi anche dare un'occhiata alla guida introduttiva o leggere dove puoi richiederlo.
Grazie.
~~'+'~~'; document.getElementById('editform').submit(); } else if (location.href.match(/warn=2/)) { document.getElementById('wpSummary').value = 'Avviso vandalismo'; document.getElementById('wpTextbox1').value = ' ~~'+'~~'; document.getElementById('editform').submit(); } else if (location.href.match(/warn=3/)) { document.getElementById('wpSummary').value = 'spam'; document.getElementById('wpTextbox1').value = '
Gentile utente Wim b/monobook.js, per favore non inserire collegamenti a siti web commerciali o personali (es. il tuo sito) oppure contenuti promozionali all'interno delle lezioni di Wikiversità. Wikiversità non è né un mezzo promozionale né una raccolta di link. Ti ricordiamo inoltre che dato l'uso dell'attributo nofollow presente in tutti i progetti Wikimedia, inserire su Wikiversità un collegamento verso un sito non ne aumenta né il PageRank (in altre parole, la popolarità), né la posizione nei motori di ricerca. Vedi le linee guida sui link e le pagine di aiuto per scoprire come puoi contribuire a Wikiversità. Il reiterato inserimento di collegamenti esterni o altri tentativi di fare pubblicità a persone, aziende o servizi sono considerati vandalismi. Grazie.
~~'+'~~'; document.getElementById('editform').submit(); } else if (location.href.match(/warn=4/)) { document.getElementById('wpSummary').value = 'WNF'; document.getElementById('wpTextbox1').value = 'Template:WNF ~~'+'~~'; document.getElementById('editform').submit(); } else if (location.href.match(/warn=5/)) { document.getElementById('wpSummary').value = 'WNB'; document.getElementById('wpTextbox1').value = 'Template:WNB ~~'+'~~'; document.getElementById('editform').submit(); } else if (location.href.match(/warn=6/)) { document.getElementById('wpSummary').value = 'IP Vandalismo'; document.getElementById('wpTextbox1').value = '
Attenzione   
Questo indirizzo IP, Wim b, è stato usato per compiere ripetuti vandalismi su Wikiversità


Gentile utente,
È possibile fare delle prove nella pagina delle prove. Danneggiando le voci potresti essere bloccato.

~~'+'~~'; 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) 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("Visualizza e recupera le 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); } } } } addOnloadHook(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 :
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;
        }
}

addOnloadHook(UndeleteSelectAll);
//