Commit Graph

1046 Commits

Author SHA1 Message Date
Kartik Mistry
6f1981dede Update font repo for Hussaini Nastaleeq font for pnb
Regression from 34c41a0e04

Bug: T118677
Change-Id: I43a12c06672cd3af80c09b5fcd024d6d64ee808d
2022-09-19 20:36:01 +05:30
Santhosh Thottingal
3450f90678 Add support for empty states to the current language selector
Bug: T290436
Change-Id: I42c5d44ec15e291d71723c9738ddb8f0d1cf0b09
2022-07-01 09:16:40 +00:00
Santhosh Thottingal
cfd6d48bc1 Load OOUI widgets only when ULS is opened
OOUI widgets are required for the actions menu dialog, but no need
to have them loaded unconditionally.

Bug: T309793
Change-Id: Icc09b88aa70af1316bd67a56b13a411ebc8f7f8a
2022-06-06 12:35:48 +05:30
NikG
257112ce78 ULS actions menu buttons: Add support for href
Currently, actions menu button only support an event handler to be
called upon button click. However, when the desired result of a
button click is just a redirection, "href" attributes are preferable,
due to their accessibility support.

To better handle such cases, this patch also adds support for "href"
attributes inside action item buttons. When "href" property exists
for an actions menu item, it is used and the event handler is
ignored.

Bug: T289840
Change-Id: I776680c19564f032acd550206c7d1306407420e0
2022-05-09 09:08:49 +00:00
NikG
9fc25cc862 Require action menu items registry at the top of uls interface module
"ext.uls.actions.menu.items.registry.js" should be required at the
top of the "ext.uls.interface.js" file. The latter is the main file
of the "ext.uls.interface" module, and it's the only one that is
executed when the module is added as an external dependency. Since,
the "mw.uls.ActionsMenuItemsRegistry" object is needed outside ULS
extension (inside ContentTranslation), the corresponding file should
be required at the top of the main file so that it's available.

Bug: T289840
Change-Id: I70ced03c09b7907c6dbf2aa35a29d5fd14b790e6
2022-04-13 07:02:57 +00:00
Santhosh Thottingal
5e6838ebdf Add actions menu inside content language selector
This patch replaces the display and input settings menu bar at the
bottom of the content language selector, with a floating icon that
opens a menu containing all the available language actions. In case
that only the language settings action is available, the language
settings menu is being opened instead.

In order to provide extensibility and support the addition of new
action items from other extensions, a registry class that inherits
from OO.Registry class is created. This class is used to create a
singleton registry object that holds all action items that should
be rendered inside the menu. Other modules/extensions can use this
registry to add new actions items to the menu, by passing the item
as argument, in the following form:
{ name: "", icon: "", text: "", handler: function() {} }

Bug: T289840
Change-Id: Iee017a9e3e6a654145e9fdd2b7df35baa348697d
2022-04-11 05:24:08 +00:00
Timo Tijhof
af60848942 displaysettings,inputsettings: Rename two classes for consistency
I suspect these may have been accidentally mixed up or miscompleted
from a nearly data-attribute or interface message, since all other
classes start with `.uls-` in this repository.

* "uls-input-settings-imes" is not used referenced anywhere else.

* "uls-sub-panel" is referenced in one skinStyles override, updated with
  https://github.com/StarCitizenTools/mediawiki-skins-Citizen/pull/434.

Change-Id: Ia0b23d795f7807ef9227f66d0890a25524cd5a9f
2022-03-10 05:19:48 +00:00
Ed Sanders
02e17c5242 build: Update eslint-config-wikimedia to 0.22.1
Change-Id: I02692eeabb23c5b99997faa7a17d42f019148ed1
2022-03-08 09:41:49 +00:00
Abijeet
03cf7863ec Stop propagating first click handler when loading languagesettings
The languagesettings dialog does not open when clicking the
uls.trigger for the first time. This issue occurs when the user is
not logged in, ULSPosition is personal, and ULSAnonCanChangeLanguage
is false.

Without this change, the following happens:
* uls.languagesettings is loaded via uls.interface
* uls.languagesettings::hide is called via uls.languagesettings::init
* click method is triggered immediately via script in uls.interface
* uls.languagesettings::show is called
* uls.languagesettings::hide is called - triggered via ::show
  method - $( document.documentElement ).trigger( 'click' ); but
  dialog is not visible yet, so this does nothing
* uls.languagesettings::show displays the uls.languagesettings
* hide method called again via click handler for documentElement

With this change in place the hide method is not called again due to
e.stopPropagation();

Additionally add a parameter autoOpen that can be set to open the dialog
automatically.

