Utente:Senpai/monobook/recent2.js: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
ok
m top: Sostituisco tag font con span, replaced: <font color="#777">'; window.feedFailed=function(x,bundle) { try { bundle.status.innerHTML+=greyFont+'failed: '+x.statusText + '</font> → <span style="color:#777">'; window.feedFailed=function(x,b...
 
(45 versioni intermedie di 5 utenti non mostrate)
Riga 1:
/*
 
Importato da [[:en:User:Lupin/recent2.js]] alla versione del 26 giugno 2006:
http://en.wikipedia.org/w/index.php?title=User:Lupin/recent2.js&oldid=60650074
 
This tool hits the RSS feed for recent changes every 30 seconds or so
Riga 16 ⟶ 19:
// Edit these to your liking.
// Make sure there's a comma at the end of each line.
badwordsUrl: 'UserUtente:Senpai/parolaccebadwords',
filterPage: 'UserUtente:LupinSenpai/Filter_recent_changesFiltra_le_ultime_modifiche',
Pagine più recentiallRecentPage: 'UserUtente:LupinSenpai/All_recent_changesTutte_le_ultime_modifiche',
Edit più recenti di IPrecentIPPage: 'UserUtente:LupinSenpai/Recent_IP_editsUltime_modifiche_anonime',
monitorWatchlistPage: 'Utente:Senpai/Segui_gli_osservati_speciali',
Monitor pagine osservate: 'User:Lupin/Monitor_my_watchlist',
spelldictUrl: 'WikipediaUtente:Lists_of_common_misspellingsSenpai/For_machinesLista_degli_errori_comuni/Formato_macchina',
spelldictPage: 'UserUtente:LupinSenpai/Live_spellcheckControllo_ortografico',
safePages: '[Ww]ikipedia:([Ii]ntroduction|[Ss]andbox|[Tt]utorial[^/]*/sandbox)',
 
// leave this alone
dummy: null
Riga 94 ⟶ 97:
recent2.getWatchlist=function() {
window.gettingWatchlist=true;
recent2.download({url: 'http://' + document.___location.hostname + '/wiki/SpecialSpeciale:Watchlist/edit',
onSuccess: recent2.processWatchlist, onFailure: function () { setTimeout(getWatchlist, 15000); return true; }});
}
Riga 134 ⟶ 137:
 
 
var feed='http://' + document.___location.hostname + '/w/index.php?title=SpecialSpeciale:Recentchanges&feed=rss';
 
window.newOutputDiv=function(klass, position, immortal) {
Riga 186 ⟶ 189:
status.style.borderStyle='solid';
status.style.borderColor='orange';
status.innerHTML=greyFont+'(' + recent2.count + ') updatingaggiornamento...</font>';
 
// this abort stuff doesn't work properly for some reason...
Riga 194 ⟶ 197:
}
 
var greyFont='<fontspan colorstyle="color:#777">';
 
