Utente:Jalo/vector.js: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
test sannita
fine test
Riga 1:
//<pre>
// Elenco dei tool da caricare.
 
var myButtons = new Array([2,'{{WIP|Jalo}}\\n{{UNESCO\\n|tipoBene = patrimonio\\n|nome = \\n|nomeInglese = \\n|immagine = \\n|anno = \\n|tipologia = Culturali\\n|pericolo= \\n|criterio = (i) (ii) (iii) (iv) (v) (vi) (vii) (viii) (ix) (x) (xi) (xii)\\n|link = \\n|stato = \\n|linkCategoria= \\n}}\\n','','UNESCO tpl',245,''],[2,'{{WIP|Jalo}}\\n{{coord||display=title}}\\n{{UNESCO\\n|tipoBene = patrimonio\\n|nome = \\n|nomeInglese = \\n|immagine = \\n|anno = \\n|tipologia = Culturali\\n|pericolo= \\n|criterio = (i) (ii) (iii) (iv) (v) (vi) (vii) (viii) (ix) (x) (xi) (xii)\\n|link = \\n|stato = \\n|linkCategoria= \\n}}\\n\\n\\n==Collegamenti esterni==\\n\\n*[http://whc.unesco.org/en/list/ Scheda UNESCO]\\n\\n{{Patrimoni Unesco|}}\\n\\n[[Categoria:Patrimoni dell\'umanità in ]]\\n','','UNESCO voce',0,''],[2,'{{Bio\\n|Titolo = \\n|Nome = \\n|Cognome = \\n|PostCognome = \\n|ForzaOrdinamento = \\n|Sesso = M\\n|LuogoNascita = \\n|GiornoMeseNascita = \\n|AnnoNascita = \\n|LuogoMorte = \\n|LuogoMorteLink = \\n|GiornoMeseMorte = \\n|AnnoMorte = ?\\n|Attività = \\n|Nazionalità = \\n|PostNazionalità =\\n|Immagine = \\n|Didascalia =\\n|FineIncipit = \\n|Categorie = \\n}}','','Bio',315,''],[2,'{{Conflitto\\n|nome del conflitto = \\n|parte_di = \\n|immagine = \\n|didascalia = \\n|data = \\n|luogo = \\n|casus = \\n|mutamenti_territoriali = \\n|esito = \\n|schieramento1 = \\n|schieramento2 = \\n|comandante1 = [[Immagine:White flag icon.svg|16px]]\\n|comandante2 = \\n|effettivi1 = \\n|effettivi2 = \\n|perdite1 = \\n|perdite2 = \\n|perdite3 = \\n|note = \\n}}\\n','','Conflitto',0,''],[2,'{{Box successione\\n|carica = \\n|immagine = \\n|periodo = \\n|precedente = \\n|successivo = \\n}}','','Box successione',92,'']);
var toLoad="purg led lks orol tabs nav stru unw allp tbar avan popup nms edt ver bot qdel";
 
var myLinks = new Array(['Voce su en.wiki','http://en.wikipedia.org/wiki/%TITOLO%'],['Voce su Commons','http://commons.wikimedia.org/wiki/Image:%TITOLO2%'],['Vecchio Edit-count','http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?user=Jalo&dbname=itwiki_p'],['Bold / No bold','javascript:bolda();'],['Logo / No logo','javascript:noLogo();']);
 
