Create a function for this purpose and use it everywhere where
language code is read from an attribute.
Bug: T143867
Change-Id: I01b6f04dd9185a9f4ab565e96ca5a6a34e4ea14a
Consistently with getInterlanguageList(). Without this 'nds-NL'
will be handled incorrectly when the article in it is featured.
Bug: T143527
Change-Id: Ie7fe5a270cb3030899b6034512351d5d66d7be06
This is just a simple search for elements with lang attribute.
This will be executed only when previous languages, geo-IP based languages,
browser, UI, content languages etc. are not filling the defined compact size.
Bug: T70077
Change-Id: I77d1efa5e29deeaaf595753fb5519c8b70c7f2b5
Not outputting language codes with proper casing should
be solved upstream in jquery.uls.
Bug: T139795
Change-Id: Ide81c76135b23a031f1f09a33462e767e57a50b0
We were executing all compacting strategies even when we have
more than enough items as candidates. If the strategy is expensive,
(performance wise) this is a problem.
In this commit, we execute them one by one and stop when we have enough
candidates.
The methods in CompactInterlanguageList class also arranged as
individual function declarations than comma seperated method list.
Change-Id: Idce6489387d139852125f4448d0e192f6a7e1353
This is already expected by the callers. Added addPreviousLanguage
to make updating the list easier.
Change-Id: Ie4f888235ea4de4a2ce6bf5a9f24955e423e8c48
jquery.uls.compact module is kept for now as some other
extensions depend on it. But it does not do anything
anymore.
There are some styles which should be in jquery.uls
upstream, but given the current state that is easiest
done in a follow-up later.
The main change is that language selection is now
compact by default: no heading etc.
Includes style changes for the dialogs, and especially
for the new position of the callout caret.
Bug: T85519
Change-Id: Iade8005439b4f58ab241752f69a5365d8bb88d2c
Load jquery.uls only when the trigger is clicked.
Reduces the initial footprint by 63.9 KB (uncompressed)
Bug: T135210
Change-Id: I972cb6ea1794485917ea530f7abe68bdddc2014f
It re-triggers mw.uls.getFrequentLanguageList(),
getPreviousLanguages() and localstorage read.
In this patch the result was saved and reused.
Bug: T122341
Change-Id: I14839eb611cd3e995e8d8ab729ee3f714840f9ad
We don't need plugin pattern here since it is not meant for a use
in multiple contexts. Code simplified.
Change-Id: Iee86069aaa82f5a9ab3a856c19360e9ea89211ad
Interlanguage lists can contain language codes that are redirects
in language data of ULS.
For example, sr is a redirect to sr-cyrl.
So, if sr is passes as one of the language to ULS, its region, script
grouping is failing and the end result will be missing them in the ULS
language list. This should be properly fixed in jquery.uls library.
Tracked at https://github.com/wikimedia/jquery.uls/issues/207
In this patch we are following a simple approach of passing the language
codes to ULS as redirect resolved.
Bug: T100002
Bug: T131005
Bug: T126909
Bug: T123834
Change-Id: I8b89edb60b4d2c6f2b25c8589569f748c5523722
The pointer arrow of the ULS was not aligned with the 'x more' trigger
and it missed shadow. This commit fixes it.
Notably, we replace the old arrow with a box rotated 45 degree so that
we can apply the shadow very easily.
Bug: T130633
Change-Id: I4d36f3ee9fcfea932e10208518a03e7b246a7abe
- Updated versions and order of checkers.
- Some consistency updates in Gruntfile.js.
- Updates to make jscs pass.
Change-Id: I7ed93596ff383dc713bd17af2da0472be934d59d
T122341:
* Move hideOriginal() call to right before render() to reduce repaint flash.
* Use plain css() instead of show() and hide().
* Use native getAttribute() instead of jQuery().attr.
Other minor clean up:
* Fix jsduck syntax.
* Consistently use 'location' instead of 'window.location'
(mostly the case already except for one).
Bug: T122341
Change-Id: Ief76fe7c0fb2bfca3468361ebab14c1dfb1df4c2
Assistant languages are chosen by users in a wiki with
Translate extension. If assistant languages are defined,
use that also for predicting the languages in compact list.
Bug: 62342
Change-Id: I25f42f3802e80baf5d4724ba6e42e00b8be2349e
The #p-lang-list id was removed from core (I028880cfa),
and this broke the compact links beta feature.
This commit replaces it with a different selector.
Change-Id: I154919a54b032dd481fe080204a2a16819d85140
No change in functionality. Refactored the code a lot and made it as
a jquery plugin, similar to the other components of ULS
Change-Id: I69199ba37b13ec7fd4a9b7b8eba5b3aa28f0edb5