The ulsPopup variable is local to the showUndoTooltip() function.
If it is called multiple times, then a previous assignment of an
OO.ui.PopupWidget object would not be found here in subsequent calls.
This check can only ever be false since it is the first statement in
the function (after variable and function declarations, which don't
do anything other than call `$()`).
Change-Id: I7020c103428d01b5e48c65be695471401f588fc4
composer:
* mediawiki/minus-x: 1.1.0 → 1.1.1
npm:
* eslint-config-wikimedia: 0.17.0 → 0.19.0
The following rules are failing and were disabled:
* compat/compat
Additional changes:
* Added the "composer phan" command to conveniently run phan.
* eslint: Renamed `wikimedia/client` profile to `client-es5` (T277085).
Change-Id: Ib31cbcd8c615d2e6abf9ee30f0f4d7b7baa54e2e
In development environment, ev.currentTarget is the button.
In Beta Cluster, however, once ext.uls.mediawiki is loaded,
it is now the document (the event has bubbled up). I do not
know what causes the difference, but we can use the target.
Bug: T276255
Change-Id: Ie4c425510293a6f2ce81e4bf4a353f2c8d86d412
Small dialogs were resizing after loading when display and input
setting buttons were added to it. Now delay showing the dialog until
they are loaded.
Bug: T276248
Change-Id: I7033903737afedbd4be908c84d07656c468ce801
Unrelated behavior change: ULS language selection dialog is hidden while
display or input settings is open.
Also simplified dead code in addDisplaySettings.
Bug: T276248
Change-Id: Ia91a2b83e7ad4072016649230e2376b0793cbbff
Reported in
https://github.com/wikimedia/jquery.uls/pull/383#pullrequestreview-613761459
Instead of checking the left edge of the trigger, check the midpoint.
This is more reliable and does not cause the dialog to incorrectly
swap sides in narrow screens in LTR direction,
This patch does not touch the compact language links variant.
Bug: T276248
Change-Id: Ic734abb7b350852f8c5c10ced8456bf146df62d8
New Vector introduced a new content language selector trigger. This
code was hardcoding a behavior that works for compact language links
but is not so appropriate for other uses in the skin, which are out
of our control.
This patch aims to be a minimal change to allow other kinds of
behavior without changing the amount of tech debt. This changes
the default ULS dialog behavior to match the requirements shown
in the task. Compact language links specific behavior is retained but
only enabled for the compact language links trigger. The behavior
is chosen depending on the value of isUsingStandaloneLanguageButton().
For future changes, I propose that mw-interlanguage-selector class will
not have any styles attached to it. Whoever creates the trigger would
be in charge of styling it. Ideally that code would also define the
positioning and other behavior, but it is less clear how that can be
abstracted in a nice and decoupled way.
Bug: T276248
Change-Id: I52da6c2f5a1f25d64f322a3c8f6105da3b244b66
Changes to comments, naming and code to increase clarity of the code
and explain better what it does and why. No change in behavior.
Change-Id: I998fcfd620c2ee737618c3ab8f41fb6dfdd2c99a
Translate's pagetranslation.uls module needs to override the action
that happens after language code is set. Currently it uses setlang
url parameter, which (no longer) works with Special:MyLanguage.
After this patch, it can use mw.uls.setLanguage and does not need
to reimplement it's functionality.
Turned mw.uls.changeLanguage into simple utility that calls
location.reload when the promise is resolved.
Change-Id: I9a648b146188dd252c239085bbe276165dc5f393
Per T275894, Readers Web intend to increase the scope of the
UniversalLanguageSelector instrument to help them understand how
users are interacting with the Languages list in sidebar.
In order to keep the UniversalLanguageSelector extension focussed and
not overly Wikimedia-specific, it was agreed that the instrument would
be migrated to the WikimediaEvents extension, where other such
instruments are located.
Therefore, remove all code related to the UniversalLanguageSelector
instrument.
Bug: T275894
Depends-On: I2acee8ba8dc59c497dc6ba42cd5bd88dfd985c8b
Change-Id: I72b1d0ff35488521b3499e9606efee26baff8c00
Light refactor of existing code into reusable method to support
this.
Use Extension attributes to allow skins to provide ULS
additional configuration.
Bug: T274396
Change-Id: I7dcd49f05fae83fbc0c15768bee8ca93eab17bcc
Without the following changes the language button shows the
wrong label and opens a dialog with zero languages.
* Don't apply heading change to modern Vector
* Look for the element .mw-portlet-lang as well as #p-lang
Bug: T273232
Bug: T273928
Change-Id: Ic201b1983a17cc37fd1ff7c507aab656ea25f370
This is updated version of 61f1a9863a
which was reverted due to compatability issues which are no longer
present.
Change-Id: I05333ddc288171b6d867dce8a1d3efc1e1450e0a
This provides an alternative mechanism to
I0518ecdf402ebf5eb6bad2c430f6462322c0d8e1 for loading the compact
language link module. Instead of relying on the client, the HTML
is inspected.
Bug: T264824
Change-Id: I977a998388b3e70f7fe4d97fa05be3c1ac1bf676
Example usage:
Iabd4688c6081b4de391b9655b92a16f3a414e018
We will skip loading the compact link if we don't need
to compact the languages.
Note special handling is known for Timeless which stops
propagation of events. This will be fixed in Timeless at a
later date.
Bug: T264824
Change-Id: I0518ecdf402ebf5eb6bad2c430f6462322c0d8e1
This should avoid problems with elements that are not real
interlanguage links, which may be added by other code,
for example user scripts.
Bug: T267887
Change-Id: I3f9c618b417363f667a31e9dad335c1aec15b055
This refactor will allow us to separate these two functions so that
the modernized version of Vector can avoid loading the compact
language list.
Changes:
* `options` is now optional to the CompactInterlanguageList constructor
The max value is already defined in
CompactInterlanguageList.prototype.init
* this.interlanguageList is now initialized inside the constructor
Previously calling CompactInterlanguageList.prototype.createSelector
or getCompactList before calling init would throw an exception.
This will be important in I0518ecdf402ebf5eb6bad2c430f6462322c0d8e1 when
the responsibilities of wiring up the button and compacting the languages
is separated.
Bug: T264824
Change-Id: I9606df30a050d0cdaf7add2deff849cd5b895bab
Introduced in I740600d18859422b2f98a5ef92d0321f6e9615a2.
We need to prevent the default action (navigating a link) so that
our custom code has a chance to run. Before it was synchronous so
it called location.href before default action had a chance to execute.
When it was made asynchronous, the default action got executed before
our custom code.
Change-Id: I292f99aa5f5ff536d8197174c317018462685866
Introduced in I740600d18859422b2f98a5ef92d0321f6e9615a2.
When onSelect was called for the new language, it set dirty to true.
Then the, now delayed, render function reset the dirty status to false.
There is no need to set dirty to false on render, so moved it to the
constructor.
Change-Id: Ibfa23f545c9d358e7e03fb299c238182ea449d7c
Follows-up c578db02 and ea671b1f, which I thought removed
all code relating to the old async EventLogging method.
I didn't notice this UI code at the time, because I only took a
single pass over the code to find dead code. Now that that code
is gone, it is clear that the UI code is also redundant.
The mw.track() and logEvent() methods don't track the Beacon API's
async fetches, which also isn't needed, since the loss of browser
context upon navigation doesn't abort background beacons.
The loading of the EL library itself is already ensured via a
dependency so we already know there won't be an async fetch for
that.
What that leaves is some portion of older browsers in which a
EventLogging falls back to 'new Image'. This is basically just
IE 11 per <https://caniuse.com/beacon>, and for those some portion
of events will have been lost since EventLogging removed support
two+ years ago for tracking those fallback fetches via a Promise
(because of the perf issues caused by what the removed code here
was able to do).
Change-Id: Idf4378f983b6ba0e755ebadb97aa6d87cf95f7a5
ext.uls.preferences only depended on ext.uls.common because of its
use of the uls global. This is unnecessary, and made clearer by using
require and module.exports to access it.
Change-Id: Ied2a1b560d19a18529fd766ced778c912199fa2f
As a precursor to incorporating a new language switcher in the new
version of Vector I'd like to improve the performance of loading
the switcher.
It seems most code can be deferred until the language selector
button is clicked.
This shaves around 30kb of resources off the critical path for
most users. There's potential here for a positive performance
impact so we should follow up the deployment by checking the
associated performance graphs to see if there's improvement.
Note, if the compact personal links feature is enabled
there is no performance saving for now. This will be addressed in follow
ups.
Bug: T153844
Bug: T153845
Bug: T237061
Change-Id: I740600d18859422b2f98a5ef92d0321f6e9615a2
These modules are always loaded together. There is no need to load
them in separate ResourceLoader modules
Change-Id: Ibdf7d1bbd9090ffed6a142055ee684ad97dd6680
This reverts commit 61f1a9863a.
Reason: mw.storage.getObject was introduced in MW 1.34. Need to
support MW 1.33 for MLEB 2020.04 release.
Change-Id: If9cd8d1f9e1ab544eba280c8fa7b36db91b64573
The main goal here is to reduce complexity. For example, the method to
remove a parameter from the current URL is never used with another
parameter. The complexity is not needed.
This is inspired by the changes I have seen in Icaf086f.
Change-Id: If22c25e84f50ac380320cd581690835ddb70f01d
Add two new options for ext.uls.dialog - afterOpen and afterClose.
These are callback function which will be triggered after the dialog
opens or closes.
Using the afterClose callback in ext.uls.setlang to remove the
setlang parameter from the URL if the dialog is closed without
pressing any button. This might happen if the user closes the dialog
by pressing Esc, or by clicking on the overlay.
Also see: Ie3215d12d9c77f15597495e21610707b272eeee9
In addition, renamed all occurrence of setlang to setLang.
Bug: T63115
Change-Id: Icaf086f947b1d91bf7ad5b36f126da0be1fc7747
Support has been added for:
* Esc: Closes the dialog
* Tab: Ensures that tabbing keeps focus on the focusable elements
in the dialog. If no overlay is not present, the focus is
allowed to flow normally.
This should not happen but if NO focusable elements are found and
overlay is displayed, focus is locked on the overlay.
Also add description and other license information for uls.dialog
& uls.setlang files.
Bug: T63115
Change-Id: Ie3215d12d9c77f15597495e21610707b272eeee9
This change allows to use the ULS language changer without getting a
dialog for restoring the old language.
This change requires that the module is also loaded in this case.
Change-Id: Ie5169e986d0362034ede122b0bc29ce7a4aa481e