Commit Graph

703 Commits

Author SHA1 Message Date
Amire80
4bd38a0fcf Query only for <a> elements that are interlanguage links targets
Depends on the core change in 1.28, which adds the
interlanguage-link-target class to the <a> elements:
I06c80945af785477be52096022c8493e7f82c298

Includes backwards compatibility code so that ULS compact links
would be usable on core versions that don't have this change.

Bug: T135378
Change-Id: I2909ce31e19087358d194e0e108e1ba038e7273e
Depends-On: I06c80945af785477be52096022c8493e7f82c298
2016-11-01 12:59:35 +00:00
Volker E
41f5ce254e Replace deprecated .mw-ui-constructive with .mw-ui-progressive
Bug: T146923
Change-Id: I5d4b5e9fa41ef7657442b734702b3ea21d90c66a
2016-09-29 15:59:32 -07:00
Amire80
908161f0c1 Add hooks fired when finished processing compact language links
Bug: T145755
Change-Id: I921191c2cd32d55161b32bad2b2e0d98228cf230
2016-09-27 13:34:02 +00:00
Timo Tijhof
1240a62ca0 geoclient: Update localStorage comment
Follows-up 4cd1def.

localStorage is available by all supported browsers as of MediaWiki 1.25.
As of MediaWiki 1.27, this is also enforced by an explicit feature test
in startup.js.

Change-Id: I12b577919579f498e294376f748715b868f21869
2016-09-15 14:17:20 -07:00
Niklas Laxström
41f9a6f994 Undo tooltip: position when shown, not when created
Especially on Special:CX, where page layout changes soon after load
(for example scrollbars get added when more content loads), the tooltip
would be positioned incorrectly. Now it is more likely to be positioned
correctly, and will get re-positioned again if it is shown again after
being hidden.

Bug: T145483
Change-Id: I527fc62b196e55101950cffcc6ec43926f63aa4a
2016-09-15 08:06:40 +00:00
Niklas Laxström
a94ffa4b21 Do not use tipsy class with new popup
The tipsy class has CSS styling from the tipsy module which do
not work with the OO.ui.PopupWidget. If the tipsy module gets
loaded for some other reason, the display will be slightly broken.
Fixed by renaming the class.

Bug: T96648
Change-Id: Ib0e11098506560f4de1c6402b8c980ad3ebc3879
2016-08-31 10:21:36 +02:00
Fomafix
8778051f8f Remove unused variable loginUri
The variable loginUri was added in 422371f6 but never used.

Change-Id: I85aaa6aa524dbe0a02129696f1bff46fb410fbe5
2016-08-30 12:18:45 +02:00
jenkins-bot
58b31d7078 Merge "ext.uls.compactlinks: consistently normalize language codes" 2016-08-25 09:50:25 +00:00
Niklas Laxström
2144019c50 ext.uls.compactlinks: consistently normalize language codes
Create a function for this purpose and use it everywhere where
language code is read from an attribute.

Bug: T143867
Change-Id: I01b6f04dd9185a9f4ab565e96ca5a6a34e4ea14a
2016-08-25 08:22:17 +00:00
Niklas Laxström
4cd1def0f3 Switch default ULS geoip provider
Current provider is going away. Switching to another free provider.
Implemented caching with a cookie for speed and to avoid generating
unnecessary load on the service.

Bug: T143542
Change-Id: I191d69a6fb8abe9556f475dfef1368dc9f96b846
2016-08-24 15:55:00 +00:00
Amire80
0d1d9a4b6d Apply toLowerCase when reading featured articles
Consistently with getInterlanguageList(). Without this 'nds-NL'
will be handled incorrectly when the article in it is featured.

Bug: T143527
Change-Id: Ie7fe5a270cb3030899b6034512351d5d66d7be06
2016-08-21 22:47:27 +03:00
eranroz
abaddfaccd Earlier evaluation of compactlinks
* Prospectively load ext.uls.init
* Prospectively check if readyState is interactive
Bug: T136463
Change-Id: Ib36ef6a2b9955189acfbe06bd6b498a66014cf06
2016-08-19 11:10:27 +00:00
jdlrobson
9e0dcbde35 Enable UniversalLanguageSelector modules for mobile
Enable several of the ULS modules so they can be used in a mobile context,
in particular by the Translate Extension

Changes:
* Create a ext.uls.common module that can be loaded safely on mobile
* Only add the ext.uls.init entry point module on desktop (ensured by
the use of targets). On mobile it has no impact other than to increase
the amount of bytes shipped to users.
* Note various modules have not been enabled for mobile usage.

