Commit Graph

164 Commits

Author SHA1 Message Date
Nikerabbit
3ac9853220 Simplify ext.uls.preferences module
This is updated version of 61f1a9863a
which was reverted due to compatability issues which are no longer
present.

Change-Id: I05333ddc288171b6d867dce8a1d3efc1e1450e0a
2021-01-21 08:08:15 +00:00
Ottomata
93c48e4667 Finalize migration of UniversalLanguageSelector to event platform
Bug: T267352

Change-Id: Ic961eba1587e4f5c61c8a92d74501abeb45f6699
2021-01-12 08:57:59 -05:00
James D. Forrester
9fc9dbafa3 Use User->isRegistered(), not deprecated isLoggedIn()
Bug: T270450
Change-Id: Ibeb882b8917f43aed9fd2411a6d4a2400532da33
2020-12-18 22:16:26 +00:00
jdlrobson
ab6decae11 Allow skins to register their own button and disable compact
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
2020-11-18 17:06:40 +00:00
jdlrobson
e3569d32a7 Separate compacting of language list from launching of dialog
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
2020-11-05 08:44:06 +00:00
jdlrobson
740ff490e0 Drop unnecessary ext.uls.init module
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
2020-10-29 11:52:47 +00:00
Kartik Mistry
eab051abe1 Update version before MLEB release
Bug: T265886
Change-Id: I1821a7dfc72cd44ffc37c8cc8e1146978d5c3c6d
2020-10-26 12:09:04 +05:30
jdlrobson
5cd10ce862 Reduce JS loaded on critical path
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
2020-10-20 13:40:49 +00:00
jdlrobson
a1963ce12d Merge ext.uls.inputsettings into ext.uls.displaysettings
These modules are always loaded together. There is no need to load
them in separate ResourceLoader modules

Change-Id: Ibdf7d1bbd9090ffed6a142055ee684ad97dd6680
2020-10-14 21:11:03 +00:00
Niklas Laxström
98f0bb42bd Remove ULSCompactLinksForNewAccounts and ULSCompactLinksEnableAnon
These are disabled by default and on production. They are only enabled
in the beta cluster, which is not needed.

Change-Id: Ifa847fd8a1f3d7d2695a7c1c4a1a93f136091604
2020-10-14 13:02:25 +00:00
jdlrobson
b5aff8a06b Define unsupported skins
Previously UniversalLanguageSelector relied on the targets system
meaning the modules ext.uls.interface,
ext.uls.interlanguage and ext.uls.pt were
loaded on Minerva desktop skin unnecessarily and silently removed
on MobileFrontend which throws a warning.

Instead of doing this, check the skin

Bug: T237036
Bug: T235712
Change-Id: Ib38b041533cf959c3c4c30decc65869995c254fa
2020-07-28 14:55:40 +00:00
Kartik Mistry
e85b393965 Update version before MLEB release
Bug: T257286
Change-Id: I58005902adfd2cd9ee8cf751b060d0ecb0071f8b
2020-07-21 06:05:01 +00:00
jdlrobson
afebb45eb9 SkinTemplateOutputPageBeforeExec is deprecated
Instead use SkinAfterPortlet to force the language portal
to always display. This will work with all Wikimedia deployed skins that
use ULS (note the Minerva skin is not impacted but in future can benefit
from this change)

Depends-On: I438daa79d3d97e2518e6258c3213a805bd1f30e8
Bug: T253178
Change-Id: I2843edde1bb45c70911d5acf2f7dafdff3bac53e
2020-06-12 09:07:14 -07:00
Timo Tijhof
5b7e12705a Remove redundant dependency on 'mediawiki.notify'
As this extension supports MW 1.34 (and MW 1.33) in the master
branch, apply the usual ternary PHP registration and ternary
tricks.

Bug: T233676
Change-Id: I4d18bab53460b397d4f50485c4a149185a1db7b3
2020-05-28 07:27:24 +00:00
James D. Forrester
18552a7142 Use QUnitTestModule instead of deprecated ResourceLoaderTestModules
This increases the compatibility requirement of this extension to
MediaWiki 1.33+

Bug: T232875
Change-Id: I50e652697c9d6e2886d457885b1d7b04a45f376f
2020-05-11 19:06:21 +00:00
Reedy
6e607e2d26 Update license-name to include OR MIT
Bug: T251643
Change-Id: I2b8544136d20a73668fd81b53cba59980d027ee9
2020-05-02 13:00:57 +01:00
Kartik Mistry
15088649bd Version update before MLEB release 2020.04
Bug: T249694
Change-Id: I68a4cdecf974db57125d5e020e990b6f87920441
2020-04-20 07:35:36 +00:00
Abijeet Patro
56c38a5515 Revert "Simplify ext.uls.preferences module"
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
2020-04-16 12:43:38 +00:00
Niklas Laxström
61f1a9863a Simplify ext.uls.preferences module
Related to T246370

