Commit graph

1623 commits

Author SHA1 Message Date
Translation updater bot 0f70bcfa10
Localisation updates from https://translatewiki.net.
Change-Id: Icba4e2cea6f55f3ac11603ad81f4975d9c396ca2
2024-10-24 09:21:14 +02:00
Translation updater bot 5e708cfd6d
Localisation updates from https://translatewiki.net.
Change-Id: I7e0ef1b6d215a48696608cfee7ab02ed6f22dae1
2024-09-26 07:58:55 +02:00
Translation updater bot f9effc6914
Localisation updates from https://translatewiki.net.
Change-Id: Idc93ec23966f23de09c9e7d1d00ae03196ac88e0
2024-09-05 08:06:42 +02:00
jenkins-bot db96518926 Merge "build: Updating micromatch to 4.0.8" into REL1_42 2024-08-30 21:31:08 +00:00
Translation updater bot f1e5b68fde
Localisation updates from https://translatewiki.net.
Change-Id: I753684906bb356aa4d7dfdd56fd606cddecc4bbc
2024-08-29 08:12:05 +02:00
libraryupgrader 8588b1a20d build: Updating micromatch to 4.0.8
* https://github.com/advisories/GHSA-952p-6rrq-rcjv

Change-Id: Ibb98c859e7b007074615db28eca6dcde2e8bc95b
2024-08-29 01:36:01 +00:00
Translation updater bot f4ddb246c8
Localisation updates from https://translatewiki.net.
Change-Id: If20c39c018a204b564942803b2216980fc48e239
2024-08-01 07:55:55 +02:00
Translation updater bot 1fb580598e
Localisation updates from https://translatewiki.net.
Change-Id: I769b2cbf39025bccc79f460b6ec471481feca279
2024-07-18 08:16:32 +02:00
Translation updater bot 0e3daf9a79
Localisation updates from https://translatewiki.net.
Change-Id: I06ce2a12a2e516a0e81ad2f90535c53629401062
2024-07-11 08:06:33 +02:00
Translation updater bot 7ff99b7cc3
Localisation updates from https://translatewiki.net.
Change-Id: Id500fad2815d92d2a4fa8fae50b907d7c9dc0d61
2024-07-04 08:35:51 +02:00
Translation updater bot 3d62f670a0
Localisation updates from https://translatewiki.net.
Change-Id: I4ef28757ffbeebe72eadd89206f5c552be52e784
2024-06-27 08:45:37 +02:00
Translation updater bot dc46a96de2
Localisation updates from https://translatewiki.net.
Change-Id: I7472c661f5874d22a77dbe1d703c4e78acd79b73
2024-06-20 08:46:19 +02:00
libraryupgrader 58870faa2d build: Updating braces to 3.0.3
* https://github.com/advisories/GHSA-grv7-fg5c-xmjg

Change-Id: I3bb81597557aa8fc4eb8162e574634871264bff2
2024-06-15 22:09:45 +00:00
Translation updater bot 33d8f49f77
Localisation updates from https://translatewiki.net.
Change-Id: I12ee51a671a6383487f3b7919c2cbd03a8046651
2024-06-13 08:40:33 +02:00
Translation updater bot 28974bc340 Localisation updates from https://translatewiki.net.
Change-Id: I349777b116c5edbee073f2a7bc1315fdc3386d1f
2024-05-30 09:13:36 +02:00
Translation updater bot b8aded596c Localisation updates from https://translatewiki.net.
Change-Id: I78e160715fe707def87f7544ff02d2acb362d3bf
2024-05-23 08:41:38 +02:00
Translation updater bot 742b58e192 Localisation updates from https://translatewiki.net.
Change-Id: I4886ffa73e85b487c3b6290a749ef061e459b33e
2024-05-16 08:32:15 +02:00
libraryupgrader ab71730c72 build: Updating ejs to 3.1.10
* https://github.com/advisories/GHSA-ghr5-ch3p-vcr6

