Index: trunk/extensions/AbuseFilter/AbuseFilter.php |
— | — | @@ -70,4 +70,7 @@ |
71 | 71 | |
72 | 72 | $wgAjaxExportList[] = 'AbuseFilter::ajaxCheckSyntax'; |
73 | 73 | $wgAjaxExportList[] = 'AbuseFilter::ajaxEvaluateExpression'; |
74 | | -$wgAjaxExportList[] = 'AbuseFilter::ajaxReAutoconfirm'; |
\ No newline at end of file |
| 74 | +$wgAjaxExportList[] = 'AbuseFilter::ajaxReAutoconfirm'; |
| 75 | + |
| 76 | +## Style version |
| 77 | +$wgAbuseFilterStyleVersion = 1; |
\ No newline at end of file |
Index: trunk/extensions/AbuseFilter/SpecialAbuseFilter.php |
— | — | @@ -14,8 +14,10 @@ |
15 | 15 | } |
16 | 16 | |
17 | 17 | function execute( $subpage ) { |
18 | | - global $wgUser,$wgOut,$wgRequest; |
| 18 | + global $wgUser,$wgOut,$wgRequest, $wgAbuseFilterStyleVersion, $wgScriptPath; |
19 | 19 | |
| 20 | + $wgOut->addExtensionStyle( "{$wgScriptPath}/extensions/AbuseFilter/abusefilter.css?{$wgAbuseFilterStyleVersion}" ); |
| 21 | + |
20 | 22 | $this->setHeaders(); |
21 | 23 | |
22 | 24 | $this->loadParameters( $subpage ); |
— | — | @@ -463,12 +465,11 @@ |
464 | 466 | |
465 | 467 | // Add syntax checking |
466 | 468 | $rules .= Xml::element( 'input', array( 'type' => 'button', 'onclick' => 'doSyntaxCheck()', 'value' => wfMsg( 'abusefilter-edit-check' ), 'id' => 'mw-abusefilter-syntaxcheck' ) ); |
| 469 | + $rules .= Xml::element( 'div', array( 'id' => 'mw-abusefilter-syntaxresult', 'style' => 'display: none;' ), ' ' ); |
467 | 470 | |
468 | 471 | // Add script |
469 | | - $scScript = file_get_contents(dirname(__FILE__)."/edit.js"); |
| 472 | + $wgOut->addInlineScript( file_get_contents(dirname(__FILE__)."/edit.js") ); |
470 | 473 | |
471 | | - $wgOut->addInlineScript( $scScript ); |
472 | | - |
473 | 474 | return $rules; |
474 | 475 | } |
475 | 476 | |
Index: trunk/extensions/AbuseFilter/edit.js |
— | — | @@ -8,13 +8,16 @@ |
9 | 9 | var response = request.responseText; |
10 | 10 | |
11 | 11 | removeSpinner( 'abusefilter-syntaxcheck' ); |
| 12 | + |
| 13 | + var el = document.getElementById( 'mw-abusefilter-syntaxresult' ); |
| 14 | + el.style.display = 'block'; |
12 | 15 | |
13 | 16 | if (response.match( /OK/ )) { |
14 | 17 | // Successful |
15 | | - jsMsg( 'No syntax errors.', 'mw-abusefilter-syntaxresult' ); |
| 18 | + changeText( el, 'No syntax errors.' ); |
16 | 19 | } else { |
17 | 20 | var error = response.substr(4); |
18 | | - jsMsg( 'Syntax error: '+error, 'mw-abusefilter-syntaxresult' ); |
| 21 | + changeText( el, 'Syntax error: '+error ); |
19 | 22 | } |
20 | 23 | } |
21 | 24 | function addText() { |
— | — | @@ -22,7 +25,7 @@ |
23 | 26 | return; |
24 | 27 | } |
25 | 28 | |
26 | | - insertAtCursor(document.getElementById('wpFilterRules'), document.getElementById('wpFilterBuilder').value); |
| 29 | + insertAtCursor(document.getElementById('wpFilterRules'), document.getElementById('wpFilterBuilder').value + " "); |
27 | 30 | document.getElementById('wpFilterBuilder').selectedIndex = 0; |
28 | 31 | } |
29 | 32 | |
— | — | @@ -44,4 +47,10 @@ |
45 | 48 | } else { |
46 | 49 | myField.value += myValue; |
47 | 50 | } |
48 | | -} |
\ No newline at end of file |
| 51 | +} |
| 52 | + |
| 53 | +addOnloadHook( function() { |
| 54 | + addHandler( document.getElementById( 'wpFilterRules' ), 'keyup', function() { |
| 55 | + document.getElementById( 'mw-abusefilter-syntaxresult' ).style.display = 'none'; |
| 56 | + } ); |
| 57 | +} ); |
\ No newline at end of file |
Index: trunk/extensions/AbuseFilter/AbuseFilter.i18n.php |
— | — | @@ -224,8 +224,6 @@ |
225 | 225 | 'abusefilter-edit-builder-vars-user-name' => 'Name of user account', |
226 | 226 | 'abusefilter-edit-builder-vars-user-groups' => 'Groups (including implicit) user is in', |
227 | 227 | 'abusefilter-edit-builder-vars-user-emailconfirm' => 'Time email address was confirmed', |
228 | | - |
229 | | - |
230 | 228 | |
231 | 229 | // Filter history |
232 | 230 | 'abusefilter-history' => 'History for filter $1', |