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

Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica
test
Riga 1:
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',318,''],[2,'{{Infobox 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','','Infobox conflitto',0,''],[2,'{{Box successione\\n|carica = \\n|immagine = \\n|periodo = \\n|precedente = \\n|successivo = \\n}}','','Box successione',92,''],[1,'{{Sportivo\\n|Nome = \\n|NomeCompleto = \\n|Immagine = \\n|Didascalia = \\n|Sesso = \\n|CodiceNazione = \\n|Altezza = \\n|Peso = \\n|Disciplina = \\n|Specialità = \\n|Categoria = \\n|Ruolo = \\n|Record = \\n|Ranking = \\n|BestRanking = \\n|Società = \\n|Squadra = \\n|TermineCarriera = \\n|GiovaniliAnni = \\n|GiovaniliSquadre = \\n|Squadre = \\n|AnniNazionale = \\n|Nazionale = \\n|PresenzeNazionale(goal) = \\n|Allenatore = \\n|Incontri = \\n|RigaVuota = \\n|Palmares = \\n|Vittorie = \\n|Aggiornato = \\n}}\\n','0','Sportivo',0,''],[1,'{{Da aggiornare|arg=sport|anno=2012|mese=08}}','0','Aggiornare sport',0,'']);
 
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']);
 
// Firefox
 
//CONFIGURAZIONE POPUP
popupDelay = 2; // aspetta 2 secondi
popupQueriedRevertSummary = "Rollback da popup. Ripristinata la versione di $3";
 
//MOSTRA I TATTOO
mw.loader.load("//it.wikipedia.org/w/index.php?title=Utente:Jalo/Tatoo&action=raw&ctype=text/javascript&dontcountme=s");
 
//NASCONDI IL COPYWARN SOTTO LA CASELLA DI MODIFICA
$( document ).ready ( function ()
{
if (document.getElementById("editpage-copywarn"))
document.getElementById("editpage-copywarn").style.display="none";
})
 
// TRADOTTO DA
function addTradottoDa()
{
interlinks = $.ajax({
url:mw.util.wikiScript('api'),
data: { action: 'query', format: 'xml', prop: 'langlinks', lllang: 'en', titles: wgTitle},
async:false
})
.responseText;
 
if (interlinks.indexOf("<ll lang") < 0)
enArticle = "";
else
{
enArticle = interlinks.substr(interlinks.indexOf("<ll lang"));
enArticle = enArticle.substr(enArticle.indexOf(">")+1);
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);
}
 
function tradLink()
{
var toTrad = mw.html.escape($('#wpTextbox1').textSelection('getSelection'));
var trad ="";
$.getJSON("http://en.wikipedia.org/w/api.php?callback=?",
{
action: "query",
prop: "langlinks",
lllang: "it",
titles: toTrad,
format: "json",
redirects: ""
},
function(data) {
selStart = document.getElementById('wpTextbox1').selectionStart;
selEnd = document.getElementById('wpTextbox1').selectionEnd;
if (typeof(data)!="undefined" &&
typeof(data.query)!="undefined" &&
typeof(data.query.pages)!="undefined")
{
for (var key in data.query.pages) {
if (typeof(data.query.pages[key])!="undefined" &&
typeof(data.query.pages[key].langlinks)!="undefined" &&
typeof(data.query.pages[key].langlinks[0])!="undefined" &&
typeof(data.query.pages[key].langlinks[0]["*"])!="undefined")
{
trad = data.query.pages[key].langlinks[0]["*"];
try {
mw.html.escape($('#wpTextbox1').textSelection('encapsulateSelection', { pre: trad + "[", post: "]" }));
} catch (err) {};
document.getElementById('wpTextbox1').selectionStart = selStart + trad.length;
document.getElementById('wpTextbox1').selectionEnd = selEnd + trad.length + 2;
 
return;
}
}
}
try {
mw.html.escape($('#wpTextbox1').textSelection('encapsulateSelection', { pre: "", post: "[NO LINK]" }));
} catch (err) {};
document.getElementById('wpTextbox1').selectionStart = selEnd;
document.getElementById('wpTextbox1').selectionEnd = selEnd + 9;
});
}
 
// Configurazione HOTKEYS
var tastiHotkeys = new Array();
tastiHotkeys["firma"] = 'F';
tastiHotkeys["case"] = 'C';
tastiHotkeys["obj"] = 'Z';
 
pulsantiComandoPers = new Array();
pulsantiHotkeyPers = new Array();
pulsantiDescrPers = new Array();
//SUP 2
pulsantiComandoPers["sup2"] = 'javascript:addTextAtCursor("²","","",1)';
pulsantiHotkeyPers["sup2"] = '2';
pulsantiDescrPers["sup2"] = 'Alla seconda';
 
//CITA
pulsantiComandoPers["cita"] = 'javascript:addTextAtCursor("<ref>{{Cita||}}</ref>","","",12)';
pulsantiHotkeyPers["cita"] = '';
pulsantiDescrPers["cita"] = '{{Cita}}';
 
//REFERENCES
pulsantiComandoPers["ref"] = 'javascript:addTextAtCursor(\'==Note==\\n{{references}}\\n\\n\',"","",0)';
pulsantiHotkeyPers["ref"] = 'R';
pulsantiDescrPers["ref"] = 'Note+references';
 
//PORTALE ANTICA ROMA
pulsantiComandoPers["roma"] = 'javascript:addTextAtCursor("{{Portale|Antica Roma|Germani|Storia}}","","",0)';
pulsantiHotkeyPers["roma"] = 'A';
pulsantiDescrPers["roma"] = 'Portali';
 
//INTERPROGETTO
pulsantiComandoPers["ipro2"] = 'javascript:addTextAtCursor("==Altri progetti==\\n{{interprogetto|","}}\\n\\n","",0)';
pulsantiHotkeyPers["ipro2"] = 'I';
pulsantiDescrPers["ipro2"] = 'Interprogetto + titolo';
 
//FOTO RICHIESTE:
pulsantiComandoPers["foto"] = 'javascript:addTextAtCursor("{{Richiesta"+" foto|}}","","",17)';
pulsantiHotkeyPers["foto"] = 'N';
pulsantiDescrPers["foto"] = 'Richiesta foto';
 
//TRADOTTO DA:
pulsantiComandoPers["mytradda"] = 'javascript:addTradottoDa()';
pulsantiHotkeyPers["mytradda"] = 'T';
pulsantiDescrPers["mytradda"] = 'Tradotto da';
 
//BUTTONGREEN PER CONTRIBUTI:
pulsantiComandoPers["butgreen"] = 'javascript:addTextAtCursor(" [[Immagine:ButtonGreen.svg|15px]] ","","",35)';
pulsantiHotkeyPers["butgreen"] = 'A';
pulsantiDescrPers["butgreen"] = 'ButtonGreen';
 
//TRADUCI WIKILINK:
pulsantiComandoPers["tradme"] = 'javascript:tradLink()';
pulsantiHotkeyPers["tradme"] = 'W';
pulsantiDescrPers["tradme"] = 'Traduci link';
 
//test
//importScript('Utente:Jalo/Sandbox2');
//importStylesheet('Utente:Jalo/Sandbox2');