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
Return an empty array if there are no languages in territory.
Addresses T265158.
Updating to
9a1f5c0e5a
Bug: T265158
Change-Id: I36f69a2007791a4469eff6415eedbaecc3f60f70
Return an empty array if there are no previous IMEs
in preferences.
Addresses bug T262865.
Updating to
77bd142ad4
Bug: T262865
Change-Id: Ifce6707914be0033239bc88ce0dc869ba8626e2c
https://github.com/wikimedia/jquery.uls/commit/967eec093edb153f4fdd0e5e4
Updates:
1) Always send event when triggering onSelect
The $.uls function in jquery.uls.core in createLanguageFilter passes the
onSelect function to the $.fn.languagefilter so the onSelect there should be
made compatible.
2) Removal of png images no longer needed for old browsers.
Bug: T261973
Change-Id: Ie316cc627178dde15d22607b2099d0da96dd6fda
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
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationProtected
Change-Id: Ie51d2cbd02d94196ef523b55b7beb84ff893d331
Active state is already covered with `mw-ui-button`. Color needs to
become darker for better contrast ratio when button is toggled.
Change-Id: If888a862c0b642aaa200e8207f3804f76f05b8b0
Also amending `color` & `padding` to be closer to button standard appearance and
increase `margin-bottom` to make “Edit links” link not stick to button.
Bug: T170137
Change-Id: Iabb6abfdb8fa69c9f2634b190cb5fa6c005eb17c
This module is just an alias at this point. It's only consumer
is taken care of in the depends on.
Depends-On: I7c362ad391b076d3c4214c7b01fca7bbaaa320b9
Change-Id: I842c1ba10b24967a3888107806788f7e7844339b
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