Commit Graph

132 Commits

Author SHA1 Message Date
Ed Sanders
2b16bb0ad8 Upstream WMF config to disable ULS in Ace editor widgets
This rule was applied to all WMF wikis in T55300 / I0cc1e92a8f,
but for some reason was not set here.

Change-Id: I908aac19b648de550659aad85bca115f26f43fb4
2021-11-30 12:19:08 +00:00
Abijeet
defc3d416d ApiULSSetLanguage: Use LanguageNameUtils
Change-Id: I00e814894db4ba84f1d08c52db2993b59fbccf55
2021-11-16 18:36:23 +00:00
Fomafix
10e15cf0f8 Use .parseDom() instead of .parse()
Use

  $( ... ).append( mw.message( ... ).parseDom() )

instead of

  $( ... ).html( mw.message( ... ).parse() )

Add dependency on 'mediawiki.jqueryMsg' to 'ext.uls.setlang'.

Change-Id: I23897ab16a84a1732286921a8153b9a5e57c9462
2021-11-09 21:12:01 +00:00
Fomafix
f0c6bec1ac Use HookHandlers and inject services
This change also replaces the calls of deprecated functions from class
Language and replaces the global variables by the MainConfig.

Change-Id: Ice7273481a736cb138e263a9300bfd90fdcbb401
2021-11-04 14:00:31 +00:00
Fomafix
183bb97f74 ApiULSLocalization: Inject LanguageNameUtils
Replace deprecated Language::isValidCode by
LanguageNameUtils::isValidCode.

Change-Id: I2adef21fb37e78c163674008a4f9b1e5a74aa6a1
2021-10-29 13:14:31 +00:00
Abijeet
770b0dfe50 Update version for MLEB 2021.10
Bug: T294021
Change-Id: I252fffcde7d0c401cb8a460c3b162c71948ec018
2021-10-25 13:29:03 +05:30
DannyS712
e17f5c0b39 Merge jquery.webfonts into ext.uls.webfonts.repository
The two modules are always loaded together and don't need
separate entry points.

Additionally, this makes the ext.uls.webfonts.fonts
just depend on the ext.uls.webfonts.repository module
and not do anything else, so remove it in favor of
referencing ext.uls.webfonts.repository directly where
needed.

Bug: T292042
Change-Id: I067b9eda923fcb0d5da0ed80030356f1f747259b
2021-10-19 09:07:11 +00:00
jdlrobson
a55369e0e2 Pull out Vector personal tools styles into skinStyle
Most of the skin styles are no longer needed for modern
Vector. This refactors them so that they only apply
to legacy vector, reducing the overrides needed inside
Vector.

Depends-On: I1edee874a42b070bc319648496ae80a01b6365fb
Bug: T289630
Change-Id: Ic5ab5172d881c48caae6bb3691ccc95515dcdcdb
2021-09-07 06:58:22 +00:00
Alexander Vorwerk
0d9e1b134a Avoid using User::setOption()
User::setOption() is deprecated and should be replaced with
UserOptionsManager::setOption()

Bug: T277818
Change-Id: I5ac58c4be5046d4457de24b63b062aa238e972b6
2021-08-16 06:00:28 +00:00
Niklas Laxström
36d79be608 Remove ULSEnableAnon
I am not aware of anyone using this niche configuration where ULS
visible interface is enabled only for logged in users. Simplify
code and updated comments.

Change-Id: I9f0a5969fdc76ca790d961ee3035fdb27ece9c0c
2021-08-09 23:25:01 +05:30
Kartik Mistry
5a7a6a5fe3 Update version before MLEB release
Bug: T286474
Change-Id: I2bc4406addfad28a843fd4f5328882b1f388c7c7
2021-07-20 11:49:38 +05:30
jdlrobson
2c46226f83 Use SkinTemplateNavigationUniversal for ULS button
As part of the desktop refresh, we are moving towards a universal
hook for adding menu items. This allows more control over placement
without breaking backwards compatibility.

In modern skins, the personal URLs bar is split into
user-menu and notifications options which are combined for legacy
skins.

Depends-On: If4805e5186756056afcd31d21919e907a7782ce8
Bug: T282196
Change-Id: I79fa85e67d9c0064dd4dc9437517264d5fc04140
2021-06-07 20:40:14 +00:00
Niklas Laxström
0c45465786 Simplify extension.json with ResourceFileModulePaths
Change-Id: I4f00d86456132ed7a852cba0e9ce3e73a7d42193
2021-06-03 15:58:14 +03:00
Abijeet
5baf437b3c Remove MW 1.34 backward compatible code
Move hooks and scripts to extensions.json

Bug: T282783
Change-Id: Id63d17d04789bb36fff35e0512e7878dc8bfe12c
2021-06-01 08:17:13 +00:00
jdlrobson
1786fce2c6 Default state of ULSCompactLanguageLinksBetaFeature should be false
extension.json configuration should reflect recommended production
configuration whenever possible. This particular configuration flag
is only ever true on Russian Wikivoyage or Wikisource, so is more
often false than true.

Having this default would have saved me ten minutes trying to work
out how to make the preference available, so I am keen to save someone
else that time in future.

Bug: T282149
Change-Id: Ieef58631c7ef5c42ffc05f13d0ed8a4f02c48de1
2021-06-01 07:45:37 +00:00
Kartik Mistry
2e05b501bb Update version before MLEB release
Bug: T279280
Change-Id: Ida8597db98c3bef3dd97a11ceda0c9b08087d3d0
2021-04-27 17:01:31 +05:30
Sam Smith
852d72e66d Remove UniversalLanguageSelector instrument
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
2021-03-04 13:58:19 +00:00
Kartik Mistry
a04f1af26f Update version before MLEB release
Bug: T271398
Change-Id: I42f5e7051bcd295d4a5e925e66f4545e7e2c1657
2021-01-21 10:20:12 +00:00
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