mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 22:15:26 +00:00
f9c9c07ccf
* Add searching and filtering functionality to the existing 'test' interface. * Add an 'examine' interface designed for testing filters against a previous change, selectable through the search interface in either the 'test' or the 'examine' view. * Minor enabling change in ChangesList core, to allow subclassing.
25 lines
752 B
JavaScript
25 lines
752 B
JavaScript
/** Scripts for Examiner */
|
|
|
|
function examinerCheckFilter() {
|
|
var filter = document.getElementById( 'wpTestFilter' ).value;
|
|
|
|
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 );
|
|
} else if (response == 'NOMATCH') {
|
|
changeText( el, wgMessageNomatch );
|
|
} else if (response == 'SYNTAXERROR' ) {
|
|
changeText( el, wgMessageError );
|
|
}
|
|
} );
|
|
}
|
|
|
|
addOnloadHook( function() {
|
|
var el = document.getElementById( 'mw-abusefilter-examine-test' );
|
|
addHandler( el, 'click', examinerCheckFilter );
|
|
} ); |