Utente:Senpai/monobook/recent2.js: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica |
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... |
||
(25 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 17 ⟶ 20:
// Make sure there's a comma at the end of each line.
badwordsUrl: 'Utente:Senpai/badwords',
filterPage: 'Utente:Senpai/
allRecentPage: 'Utente:Senpai/
recentIPPage: 'Utente:Senpai/
monitorWatchlistPage: 'Utente:Senpai/
spelldictUrl: 'Utente:Senpai/
spelldictPage: 'Utente:Senpai/
safePages: '[Ww]ikipedia:([Ii]ntroduction|[Ss]andbox|[Tt]utorial[^/]*/sandbox)',
// leave this alone
dummy: null
Riga 194 ⟶ 197:
}
var greyFont='<
window.feedFailed=function(x,bundle) {
try { bundle.status.innerHTML+=greyFont+'failed: '+x.statusText + '</
catch (err) { bundle.status.innerHTML+=greyFont+'failed badly: '+err+'</font>'; }
return true;
Riga 217 ⟶ 220:
recent2.delayedLines={};
recent2.delay=0;
recent2.namespaces={'Media':1, "Speciale":1, "Utente":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+'
if (processRecentChanges.id > initialId) {
statusTail+=' <a href="javascript:showHideDetailRange(' + initialId + ',' + processRecentChanges.id + ')">
if (recent2.autoexpand) {
setTimeout( function() {
Riga 308 ⟶ 315:
}
}
statusTail += ' <a href="javascript:deleteEarlierOutputDivs(' + bundle.status.id + ')">rimuovi
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++;
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, '
' (' + linkmaker(bundle.article+'?action=history', '
' ' + linkmaker(bundle.article, bundle.articleTitle) +
( bundle.badWord ? '
linkmaker(wikiBase + 'Utente:' + bundle.editor, bundle.editor) + ' (' +
linkmaker(wikiBase + '
linkmaker(wikiBase + '
'&autoedit=s#$#\\n{{
'}}%20~~' + '~~#&autosummary=
'
linkmaker(wikiBase + 'Speciale:Contributions/' + bundle.editor, '
linkmaker(wikiBase + 'Speciale:
( bundle.summary ? '<i>('+bundle.summary+')</i> . . ' : '') +
'<a href="javascript:showHideDetail(' + bundle.id + ')" id="showdiff_link_' + bundle.id + '">
' . . [<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('
'\
'
return;
}
Riga 531 ⟶ 563:
var summary=lastSummary.replace(RegExp('<[^>]*?>','g'),'');
if (!summary) summary=lastSummary;
alert( '
'\
return;
}
Riga 548 ⟶ 580:
recent2.tryNonAdminRollback=function(id) {
if (!autoEdit) { alert('
'Esso è incluso nei [[Wikipedia:Popup_di_navigazione|popup di navigazione]].\n\n'); 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 +
return;
}
if (i==edits.length) { alert(bundle.editor + '
'.\n\nRollback
var prevEditor=edits[i]['user'];
var prevRev=edits[i]['revid'];
var summary='
escape(bundle.editor) + ']]
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='nascondi
else { div.style.display='none'; lk.innerHTML='
}
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(
function() { recent2.show_talkpages=!this.checked; },▼
line('Ignora le pagine di discussione', !recent2.show_talkpages,
recent2.controls.newline();▼
recent2.controls.newline();▼
line('Visualizza solo le modifiche immutate dopo 4 aggiornamenti', false,
▲ recent2.newCheckbox('Espandi automaticamente i nuovi contenuti', recent2.autoexpand,
line('Usa il rollback per i non amministratori', false,
function() { recent2.non_admin_rollback = this.checked; }, 'nonadminrollback');
function() { recent2.ignore_safe_pages = this.checked; }, 'ignoresafepages');
//
// recent2.wait_for_output = this.checked;
// if (this.checked) { recent2.
// else {recent2.unpauseOutput(); }
▲ recent2.newCheckbox('Ignora le mie modifiche', false,
// }, 'waitforoutput');
▲ function() { recent2.ignore_my_edits = this.checked; },
var b=document.createElement('input');
b.type='button';
b.value='interrompi aggiornamenti';
b.onclick=function(){
b.value=(recent2.paused)?'interrompi aggiornamenti':'riprendi aggiornamenti';
}
recent2.setCheckboxValuesFromCookie();
}
Riga 724 ⟶ 761:
setTimeout(function () {
if (recent2.paused) {++recent2.count; return; }
if (++recent2.count >= iterations && ! confirm('
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;
}
|