Bug: T301882
Change-Id: I54e8172ae017c4a9c6ab5b841d9328b2f24f97a8
2022-03-08 09:39:43 +00:00
Volker E
5abe986953 build: Update 'svgo' to latest v2.8.0 & re-crush images
Updating 'svgo' to v2.8.0 and newest Wikimedia SVG guidelines –
mainly around new whitespace features of SVGO.

Change-Id: I7c9eb84fdaeb50f6ff04c9e5cd2f005e129d555a
2022-02-27 23:59:05 +00:00
Santhosh Thottingal
5bd64b167c Improve the loading time of ULS language selector by fetching modules early
Start fetching them on mouseover without waiting for click.

Bug: T299202
Change-Id: I1ba3b8516bd01ad1bf8bb4c57d72d10ca59e06ca
2022-01-27 14:31:07 +00:00
Clare Ming
f539619b1c Simplify function to check for standalone language button.
Change-Id: I4d4afa0e5098736e40e49924e87f471b3d09257a
2022-01-14 05:58:42 +00:00
Jon Robson
607124c247 Drop ineffective rule
This has been moved to Vector in
I8d5294a986d76574284419efc7d384fc954a86c8

Bug:  T297579
Change-Id: Id75de20550de208c23d27842c0d2686521e59b5c
2022-01-11 08:24:14 +00:00
Santhosh Thottingal
cc1a255081 Update GentiumPlus font
Update to version 6.001
Upstream font file names were changes. So updated it here too.
Added Bold and Bold Italic since they are present in upstream.

Bug: T298613
Change-Id: I1c0429f6c5abac66471df0fa96738a10a7b28d04
2022-01-10 07:38:58 +00:00
jdlrobson
26aa8d450c Hide sticky header language button with preference disabled
Adds a class to body when the ULS dialog is disabled.

Bug: T297579
Change-Id: I791c65c6a7ac5221dcf24e5db01c22c3e2e9f81a
2022-01-06 05:13:45 +00:00
bwang
c95e8e70c5 Handle "Enter" keyboard event for checkbox hack selectors
"Enter" key support for Vector ULS button was previously handled by the core checkbox hack. With the upcoming changes to the checkbox hack implementation, it needs to be handled separately.
Context: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/747877/10/resources/src/mediawiki.page.ready/checkboxHack.js#b275

Change-Id: Id74a80cda6cf460cc2b579269b8d5b2ce81c8ca5
2021-12-21 22:17:34 +00:00
jdlrobson
5890cf27f1 Disable language button background color on modern Vector
Limit this style to sidebar buttons. When skins are not placing it
inside the sidebar (e.g. modern Vector), we should defer to them for
all styling matters. This rule clashes with modern Vector's mw-ui-button
class.

Bug: T296323
Change-Id: I16bdbf8882e37b8727fbf693c904b9c9d1d8820c
2021-11-29 23:28:35 +00:00
Jan Drewniak
2d9279a1f1 Accommodate Vector sticky header in menu positioning
Adds special logic to accommodate the ULS trigger being placed inside
modern Vector's sticky header, which has a fixed position and requires
the ULS menu to remain pinned to the page when scrolling.

Bug: T295391
Change-Id: Ic531dd2ae213f8221157386f79edb95bc61a8119
2021-11-29 17:26:28 +00:00
Reedy
c3bdd26c7a Add Awami Nastaliq font
Bug: T290510
Change-Id: I37403b6ff61af63f54e4277acbb436bf2d93db6d
2021-11-29 14:02:36 +00:00
Jan Drewniak
7805386fcb Lower .uls-menu z-index for Vector skin
To avoid overlapping with the Vector sticky header, the z-index
should be lowered so that the sticky header is always
above it.

Bug: T295794
Change-Id: I9d3f45d56204bedc98d1994ed984b43f01c29fd5
2021-11-24 17:13:06 +00:00
Fomafix
6ee366a2c8 Reuse userCanChangeLanguage()
Change-Id: I52893ca8e2579520d21579bd7fdcb9af858a52b9
2021-11-21 19:39:25 +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
Reedy
7617fda424 Update OpenDyslexic
Change-Id: I148f31b71b28c954e788719f321c11e463d5d724
2021-11-09 11:35:37 +00:00
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
869c721e91 Language button should prevent default click behavior
In Vector the language button is a checkbox. It uses the checkbox
hack to provide non-JS dropdown behaviour.

When the JS upgrades such a button, the checkbox behavior continues
to work. An unsatisfying hack in Vector workarounds this problem.

This provides a neater way to disable that behavior
in Vector once the button is clicked by adding support for the
well documented checkbox hack.

Bug: T283757
Change-Id: I97a69c30b27cb1ded06451389e086229561c3589
2021-09-13 07:04:33 +00:00
bwang
9e952f28af Add support for multiple ULS buttons
- Update document click handler for loading ULS
- Use data attributes to ensure ULS isnt loaded multiple times for an element

