The classic editor (textarea) already takes focus, while for Ace we need
to explicitly call its focus() method.
Bug: T202480
Change-Id: I8dcf54e46e730b2879b09b4e21198b2ef1131706
This settles almost everything, leaving the tags part ready to be
further improved in the follow-ups.
Also, replaced some fields with totally different ones, improved the
warn preview area and improved a bit nojs experience by hiding unusable
buttons.
Bug: T132284
Bug: T154749
Change-Id: I7a5caa862a32f9792140c6a4d9708a2d20472672
I copied that function from github, but I realised that ace already
includes it, so no reason to have unnecessary function declarations.
Also, this fixes a minor bug that prevents the caret from moving to the
very last character when checking syntax.
Change-Id: Ia243b75803008b801dc24faaacbe7844618ccb45
Basically, with this we always start with a functioning textarea. If JS
is enabled (and CodeEditor installed), it gets then replaced by the Ace
editor.
Bug: T192241
Change-Id: Id4dc1debf0240d5b336f4d9ab5b363c240f08807
Standardized Special:AbuseFilter/test and /examine/# to OOUI. They need
to be updated together, since they share the same load filter button
(now centralized) which needs to be handled in a different way.
Bug: T132284
Bug: T58367
Bug: T58368
Depends-On: If3d6a994142e34686bb7fc9f09093f751b599485
Change-Id: Ib935e8c9706e987468e52ec2ad1c7219b35fb9d5
Conversion of the builder dropdown, the syntax checker button and also
the button for switching editor coming from ace.
Bug: T132284
Depends-On: If3d6a994142e34686bb7fc9f09093f751b599485
Change-Id: Ic7f17437f4f0dcc0ea0edbab24eb976e2f76bdbd
Replace the conditions textarea with Ace editor for editing and testing
filter. This uses a soft dependency on CodeEditor; if the latter isn't
installed, the classic textarea is used. The user is still able to
switch between the editors on the go; the new buttons may look a bit
ugly now, but after switching to OOUI they should get much better.
Finally, added a custom syntax highlight for AbuseFilter rules.
Bug: T39192
Change-Id: If3d6a994142e34686bb7fc9f09093f751b599485
Public comments are parsed in some places and they are
shown as plain text in others. Always show them as
plain text instead of parse them.
Bug: T173249
Bug: T141670
Change-Id: I173ffab1a99c1536cca260b76be0d95a4966b139
When you tested filter against the change (with failure) and then
checked the syntax (with success), the new CSS class was overriden by
the old one, that's why the red X stayed.
Bug: T129753
Change-Id: I34cdba72f0b0e24e97083ba6b47554d0c8b826cf
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
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
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
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
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
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
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
* 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
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
* 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.