Utente:Lusum/toolbarbuttons.js: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
 
modifica solo formale per aggiornamento accessorio
 
(Una versione intermedia di uno stesso utente non è mostrata)
Riga 1:
function addTradottoDa() {
window.gadgetToolbarUserButtons = [
var interlinks, enArticle;
{
interlinks = $.ajax( {
id: 'Barrato',
url: mw.util.wikiScript( 'api' ),
data: {
action: 'query',
format: 'xml',
prop: 'langlinks',
lllang: 'en',
titles: mw.config.get( '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();
var arrayMese = [ 'gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno',
'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre' ];
var dataOggi = my_date.getDate() + ' ' + arrayMese[my_date.getMonth()] + ' ' + ( 1900 + my_date.getYear() );
var text = '{{Tradotto da|en|' + enArticle + '|' + dataOggi + '|id}}\n';
$( '#wpTextbox1' ).textSelection( 'encapsulateSelection', { pre: text } );
}
 
window.gadgetToolbarUserButtons = [{
id: 'Barrato',: {
group: 'altro',
hotkey: 'B',
Riga 10 ⟶ 39:
}
},
id: 'Firma',: {
{
id: 'Firma',
group: 'altro',
hotkey: 'F',
Riga 20 ⟶ 48:
}
},
id: 'Alla seconda',: {
{
id: 'Alla seconda',
group: 'altro',
hotkey: '2',
Riga 30 ⟶ 57:
}
},
id: 'Note+references',: {
{
id: 'Note+references',
group: 'altro',
hotkey: 'R',
Riga 40 ⟶ 66:
}
},
id: 'Interprogetto + titolo',: {
{
id: 'Interprogetto + titolo',
group: 'altro',
hotkey: 'I',
Riga 50 ⟶ 75:
}
},
id: 'Tradotto da',: {
{
id: 'Tradotto da',
group: 'altro',
hotkey: 'T',
Riga 57 ⟶ 81:
execute: addTradottoDa
},
id: 'ButtonGreen',: {
{
id: 'ButtonGreen',
group: 'altro',
hotkey: 'A',
Riga 67 ⟶ 90:
}
},
id: 'Campo oggetto',: {
{
id: 'Campo oggetto',
group: 'altro',
hotkey: 'Z',
Riga 76 ⟶ 98:
}
}
]};