Utente:Otrebor81/monobook.js

Da Wikipedia, l'enciclopedia libera.
Vai alla navigazione Vai alla ricerca

Questa pagina definisce alcuni parametri di aspetto e comportamento generale di tutte le pagine. Per personalizzarli vedi Aiuto:Stile utente.


Nota: dopo aver salvato è necessario pulire la cache del proprio browser per vedere i cambiamenti (per le pagine globali è comunque necessario attendere qualche minuto). Per Mozilla / Firefox / Safari: fare clic su Ricarica tenendo premuto il tasto delle maiuscole, oppure premere Ctrl-F5 o Ctrl-R (Command-R su Mac); per Chrome: premere Ctrl-Shift-R (Command-Shift-R su un Mac); per Konqueror: premere il pulsante Ricarica o il tasto F5; per Opera può essere necessario svuotare completamente la cache dal menù Strumenti → Preferenze; per Internet Explorer: mantenere premuto il tasto Ctrl mentre si preme il pulsante Aggiorna o premere Ctrl-F5.

 var myButtons = new Array([1,'{{Giappone}}','1','Giappone',0,'+ tl Giappone']);
// SCRIPT PER IL REVERT DI [[wikipedia:user:Lorian|Lorian]] TRADOTTO E RIADATTATO [[utente:wim b|Wim b]]
// Revert tools by Lorian<br />
//Riadattato per wikipedia da [[utente:Wim_b|Wim b]]<br />
// VERSIONE PER ADMIN
//<pre><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, user2) {
var message = prompt ('CHe messaggio vuoi lasciare nella cronologia?', '');
window.location = 'http://it.wikipedia.org/w/index.php?title=' + _GET['title'] + '&action=edit&oldid=' + _GET['oldid'] + '&'+where+'=2&user1='+user1+'&user2='+user2+'&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;


    document.getElementById('contentSub').innerHTML = '(<a href="http://it.wikipedia.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.wikipedia.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.wikipedia.org/w/index.php?title=User_talk:'+user1+'&action=edit&section=new&warn=1">Test</a> / <a href="http://it.wikipedia.org/w/index.php?title=User_talk:'+user1+'&action=edit&section=new&warn=2">Vandalismo</a> / <a href="http://it.wikipedia.org/w/index.php?title=User_talk:'+user1+'&action=edit&section=new&warn=3">Spam</a> / <a href="http://it.wikipedia.org/w/index.php?title=User_talk:'+user1+'&action=edit&section=new&warn=4">WNF</a> / <a href="http://it.wikipedia.org/w/index.php?title=User_talk:'+user1+'&action=edit&section=new&warn=5">WNB</a> / <a href="http://it.wikipedia.org/w/index.php?title=User_talk:'+user1+'&action=edit&section=new&warn=6">IP Vandalismo</a>) (Admin: <a href="http://it.wikipedia.org/wiki/Speciale:Blocca/'+user2+'">Blocca utente</a> / <a href="http://it.wikipedia.org/w/index.php?title=Speciale%3ADeletedContributions&target='+user2+'&namespace=">Contributi cancellati</a> / <a href="http://it.wikipedia.org/w/index.php?title=' + _GET['title'] + '&action=protect">Proteggi pagina</a> / <a href="http://it.wikipedia.org/w/index.php?title=' + _GET['title'] + '&action=delete">Cancella 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}}~~'+'~~';
    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();
  }
});
//SCRIPT VPOPSPEED
mw.loader.load('//it.wikipedia.org/w/index.php?title=Utente:Henna/VPopSpeed.js&action=raw&ctype=text/javascript');

mw.loader.load('//nl.wikipedia.org/w/index.php?title=Gebruiker:Valhallasw/hennading.js&action=raw&ctype=text/javascript');
/////////////////////////////////////////////////////////////////////////////////////////////

//TAB PER GLI ADMIN-----------------------------------
//Una riga per ogni voce del menu
mw.loader.using( 'mediawiki.util' )
	.then( function() {
		mw.util.addPortletLink( 'p-cactions','/wiki/Speciale:DeletedContributions','contributi eliminati', ''); // Esempio di collegamento nel menu
		mw.util.addPortletLink( 'p-cactions','/wiki/Speciale:Blocca','blocca utente', '');
		mw.util.addPortletLink( 'p-cactions','/wiki/Speciale:Importa','importa pagina', '');
		mw.util.addPortletLink( 'p-cactions','/wiki/Speciale:Ripristina','recupera pagina', '');
	} );
  
importScript( 'MediaWiki:Gadget-ClearDeleteReason.js' );

//</source>