Change-Id: I7b8b028195d10a311532057cf1bc8a63f8ed1564
2024-05-02 13:51:06 +00:00
jenkins-bot 40bbb24d73 Merge "Drop RTL scroll type detection, obsolete since 2023" 2024-04-05 07:28:37 +00:00
Translation updater bot 4c40fffc39 Localisation updates from https://translatewiki.net.
Change-Id: I0c4d069c7a04e68919e7952a4bff4c66a7bf9427
2024-03-26 08:20:46 +01:00
libraryupgrader 43908d80c6 build: Updating mediawiki/mediawiki-codesniffer to 43.0.0
Change-Id: Iba959438c61bc43240aefe78cf6ac1d114f61d4c
2024-03-18 00:07:20 +00:00
thiemowmde c45b92209c Drop RTL scroll type detection, obsolete since 2023
According to https://www.mediawiki.org/wiki/Compatibility we can:
* Ignore Internet Explorer as well as "Edge legacy" (before it
  switched to Chromium) entirely.
* Ignore old Opera (Presto, before it switched to Chromium).
* Ignore Chrome and Chromium-based browsers that are more than
  3 years old.

According to https://github.com/othree/jquery.rtl-scroll-type
* Firefox and Safari always followed the web standard.
* The "reverse" type was only ever relevant in IE.
* The "default" type was only relevant in old Chrome and
  Chromium-based browsers, before the engine was changed to follow
  the web standard.

According to https://chromestatus.com/feature/5759578031521792 this
happened in version 85, June 2020.

The only edge-case I can think of is that we want to support some
niche browser that – for some reason – still uses Chromium 84 or
older. But according to https://www.mediawiki.org/wiki/Compatibility
we are at 88+ already, everywhere.

It appears like we can safely remove two types, which means only
the web standard behavior (a.k.a. "negative") is left.

No pressure merging this. This patch can as well sit here for
another year. ;-)

Bug: T352169
Change-Id: Ifdedfd6d16abc87576df9807a55cd1b8a7d185db
2024-03-12 18:41:54 +01:00
thiemowmde e8a327fd85 Remove unused dir property from RevisionListView
The property is unused since I883a502 from 2017.

Change-Id: Idb61db8615038f136982f74f67960a2f86e1b3ff
2024-03-12 17:38:57 +01:00
jenkins-bot c75ba6880b Merge "Work around rounding errors in RTL scroll type detection" 2024-02-29 08:03:24 +00:00
jenkins-bot 4cc578bf17 Merge "Fix flipped left/right cursor keys in RTL mode" 2024-02-29 08:03:22 +00:00
thiemowmde 346846f16c Work around rounding errors in RTL scroll type detection
This is closely related to Ied0b974 which fixed a similar, if not
the same rounding issue.

Note the following might be different depending on e.g. the
operating system. My Ubuntu+Chromium shows the following behavior:
* The RTL scroll type is correctly detected as "negative" with all
  zoom factors below and up to 100%.
* When the zoom factor is 110%, 125%, or 150% the scrollLeft value
  is not 0 but something like 0.909090876 or 0.200000002.
* It's 0 again at 175% and 200%.
* Bad at 250%. Good at 300%. Bad at 400%. And so on. No rhyme or
  reason.

The current Firefox version also ends in the "negative" branch, but
doesn't have the same rounding errors. It's always a perfect 0 in
Firefox.

This makes it look like a bug in Chrome's engine. We don't know how
old it is, but based on the information in T352169 it might be a
relatively new bug that didn't exist when this code was originally
written in 2016 (see I7c903c2).

For reference, this is what's supposed to happen here: Browsers with
the scroll type "negative" (which are apparently all current Chrome
and Firefox versions) won't allow scrollLeft to be a positive number
on an RTL page. When you scroll to the left in such browsers the
numbers get negative. The detection code tries to set the number to
+1 anyway. We expect the browser to ignore this invalid call and
still report the previous 0.

This mostly works in Chrome as well. For example, setting scrollLeft
to +100 wont set it to +100 but to … some random number between >=0
and <1, depending on the current zoom factor? o_O?

I suspect we can remove this detection code entirely, or at least
change the default to "negative". But this needs more testing with
more browsers. Let's start with this tiny fix.

Bug: T352169
Change-Id: I22cbb8881578e96165097d4fcc812baadc22d7fa
2024-02-28 14:03:32 +01:00
jenkins-bot 9bc2b41d50 Merge "Drop separate .render/.initialize logic from View classes" 2024-02-27 09:07:52 +00:00
jenkins-bot 59d3001331 Merge "Merge separate "noscript" CSS module" 2024-02-27 09:06:59 +00:00
thiemowmde 759c081add Drop separate .render/.initialize logic from View classes
Most callers use it as if it's a `getElement` call anyway.

