Commit graph

20 commits

Author SHA1 Message Date
helderwiki 20dabefe22 Improve error handling for HTTP requests
The API provides more details about HTTP errors, so show these to
the user instead of a generic "An unknown error occurred."

Bug: 68767
Change-Id: I3188b9729c815a07c65a7dbef4d40deebe29b87d
2014-08-02 11:56:32 +00:00
se4598 8125decd66 fix "JQMIGRATE: jQuery.fn.toggle(handler, handler...) is deprecated"
Bug: 65804
Change-Id: Ie25caa8ee2c2be9c5a2c13b3415fcd2d32ad7fb1
2014-06-08 20:59:50 +02:00
Sorawee Porncharoenwase 37d1a5c3b1 Preload abusefilter-warning if created page is blank
This patch makes a new warning message preload the text 
of MediaWiki:abusefilter-warning when the message is created 
through the filter editing view. Generally, it will make 
users more convenient because filter warnings
usually have a pattern, and preloading a pattern from the page
will save time. This patch doesn't work when
MediaWiki:abusefilter-warning hasn't created yet.

Change-Id: Ia327463c52060bfd55c0a1fa6fcec592cc3c3999
2014-01-26 15:22:28 +00:00
Helder.wiki c6a0a7daca Load filter conditions when the user presses ENTER
Cleanup:
- Trim the field value before trying to load the filter
- Add the pattern to the box using .val() instead of .text(), to
  update the content even if the user has made changes to it

Bug: 51402
Change-Id: I4ae671941571dce206448424f8e996cb99ac8d41
2013-07-23 14:01:02 -03:00
Marius Hoch 013889c5ac Prevent custom warning messages for global rules
This prevents an abuse filter admin from setting a custom warning
message (which are references to a non-translated, local wiki page),
for global filters (which can be on any wiki in any language).

bug: 45164
Change-Id: If61716053b75f45e4b70f78d3809ddd02ac6d83e
2013-07-02 23:20:06 +02:00
Marius Hoch f883ad8675 Use POST method for action=abusefilterchecksyntax API requests
Needed as filters take arbitrary user input through a textarea,
which can get rather big. GET cuts it off sometimes.

Bug: 47298
Change-Id: I317f5d7c372710617a7a6526cd4613de9660a40a
2013-04-17 15:09:43 +02:00
Marius Hoch 87094b9c0a Add .jshintrc for AbuseFilter and make it pass
Change-Id: I1cee072e6c751e441e77e6f005676fe13841283e
2013-04-17 15:03:36 +02:00
Timo Tijhof 5d50832447 JSHint: If you use 'use strict', make sure you actually pass it.
Someone added "use strict" to AbuseFilter JS files, but it didn't
actually pass in strict mode.

Change-Id: I0cf26b4dacfa88fb40d0595276db65239823763a
2013-04-02 21:44:01 +02:00
Marius Hoch e3d15fe915 Overhaul of the AbuseFilter JS
I've changed the JS of the AbuseFilter extension to match our
coding conventions and made it use mediaWiki.Api(). Furthermore
I fixed several error handlers and made some things nicer in
general while trying to not change the user appearance.

I've tested the changes as good as I could (I'm pretty sure everything
works).

Change-Id: Iaa0f99367bd7e0bfaf7249dcc9ac9ce9881b46e1
2013-03-07 14:14:25 +01:00
Marius Hoch f52f940ee5 Fix the AbuseFilter JS
This is bad style, but it works... please take a look at
https://gerrit.wikimedia.org/r/30110 which is much cleaner
and doesn't have the problems as well.

Change-Id: I91684de0c8594917736812846ed3782653a46e99
2012-10-26 15:57:54 +02:00
Siebrand Mazeland 176227e721 Maintenance for AbuseFilter extension.
* Replace deprecated methods.
* Remove no longer needed function fnmatch().
* Remove superfluous newlines.
* Remove unused and redundant local variables and globals.
* Deglobalization.
* Update documentation.
* Fix incorrect return values or add FIXMEs when in doubt.
* Escape output in a few places where needed.
* Remove unneeded MEDIAWIKI constant checks.
* Fix various JSHint/JSLint issues.

Patch Set 11: Merged https://gerrit.wikimedia.org/r/24701 into
this one per Siebrand's request

Change-Id: I02ba4ce31b6aca5b7324114093f8ece143abc295
2012-10-09 22:26:45 +02:00
Andrew Garrett 18bac6fed9 AbuseFilter: Make it possible to have differing default warning messages for differing filter groups.
Includes JS to sneakily change the default message if the user changes the filter group without having selected the "warn" action yet.

Change-Id: Ic753c3e018321dba3bf9f6d7bcee10a49c9faac8
2012-06-26 21:56:30 +02:00
Tim Starling 44c29b8c4f * (bug 34538) Fixed compatibility with $wgResourceLoaderExperimentalAsyncLoading in some extensions.
* Tested AbuseFilter.
* Did not test ArticleCreationWorkflow, Configure, ContributionTracking, FlaggedRevs, FundraiserPortal, InlineCategorizer, MarkAsHelpful, Math/Mathjax.
* Fixed a typo in a comment in LiveTranslate.
* Did not review extensions alphabetically after MoodBar.
2012-02-21 04:03:00 +00:00
Sam Reed d808b53fc4 Swap
/*
 *

for

/**
 *
2011-10-26 03:49:06 +00:00
John Du Hart 6018d5fc4c Followup r95572, replace insertAtCaret with textSelection per CR 2011-09-30 01:57:00 +00:00
John Du Hart 9c75f9907f Followup r95572, minor tweaks per CR 2011-09-30 00:48:00 +00:00
John Du Hart 4926aeae24 Followup r98490, since the module names changed the variable names need changing as well 2011-09-30 00:05:08 +00:00
John Du Hart 3f06314486 Followup r95572, rename API modules to reduce chance of collisions per CR 2011-09-29 23:30:42 +00:00
John Du Hart 39f30c3f22 Followup r95572 to change variable names and use an associative array per Krinkle and Roan on IRC 2011-08-26 20:26:57 +00:00
John Du Hart b30697e94c Adds ResourceLoader support to AbuseFilter
Rewrote javascript to use jQuery
Added API modules to replace sajax_* calls
Solves bug 29714
2011-08-26 20:12:34 +00:00