Bug: T289815
Change-Id: Iba6cbbd6c6e48a1abfda342421822e3ff2715362
2021-09-07 15:21:26 -05: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
jdlrobson
9f92d7e759 Register meta data to allow Vector to handle display of this menu item
- Adjusts CSS to defer button/icon rendering to skins that support button
and icons e.g. Vector

Depends-On: Ib518858e06549f252d73d57fd4768f446cc561b9
Bug: T289630
Change-Id: Ie9e30af5468aea9803d77c9a36e480ba2b2e86a0
2021-09-03 19:21:21 +00:00
Jdlrobson
4c3907e61d Revert "Language button icon/button should be consistent with other buttons"
This reverts commit 5ca2ccb58a.

Reason for revert: Per Niklas's review (T289630#7324439)
I've also seen a much better way to do this which limits the change
to modern skins so I'll post a follow up shortly.

Change-Id: I99802c60390e23eaa0de21462788da622a35a37a
2021-09-01 15:35:05 +00:00
jdlrobson
5ca2ccb58a Language button icon/button should be consistent with other buttons
This converts the language button into a mw-ui-button which is the
class we're currently using in both Vector and Minerva. In future
this can become a WVUI button using the same roadmap as Vector
and Minerva.

This fixes the issue with the icon resize, as well as the issue
with the button lacking appropriate hover/focus states.

Bug: T289630
Change-Id: I8242986e8762a8f663f8cab07c54481e14223320
2021-09-01 08:05:54 +00:00
jdlrobson
01c7a4fb0b Restrict compact language button styles to legacy Vector
These styles are causing the language button to move downwards
on page load in modern Vector

and legacy Vector.

See T191021#7231088.

Bug: T191021
Change-Id: I9d62ad8a79168bdaebace07fb82f22da4c534b5c
2021-07-22 23:47:01 +00:00
Niklas Laxström
03d099eddc Fix regressions in ULS entry point setup
* Link in preferences is again opening ULS
* "personal" entry point now works even with compact languages
  preference disabled

I added lots of comments and refactored this code to give things
better names to make this code easier to understand and maintain
and hopefully reduce the amount of bugs in the future.

Bug: T282956
Bug: T286574
Change-Id: I9cd6776ea6664e33fd63c49dfa77c5f004fba799
2021-07-16 19:23:34 +00:00
Santhosh Thottingal
4f40e08f9c Remove deprecated .box-shadow mixin
Replace with unprefixed box-shadow

Bug: T286692
Change-Id: Icb448cb092c214b0c467864201a2469076134a4c
2021-07-15 06:52:46 +00:00
Sam Smith
3b9134f8ac launchULS: Add context to interface.language.change hook
Now that the interface.language.change hook is fired when the user
switches language using the Compact Language Switcher, we should provide
additional context to the UniversalLanguageSelector instrument.

Bug: T280770
Change-Id: I6c4ddf9738e527ac42581c9fb4924ed1d12748b4
2021-06-21 21:25:31 +00:00
jdlrobson
09a2b33bd6 Restore compact languages button user preference
The compact languages button user preference will be applied to
any compact language button provided by the skin, this allows users
to opt out of the feature as before.

This will be used immediately in Vector in
I436554d9d51470d277d59c2c71e08124735e12fd

Bug: T282149
Change-Id: I726c61d4c6895a28b999781752535e0ddc961744
2021-06-14 15:24:53 +00:00
Sam Smith
bc14f8fa40 Fire language change hook
As of Id345e933, we fire the language change hook when the user switches
language by clicking on a link in the languages list. In order to
compare the user switching language in the scenario above with the user
switching language via the CLS and/or Vector's language switcher, ensure
that we fire language change hook in all treatments.

Bug: T280770
Change-Id: I4a74254612557c287b16f4f086077a2637de9a2e
2021-06-10 11:11:37 +00:00
Sam Smith
49924e9ec5 Pass context to compact_language_links.open hook
Following on from I6fa966c2, fire the mw.uls.compact_language_links.open
hook with the $trigger parameter as context for clients to be able to
able to distinguish which treatment is visible to the user.

Supporting changes:

- Note that the hook is unstable next to its callsite

Bug: T280770
Change-Id: Ie4bbfea4dc5e36401df587550f466aeae5c8fdcc
2021-06-01 18:11:30 +00:00
Volker E
8354e280b6 build: Update SVGO to latest v2.3.0 and re-optimize SVGs
SVGO v2.x changed configuration to JS, amending configuration.
Adding new 'minify-svg' npm script.
Also re-optimize SVGs.

Bug: T278656
Change-Id: I88ebed650be0d20b71bca6f15f3aa70b6b5eb42a
2021-05-27 11:53:05 -07:00
Timo Tijhof
977e6c68c2 ext.uls.interface: remove some needless uses of jQuery
* $(node).prop(foo) -> node.foo