// Firefox
var toLoad = "";
toLoad += "purg ";
toLoad += "led ";
toLoad += "ns0 ";
toLoad += "lks ";
// toLoad += "tabs ";
toLoad += "mjs ";
toLoad += "sand ";
toLoad += "admin ";
// toLoad += "bot ";
toLoad += "requi ";
toLoad += "uec ";
toLoad += "log ";
toLoad += "whois ";
toLoad += "unw ";
toLoad += "wiki ";
toLoad += "stu ";
toLoad += "voto ";
toLoad += "canc ";
toLoad += "caut ";
// toLoad += "bpar ";
toLoad += "edw ";
toLoad += "wip ";
toLoad += "sot ";
toLoad += "small ";
toLoad += "bar ";
toLoad += "case ";
toLoad += "fat ";
toLoad += "nfat ";
toLoad += "cwtch ";
toLoad += "popup ";
toLoad += "nms ";
// toLoad += "qed ";
toLoad += "since ";
toLoad += "edt ";
toLoad += "vfol ";
toLoad += "linkcomplete ";
toLoad += "lrc ";
// toLoad += "elrc ";
// toLoad += "rch ";
// toLoad += "wed "; // NO
// toLoad += "orol "; // NO
// toLoad += "nav "; // NO
// toLoad += "stru "; // NO
// toLoad += "tbar "; // NO
// toLoad += "avan "; // NO
// toLoad += "chat "; // NO
// toLoad += "cmd "; // NO
// toLoad += "goo "; // NO
toLoad += "ver "; // NO
// toLoad += "vpop "; // NO
// toLoad += "qdel "; // NO
// toLoad += "dels "; // NO
 
 
//var toLoad = "purg led ns0 lks tabs mjs sand admin bot requi uec log whois unw wiki stu voto canc caut bpar edw wip sot small bar case fat nfat cwtch popup nms qed since edt vfol linkcomplete lrc elrc rch";
 
var nomeBot="JaloBot";
 
var nomeBot="SanniBot";
 
//Monobook Modulare
//Lancia il vero monobook
// Vedi [[Wikipedia:Monobook.js/MonobookCompleto.js]]
importScriptURI("/w/index.php?title=Wikipedia:Monobook.js/MonobookCompleto.js&action=raw&ctype=text/javascript&dontcountme=s");
//
 
document.writeln('<script type="text/javascript" src="/w/index.php?title=Wikipedia:Monobook.js/MonobookCompleto.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//JUST FOR DEBUG
//importScriptURI("/w/index.php?title=Utente:Jalo/monobook.js/test&action=raw&ctype=text/javascript&dontcountme=s");
 
 
 
//CONFIGURAZIONE POPUP
popupDelay = 2; // aspetta 2 secondi
popupRedlinkRemoval = true; // elimina i collegamenti a link rossi
popupQueriedRevertSummary = "Rollback da popup. Ripristinata la versione di $3";
popupRedlinkSummary = "Eliminato link rosso: %s";
 
//Mostra i Tatoo
importScriptURI("/w/index.php?title=Utente:Jalo/Tatoo&action=raw&ctype=text/javascript&dontcountme=s");
 
//TASTI PERSONALI
addLoadEvent ( function ()
{
if (document.title.indexOf("Modifica") == -1)
return;
addToolbarButton('tb-firma', 'javascript:addTextAtCursor("~~~~","","",4)',
'http://upload.wikimedia.org/wikipedia/commons/d/d1/Button_mysignature.png', 'My sign', 'Jalo');
 
addToolbarButton('tb-commento', 'javascript:addTextAtCursor("<!"+"--","Tolgo immagine inesistente","-->",0)',
'http://upload.wikimedia.org/wikipedia/commons/2/23/Quotes-Lithuanian.png', 'no-img', 'Tolgo immagine inesistente');
 
daInserire = "==Cronologia precedente alla pulizia dai copyviol==\n{{cassetto\n|titolo=cronologia\n|testo=<pre>\n</pre>}}";
addToolbarButton('tb-cass', 'javascript:aggiungiTesto(daInserire, "Cronologia pre-pulizia copyviol", 1)',
'http://upload.wikimedia.org/wikipedia/commons/c/cd/Button_vote_deletion.png', '[pre-copyviol]', 'Cronologia pre-copyviol');
});
 
//NASCONDI IL COPYWARN SOTTO LA CASELLA DI MODIFICA
addLoadEvent ( function ()
{
if (document.getElementById("editpage-copywarn"))
document.getElementById("editpage-copywarn").style.display="none";
})
 
//Bolda il "wpTextbox1"
//function bolda()
//{
// //Inverte BOLD/NO BOLD
// var cookieExpire = new Date(); // scadenza del cookie
// cookieExpire.setTime(cookieExpire.getTime() + (30 * 24 * 60 * 60 * 1000)); // il cookie scade dopo un mese
//
// var boldare = GetCookie('wikiBolda');
// if (boldare == 'si')
// SetCookie('wikiBolda', 'no', cookieExpire.toGMTString(), '/');
// else
// SetCookie('wikiBolda', 'si', cookieExpire.toGMTString(), '/');
//}
 
//if (wgAction == "edit")
//addLoadEvent ( function ()
//{
// var boldare = GetCookie('wikiBolda');
// if (boldare == 'si')
// document.getElementById("wpTextbox1").style.fontWeight = "bold";
//})
 
//Nascondi il logo di wikipedia
//function noLogo()
//{
// //Inverte LOGO/NO LOGO
// var cookieExpire = new Date(); // scadenza del cookie
// cookieExpire.setTime(cookieExpire.getTime() + (30 * 24 * 60 * 60 * 1000)); // il cookie scade dopo un mese
//
// var nologo = GetCookie('wikiLogo');
// if (nologo == 'si')
// SetCookie('wikiLogo', 'no', cookieExpire.toGMTString(), '/');
// else
// SetCookie('wikiLogo', 'si', cookieExpire.toGMTString(), '/');
//}
 
//addLoadEvent ( function ()
//{
// var nologo = GetCookie('wikiLogo');
// if (nologo == 'si')
// document.getElementById("p-logo").style.display = "none";
//})
 
//Aggiunte x Sannita
// TRADOTTO DA
function addTradottoDa()
Riga 18 ⟶ 157:
enArticle = enArticle.substr(enArticle.indexOf("[[en:")+5);
enArticle = enArticle.substr(0,enArticle.indexOf("]]"));
 
var my_date = new Date();
dataOggi = my_date.getDate()+" "+arrayMese[my_date.getMonth()+1]+" "+(1900+my_date.getYear());
addTextAtCursor("{{Tradotto da|en|"+enArticle+"|"+dataOggi+"|id}}\n~~"+"~~","+Tradotto da","",0);
}
 