window.feedFailed=function(x,bundle) {
try { bundle.status.innerHTML+=greyFont+'failed: '+x.statusText + '</fontspan>'; }
catch (err) { bundle.status.innerHTML+=greyFont+'failed badly: '+err+'</font>'; }
return true;
Riga 217 ⟶ 220:
recent2.delayedLines={};
recent2.delay=0;
recent2.namespaces={'Media':1, "SpecialSpeciale":1, "UserUtente":1, "UserDiscussioni talkutente":1, "Wikipedia":1,
"WikipediaDiscussioni talkWikipedia":1, "ImageImmagine":1, "ImageDiscussioni talkimmagine":1, "MediaWiki":1,
"Discussioni MediaWiki talk":1, "Template":1, "TemplateDiscussioni talktemplate":1, "HelpAiuto":1,
"HelpDiscussioni talkaiuto":1, "CategoryCategoria":1, "CategoryDiscussioni talkcategoria":1, "PortalPortale":1, "PortalDiscussioni talkportale":1, "Progetto":1, "Discussioni progetto":1};
window.processRecentChanges=function(req, bundle){
var initialId=processRecentChanges.id;
Riga 226 ⟶ 229:
var items=doc.getElementsByTagName('item');
var latest=processRecentChanges.lastDate;
var safePagesRe=new RegExp('^' + recent2.safePages + '$');
for (var i=items.length - 1; i>=0; --i) {
var timestamp = Date.parse(getFirstTagContent(items[i],'pubDate'));
Riga 236 ⟶ 240:
 
var article=getFirstTagContent(items[i], 'link');
if (recent2.ignore_safe_pages && safePagesRe.test(article)) { continue; }
if (recent2.delayedLines[article] && recent2.delayedLines[article].editor != editor) {
delete recent2.delayedLines[article];
Riga 287 ⟶ 292:
} /* end for loop */
var output=recent2.getDelayedLineOutput();
//console.log(output);
var outputString='';
if (recent2.outputPosition=='top') {
Riga 297 ⟶ 303:
}
bundle.output.innerHTML+=outputString;
if (recent2.wait_for_output) { recent2.pauseOutput(); }
setTimeout(function() {recent2.doPopups(bundle.output)}, 300);
processRecentChanges.lastDate=latest; // - 1; // overlap better than missing some out, i think; FIXME do this properly
var statusTail=greyFont+'doneterminato up toalle ' + formatTime(latest) + '</font>';
if (processRecentChanges.id > initialId) {
statusTail+=' <a href="javascript:showHideDetailRange(' + initialId + ',' + processRecentChanges.id + ')">toggle these detailsdettagli</a> |';
if (recent2.autoexpand) {
setTimeout( function() {
Riga 308 ⟶ 315:
}
}
statusTail += ' <a href="javascript:deleteEarlierOutputDivs(' + bundle.status.id + ')">removerimuovi earlieraggiornamenti outputprecedenti</a>';
if (recent2.wait_for_output) {
statusTail += ' | <a href="javascript:recent2.unpauseOutputOnce()">mostra nuovi aggiornamenti</a>';
}
statusTail+='<br>';
bundle.status.innerHTML+=statusTail;
Riga 322 ⟶ 332:
recent2.count - recent2.delayedLines[a].count >= recent2.delay) {
recent2.delayedLines[a].id=id++;
ret.pushvar line=(recent2.doLine(recent2.delayedLines[a]));
if (line) { ret.push(line); }
delete recent2.delayedLines[a];
}
Riga 390 ⟶ 401:
 
recent2.pendingLines=[];
 
recent2.unpauseOutputOnce=function() {
//console.log('unpausing once');
if (recent2.pausedOutput) {
recent2.togglePausedOutput();
recent2.togglePausedOutput();
}
}
 
recent2.pauseOutput=function() {
//console.log('pausing');
if (!recent2.pausedOutput) { recent2.togglePausedOutput(); }
//console.log(recent2.pausedOutput);
}
recent2.unpauseOutput=function() {
//console.log('unpausing');
if (recent2.pausedOutput) { recent2.togglePausedOutput(); }
//console.log(recent2.pausedOutput);
}
 
recent2.togglePausedOutput=function() {
Riga 397 ⟶ 427:
while (recent2.pendingLines.length) {
outputBuffer+=recent2.doLine(recent2.pendingLines.pop());
if (recent2.pendingLines.length) { outputBuffer+=recent2.outputSeparator; }
}
var pos=recent2.outputPosition;
var output=newOutputDiv('recent2.lines', pos);
output.innerHTML=outputBuffer;
setTimeout(function() {recent2.doPopups(output)}, 300);
return false;
}
Riga 430 ⟶ 462:
formatTime(bundle.timestamp) + ' ' +
//latest + ' ' + processRecentChanges.lastDate + ' ' +
'(' + linkmaker(lastDiffPage, 'lastdiff') + ')' +
' (' + linkmaker(bundle.article+'?action=history', 'histcron') + ')' +
' ' + linkmaker(bundle.article, bundle.articleTitle) +
( bundle.badWord ? ' matchedcontiene <b>' + bundle.badWord + '</b> . . ' : ' . . ') +
linkmaker(wikiBase + 'UserUtente:' + bundle.editor, bundle.editor) + ' (' +
linkmaker(wikiBase + 'User_talkDiscussioni utente:' + bundle.editor, 'talkdiscussioni') + ' | ' +
linkmaker(wikiBase + 'User_talkDiscussioni utente:' + bundle.editor + '?action=edit' +
'&autoedit=s#$#\\n{{sub'+'st:test1-ntest|voce=' + bundle.articleTitle +
'}}%20~~' + '~~#&autosummary=YourI%20recent20tuoi%20edits20ultimi%20edit',
'warnavvisa') + ' | ' +
linkmaker(wikiBase + 'SpecialSpeciale:Contributions/' + bundle.editor, 'contribscontributi') + ' | ' +
linkmaker(wikiBase + 'SpecialSpeciale:Blockip/' + bundle.editor, 'blockblocca') + ') . . ' +
( bundle.summary ? '<i>('+bundle.summary+')</i> . . ' : '') +
'<a href="javascript:showHideDetail(' + bundle.id + ')" id="showdiff_link_' + bundle.id + '">show detailsdettagli</a>' +
' . . [<a href="javascript:tryRollback(' + bundle.id + ')" class="recent2_rollback">rollback</a>]' +
'<p><div id="diff_div_' + bundle.id + '" style="display: none">' +
Riga 520 ⟶ 552:
var match=rollRe.exec(x.responseText);
if (!match) {
alert('NoNon rollbackè stato trovato nessun link foundper il rollback.' +
'\nMaybenForse youdevi shouldattivare tryla the non-adminfunzione rollback byper i non ammistratori, checkingcliccando thenel checkboxriquadro abovesovrastante?\n' +
'Alternatively,In thisalternativa, maypotrebbe beessere aun bug.');
return;
}
Riga 531 ⟶ 563:
var summary=lastSummary.replace(RegExp('<[^>]*?>','g'),'');
if (!summary) summary=lastSummary;
alert( 'CouldImpossibile noteffettuare il rollback - someonequalcun\'altro ha elseeditato hasla editedpagina sincedopo theil vandalvandalo.\n\nPage: '+ b.articleTitle +
'\nVandalnVandalo: '+vandal+'\nLastnUltimo editorcontributore: '+lastEditor+'\nEdit summarynOggetto: '+summary);
return;
}
Riga 548 ⟶ 580:
 
recent2.tryNonAdminRollback=function(id) {
if (!autoEdit) { alert('YouTu needhai tobisogno havedi autoeditattivare functionalityil forrollback per i non-admin rollbackamministratori.\n\n' +
'Esso è incluso nei [[Wikipedia:Popup_di_navigazione|popup di navigazione]].\n\n'); return; }
'This is included in Navigation popups - see [[WP:POP]].\n\n'+
'Alternatively, you can try adding '+
'{{sub'+'st:js|User:Lupin/autoedit.js}} ' +
'to your user javascript file.'); return; }
var b=recent2.getBundleVandal(id);
if (!b) { return; }
Riga 577 ⟶ 606:
if (i===0) {
alert( 'Could not rollback - someone else has edited since the vandal.\n\nPage: '+ bundle.articleTitle +
'\nVandal: '+bundle.editor+'\nLast editor: '+edits[0]['user']+'\nEdit summary: '+edits[0]['*comment']);
return;
}
if (i==edits.length) { alert(bundle.editor + ' seemssembra tol\'unico beautore thedella only editor topagina ' + bundle.articleTitle +
'.\n\nRollback abortedfallito.'); return; }
var prevEditor=edits[i]['user'];
var prevRev=edits[i]['revid'];
var summary='RevertedRipristino editsmodifiche bydi [[SpecialSpeciale:Contributions/' + escape(bundle.editor) + '|' +
escape(bundle.editor) + ']] torecuperando lastl\'ultima versionversione bydi ' + escape(prevEditor);
summary=summary.split(' ').join('%20');
var url=bundle.article + '?action=edit&autosummary=' + summary + '&oldid=' + prevRev +
Riga 618 ⟶ 647:
var bundle=window.bundles[id];
if (!div.innerHTML) div.innerHTML= ( bundle.badDiffFragment ? bundle.badDiffFragment:'') + bundle.diff;
if ((force && state==true) || (!force && div.style.display=='none')) { div.style.display='inline'; lk.innerHTML='hide detailsnascondi'; }
else { div.style.display='none'; lk.innerHTML='show detailsdettagli'; }
 
}
Riga 645 ⟶ 674:
var l=document.createElement('label');
l.innerHTML=label;
l.onclick=function(){ ret.click(); }
recent2.controls.appendChild(l);
recent2.checkboxes.push(ret);
Riga 690 ⟶ 720:
recent2.controls=newOutputDiv('recent2.controls', 'top', true);
recent2.controls.newline = function(){ recent2.controls.appendChild(document.createElement('br')); };
var line=function(a,b,c,d){ recent2.newCheckbox('Ignore talk pages'a,b,c,d); !recent2.show_talkpages,controls.newline(); }
 
function() { recent2.show_talkpages=!this.checked; },
line('Ignora le pagine di discussione', !recent2.show_talkpages,
'talk');
function() { recent2.show_talkpages=!this.checked; }, 'talk');
recent2.controls.newline();
recent2.newCheckboxline('IgnoreIgnora pagesle outsidepagine thenon articleappartenenti al namespace principale', false,
function() { recent2.hideNonArticles = this.checked; }, 'hidenonarticles');
line('Espandi automaticamente gli aggiornamenti', recent2.autoexpand,
'hidenonarticles');
function() { recent2.ignore_my_editsautoexpand = this.checked; }, 'autoexpand');
recent2.controls.newline();
line('Visualizza solo le modifiche immutate dopo 4 aggiornamenti', false,
recent2.newCheckbox('Automatically expand new content', recent2.autoexpand,
function() { recent2.autoexpanddelay = (this.checked) ? 4 : 0; }, 'delayby4');
line('Usa il rollback per i non amministratori', false,
'autoexpand');
function() { recent2.non_admin_rollback = this.checked; }, 'nonadminrollback');
recent2.controls.newline();
recent2.newCheckboxline('OnlyIgnora showle editsmie unchanged after four updatesmodifiche', false,
function() { recent2.delayignore_my_edits = (this.checked) ? 4 : 0; }, 'ignoremyedits');
line('Ignora le pagine sicure', false,
'delayby4');
function() { recent2.ignore_safe_pages = this.checked; }, 'ignoresafepages');
recent2.controls.newline();
// line('Only show output when I ask for it', false,
recent2.newCheckbox('Use non-admin rollback', false,
// function() { recent2.non_admin_rollback = this.checked; },
// recent2.wait_for_output = this.checked;
'nonadminrollback');
// if (this.checked) { recent2.controls.newlinepauseOutput(); }
// else {recent2.unpauseOutput(); }
recent2.newCheckbox('Ignore my edits', false,
// }, 'waitforoutput');
function() { recent2.ignore_my_edits = this.checked; },
var b=document.createElement('input');
'ignoremyedits');
b.type='button';
b.value='interrompi aggiornamenti';
b.onclick=function(){
b.value=(recent2.paused)?'interrompi aggiornamenti':'riprendi aggiornamenti';
recent2.controls.newlinetogglePaused();
}
recent2.controls.newlineappendChild(b);
recent2.setCheckboxValuesFromCookie();
}
Riga 724 ⟶ 761:
setTimeout(function () {
if (recent2.paused) {++recent2.count; return; }
if (++recent2.count >= iterations && ! confirm('ContinueVuoi monitoringcontinuare recenta changescontrollare le ultime modifiche?') ) return;
recent2.count %= iterations; loopRecentChanges(url, iterations);
}, 30000);
Riga 754 ⟶ 791:
}
// re-render the title and accesskeys from existing code in wikibits.js
//akeytt(); //rimosso, non funziona più
return li;
}
Riga 765 ⟶ 802:
window.addMarvin=function() {
var prefix = 'http://' + document.___location.hostname + '/wiki/';
recent2.addToolboxLink(prefix + recent2.filterPage, 'FilterFiltra recentle changesultime modifiche', 'toolbox_filter_changes');
recent2.addToolboxLink(prefix + recent2.allRecentPage, 'AllTutte recentle changesultime modifiche', 'toolbox_all_changes');
recent2.addToolboxLink(prefix + recent2.recentIPPage, 'RecentUltime IPmodifiche editsanonime', 'toolbox_IP_edits');
recent2.addToolboxLink(prefix + recent2.monitorWatchlistPage, 'MonitorSegui mygli watchlistosservati speciali', 'toolbox_watchlist_edits');
recent2.addToolboxLink(prefix + recent2.spelldictPage, 'LiveControllo spellcheckortografico', 'toolbox_spelling');
//document.getElementById('toolbox_filter_changes').onclick=marvin;
}