Commit graph

41 commits

Author SHA1 Message Date
jenkins-bot 25b1820f4c Merge "abusefilter.css: Increase the default abusefilter editor width" 2023-03-15 14:00:30 +00:00
xiplus a29520ad92 Re-add #mw-abusefilter-syntaxresult
It was accidentally removed in f3383dbea2.

Bug: T331787
Change-Id: Ia8aa40098029b34870afe5ae18cbca43404572c5
2023-03-11 23:36:54 +08:00
MarcoAurelio f3383dbea2 Increase CSS specifity to override MonoBook .special li
Bug: T331211
Change-Id: I3ad44c830f8d1f59b798820a2cba1c7950115492
2023-03-04 21:02:48 +00:00
TheresNoTime fdcf2aab36 abusefilter.css: Increase the default abusefilter editor width
Increase default widths from `65%` to `90%` for the editor, notes,
description, group inputs.
Add `mw-abusefilter-edit-description-input` id to
`abusefilter-edit-description` TextInputWidget.

Bug: T294856
Change-Id: Ia9472298170740a39fd24864003b766078fcdfaf
2023-02-07 20:59:13 +00:00
jenkins-bot 170bd831e7 Merge "ViewEdit: avoid linebreaks in form labels" 2020-10-14 15:29:02 +00:00
Daimona Eaytoy 62adeb3ce5 Add a lot of selenium tests for the editing view
The editing view is currently full of tech debt, brittle and surprising
code and whatnot. It's basically a miracle if it works without problem,
and it'd be an even bigger miracle if you could change something there
without breaking anything.

For these reasons, and because that class must be refactored as part of
the upcoming overhaul, this patch adds a bunch of selenium tests to test
the main functionality of that page.

In particular, these tests cover all possible cases (each corresponding
to a data source) for which buildFilterEditor can be called, which FTR are:
1 - View the result of importing a filter
2 - Create a new filter
3 - Load the current version of an existing filter
4 - Load an old version of an existing filter
5 - Show the user input again if saving fails after one of the steps
  above

Having automated tests to cover these cases means that we don't have to
manually test all the scenarios manually each time the class is touched.

Bug: T201193
Change-Id: I408e0a132905416effe0d6d6dc0921991edd66bd
2020-09-29 14:22:53 +00:00
Daimona Eaytoy 03becdd2e9 ViewEdit: avoid linebreaks in form labels
This will prevent the labels from being squeezed under certain
conditions (e.g. if the interface is in Chinese). The labels are now
taking up more space for all languages, but that's not a problem because
we have plenty of space on the right.

Bug: T231962
Change-Id: I8569cc63c4116c3a8978258d5656c72fcf2552b0
2020-09-20 13:55:06 +02:00
Daimona Eaytoy c1b4f1084c ViewTools: hide the result box when empty
The <pre> element is now hidden with CSS, and is only shown after the
user clicks the "Eval" button.
Moreover, make the button primary and progressive, as to indicate that
it activates the primary function of that page.

Bug: T253492
Change-Id: I300ce6ec0a84ea73025a5af9173024df7c291e03
2020-09-19 12:37:06 +00:00
Daimona Eaytoy 4c98aecf4d Improve var dumping in /details, /examine and /tools
Using var_export for better visual effect, especially for arrays.
The result from /tools is much clearer and the 'wrong syntax' message is
a bit more explicative than before.

Bug: T190653
Bug: T239972
Change-Id: I79a17305c7f19f7900f896f895e9365bb5f2fd58
2020-03-28 17:35:43 +01:00
Daimona Eaytoy b235e1040a Restyle edit box dimensions
Now it's always wider, and so is the "notes" field. Moreover, the
fallback textarea has the exact same size. Plus removed a parameter
which only made it hard to write a CSS rule for the textarea. Since the
textarea is generated by the same code, and we're always using it for
the same thing (filter syntax, regardless of the final goal), make it
always use the same name.

Bug: T230591
Change-Id: Ibb308e80d954c0e81aa09249c38c39572f157948
2019-08-17 18:53:13 +02:00
Daimona Eaytoy 4b33b2b5a7 Strike suppressed AbuseLog entries
Instead of adding a message, do like core does by striking and greying
out the row. Plus, don't show the AbuseLog page description when hiding
entries, as it doesn't fit.

Change-Id: I645a89dd8df79d45ca440e0ba62adcdee921b8e9
2019-01-23 11:34:43 +01:00
jenkins-bot 196272fbc1 Merge "Move changed field styles to TD for history pager" 2019-01-19 13:18:32 +00:00
se4598 9d12e1b353 Allow selecting custom disallow message
You can now select a custom message to be displayed for disallowing a edit
the same way as for warn mode. This can be the same or a totally different
message.

