MediaWiki:Gadget-tradLink.js: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
m fix arg
fix alert
Riga 10:
var cookieName = 'tradLinkLangs';
var windowManager, optDialog;
 
/**
* Mostra un errore relativo al dialog. Non possiamo usare OO.ui.alert() perché
* quello usa la sua window che viene messa sotto a quella del dialog.
* Codice basato sull'implementazione di OO.ui.alert()
*
* @param {string} text Messaggio di errore
*/
function showDialogError( text ) {
windowManager.openWindow( 'message', {
message: text,
actions: [ OO.ui.MessageDialog.static.actions[ 0 ] ]
} ).closed.then( function () {
return undefined;
} );
}
 
/**
Riga 84 ⟶ 100:
}
 
/**
* Valida l'aggiunta di nuove lingue
* @param {array} formFields
*/
function submitDialogHandler( formFields ) {
new mw.Api().get( {
Riga 108 ⟶ 128:
var code = lingue[j];
if ( code === 'it' ) {
OO.ui.alertshowDialogError( 'Il codice "it" non può essere usato' );
return;
}
if ( !( code in filteredMatrix ) ) {
OO.ui.alertshowDialogError( 'Codice lingua non riconosciuto: ' + code );
return;
}
Riga 123 ⟶ 143:
}
if ( !found ) {
OO.ui.alertshowDialogError( 'Non esiste una Wikipedia nella seguente lingua: ' + code );
return;
}