// Configurazione HOTKEYS
var tastiHotkeys = new Array();
tastiHotkeys["firma"] = 'F';
tastiHotkeys["case"] = 'C';
tastiHotkeys["obj"] = 'Z';
 
pulsantiComandoPers = new Array();
pulsantiHotkeyPers = new Array();
pulsantiDescrPers = new Array();
//PATRIMONIO
pulsantiComandoPers["mytradda"] = 'javascript:addTradottoDa()';
pulsantiComandoPers["patrimonio"] = 'javascript:addTextAtCursor("[[patrimonio dell\'umanità|patrimoni dell\'umanità]]","","",50)';
pulsantiHotkeyPers["mytradda"] = 'T';
pulsantiDescrPerspulsantiHotkeyPers["mytraddapatrimonio"] = 'Tradotto daP';
pulsantiDescrPers["patrimonio"] = 'Patrimonio';
 
//<pre>UNESCO
pulsantiComandoPers["unesco"] = 'javascript:addTextAtCursor("[[Organizzazione delle Nazioni Unite per l\'Educazione, la Scienza e la Cultura|UNESCO]]","","",87)';
// Functions auxFicus and Ficus
pulsantiHotkeyPers["unesco"] = 'U';
// funzione richiamata quando viene schiacciato il pulsante "OK" sul popup.
pulsantiDescrPers["unesco"] = 'Unesco';
// Utilizza la variabile globale "curTemplate" per sapere qual'era il
//template richiesto
 
