MediaWiki:Gadget-CatWatch.js: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
m fix spazio |
+i18n |
||
Riga 9:
* è presente in OsservatiSpeciali, viene allora aggiunta a quelle già presenti in OsservatiSpeciali.
*
*
* http://it.wikipedia.org/w/index.php?title=Wikipedia:Monobook.js/Catwatch.js&oldid=52893797
* che a sua volta lo importava da:
* http://en.wikipedia.org/w/index.php?title=User:Ais523/catwatch.js&oldid=216824057
*
* @author [[
*/
/*jshint unused: false, evil: true */
Line 20 ⟶ 22:
'use strict';
var i18n = {
en : {
errorEval: 'Error evaluating',
errorGet: 'Error retrieving',
msgConfig: 'Category watchlist not found. Do you want to create a new one?',
monthNames: 'wgMonthNames'
},
it : {
errorEval: 'Errore in',
errorGet: 'Errore nel leggere',
monthNames: 'wgMonthNamesShort'
}
},
// Massimo numero di pagine monitorate per categoria (max 500)
// Configurazione utente
userConfig = 'User:' + mw.config.get( 'wgUserName' ) + '/CategorieOsservate.js',
// Modello di configurazione
configModel = 'MediaWiki:Gadget-CatWatch.js/CategorieOsservateTemplate.js'
function msg( key ) {
▲ msgHelp = '[Gadget-CatWatch] Non hai ancora una lista di categorie da controllare. Vuoi crearne una?';
var msgs = i18n[mw.config.get( 'wgUserLanguage' )] || i18n.en;
return msgs[key];
}
// Ritorna la variabile CategorieOsservate nel CategorieOsservate.js dell'utente
Line 45 ⟶ 64:
eval( data );
} catch ( e ) {
alert( '[
return;
}
Line 52 ⟶ 71:
categoryHandler( window.CategorieOsservate );
}
} else if ( confirm( '[CatWatch] ' + msg( 'msgHelp' ) ) ) {
document.___location = mw.config.get( 'wgScript' ) +
'?action=edit&title=' + userConfig +
Line 60 ⟶ 79:
.fail( function ( jqXHR, textStatus, errorThrown ) {
if ( mw.util.getParamValue( 'debug' ) ) {
alert( '[
userConfig + ': ' + errorThrown );
}
} );
Line 99 ⟶ 118:
hours = date.getHours();
minutes = date.getMinutes();
months = mw.config.get( msg( '
return {
date: date.getDate() + ' ' + months[date.getMonth() + 1] + ' ' +
Line 108 ⟶ 127:
function makeTimestamp( text ) {
var months, month, date = text.split( ' ' );
}
Line 184 ⟶ 203:
$( function () {
// Se la pagina corrente è Speciale:OsservatiSpeciali
if ( mw.config.get( '
// scarica la lista delle categorie da monitorare.
getUserConfig( function ( categories ) {
|