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

Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica
Nessun oggetto della modifica
Riga 151:
 
// TRADOTTO DA
//<source lang=javascript>
function addTradottoDa()
{
interlinks = $.ajax({
enArticle = getpagecontent(wgTitle);
url:mw.util.wikiScript('api'),
enArticle = enArticle.substr(enArticle.indexOf("[[en:")+5);
data: { action: 'query', format: 'xml', prop: 'langlinks', lllang: 'en', titles: wgTitle},
enArticle = enArticle.substr(0,enArticle.indexOf("]]"));
async:false
})
.responseText;
 
if (interlinks.indexOf("<ll lang") < 0)
enArticle = "";
else
{
enArticle = interlinks.substr(interlinks.indexOf("<ll lang"));
enArticle = enArticle.substr(enArticle.indexOf("[[en:>")+51);
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);
}
//</source>
 
// Configurazione HOTKEYS
Riga 229 ⟶ 243:
 
//TRADOTTO DA:
pulsantiComandoPers["mytradda"] = 'javascript:addTradottoDa2addTradottoDa()';
pulsantiHotkeyPers["mytradda"] = 'T';
pulsantiDescrPers["mytradda"] = 'Tradotto da';