//SUP 2
function auxFicusSannita()
pulsantiComandoPers["sup2"] = 'javascript:addTextAtCursor("²","","",1)';
{
pulsantiHotkeyPers["sup2"] = '2';
// copia dal frame di wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js) alla wpTextbox1 textarea
pulsantiDescrPers["sup2"] = 'Alla seconda';
if (typeof(wikEdUseWikEd) != 'undefined')
if (wikEdUseWikEd == true)
WikEdUpdateTextarea();
//alcuni tasti modificano la textarea del wikEd, non quella classica
// attraverso questa variabile posso sapere se, alla fine, devo copiare quella standard in quella di wikEd oppure no
// se non la usassi il testo inserito in questa funzione con l'uso di "addTextAtCursor" non verrebbe visualizzato
var tornareIndietro=true;
// Carica il textbox1
wpTextbox1 = document.getElementById("wpTextbox1");
 
//CITA
// a seconda del template richiesto viene aggiunta (nel posto giusto) la relativa stringa
pulsantiComandoPers["cita"] = 'javascript:addTextAtCursor("<ref>{{Cita||}}</ref>","","",12)';
if (curTemplate == "StopVoto")
pulsantiHotkeyPers["cita"] = '';
{
pulsantiDescrPers["cita"] = '{{Cita}}';
Motivo = document.getElementById('motivo').value;
wpTextbox1.value=wpTextbox1.value+"{{StopVoto|"+Motivo+"}}--~~~~\n{{Canc fatte}}\n";
}
 
//TESTO ROSSO
// Chiude il Popup (lavoro finito)
pulsantiComandoPers["rosso"] = 'javascript:addTextAtCursor(\'<span style="color:red">\',"","</span>",0)';
RemoveNode('inlinePopupDiv');
pulsantiHotkeyPers["rosso"] = 'R';
pulsantiDescrPers["rosso"] = 'Testo rosso';
// Se devo ricopiare la textarea classica in quella di wikEd
if (tornareIndietro == true)
// copia la wpTextbox1 textarea nel frame del wikEd
if (typeof(wikEdUseWikEd) != 'undefined')
if (wikEdUseWikEd == true)
WikEdUpdateFrame();
}
 
