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-01-29 22:44:31 +00:00
|
|
|
sajax_do_call( 'AbuseFilter::ajaxCheckFilterWithVars', [filter, wgExamineVars], function(request) {
|
|
|
|
var response = request.responseText;
|
|
|
|
var el = document.getElementById( 'mw-abusefilter-syntaxresult' );
|
|
|
|
|
|
|
|
el.style.display = 'block';
|
|
|
|
|
|
|
|
if (response == 'MATCH') {
|
|
|
|
changeText( el, wgMessageMatch );
|
2009-01-30 00:54:20 +00:00
|
|
|
el.className = 'mw-abusefilter-examine-match';
|
2009-01-29 22:44:31 +00:00
|
|
|
} else if (response == 'NOMATCH') {
|
|
|
|
changeText( el, wgMessageNomatch );
|
2009-01-30 00:54:20 +00:00
|
|
|
el.className = 'mw-abusefilter-examine-nomatch';
|
2009-01-29 22:44:31 +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 );
|
|
|
|
} );
|