Benutzer:WWWIG/monobook.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
WWWIG (Diskussion | Beiträge) |
WWWIG (Diskussion | Beiträge) |
||
Zeile 122: | Zeile 122: | ||
document.getElementById( 'InsertRCForm' ).innerHTML = '<hr style="margin-top:1em;"><ul>'; | document.getElementById( 'InsertRCForm' ).innerHTML = '<hr style="margin-top:1em;"><ul>'; | ||
− | + | for ( t_File = 0; t_File < t_blackwordlist.length; t_File++ ) { | |
− | |||
− | |||
// comment | // comment | ||
− | if ( CheckBadWord( | + | if ( CheckBadWord( t_Files[t_File][3] ) ) { |
− | document.getElementById( 'InsertRCForm' ).innerHTML += '<li>' + | + | document.getElementById( 'InsertRCForm' ).innerHTML += '<li>' + t_Files[t_File][0]+'/'+t_Files[t_File][1]+'/'+t_Files[t_File][2]+'/'+t_Files[t_File][3] + '</li>'; |
} | } | ||
} | } |
Version vom 11. September 2010, 10:31 Uhr
/* -- */ // my_vkdebug = true; addOnloadHook( function () { LoadTemCatGenForm(); }); var t_wikiurl = wgServer + wgScriptPath + '/api.php'; var t_Files = new Array(); var t_FilesChecked = new Array(); t_blackwordlist = new Array( 'comment', 'porn', 'angel', 'fire', 'sex', 'animal', 'movies', 'film', 'gift', 'free', 'self', 'young', 'donna', 'teens', 'girls', 'craig', 'generic', 'extend', 'discount', 'pills', 'insurance', 'life', 'valium', 'robaxin', 'vimax', 'xtreme', 'bodybuilding', 'tits', 'total', 'gym', 'reverse', 'number' ); function LoadTemCatGenForm() { if ( document.getElementById( 'InsertcheckRCForm' ) ) { out = '<form method="get" style="width:100%" name="TemCatGenForm">' + '<fieldset><legend>Recentchanges</legend>' + '<div style="margin-top:.5em; margin-left:1em; margin-right:1em;">' + '<p><input type="button" value="Hole RC" ' + 'title="" onClick="CheckRC()"> ' + '</p>' + '<label for="Status" style="vertical-align:top;">Status:</label>' + '<p id="Status" style="border: 1px solid #aaa; padding:.5em;height:75px;" > ...</p>' + '<div id="PreviewForm"></div>' + '<div id="InsertRCForm"></div>' + '</div></fieldset></form>'; document.getElementById( 'InsertcheckRCForm' ).innerHTML = out; } } function CheckRC() { var t_parameters = '?action=query&format=json&list=recentchanges&rclimit=50&rctype=new&rcprop=user|comment|flags|timestamp|title|ids|sizes'; var t_http_req = null; if (window.XMLHttpRequest) {t_http_req = new XMLHttpRequest();} else if (window.ActiveXObject) {t_http_req = new ActiveXObject("Microsoft.XMLHTTP");} t_http_req.open("GET", t_wikiurl + t_parameters, true); t_http_req.onreadystatechange = function() { if(t_http_req.readyState != 4) { document.getElementById('Status').innerHTML = 'RC-Liste wird angefordert ...'; } if(t_http_req.readyState == 4 && t_http_req.status == 200) { GotRC( eval("(" + t_http_req.responseText + ")"), t_http_req.responseText ); } } t_http_req.send(null); } function GotRC( queryData, rawData ) { if ( queryData.query && queryData.query.recentchanges ) { for ( t_Change = 0; t_Change < queryData.query.recentchanges.length; t_Change++ ) { if ( typeof queryData.query.recentchanges[t_Change].anon != 'undefined' ) { var t_File = new Array( queryData.query.recentchanges[t_Change].title, queryData.query.recentchanges[t_Change].revid, queryData.query.recentchanges[t_Change].user, queryData.query.recentchanges[t_Change].comment ); t_Files.push( t_File ); } else { } } } CheckTitles(); } function CheckBadWord( t_text ) { document.getElementById('Status').innerHTML += t_text + '<br>'; if ( t_text ) { for ( t_Word = 0; t_Word < t_blackwordlist.length; t_Word++ ) { if ( String( t_text ).indexOf( t_blackwordlist[t_Word] ) != -1 ) return true; } return false; } } function CheckTitles() { var t_FileToCheck = new Array(); document.getElementById( 'InsertRCForm' ).innerHTML = '<hr style="margin-top:1em;"><ul>'; for ( t_File = 0; t_File < t_blackwordlist.length; t_File++ ) { // comment if ( CheckBadWord( t_Files[t_File][3] ) ) { document.getElementById( 'InsertRCForm' ).innerHTML += '<li>' + t_Files[t_File][0]+'/'+t_Files[t_File][1]+'/'+t_Files[t_File][2]+'/'+t_Files[t_File][3] + '</li>'; } } document.getElementById( 'InsertRCForm' ).innerHTML += '</ul>'; }