//PORTALE ANTICA ROMA
// Crea il popup utilizzato per quei template che richiedono parametri aggiuntivi
pulsantiComandoPers["roma"] = 'javascript:addTextAtCursor("{{Portale|Antica Roma|Germani|Storia}}","","",0)';
function FicusSannita(Template){
pulsantiHotkeyPers["roma"] = 'A';
//Creo il testo del popup
pulsantiDescrPers["roma"] = 'Portali';
switch(Template){
case "Tmp":
Greeter = "Hai richiesto di fermare una procedura di cancellazione.<br/>" +
" Per favore specifica il motivo";
break;
default: Greeter = "Specifica il motivo per cui hai richiesto di fermare la procedura."
}
 
//SOVRAIMMAGINE
// memorizzo il template richiesto. Verra' usato nella funzione AuxFicus
pulsantiComandoPers["simm"] = 'javascript:addTextAtCursor("{{Sovraimmagine\\n | allineamento = right\\n | sotto = Germania Magna jpg.jpg\\n | sotto_larghezza = 300px\\n | sotto_didascalia = Mappa delle tribù germaniche (Nell ovale rosso gli Angrivari)\\n | sopra = Red oval.svg\\n | sopra_larghezza = 40px\\n | sopra_didascalia = Angrivari\\n | x = 80\\n | y = 55\\n}}","","",0)';
curTemplate = Template;
pulsantiHotkeyPers["simm"] = 'S';
pulsantiDescrPers["simm"] = 'Sovraimmagine';
 
//INTERPROGETTO
var div = document.createElement('div');
pulsantiComandoPers["ipro2"] = 'javascript:addTextAtCursor("==Altri progetti==\\n\\n\\n\\n","","",20)';
div.id = 'inlinePopupDiv';
pulsantiHotkeyPers["ipro2"] = 'I';
div.style.position = 'fixed';
pulsantiDescrPers["ipro2"] = 'Interprogetto + titolo';
div.style.zIndex = 1000;
div.style.left = '5px';
div.style.top = '5px';
div.style.backgroundColor = '#FFFFFF';
div.style.borderStyle = 'solid';
div.style.borderWidth = ' medium';
div.style.borderColor = '#000000';
 
//CATEGORY:
var top = document.createElement('div');
pulsantiComandoPers["category"] = 'javascript:addTextAtCursor("Category:","","",9)';
top.id = 'inlinePopupTop';
pulsantiHotkeyPers["category"] = 'X';
top.style.textAlign = 'right';
pulsantiDescrPers["category"] = 'Category:';
top.style.margin = '8px';
top.style.backgroundColor = '#DDDDDD';
 
//FOTO RICHIESTE:
// crea il tasto "Close"
pulsantiComandoPers["foto"] = 'javascript:addTextAtCursor("{{Richiesta"+" foto|}}","","",17)';
var a = document.createElement('a');
pulsantiHotkeyPers["foto"] = 'N';
a.appendChild( document.createTextNode('Close'));
pulsantiDescrPers["foto"] = 'Richiesta foto';
a.href = "javascript:void RemoveNode('inlinePopupDiv')";
a.style.margin = '8px';
 
//TRADOTTO DA:
top.appendChild(a);
pulsantiComandoPers["mytradda"] = 'javascript:addTradottoDa()';
 
pulsantiHotkeyPers["mytradda"] = 'T';
div.appendChild(top);
pulsantiDescrPers["mytradda"] = 'Tradotto da';
 
//BUTTONGREEN PER CONTRIBUTI:
// crea la spiegazione
pulsantiComandoPers["butgreen"] = 'javascript:addTextAtCursor(" [[Immagine:ButtonGreen.svg|15px]] ","","",35)';
var greet = document.createElement('p');
pulsantiHotkeyPers["butgreen"] = 'A';
greet.innerHTML = Greeter;
pulsantiDescrPers["butgreen"] = 'ButtonGreen';
div.appendChild(greet);
 
//PORTALE MITOLOGIA:
var form = document.createElement('form');
pulsantiComandoPers["mito"] = 'javascript:addTextAtCursor("{{Portale|Mitologia}}","","",19)';
form.name = "popupForm";
pulsantiHotkeyPers["mito"] = 'M';
var p = document.createElement('p');
pulsantiDescrPers["mito"] = 'Portale mitologia';
 
//TEMPLATE WIKIAFRICA:
// crea casella di testo "Motivo:"
pulsantiComandoPers["africa"] = 'javascript:addTextAtCursor("{{WikiAfrica/lettera27}}\\n","","",25)';
if (Template == "StopVoto")
pulsantiHotkeyPers["africa"] = 'W';
{
pulsantiDescrPers["africa"] = 'Template WikiAfrica';
p.appendChild(document.createTextNode('Motivo:'));
var motivo = document.createElement('input');
motivo.name = 'cause';
motivo.id = 'motivo';
motivo.type = 'text';
p.appendChild(motivo);
}
// crea il bottone "OK"
var button = document.createElement('input');
button.value = 'OK';
button.type = 'button';
// il comando dipende dal browser utilizzato
// Per ora e' stato testato solo con Firefox2 ed IE6. In caso di problemi fare riferimento alla
// dichiarazione di "BrowserDetect", in cima allo script, per avere la lista dei browser
// supportati e dei metodi di calcolo degli stessi
if (BrowserDetect.browser=="Firefox" || BrowserDetect.browser=="Mozilla" || BrowserDetect.browser=="Netscape")
button.setAttribute('onclick', 'auxFicusSannita()');
else
//if (BrowserDetect.browser=="Explorer") commentato per farlo funzionare con gli altri browser
button.onclick = auxFicusSannita;
p.appendChild(button);
 
//</pre>
// reimposta il tutto
form.appendChild(p);
div.appendChild(form);
 
// e lo mostra a video
document.body.appendChild(div);
div.getElementsByTagName('input')[0].focus();
}
 
addLoadEvent ( function ()
{
addToolbarButton('tb-fic', "javascript:FicusSannita('StopVoto');",
'http://upload.wikimedia.org/wikipedia/it/2/22/Pulsante_stop.png',
'[Stop]', 'StopVoto');
}
);