There is one .initialize method left in the HelpDialog class. That's
part of the upstream OOUI Window interfaces.

Change-Id: I5727c59ad0ad05d712d51d255906ddc44e898668
2024-02-26 20:40:28 +00:00
thiemowmde 4d5b7be496 Remove confusing grab cursor when hovering ghosts
This line was added in 2017 via I9adbd47. I think this was a mistake.
What happens is that the grab cursor appears as part of the hover
effects (the yellow/blue "ghost" circles). But these can't be
dragged. Having the cursor there is confusing as it constantly
flickers between the click and drag cursors.

Am I missing something?

Change-Id: I611fee6f7199d68b61b103bcbb2011c88651883b
2024-02-26 19:07:45 +01:00
thiemowmde af86647d5c Merge separate "noscript" CSS module
It looks like there is nothing special about this module. It is
loaded the same time as the other "lazy" module, under the same
conditions.

Change-Id: Iae3e425297ef5ed3f35cb8c8d66b390875158905
2024-02-26 17:54:53 +01:00
thiemowmde f8ad641612 Fix flipped left/right cursor keys in RTL mode
In RTL mode the slider is flipped and goes from right to left. The
revisions increase from right to left. The left cursor key needs to
be the one that increases the position.

Note there are three different "RTL scroll types" called "default",
"negative", and "reverse". This is only about CSS positions and
doesn't affect the cursor keys.

Change-Id: Ie747aa2572f2542b6c2c2176f817dd9a42b29f78
2024-02-22 16:34:26 +01:00
jenkins-bot f7b6d277ee Merge "Pass through pointer events from pointer-containers" 2024-02-22 15:33:38 +00:00
WMDE-Fisch f42385eafa Pass through pointer events from pointer-containers
Hover and click events to highlight or change revisions need to
know the intended revision target. This did not work for the area
where the pointer containers overlap the underlying revisions.

For that reasons we implemented a calculation to get the revision
using the mouse positions. That implemetation seems to be faulty
at some points.

pointer-events: none allows us to pass though the mouse events so
that we're able to always rely on the revision containers as target.

On the pointers we still want to catch events to allow dragging.

Bug: T352169
Change-Id: Ie53a6ec3b7c458dc2f72e494829dfab80952b86f
2024-02-22 16:17:01 +01:00
WMDE-Fisch f056cca73a Use attr() to get revision position number
When we load new revsions in the background and extend the view,
we still want to keep track of the positioning. This is done with
the `data-pos` attribute. When shifting the numbers due to
re-loading the `data-pos` of each revision is updated to a new
value.

$.data() does not nessecarily load the value from the `data-`
attribute, but seems to have a different representation in parallel

In some situations the results of data() vs attr( 'data-' ) seem
to differ, leading to situations where the pointer moves to the
wrong postion when clicking.

Trusting the attribute call seems to be the most stable approach
here.

Change-Id: I3c877b5a5f21ca36b8857d29ec018b16ff588962
2024-02-22 15:12:10 +01:00
jenkins-bot 62e9fd443c Merge "Rewrite revision style assignment with jQuery.toggleClass" 2024-02-21 08:31:51 +00:00
thiemowmde e5866136dd Move safety checks closer to where they belong
This is split from I4431882 to make that easier to review. This just
moves existing code around. It should not make any difference.

Change-Id: Ic1a63bac4c30656533c2323a5a133aa483a26975
2024-02-20 09:11:21 +01:00
thiemowmde 9280f7f2e7 Rename many methods to be much more meaningful
This is split from I4431882 to make that much easier to review.

Additional changes:
* Remove plural "s" from setRevisionPreviewHighlight
* Add "All" to removeAllRevisionPreviewHighlights
* Merge two methods into a single enableRevisionPreviewHighlights

Change-Id: I7088b23a330a46fadfc4ae296cf1d61f0be435f8
2024-02-20 08:53:31 +01:00
thiemowmde 29c8a4830d Rewrite revision style assignment with jQuery.toggleClass
This does the same as before, just in one single loop instead of so
many different steps.

The way the loop counts is odd. Why are the numbers returned by
getOldestVisibleRevisionIndex and getNewestVisibleRevisionIndex
off by one? I tried to make this more visible in the code without
touching it.