This also solves the usecase, when a edit filter is set to warn AND disallow,
to be able to show the user a custom message, but the generic is shown
on the second try (disallow). Now it can be only set to disallow.

Bug: T27086
Change-Id: Ic1de03a6944c43a346fa317ee0a217551f0d284a
2018-10-11 10:35:01 +02:00
Daimona Eaytoy 1634bd1b35 Move changed field styles to TD for history pager
This produces the following results:
*Fields are coloured with red even when empty, to make clear that the
field has been changed and emptied.
*The background color is applied to the whole cell, with no padding.
This is clearer to see, although I don't know if the visual effect is
acceptable (to me, it is).
The weight of CSS rule has to be increased too, since core classes are
loaded first.

Plus, improve a little bit the way changed fields are detected.

Bug: T204650
Change-Id: I1b107e47b3b8b2e23c6f135e0d6f26768c5f39b2
2018-09-21 16:17:36 +02:00
Daimona Eaytoy e8a4517d6b Improve Ace syntax highlight
Several improvements, this is the list:
*Added highlighting for disabled and deprecated variables
*Simplified a bit Ace's keyword mapper
*Added highlighting for ternary operator
*Added logic to retrieve operators from AF tokenizer
*Removed $ symbol since it's not usable in declaring stuff
*Customized highlighting via CSS

Depends-On: I5c370b54e6516889624088e27928ad3a1f48a821
Change-Id: If95e34fc7260413c4fb39c18a1ef44f5a93e1a68
2018-08-22 15:23:35 +00:00
Daimona Eaytoy b825e396b5 Switch editing interface to OOUI & improve NoJS usability
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
2018-07-17 14:49:50 +02:00
Bartosz Dziewoński abe72f2937 Make the "Load filter ID:" field on Special:AbuseFilter/test wider
The translation can be a lot longer in languages which have no common
abbreviation like "ID" for the word "identifier". For example, the
label currently wraps over 3 lines in Polish (pl).

Change-Id: I822aafb52bbe840c00d2f0edbaeec37e3748f96f
2018-06-13 02:32:48 +00:00
Daimona Eaytoy cf4ac34420 Show throttled filters in Special:AbuseFilter
With this patch, filters which are both enabled and throttled have an
"actions automatically disabled" label together with "enabled" and the
row is displayed in red. Plus, some minor changes like removing unused
fields from sortable ones and added a comment to getQueryInfo about used
columns (the idea is that it'll be easy to understand if a given column
is already there, plus if we'll need the missing one we may just replace
it with '*').

Bug: T154206
Change-Id: Iab157d094cbf2d50e9db537535fd48243e74af0b
2018-06-08 21:54:58 +02:00
Daimona Eaytoy 2d876d08bd Use OOUI buttons instead of plain links and Html::errorbox for errors
Like we did for other links in /diff and /histories, there are some
links that we'd better display as OOUI buttons. Also, use the Html
class' specific method to show errorboxes.

Bug: T132284
Change-Id: If67035991a0835ec3edc13be4543e6b40c76c3ea
2018-05-02 13:13:01 +02:00
Daimona Eaytoy fa413d431e Use the old textarea if JavaScript is disabled
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
2018-04-23 23:43:23 +00:00
Daimona Eaytoy 7450fb1d62 Switch /test and /examine/# to OOUI
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
2018-03-30 13:12:36 -04:00
Daimona Eaytoy 520ebea2cb Switch footer of editor to OOUI
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
2018-03-30 12:58:45 -04:00
jenkins-bot c67ab4a061 Merge "Revert "Revert "Switch editor to Ace and provide syntax highlight""" 2018-03-30 15:29:01 +00:00
Daimona Eaytoy 3350183fe3 Revert "Revert "Switch editor to Ace and provide syntax highlight""
Make Ace use a fixed size in em.

This reverts commit 272775ff81.

Change-Id: I9b439b20df91eb367bcef4b6f33ff087aded0b62
2018-03-30 11:10:16 -04:00
jenkins-bot 21ee742e08 Merge "Reinforce CSS selectors to avoid overriding by MonoBook" 2018-03-30 14:07:38 +00:00
jenkins-bot 899fd5783b Merge "Revert "Switch editor to Ace and provide syntax highlight"" 2018-03-30 02:14:15 +00:00
Huji 272775ff81 Revert "Switch editor to Ace and provide syntax highlight"
This reverts commit 89e6778793.