Change-Id: Iedef79c75ef0ab9c1baff5a0e6f1953c3c56ac91
2020-03-03 11:38:23 +00:00
Kartik Mistry
1375f0c56c Update version before MLEB release
Change-Id: I02e948abf9263f6fcbac0f59f345e4a80358be4e
2020-01-23 11:09:32 +05:30
Abijeet
ff02e63a45 Update setlang to display confirmation dialog to change language
setlang will now display a dialog to confirm with the user that
they would like to change their interface language. The preferred
language will only be updated if the user confirms.

The dialog will be displayed if the setlang parameter is present in
the query string and,

* A user is logged in, and their preferred language is not the same
  as the one passed via setlang.
* For an anonymous user if the wgULSAnonCanChangeLanguage is true,
  and the current interface language is not the same as the one
  passed via setlang.

Bug: T63115
Change-Id: I882297d99a594fd82fd0aec3b4664e8bfd1eac3a
2019-12-19 14:54:34 +00:00
zoranzoki21
ef741394c4 Convert UniversalLanguageSelector extension.json to manifest_version 2
Bug: T239433
Change-Id: Id2e0af8bab2cb834c1ffaa0abe692e0c3d58c14d
2019-12-02 20:43:29 +00:00
Kartik Mistry
2c0be6be46 Update version before MLEB release
Change-Id: I80f13f3164cb4b100e747cfc2ea40f94ba3b9ac1
2019-10-31 13:25:12 +05:30
Kartik Mistry
0f4b9f34b6 Update version before MLEB release
Bug: T227078
Change-Id: I95d986837e0605e00707312199a638256ef56129
2019-07-22 18:15:14 +05:30
Fomafix
71aefc8d4b Drop support for MediaWiki 1.31 and earlier
MediaWiki 1.33 is released. The next version MLEB 2019.07 will be
compatible with MediaWiki 1.32 and 1.33.

Change-Id: I9487706125fe84d02cb8d3fec0a10e1f10006e64
2019-07-08 22:51:08 +02:00
Kartik Mistry
17df646831 Update version before MLEB release
Bug: T221573
Change-Id: I38eb389c5100b7bcc5d128e3f02933c30da972a2
2019-04-24 12:50:32 +05:30
Timo Tijhof
6928b7ec8d Merge ext.uls.eventlogger into ext.uls.common
This could've been done longer ago (by defining ext.uls.common
in Hooks.php), but didn't notice it before.

The ext.uls.eventlogger was (if configured) loaded on all page
loads. Same as ext.uls.init (but without config condition).

ext.uls.ext is an empty shim around ext.uls.common, which is thus
also loaded on all pages. Merge this into there given has no
reason for being its own module. They are always loaded together.

Change-Id: Icdda6f27470a1d56a37275164c06541514a488a0
2019-04-17 10:52:04 +00:00
Ed Sanders
aec4604b76 Disable ULS in VE readOnly mode
Bug: T217740
Change-Id: I217cf957f853bf0ed701f997f36bdbcc58f4a23d
2019-04-12 22:03:34 +01:00
Reedy
f8e9ed1299 Move some more php files under includes
Change-Id: I55d536e05c50a90f0805a6dc4252cc003ee0c7bb
2019-03-02 20:11:49 +00:00
Kartik Mistry
a79c1f5038 MLEB: Update version
Change-Id: I2a7814532bdb8c94ae6cf0c05228b67de38f45d1
2019-01-17 15:58:46 +00:00
Kartik Mistry
e61b40ca9c MLEB: Update version before MLEB release
Also, fix some old copyright year.

Bug: T206609
Change-Id: I2f5a04c01657b6a6853bba2458ea54ab210d1fae
2018-10-29 09:17:08 +00:00
Fomafix
fd9e39afb2 Sort ResourceModules in extension.json alphabetically
Change-Id: Ifb96dd97247592154191318531a535ce4c532dbd
2018-10-10 13:44:52 +00:00
Bartosz Dziewoński
f0ad6be4ab Avoid reflow (FOUC) due to ULS link on Special:Preferences
Rather than building the link in JS, which is delayed until the JS
code loads, we build it in PHP and hide it from no-JS users with CSS.

Change-Id: If0c3a4dc137d8bf6cf24957dd063bd0a39791d2e
2018-09-09 10:52:17 +00:00
Niklas Laxström
1857627c2f Drop support for discontinued freegeoip.net
There is a new service called ipstack, but their free option does
not support https, so by default there will not be any geoip service.

Bug: T199106
Change-Id: I9f4e59d736b50760f50c6214e2d191e72406d0d9
2018-09-07 19:45:21 +00:00
Niklas Laxström
51d86ad5bb Move now static ext.uls.compactlinks to extension.json
Change-Id: Ie074918ca58de4c62a6ba44caa48d429e561bb6b
2018-09-06 05:43:53 +00:00
Kunal Mehta
8ee09f0ba1 Allow $wgULSLanguageDetection to work if $wgULSAnonCanChangeLanguage is false
$wgULSAnonCanChangeLanguage is documented as just affecting setting of
language for anonymous users via cookies and &setlang=. But currently it also
affects the fallback to Accept-Language if $wgULSLanguageDetection is enabled.

With this, $wgULSAnonCanChangeLanguage will now only control whether cookies
and &setlang= can be used for anonymous users, and keeps
$wgULSLanguageDetection independent.

