„Szerkesztő:AntiVandal/recent2.js” változatai közötti eltérés
Tartalom törölve Tartalom hozzáadva
aNincs szerkesztési összefoglaló |
aNincs szerkesztési összefoglaló |
||
1. sor:
/*
16 ⟶ 14 sor:
recent2={
// Edit these to your liking.
// Make sure there's a comma at the end of each line.
badwordsUrl: 'User:AntiVandal/lista',
filterPage: 'User:AntiVandal/Friss',
23. sor:
spelldictUrl: 'User:AntiVandal/Hiba',
spelldictPage: 'User:AntiVandal/Helyes',
// leave this alone
dummy: null
};
35 ⟶ 37 sor:
: window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP")
: false;
if (x) {
x.onreadystatechange=function() {
60 ⟶ 62 sor:
onSuccess: recent2.processBadWords, onFailure: function () { recent2.runOnce(recent2.getBadWords, 15000); return true;}});
}
recent2.processBadWords=function(d) {
var data=d.responseText.split('\n');
94 ⟶ 97 sor:
onSuccess: recent2.processWatchlist, onFailure: function () { recent2.runOnce(getWatchlist, 15000); return true; }});
}
var watchlist={};
var lines=req.responseText.split('\n');
128 ⟶ 131 sor:
window.spellRe=RegExp('<td>[+]</td>\\s*<td .*?>\\s*.*?\\b(' + a.join('|') + ')\\b', 'i');
}
recent2.runOnce=function(f, time) {
153 ⟶ 158 sor:
default:
if (!newOutputDiv.alerted) {
alert('
window.newOutputDiv.alerted=true;
}
220 ⟶ 225 sor:
recent2.delayedLines={};
recent2.delay=0;
recent2.namespaces={'Media':1, "
"
"MediaWiki
"
window.processRecentChanges=function(req, bundle){
var initialId=processRecentChanges.id;
229 ⟶ 234 sor:
var items=doc.getElementsByTagName('item');
var latest=processRecentChanges.lastDate;
for (var i=items.length - 1; i>=0; --i) {
var timestamp = Date.parse(getFirstTagContent(items[i],'pubDate'));
if (timestamp <= processRecentChanges.lastDate) continue;
235 ⟶ 240 sor:
var diffText=getFirstTagContent(items[i],'description').split('</tr>').join('</tr>\n');
var editSummary=diffText.replace(RegExp('^<p>(.*?)</p>[\\s\\S]*'), '$1');
var editor=getFirstTagContent(items[i], 'creator') || getFirstTagContent(items[i], 'dc:creator');
var article=getFirstTagContent(items[i], 'link');
249 ⟶ 254 sor:
if (recent2.namespaces[namespace]) continue;
}
if (! recent2.show_talkpages && articleTitle && /^
if (recent2.filter_watchlist && articleTitle &&
! window.watchlist[articleTitle.replace(/^
if (recent2.filter_badwords) {
var badMatch=null;
if (window.vandals[editor] > 0) badMatch=['', '', '[
else badMatch=badWords.test(diffText); // .test() is meant to be faster than a full match
if (badMatch) {
if (badMatch===true) { badMatch=diffText.match(badWords); }
articleTitle=getFirstTagContent(items[i], 'title');
// highlighting
badMatch[0]=badMatch[0].split(badWord).join('<span style="background-color: #FF6">'+badWord+'</span>');
287 ⟶ 291 sor:
editor:editor, diff:diffText, summary:editSummary};
}
} /* end for loop */
var output=recent2.getDelayedLineOutput();
296 ⟶ 299 sor:
else {
for (var i=output.length-1; i>=0; --i) {
}
}
304 ⟶ 307 sor:
var statusTail=greyFont+'done up to ' + formatTime(latest) + '</font>';
if (processRecentChanges.id > initialId) {
statusTail+=' <a href="javascript:showHideDetailRange(' + initialId + ',' + processRecentChanges.id + ')">
if (recent2.autoexpand) {
recent2.runOnce( function() {
311 ⟶ 314 sor:
}
}
statusTail += ' <a href="javascript:deleteEarlierOutputDivs(' + bundle.status.id + ')">
statusTail+='<br>';
bundle.status.innerHTML+=statusTail;
317 ⟶ 320 sor:
processRecentChanges.lastDate=0;
processRecentChanges.id=0;
recent2.getDelayedLineOutput=function() {
var ret=[];
331 ⟶ 335 sor:
return ret;
}
window.deleteEarlierOutputDivs=function(cur) {
for(var i=0; i<outputDivs.length; ++i) {
434 ⟶ 439 sor:
' (' + linkmaker(bundle.article+'?action=history', 'hist') + ')' +
' ' + linkmaker(bundle.article, bundle.articleTitle) +
( bundle.badWord ? '
linkmaker(wikiBase + 'User:' + bundle.editor, bundle.editor) + ' (' +
linkmaker(wikiBase + '
linkmaker(wikiBase + 'User_talk:' + bundle.editor + '?action=edit' +
'&autoedit=s#$#\\n{{sub'+'st:
'}}%20~~' + '~~#&autosummary=
'warn') + ' | ' +
linkmaker(wikiBase + 'Special:Contributions/' + bundle.editor, '
linkmaker(wikiBase + 'Special:Blockip/' + bundle.editor, '
( 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">
'<p><div id="diff_div_' + bundle.id + '" style="display: none">' +
'</div></li>' +
507 ⟶ 512 sor:
else { window.vandals[vandal]++; }
return b;
▲ }
▲ }
}
633 ⟶ 605 sor:
return null;
}
recent2.doPopups=function(div) {
662 ⟶ 635 sor:
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='
else { div.style.display='none'; lk.innerHTML='
}
696 ⟶ 669 sor:
recent2.controls=newOutputDiv('recent2.controls', 'top', true);
recent2.controls.newline = function(){ recent2.controls.appendChild(document.createElement('br')); };
recent2.newCheckbox('
function() { recent2.show_talkpages=!this.checked; },
'talk');
recent2.controls.newline();
recent2.newCheckbox('
function() { recent2.hideNonArticles = this.checked; },
'hidenonarticles');
recent2.controls.newline();
recent2.newCheckbox('
function() { recent2.autoexpand = this.checked; },
'autoexpand');
recent2.controls.newline();
recent2.newCheckbox('
function() { recent2.delay = (this.checked) ? 4 : 0; },
'delayby4');
730 ⟶ 703 sor:
}
window.marvin=function() {
// this isn't really used (not accessible from the UI), so don't worry about it
window.sysops=RegExp("^(Burumbátor|Dhanak|grin|KovacsUr|nagytibi|NCurse|nyenyec|Serinde|tgr)$");
recent2.show_talkpages=true;
765 ⟶ 739 sor:
window.addMarvin=function() {
var prefix = 'http://' + document.location.hostname + '/wiki/';
recent2.addToolboxLink(prefix + recent2.filterPage, '
recent2.addToolboxLink(prefix + recent2.allRecentPage, '
recent2.addToolboxLink(prefix + recent2.recentIPPage, '
recent2.addToolboxLink(prefix + recent2.monitorWatchlistPage, '
recent2.addToolboxLink(prefix + recent2.spelldictPage, '
//document.getElementById('toolbox_filter_changes').onclick=marvin;
}
recent2.testPage = function (str) {
return RegExp(str.split(/[_ ]/).join('[_ ]'), 'i').test(document.location.href);
779 ⟶ 753 sor:
window.maybeStart=function() {
var loc=document.location.href;
recent2.filter_badwords=true;
recent2.runOnce(marvin, 1000);
805 ⟶ 779 sor:
addOnloadHook(addMarvin);
//// testing code
//recent2.filter_badwords=true;
//recent2.filter_spelling=true;
//recent2.runOnce(marvin,1000);
// </nowiki></pre>
|