Benutzer:WWWIG/monobook.js
< Benutzer:WWWIG
Zur Navigation springen
Zur Suche springen
Version vom 11. September 2010, 13:04 Uhr von WWWIG (Diskussion | Beiträge)
Hinweis: Leere nach dem Speichern den Browser-Cache, um die Änderungen sehen zu können.
- Firefox/Safari: Umschalttaste drücken und gleichzeitig Aktualisieren anklicken oder entweder Strg+F5 oder Strg+R (⌘+R auf dem Mac) drücken
- Google Chrome: Umschalttaste+Strg+R (⌘+Umschalttaste+R auf dem Mac) drücken
- Internet Explorer: Strg+F5 drücken oder Strg drücken und gleichzeitig Aktualisieren anklicken
- Opera: Gehe zu Menü → Einstellungen (Opera → Einstellungen auf dem Mac) und dann auf Datenschutz & Sicherheit → Browserdaten löschen → Gespeicherte Bilder und Dateien.
/* -- */ // my_vkdebug = true; addOnloadHook( function () { LoadTemCatGenForm(); }); var t_wikiurl = wgServer + wgScriptPath + '/api.php'; var t_Files = new Array(); var t_FilesChecked = new Array(); var t_processnext = 0; 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', 'asses', 'big'); 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;" > ...</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' ) { if ( CheckBadWord( queryData.query.recentchanges[t_Change].comment ) ) { 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 { } } } document.getElementById( 'InsertRCForm' ).innerHTML = '<hr style="margin-top:1em;"><ul>'; CheckTitles(); } function CheckBadWord( t_text ) { if ( t_text ) { for ( t_Word = 0; t_Word < t_blackwordlist.length; t_Word++ ) { if ( String( t_text.toUpperCase() ).indexOf( String( t_blackwordlist[t_Word]).toUpperCase() ) != -1 ) return true; } return false; } } function CheckTitles() { if ( t_processnext < t_Files.length ) { document.getElementById( 'InsertRCForm' ).innerHTML += '<li>' + t_Files[t_processnext][0]+'<br>'+t_Files[t_processnext][1]+'<br>'+t_Files[t_processnext][2]+'<br>'+t_Files[t_processnext][3] + '</li>'; var t_parameters = '?action=query&format=json&prop=info|revisions&intoken=delete&titles=' + encodeURIComponent( t_Files[t_processnext][0] ) + ''; 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", CatGenForm.t_wikiurl + t_parameters, true); t_http_req.onreadystatechange = function() { if(t_http_req.readyState != 4) { document.getElementById( 'Status' ).innerHTML += '<br>' + 'Datei-Token wird angefordert ...'; } if(t_http_req.readyState == 4 && t_http_req.status == 200) { DeleteTitles( eval("(" + t_http_req.responseText + ")"), t_http_req.responseText ); } } t_http_req.send(null); } } function DeleteTitles ( queryData, rawData ) { if ( queryData ) { if ( queryData.query && queryData.query.pages ) { var t_token = ""; var t_timestamp = ""; var t_some_pages = queryData.query.pages; for ( var t_Page in t_some_pages ) { if ( t_some_pages[t_Page].edittoken ) { t_token = encodeURIComponent( t_some_pages[t_Page].edittoken ); } else if ( t_some_pages[t_Page].deletetoken ) { t_token = encodeURIComponent( t_some_pages[t_Page].deletetoken ); } if ( t_some_pages[t_Page].revisions ) { var t_some_revisions = t_some_pages[t_Page].revisions; for ( var i = 0; i < t_some_revisions.length; i++ ) { if (t_some_revisions[i].timestamp) { t_timestamp = t_some_revisions[i].timestamp; } } } document.getElementById( 'Status' ).innerHTML += '<br>' + t_some_pages[t_Page].starttimestamp; } t_summary = '&reason=' + encodeURIComponent( 'automatisch gelöscht' ); var t_parameters = '?action=delete&format=json&title=' + encodeURIComponent( t_some_pages[t_Page].title ) + t_summary + '&watch&basetimestamp=' + t_timestamp + '&token=' + t_token + '&bot=1'; 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("POST", CatGenForm.t_wikiurl + t_parameters, true); t_http_req.onreadystatechange = function() { if( t_http_req.readyState != 4 ) { document.getElementById( 'Status' ).innerHTML += '<br>' + '<small>'+t_some_pages[t_Page].title+'</small><br>wird gelöscht ...'; } if( t_http_req.readyState == 4 && t_http_req.status == 200 ) { DeleteTitlesProcessed( eval("(" + t_http_req.responseText + ")" ), t_http_req.responseText ); } } t_http_req.send(null); } } } function CheckUsers() { if ( t_processnext < t_Files.length ) { var t_parameters = '?action=block&format=json&user=' + encodeURIComponent( t_Files[t_processnext][2] ) + '&gettoken'; 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("POST", CatGenForm.t_wikiurl + t_parameters, true); t_http_req.onreadystatechange = function() { if(t_http_req.readyState != 4) { document.getElementById( 'Status' ).innerHTML += '<br>' + 'Benutzer-Token wird angefordert ...'; } if(t_http_req.readyState == 4 && t_http_req.status == 200) { BlockUsers( eval("(" + t_http_req.responseText + ")"), t_http_req.responseText ); } } t_http_req.send(null); } } function BlockUsers ( queryData, rawData ) { document.getElementById( 'Status' ).innerHTML += '<br>' + rawData; if ( queryData ) { if ( queryData.block && queryData.block.blocktoken ) { var t_token = queryData.block.blocktoken; var t_parameters = '?action=block&format=json&user=' + encodeURIComponent( t_Files[t_processnext][2] ) + '&reason=' + encodeURIComponent( 'spam (automatisch gesperrt)' ) + '&token=' + encodeURIComponent( t_token ); 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("POST", CatGenForm.t_wikiurl + t_parameters, true); t_http_req.onreadystatechange = function() { if(t_http_req.readyState != 4) { document.getElementById( 'Status' ).innerHTML += '<br>' + 'Benutzer wird gesperrt ...'; } if(t_http_req.readyState == 4 && t_http_req.status == 200) { DeleteTitlesProcessed( eval("(" + t_http_req.responseText + ")"), t_http_req.responseText ); } } t_http_req.send(null); } } } function DeleteTitlesProcessed( queryData, rawData ) { if ( queryData['delete'] ) { if ( queryData['delete'].title && queryData['delete'].reason ) { document.getElementById( 'Status' ).innerHTML += '<br>' + queryData['delete'].title + '<br>' + queryData['delete'].reason; t_processnext++; if ( t_processnext < t_Files.length ) { CheckTitles(); } else { t_processnext = 0; CheckUsers(); } } } else if ( queryData['block'] && queryData['block'].user ) { document.getElementById( 'Status' ).innerHTML += '<br>' + queryData['block'].user + ' wurde gesperrt'; t_processnext++; if ( t_processnext < t_Files.length ) { CheckUsers(); } } else { document.getElementById( 'Status' ).innerHTML += '<br>Unbekannter Fehler ' + rawData; } document.getElementById( 'InsertRCForm' ).innerHTML += '</ul>'; document.getElementById( 'InsertRCForm' ).innerHTML += 'Prüfung durchgeführt<hr style="margin-top:1em;"><ul>'; }