Bug: T102922
Change-Id: If2808886f0bfa153f5918e3c7536e88641028da9
2016-08-17 06:43:46 +00:00
jdlrobson
798874ffa0 Remove jquery.tipsy from UniversalLanguageSelector
This doesn't appear to be justified due to the one use case. This
will now be done via OOjs UI and given jquery.tipsy is deprecated
it is better to replace it (T117720).

Bug: T119417
Bug: T102922
Change-Id: I60cce248884308bf0728d153f6137a8d25e01300
2016-08-17 06:13:09 +00:00
jenkins-bot
78adcc5e20 Merge "LanguageSettings: Simplify positioning code" 2016-08-16 11:49:44 +00:00
jenkins-bot
c4e5dcc2fd Merge "DisplaySettings: disallow focus on tabgroup buttons" 2016-08-16 10:48:09 +00:00
jenkins-bot
f44d97230b Merge "LanguageSettings: Do not render modules twice on initialization" 2016-08-16 10:03:00 +00:00
Niklas Laxström
05e0b8c53e LanguageSettings: Simplify positioning code
* Remove scrolling from positioning code
* Make sure that any calculated default positions also apply to
* modules by updating this.top and this.left.

Bug: T143074
Change-Id: Iffc49674abcca8a8c4a600569a05db1314fae3f6
2016-08-16 06:28:43 +00:00
Niklas Laxström
d24472e962 Fix some comment typos
Change-Id: I338891147cb6aa8e6d88119eb61ea718edb93747
2016-08-15 09:55:02 +00:00
Niklas Laxström
5e7e8fe48e LanguageSettings: Do not render modules twice on initialization
Change-Id: I25d939ffcabde394bb7a496ee8bc5df9a87c2573
2016-08-15 09:48:00 +00:00
Niklas Laxström
f6da60cfab DisplaySettings: disallow focus on tabgroup buttons
Focus state looks bad in this context.

Change-Id: I3bc1cd63123711ded0652910ef4fa62f19c3bd12
2016-08-15 09:47:51 +00:00
Amire80
43f62e601c Add languages in which there is a featured article
Bug: T70071
Change-Id: I5ed2f1ece5b11b96ec6416bc1c6c2266ac6b4388
2016-08-04 19:42:46 +03:00
jenkins-bot
9c1decf616 Merge "CompactLinks: support sortPrepend from WikiBaseClient" 2016-08-02 05:14:55 +00:00
jenkins-bot
b8c79727d8 Merge "Show languages that appear in the page's text" 2016-08-01 06:31:24 +00:00
Santhosh Thottingal
df70f941b2 Show languages that appear in the page's text
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
2016-07-28 17:32:10 +02:00
Kartik Mistry
d4ea8550fa Update Skeirs II font
This fixes display of Latin text in Gothic script.

Bug: T124785
Change-Id: Iaf2cc6b05591368356c241e7b65ce4a8e33c24e0
2016-07-28 15:32:27 +02:00
Niklas Laxström
217aefdb7a Move als->gsw override to ext.uls.init
So that it is loaded for compact language links. The ext.mediawiki.uls
module is starting to look very empty now can could be removed easily
in follow-up. ext.uls.init depends on jquery.uls.data so this is safe.

Bug: T139949
Change-Id: Icac10f073e122284723c48782c2a1cf7f10b45ec
2016-07-27 06:16:51 +00:00
Niklas Laxström
89175716ec CompactLinks: lowercase language codes for internal use
Not outputting language codes with proper casing should
be solved upstream in jquery.uls.

Bug: T139795
Change-Id: Ide81c76135b23a031f1f09a33462e767e57a50b0
2016-07-27 05:57:03 +00:00
Niklas Laxström
4f4051a40d CompactLinks: support sortPrepend from WikiBaseClient
Bug: T138973
Change-Id: I64b7aa37d8a6b3cac92d492a33fe6f8cb04ce0e6
2016-07-26 13:36:26 +00:00
Santhosh Thottingal
26cfea8ef4 Compact language links: Use smaller callout arrow
Uses equilateral triangle with 16px side.

Bug: T138235
Change-Id: If81342876d59e3041d0ea4029e301c3cc76f6641
2016-07-12 12:17:33 +05:30
Santhosh Thottingal
d109bddf20 Compact links: Execute the compact strategies on need basis
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
2016-07-11 10:58:00 +02:00
Santhosh Thottingal
c4ce628768 Use navigator.languages as fallback for mw.uls.getAcceptLanguageList
Follow up: Ib603f836f59f7078ac5dbb7bbbb3b84ca358cb43
Bug: T137522
Change-Id: Ia5de997fe393ce99a91b16ed397811391a85bc59
2016-06-14 04:55:34 +00:00
Santhosh
09d4c149ca Merge "Show badges in ULS language list" 2016-06-09 12:01:04 +00:00
Niklas Laxström
2a6b4d0fc2 Show badges in ULS language list
Update jquery.uls to ae9dda23b71aa76fbbc13f5650