* For objects only expected to represent a single element,
  use native querySelector() and its natural null return
  fallback, instead of `$(), $.length, $()` etc.

* Fix a few minor non-voting eslint warnings that were in the CI
  output about line length and unknown type "bool".

* Remove presumed outdated comment about Vector splitting,
  per T234907.

* Rename ulsPosition to configPosition to be more clearly
  different from ulsPopupPosition.

* Remove various 'uls' prefixes of local variables,
  since this is ULS code in the ULS repository.

Change-Id: I1c617bf48283f47dc948550111c515faf173d1eb
2021-05-20 18:57:09 +00:00
Santhosh Thottingal
7b2338cef5 Replace BabelStoneTibetan with its variant with suitable type metrics
Due to the nature of the script, Tiben usually has high ascent and descent
values. Use a variant of BabelStoneTibetan to have lesser ascent, descent
values for modern, frequently used Tibetan

Bug: T283122
Change-Id: I902af894b0e4d6f375981f13548be49405fb3602
2021-05-19 14:35:33 +05:30
Santhosh Thottingal
96ec65ac8e Replace Jomolhari with BabelStone for Tibetan
Jomolhari is inactive upstream for years and BabelStone is an active
fork with improvement for better script support.

Bug: T197596
Change-Id: I5c3c1ce5ad2a80c78e93304d4023342a66382942
2021-05-17 13:39:09 +00:00
Sam Smith
8e85f0d611 Fire hook when compact language links are opened
Following on from Icc64044d, we fire the
mw.uls.compact_language_links.open hook whenever that treatment is
opened (and not only the first time that the triggering element is
clicked).

Bug: T281928
Change-Id: I6fa966c22c738ca12bcbeb0225c03f3f8394ecee
2021-05-11 12:48:10 +01:00
Sam Smith
c914a7d0ab Fire hook when user clicks language button
This allows us to correctly instrument (via the
UniversalLanguageSelector instrument) this action so interaction rates
between treatments can be compared.

Bug: T273232
Bug: T273928
Change-Id: Icc64044d51c567482d4f286637366cefb7beeb3e
2021-05-10 20:46:37 +00:00
jdlrobson
5278a672fe Restore suggested languages to compact languages button
The filterForCommonLanguagesForUser method checks if commonInterlanguageList
is null, but it can never be null unless it is first initialized that
way.

Bug: T282037
Change-Id: I70c3a60349693473509d9b329764dc5138930506
2021-05-10 07:14:04 +00:00
jdlrobson
ec8edeb8ec Use ev.currentTarget not ev.target
In modern Vector, the ULS trigger button has a child node which is
a span. When clicks are received on the span, they will result
in positioning relating to the span rather than the button.

The ev.currentTarget should be read outside the asynchronous function
to avoid bubbling.

Bug: T276248
Change-Id: I6e138c88e29b335b8e0bc22cf0aa07c289a5eb74
2021-04-26 16:59:47 +00:00
Inductiveload
a2a218cce1 Update Junicode to 1.002
Bug: T173573
Change-Id: I0d8d650ea63e5391a405926ff769981a4c094403
2021-04-21 13:47:21 +00:00
Niklas Laxström
2a044e1e0a Small cleanups and typo fixes
Change-Id: I4faeb4673fd5e903d2931d6071262a893d4009f5
2021-04-21 11:48:15 +00:00
Niklas Laxström
929e707c49 Simplify undo tooltip positioning
OOUI is smart enough to handle this automatically:
https://doc.wikimedia.org/oojs-ui/master/js/#!/api/OO.ui.PopupWidget-cfg-position
https://doc.wikimedia.org/oojs-ui/master/js/#!/api/OO.ui.PopupWidget-cfg-autoFlip

Change-Id: Ib8e4ea0e900b3ea0904b34d82c874227462e342e
2021-04-21 11:48:13 +00:00
Timo Tijhof
a6e0c10c54 ext.uls.interface: remove unused "ulsPopup remove" code
The ulsPopup variable is local to the showUndoTooltip() function.
If it is called multiple times, then a previous assignment of an
OO.ui.PopupWidget object would not be found here in subsequent calls.

This check can only ever be false since it is the first statement in
the function (after variable and function declarations, which don't
do anything other than call `$()`).

Change-Id: I7020c103428d01b5e48c65be695471401f588fc4
2021-04-15 07:01:13 +00:00
Niklas Laxström
50b345c83d Avoid JavaScript errors for tipsy if no entry point on the page
Bug: T278313
Change-Id: I48011eec9f7d876b914550012cc76e2209fc783c
2021-04-14 23:41:54 +00:00