2009-01-29 22:44:31 +00:00
|
|
|
/** Scripts for Examiner */
|
|
|
|
|
|
|
|
function examinerCheckFilter() {
|
|
|
|
var filter = document.getElementById( 'wpTestFilter' ).value;
|
|
|
|
|
2009-03-17 00:10:58 +00:00
|
|
|
// The vars are too much for a GET.
|
|
|
|
sajax_request_type = 'POST';
|
2009-10-07 13:57:06 +00:00
|
|
|
|
|
|
|
sajax_do_call( 'AbuseFilter::ajaxCheckFilterWithVars', [filter, wgExamineVars], function( request ) {
|
2009-01-29 22:44:31 +00:00
|
|
|
var response = request.responseText;
|
|
|
|
var el = document.getElementById( 'mw-abusefilter-syntaxresult' );
|
|
|
|
|
|
|
|
el.style.display = 'block';
|
|
|
|
|
2009-10-07 13:57:06 +00:00
|
|
|
if ( response == 'MATCH' ) {
|
2009-01-29 22:44:31 +00:00
|
|
|
changeText( el, wgMessageMatch );
|
2009-01-30 00:54:20 +00:00
|
|
|
el.className = 'mw-abusefilter-examine-match';
|
2009-10-07 13:57:06 +00:00
|
|
|
} else if ( response == 'NOMATCH' ) {
|
2009-01-29 22:44:31 +00:00
|
|
|
changeText( el, wgMessageNomatch );
|
2009-01-30 00:54:20 +00:00
|
|
|
el.className = 'mw-abusefilter-examine-nomatch';
|
2009-10-07 13:57:06 +00:00
|
|
|
} else if ( response == 'SYNTAXERROR' ) {
|
2009-01-30 00:54:20 +00:00
|
|
|
el.className = 'mw-abusefilter-examine-syntaxerror';
|
2009-01-29 22:44:31 +00:00
|
|
|
changeText( el, wgMessageError );
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
}
|
|
|
|
|
|
|
|
addOnloadHook( function() {
|
|
|
|
var el = document.getElementById( 'mw-abusefilter-examine-test' );
|
|
|
|
addHandler( el, 'click', examinerCheckFilter );
|
|
|
|
} );
|