Bug: T131233
Change-Id: I7c7bafccc7d63c0a97c98b81a5b53b48c9afa527
2016-06-09 15:12:39 +05:30
Niklas Laxström
9fc215866a Have the background for input settings not run to the edge of the dialog
Bug: T136273
Change-Id: Iddc5233d840cd6f2c3e4393ea221b6882d03c531
2016-06-02 05:47:38 +00:00
Niklas Laxström
0b89c27678 Give language selection buttons more space
Let them assume normal size with regular padding. In the case that
the buttons do not fit one line, some will overflow to the second
line. In my opinion that looks less ugly than irregular padding
and truncated language names.

Bug: T136273
Change-Id: I26dd7745ac03e1b940348b318d74d0a2bd27e1a3
2016-06-02 05:47:25 +00:00
Niklas Laxström
0784540c40 Simplify code using .one
Change-Id: I84fb5e0ade474738ff6a05c2304de351a2476186
2016-05-31 09:21:51 +05:30
Niklas Laxström
791cefeec6 Remove redundant mw.loader.using
The only caller is already loading the exact same modules right
before calling these functions.

Change-Id: I71bc682f88c45e8ff20e032c7e5ee2dc3f517baf
2016-05-30 17:07:22 +02:00
jenkins-bot
9eedc358e6 Merge "Separate ULS previous interface language from previously selected languages" 2016-05-25 06:13:13 +00:00
Niklas Laxström
b2b75b15eb Drop eot from supported webfont formats
IE9+ which is lowest that MediaWiki still supports is supposed to
support both ttf and woff par some exceptions.

This reduces uncompressed repo size almost 4000 bytes.

Change-Id: If80f4ec898d86d5fd4cf873d0d86245e66da2f0b
2016-05-24 08:06:11 +02:00
jenkins-bot
7708b8d2ff Merge "Use FormatJson in font repo generator script" 2016-05-24 05:01:41 +00:00
jenkins-bot
756b80d8a6 Merge "Increase the number of stored previously selected languages to 9" 2016-05-24 04:43:34 +00:00
jenkins-bot
4b1056133f Merge "Make previous languages have most recent in the beginning" 2016-05-24 04:38:49 +00:00
Niklas Laxström
e3c2950c04 Separate ULS previous interface language from previously selected languages
Now that Compact Language Links also started to add to this list, ULS would
show incorrect language change tooltip notifications. ULS interface language
selection will still keep updating the list of previously selected languages.

Refactored the code a bit: 1) created minimal Store that wraps around plain
localStorage, since mediawiki.storage cannot be used yet. 2) Inlined the
userHasChangedLanguage function to new initTooltip function. 3) Split parts
of the huge initInterface to new initTooltip and initIme functions for
increased readability. 4) Solved a TODO for moving language change recording
out of the tooltip showing code.

Change-Id: If8478a59168d89264f4d46938ac865c0c9a04f25
2016-05-23 15:15:44 +02:00
Niklas Laxström
fa7f7e8b57 Increase the number of stored previously selected languages to 9
Discussion about the magic number in the task.

Bug: T135487
Change-Id: I5d0900f191cf277faa19d73de9cf393216d5e6ea
2016-05-23 12:50:06 +00:00
Niklas Laxström
4f82a8650a Make previous languages have most recent in the beginning
This is already expected by the callers. Added addPreviousLanguage
to make updating the list easier.

Change-Id: Ie4f888235ea4de4a2ce6bf5a9f24955e423e8c48
2016-05-23 14:50:02 +02:00
Niklas Laxström
e607466313 Use FormatJson in font repo generator script
The benefit of this is that '/' is no longer escaped, making
ext.uls.webfonts.repository.js file 376 bytes smaller. I expect
that the difference in compressed size is neglible.

Change-Id: I77c0b88fa23f2245f09615c354546b6a9ebf650c
2016-05-23 14:33:37 +02:00
jenkins-bot
43782e8635 Merge "Add some global fallbacks to compact language links" 2016-05-23 11:43:46 +00:00
jenkins-bot
384b109362 Merge "Update jquery.uls and adapt styling" 2016-05-23 11:09:01 +00:00
Niklas Laxström
e054af704c FontRepoCompiler now adds hash suffix to font paths
This is now new standard way of doing this in MediaWiki.

Since this makes the font repo bit longer, compensated by no
longer providing version information, which also simplifies the code.
Uncompressed increase is 542 bytes.

Depends on https://github.com/wikimedia/jquery.webfonts/pull/45

Bug: T135806
Change-Id: I1921115fc1abc20e6e756044c0a84a9fe4133884
2016-05-23 09:32:57 +02:00