Change-Id: I5b9bd360bf48e138a7ae9406eab716d41fabd122
2024-02-20 08:33:40 +01:00
jenkins-bot d41ff5d8cf Merge "Introduce a default for the pushState function argument" 2024-02-19 16:34:09 +00:00
jenkins-bot 9340c48600 Merge "Remove extra "div" from jQuery selectors" 2024-02-19 16:32:44 +00:00
jenkins-bot a85aa7e023 Merge "Consolidate duplicate code updating slider line CSS" 2024-02-19 16:29:54 +00:00
Translation updater bot 52edaee7f1 Localisation updates from https://translatewiki.net.
Change-Id: Ia6f3bc3f07ff277b152e777651feaf694fe14cff
2024-02-14 08:19:19 +01:00
libraryupgrader 8ca7a124a6 build: Updating dependencies
composer:
* mediawiki/mediawiki-phan-config: 0.12.1 → 0.14.0

npm:
* grunt-banana-checker: 0.11.0 → 0.11.1
* debug: 2.6.9, 4.1.1, 4.3.1, 4.3.4 → 2.6.9, 4.3.1, 4.3.4
  * https://github.com/advisories/GHSA-gxpj-cx7g-858c
* semver: 5.7.1, 7.5.0, 7.5.4 → 5.7.2, 7.5.4, 7.6.0
  * https://github.com/advisories/GHSA-c2qf-rxjj-qqgw

Change-Id: Id7a3c5822da56407f2f0963cf91bf9440fbde7f7
2024-02-13 03:17:04 +00:00
thiemowmde ed538b815e Remove extra "div" from jQuery selectors
The extra "div.…" doesn't make the selectors more specific or
anything. The class name alone is unique. This makes the code
simpler, less brittle, and potentially even faster.

Change-Id: I38f61a793a3f5d441b9bf06f9159433cb7f002ad
2024-02-12 12:07:53 +01:00
thiemowmde 1d0c16b108 Consolidate duplicate code updating slider line CSS
This code is updating the position and length of the yellow/blue
horizontal lines in the middle of the slider, left/right to the
yellow/blue circles.

1. setSliderLineCSS is called two times. A lot of the code before
is identical. Move all code that is identical into setSliderLineCSS.

2. The two single-use methods are very short now. Nothing but a
single function call. Merge the two calls into a single method.

Notice that `-0.5 * this.revisionWidth` is the same as
`-this.revisionWidth / 2`. I was able to make one disappear by
slowly transforming the code. It still does the same as before.

Change-Id: I9f9593bf4655fc8fa681fa8190db44dc8d6fc232
2024-02-10 16:35:37 +01:00
thiemowmde 52fd2e0527 Introduce a default for the pushState function argument
Storing a new entry in the browser history is the normal, default
thing to do. The only exception is on initialization, when the slider
is initialized from the browser history.

I hope this makes the code a little easier to read.

Change-Id: I09a3e9b4417ec3d57e86dc947ac0748f30ef0dd5
2024-02-10 16:18:34 +01:00
jenkins-bot acd0632c1c Merge "Use existing data-pos attribute instead of pixel calculations" 2024-02-09 17:09:18 +00:00
thiemowmde f0742e7ba3 Use existing data-pos attribute instead of pixel calculations
This click handler is assigned to many different elements. Not all
of them can be used as a source for a data-pos="…" attribute. But a
lot can.

Again, this patch alone will not actually fix T352169. But it will
improve the situation a lot, according to my local tests. Many of
the clicks will start to work fine on RTL wikis because the
problematic pixel-based getRevisionPositionFromLeftOffset
calculations are not used any more.

Steps to reproduce: Go to a RTL page with a very long history, e.g.
https://he.wikipedia.org/wiki/Special:Diff/38031767?uselang=he
Click on one of the gray bars in the right half of the slider. This
will not work, i.e. the slider will not move to this position but
to a totally different one. This is the bug described in T352169.

I noticed that a browser zoom other than 100% can cause many more
problems that are unrelated to this patch. Please test with 100%.

Bug: T352169
Change-Id: Ife49557c891736bc94df6087658f76326791f61b
2024-02-09 16:27:05 +00:00
jenkins-bot ffc40f6954 Merge "Remove $dummy element after determineRtlScrollType call" 2024-02-09 16:03:50 +00:00