Change-Id: I41aee10fdd5633d56692334696fb750f41b15433
2018-03-30 02:07:00 +00:00
jenkins-bot f903aa92d4 Merge "Switch editor to Ace and provide syntax highlight" 2018-03-30 02:02:00 +00:00
Daimona Eaytoy d57b266497 Reinforce CSS selectors to avoid overriding by MonoBook
Tiny change to avoid problems with MonoBook skin.

Bug: T78304
Change-Id: I611a84b2763fca9aa821b5ce15e216bde5d05617
2018-03-27 20:14:08 +02:00
Daimona Eaytoy 89e6778793 Switch editor to Ace and provide syntax highlight
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
2018-03-23 12:39:22 +01:00
Daimona Eaytoy 3bc4bfc4d5 Add search for filter patterns
Adds an option for searching filters with a
specific pattern in the main page, together with already existing options.
Plain search and regex are available, only for users with the
view-private right. The search is performed directly on the database.
If the user actually searched for something, it is also added a column to
Special:AbuseFilter showing a snippet of the pattern from each filter, with the query match highlighted.

Depends on: I8144062b1f273d0d8932203ffcb7a71aca60bba9

Bug: T87455
Change-Id: Ibcd84ff84edca481328210ee857b0ab723028632
2018-03-17 14:54:48 +00:00
Umherirrender fcfdb9a6b6 Add stylelint for css files
Fixed the following rules:
color-hex-length
function-parentheses-space-inside
selector-list-comma-newline-after

Change-Id: Ib30aaeb6179617caa693219d434237e950ef5270
2017-04-16 20:21:40 +02:00
Amrutha S 7fd788f9d4 Increased the number of rows of AbuseFilter's Examine Past diffs table
The text areas for the table row had only 5 rows initially which was
small and it needed scroll to view it completely.
Now it has been changed to 25.

Bug: 59866
Change-Id: I77a092ac956bd9a9e4b7eb38abb16876087b8560
2014-01-11 12:54:43 +00:00
MatmaRex 3d4d705b06 AbuseFilterViewDiff: Make diffs use standard styling (and more)
They still used old 1.18-style diffs, with styles copied from core.

Also:
* Remove the distinction between "simple" and "multiline" diff chunk,
  enabling consistent styling
* Always show word-level diff, even in previously "simple" chunks
* Ensure the full context is always shown. This was clearly intended
  (showing straight side-by-side comparison if there were no changes
  and in "simple" chunks, diff otherwise; showing chunks with no
  changes), but the default context is only 2 lines.
* Remove the distinction between 'wikitext' and 'text' diffs (all are
  treated like 'text' was); it's impossible to show parsed code with
  word-level diff, and it was only enabled for "simple" chunks, all of
  which are intended to be one-line strings and are shown unparsed
  elsewhere (e.g. filter description on the list on Special:AbuseFilter)

Bug: 36478
Change-Id: Ie24ad5ac5a9a2bc9b8f0fc0c4a03d5dfe7a6a83f
2013-06-29 23:43:45 +00:00
MatmaRex 697e2b2415 CSS: Minor code style fixes
Change-Id: Ib0b6e441be90a76a956884e0925e808ce23d25eb
2013-06-10 18:52:15 +02:00
Marius Hoch baf5001d34 Remove redundant class for syntax errors
Removed the redundant clss mw-abusefilter-examine-syntaxerror
as it was causing trouble because the syntax checker in
ext.abuseFilter.edit.js wasn't aware of it.

Change-Id: Ibb90c3e096c3914905c03a3e30c08ba8d14c9024
2013-05-24 16:45:35 +02:00
Szymon Świerkosz 36678a7b00 (bug 18145) Diffs on some /details views are stretched horizontally.
I have changed the table-layout to fixed
and increased width from %80 to 100%.

Change-Id: I7a3c6c1bfe491b8e5182f05bc2df2c1d016120d7
2012-04-13 16:52:00 +02:00
Robin Pepermans c103fac20f It's better to set directionality in html than in css. Also fixes bug 34297, because the css only affected the edit form and not the test form.
Also add a bit of docs.
2012-02-09 17:00:34 +00:00
John Du Hart ee051870ae Adding @embed for RL 2011-11-22 16:10:49 +00:00
Brion Vibber a3b99c0d7c * (bug 31870) Fix regression in AbuseFilter: pass/fail checkmark images for syntax checks work again
Was broken by r81905 consolidating background-repeat and background-position into a single background rule, which implied a 'background-image: none' overriding the background-image values set by other rules.
Restored them & added a comment so the next person won't do the same.

Also moved the image files to match the reorg of the css in r95572, which would have broken these images if r81905 hadn't done it first. ;)
2011-11-03 00:13:27 +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
Renamed from abusefilter.css (Browse further)