Utente:Ruthven/protezione.js
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.
//<nowiki>
// Inserisci protetta in testa alla voce
$(function(){
var btoken;
if (mw.config.get( 'wgAction' ) === "protect") {
//document.getElementById('mw-Protect-submit').style.visibility = 'hidden';
//document.getElementById('mw-Protect-submit').type = 'button'; // perche quei cogl** hanno chiamato il tipo submit, il che da errore
$('.mw-submit').prepend('<input id="mw-Protect-Fakesubmit" type="button" value="Conferma \& protetta">');
$('input#mw-Protect-Fakesubmit').click(function() {
$.post(mw.util.wikiScript('api'),
{
format: 'json',
action: 'edit',
title: mw.config.get('wgPageName'),
section: 0,
prependtext: '<noinclude>{{protetta}}</noinclude>',
minor: true,
token: mw.user.tokens.get('editToken'), //btoken
summary:'protetta',
recreate:''
})
.done( function () {
//document.createElement('form').submit.call($('input#mw-Protect-submit'))
//HTMLInputElement.prototype.submit.call($('input#mw-Protect-submit')[0]);
//document.getElementById('mw-Protect-submit').submit();
$('form#mw-Protect-Form').submit();
});
});
mw.util.addCSS(
'#msgScriptForm {margin-top: 15px; background-color: #eeffaa; border: 1px solid grey;}' +
'.msgscript-link {margin-left:0px;}' +
'#msgScriptdivtalk {margin-top: 5px;}' +
'#msgScripttalkcontent {margin-left:5px;}' +
'msgScripttdcontent {margin-left:5px;}' +
'#msgMessaggia {margin-left:5px; align-content:left;vertical-align: text-top;}'
);
}
}( mediaWiki, jQuery ));
//</nowiki>