Bug: T203179
Change-Id: I6c664ad11dc18b66190dc0644352b91adf87c9e5
2018-09-06 02:28:30 +00:00
Fomafix
931982d728 Fix module loading on MediaWiki 1.31 and earlier
368fe37a1a is broken when used on MediaWiki 1.31 and earlier because
it tries to add

  $modules['ext.uls.displaysettings']['dependencies'][]

although $modules['ext.uls.displaysettings'] does not exist.

The whole module definition must moved from extension.json to
UniversalLanguageSelector.hooks.php.

Change-Id: Ie8f7f084c965e6dee33fef03448004d5d8805f2c
2018-09-04 07:04:49 +00:00
Fomafix
368fe37a1a Remove dependencies on deprecated modules 'mediawiki.api.*'
In core, modules 'mediawiki.api.*' got merged into 'mediawiki.api'
and deprecated in I0afdc8ab50bc1354bb5099bf39923c07eab0b665 included
in MediaWiki 1.32.

This change does not increase the version requirement in extension.json
to "MediaWiki": ">= 1.32.0" because it adds the removed dependencies
for earlier versions of MediaWiki in a hook.

Bug: T196802
Bug: T200168
Change-Id: I27dd62fae7a470549dd533f16c145cb023b16181
2018-09-02 20:02:19 +00:00
petarpetkovic
3f93207d04 Use 1.30 as minimum required version
Change-Id: I1a77c933efbcc4cfedd84ee361fc8b1c175fd38f
2018-08-31 14:35:24 +00:00
Niklas Laxström
fa9cea4627 Support UI language change when global preferences are present
Notable changes:
* First query global preferences to detect if global language setting
  is in use. If there is no global language setting, or if GlobalPreferences
  extension is not installed, it will fall back to changing the language
  as usual. If global language setting is found, it will add an override
  instead.
* If a local override is added, the undo tooltip is different and links to
  the global preferences page. The task design shows mw.notify style popup
  located on a bottom right corner (LTR). I deviate from the design and
  re-use the old undo tooltip with a different message instead, for
  consistency. The message is chosen depending on whether local storage
  value `uls-gp` is set to '1' (set in mw.uls.changeLanguage).
* I removed one use of deprecated mediawiki.api.options module. One other
  use still remains.
* I changed tooltip text generation from html acrobatics to use
  mw.message.parseDom. Because of that I also had to move the click handler
  to avoid buildup of click handlers.
* In message documentation fixed acronym -> autonym.

Bug: T198206
Change-Id: Ie2ed792e222be919522bd1cdea98042515a0619d
2018-08-30 22:40:17 +00:00
Kartik Mistry
5d490d16a1 Update version before MLEB release
Change-Id: Ie88c87d640f86760465208953428cc878f3e3e9d
2018-07-05 11:39:45 +05:30
Kunal Mehta
07cf9bbedf Register EventLogging schemas in extension.json
Change-Id: I60012747daa927264474e7a4867ad0f9124d793c
2018-06-23 00:02:07 +02:00
Niklas Laxström
99f5945704 Add Kartik Mistry to CREDITS and sync with extension.json
Change-Id: I38c00b9e4c18d2b0684c00984961811ccfd7334b
2018-04-12 08:15:18 +00:00
Kartik Mistry
06abea211f Update version before MLEB release
Change-Id: I575ca5e72b063f912514e290757a5eba7a860e16
2018-04-10 12:40:15 +05:30
Jayprakash12345
1ad692dcee Remove deprecated dieUsage method
Bug: T189222
Change-Id: I231f938d6813a8e588991e8f3a2645a0c320aeaa
2018-03-09 03:43:54 +00:00
jenkins-bot
3bb9a27230 Merge "Update copyright year and license shortname" 2018-01-30 15:02:00 +00:00
Kartik Mistry
de17e58d65 Update copyright year and license shortname
Also update version before MLEB release.

Change-Id: I857f1de4bca3d267ada206dbd30b0bd604b7c733
2018-01-30 17:56:38 +05:30
jenkins-bot
aed8d0bec2 Merge "Update jquery.uls to d122f37" 2018-01-30 11:45:06 +00:00
Santhosh Thottingal
fd7b9ec652 Update jquery.uls to d122f37
* Do not group search results by region
* Replace ULS trigger icon with monochromatic one
* Custom no-results message support
* Upgrade jquery in the example to 3.2.1
* Use .siblings to locate the suggestions, clear elements for efficiency
* Removing assigned ids to elements that are not guaranteed to be unique
* Use eslint and stylelint, fix all errors

Update the language icon in ext.uls.pt module with new monochromatic one
Also use custom style for monobook skin.

Bug: T182539
Bug: T175769
Change-Id: I7341064cd0de367d933048c4800f951568747d11
2018-01-30 15:10:01 +05:30
Jayprakash12345
57571f2f7b Removed deprecated position statements from resource loader module
Bug: T184257
Change-Id: Ia18c993f723be55c45a813a3cda8804b99c7b1d8
2018-01-05 14:21:19 +00:00