Commit Graph

1082 Commits

Author SHA1 Message Date
Jdlrobson
5481573341 Revert "Use Codex styles for buttons in language overlay"
This reverts commit d29050d080.

Reason for revert: I had mistakenly assumed the @wikimedia/codex
module was loaded on clicking the language button. It appears to
be added on page load.

Given T248718 it's still unclear what our policy on loading
@wikimedia/codex on page load is and given several people are out
I think it would be better to attempt this again next week, possibly
delaying further if needed.

Bug: T353071
Bug: T248718
Change-Id: I09334a1faec06a7400e61013ddda374156bf5d72
2023-12-08 22:00:26 +00:00
Jon Robson
d29050d080 Use Codex styles for buttons in language overlay
* Replace all instances of mw-ui markup with Codex markup
* Use @wikimedia/codex as it is available in 1.39
and codex-search-styles is not.

Bug: T340255
Change-Id: Id85cf3b4af782c0d93bfa3bed5f3e6cbed856f1b
2023-12-07 14:19:23 +00:00
ksarabia
26ec080e5a Bump up z-index
*This addresses the issue of the sticky header
concealing the ULS menu.

Bug: T338642
Change-Id: I8fb09509c520b6db6d06d9773ff93d43fe39eecf
2023-11-02 13:48:37 -05:00
Abijeet
d413fc2721 Fix TypeError: mw.user.isNamed is not a function
This is happening due to operator precedence. Taking a simpler
example:

  return i || typeof i === 'function' ? i() : (i + 3); where i is 1

Explanation from ChatGPT:

* First, the typeof operator is evaluated for i. Since i is 1, typeof i
returns the string 'number'. The result of this operation is `'number'.
* Then, the === operator is applied to 'number' and 'function'. The
result is false because these two strings are not equal.
* Now, we have the logical OR (||) operator. The i (which is 1) is
compared to the result of the typeof and === operations combined, which
is false. Since 1 is considered truthy, the || operation results in 1.
* After the || operation, we have the conditional (ternary) operator ? :.
In this case, the condition to the left of ? is 1, which is truthy, so
the expression after ? is evaluated.
* i() is the expression after ?. Since i is not a function, and the
condition to the left is truthy, it attempts to call i() but throws
a "TypeError: i is not a function" error.

Fiddle that demonstrates the issue: https://jsfiddle.net/t2v1w6ae/2/

Bug: T347847
Change-Id: If5e8405141dfafd53c4495c91265545ec01acab3
2023-10-27 15:24:26 +00:00
Niklas Laxström
8a38906b8a Update Junicode font to 2.100
Bug: T253006
Change-Id: I7d02c91dec8200e26ebd7312ab87556b79cd806e
2023-10-17 16:19:53 +03:00
Ed Sanders
e040f65ca6 history.replaceState: Drop unused argument
Per https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState

Change-Id: I6687967c8c8f29393f7f10a3234f42754d192953
2023-09-20 21:26:08 +00:00
Ed Sanders
bde4b44108 build: Update linters
Change-Id: If959fe0c1b972fe55c6f8cee1c9bb33a52b4265d
2023-09-20 19:10:42 +01:00
Niklas Laxström
ee42cf07bb Add AwamiNastaliqBold
Fixes: I1a50a699543ad6502e452f7be380419246c3b6b8
Change-Id: I336f137750efd1cfe2a0eb46c2e746d7c116b081
2023-09-17 10:06:21 +00:00
Stang
953ca0ad88 Add Tiro Bangla font for Bengali Language
Bug: T343658
Change-Id: I86870360f00e5fda48bc1fbc2da47f807318e137
2023-09-11 04:53:20 +00:00
Abijeet
939c03bad1 ext.uls.interface.js: Inline isNamed() method
This module does not use ext.uls.common

Bug: T344635
Change-Id: Ib21c7f9020b8f51241299f4fb5b721c68de6a8e4
2023-08-22 19:37:27 +05:30
Abijeet
88f0045b94 ULS Frontend: Save preferences only for named users
Add a new method isNamed in ext.uls.common to use the isNamed
method if available else use the isAnon method as usual.

mw.user.isNamed was added in MW 1.40

Bug: T337780
Change-Id: I747c042a95e8edc793a2265a15ed6ba8ae9f1997
2023-08-21 11:08:26 +00:00
Jon Robson
76e7805881 Don't load mediawiki.ui.button on page load (attempt 2)
The stylesheet is needed on legacy Vector but not modern
Vector 2022 meaning Vector 2022 loads two sets of styles
for buttons.

This is a short term fix until UniversalLanguageSelector can
use Codex.

Bug: T340255
Change-Id: Ie34949e31e93dcfcabc07fa418dec06022159ca7
2023-07-17 21:28:23 +00:00
Jdlrobson
d7d63236fd Revert "Don't load mediawiki.ui.button on page load"
This reverts commit 693087b886.

Reason for revert: This was a bug in my code. Sorry about that.

Change-Id: Ia3bb8d2b38e179a570f94bfd1d989bb51fab41e4
2023-07-17 20:24:38 +00:00
Jon Robson
693087b886 Don't load mediawiki.ui.button on page load
The stylesheet is needed on legacy Vector but not modern
Vector 2022 meaning Vector 2022 loads two sets of styles
for buttons.

This is a short term fix until UniversalLanguageSelector can
use Codex.

Bug: T340255
Change-Id: Ib4e228908d2813898654886bc1ee76e90dc52f22
2023-07-17 05:37:17 +00:00
Winston Sung
21261dbdec UniversalLanguageSelector: Don't suggest non-specified-script zh for UI language
Change-Id: Ic46587437d3b48e43b689d18ef562cebf7730f41
2023-07-12 08:24:03 +00:00
Volker E
e67d5bd33c build: Update SVGO to v3.0.2 & re-crush icons
svgo         2.8.0  →   3.0.2

Amending to new `cleanupIds` plugin name.
Re-crushing SVGs while at it.

Bug: T339162
Change-Id: I9804d6fa3c81e3c85e6d89e45079736d0934c465
2023-06-15 02:36:53 -07:00
bwang
330853765d Remove padding-left from .uls-trigger
This padding appears to be unnecessary. It's overridden in Vector 2022 & legacy Vector, and doesn't seem useful in Monobook as well.
It would be helpful to remove because it overlaps with the Codex button styles

Bug: T336526
Change-Id: I6a991600f8826fbeb09c7afb0c4cea4ebfd5cdd5
2023-06-14 11:25:10 +00:00
Niklas Laxström
08645aae8b Update AwamiNastaliq to 3.100
Add bold variant.

Change-Id: I1a50a699543ad6502e452f7be380419246c3b6b8
2023-05-17 12:24:15 +03:00
Niklas Laxström
3ac1c1b9ce Update Junicode to 1.003
Bug: T253006
Change-Id: I34321e7430b04c8a4dcd8cc07015e65e31cc3362
2023-05-17 12:03:08 +03:00
Niklas Laxström
744eeae6a1 Update Amiri font to 1.000
Bug: T335231
Change-Id: Ief092bf4ffd6e06f208db14b79a18ce944dc9e1b
2023-05-17 11:37:34 +03:00
Jon Robson
240498e6ee Let Vector 2022 manage its own styles
Depends-On: I9996696795f792567f770ac8bf57002bd5706d06
Bug: T335710
Change-Id: I1f4bddc9091a360795f0ee16f5eed00a7a9ce846
2023-05-10 23:55:00 +00:00
libraryupgrader
d0d88ee40e build: Updating eslint-config-wikimedia to 0.25.0
Change-Id: I56a69db1b780752b33ad1ed0babee8bb280a4aa3
2023-05-05 18:51:36 +00:00
Abijeet
9b3fb0cc4e ext.uls.mixins: Use LESS variables from skin
Bug: T332541
Change-Id: If431b51615aa492b32a7707acc4946212d644971
2023-05-04 14:26:00 +00:00
Volker E
d5285655fd styles: Replace 'mediawiki.ui/variables' call with skin variables
- Replacing 'mediawiki.ui/variables.less' `@import`
  with new Codex design tokens as external library. We're using the
  legacy values as UniversalLanguageSelector has been a desktop first
  extension and those values are also used by Vector skin.
  The values replaced are anyways only touching colors, borders or
  transitions which are the same in normal and legacy.
  These will be replaced by skin-aware 'mediawiki.skin.variables.less'
  standard with dependency of UniversalLanguageSelector upped
  to MW 1.42.0.
- Replacing several static values with new Codex design token featuring
  skin variables, in categories `background-color`, `color`,
  `border-*`, `box-shadow`, `opacity` and `transition`.

Note, that this change should result in same rendering of the
extension, only properties that already have an equal token are
replaced.

Bug: T332541
Co-Authored-by: Volker E. <volker.e@wikimedia.org>
Change-Id: Ic563fa84bf8e76fd62f14487924d7d6fd5c1a065
2023-05-04 04:44:44 +00:00
Fomafix
69ddc959ac Use Unicode '\u00A0' instead of HTML '&#160;'
The .html() can replaced by .text() which avoids a possible JavaScript
injection by a malicious message.

Change-Id: Iffdf13299db6fb4ccd8a35b9df4c2f235646ea9d
2023-04-24 09:43:39 +00:00
Niklas Laxström
7d20f15b17 Remove ULSMobileWebfontsEnabled
To my knowledge never used since it was added in in 2013 with
commit fd885d9881.

Bug: T332837
Change-Id: Ia9ecb3e4dd47b8ce4dfaaa489a1ec5a71c378492
2023-04-05 06:21:40 +00:00
NikG
a6a338c0f7 ULS: Use quick actions icon inside page language selector
Currently, inside the page language selector of multilingual wikis
(like Commons), the user can access the language settings by clicking
the display and input setting buttons that are provided at the bottom
of the language selector. However, instead of these buttons, the quick
actions trigger should be used instead for a consistent user experience.

The trigger will only provide access to the language settings, and other
quick action items won't have any effect in this case.

Bug: T314021
Change-Id: Iaaf61c85518b4d3d44d4a92dbf5dc7fdb96282fa
2023-03-30 05:52:06 +00:00
Umherirrender
e464c5ab31 stylelint: Enable selector-pseudo-element-colon-notation
Via stylelint --fix

Change-Id: I77f14cac83e4422c7962339d1177da9e65b6a28e
2023-03-30 01:03:16 +02:00
NikG
fcba642756 Align page language selector in multilingual wikis
Align page language selector in multilingual wikis with the trigger button.

Bug: T314021
Change-Id: I68e3c55662d027a079c5204def04cdac0b105667
2023-03-29 04:21:47 +00:00
Wandji69
7a69478642 style: Replace deprecated prefixed mixins with unprefixed CSS property
Bug: T308351
Change-Id: I80615dcee5dd97fe267cb901fa0b4d5018a7ea88
2023-01-26 10:37:20 +00:00
NikG
dde48f50ab Add separate buttons for 'add languages' and language settings menus
Bug: T323694
Change-Id: I23cb4687d841025905224a52b843572206fa9ddb
2023-01-25 11:47:24 +00:00
Santhosh Thottingal
6804fb06f4 Set hreflang attribute to the links
They are present in the original links in the skin, so copy them to ULS too.

Bug: T327591
Change-Id: I24566d1ff4c8c655325ec0dc601f56d73e414d5f
2023-01-23 15:58:43 +00:00
NikG
965ffc3b1a Add language settings button inside dropdown for non-content pages
NOTE: This patch is identical to patch with change-id:
Ifdf2a529b30e5a2df8867b606a525c9f7b3bdb6c

The above patch has been merged but reverted because of the usage
of '$skin->getTemplateDate()' method, which should be avoided. The
current patch replaces the usage of this method, with the usage of
the output page title ($out->getTitle()). All the rest of the code
has been kept the same.

Bug: T316559
Change-Id: Ibef9f6fd46d9055c3e0865905fb8aa8d031c1940
2023-01-11 18:05:29 +02:00
Jdlrobson
570a7d3b4e Revert "Add language settings button inside dropdown for non-content pages"
This reverts commit 5d576d05b4.

Reason for revert: Using Skin::getTemplateData method outside the
skin rendering layer is dangerous and likely a performance issue as
it means generating the rendering data twice and makes various hooks
execute multiple times.
It has caused T326538 and may be causing other issues.

Bug: T326538
Change-Id: Ie5d079deae414eb199d2a40b98d04b57439eaac4
2023-01-09 20:25:46 +00:00
NikG
5d576d05b4 Add language settings button inside dropdown for non-content pages
Bug: T316559
Change-Id: Ifdf2a529b30e5a2df8867b606a525c9f7b3bdb6c
2023-01-09 05:02:57 +00:00
NikG
de77ea992e Remove unused code from ext.uls.interface.js
During the implementation of the “addEmptyState” method, a part of code
was copied from the “addActionsMenuTrigger” method. This part is the
rendering of the action menu items (Translate button, Open Language
Settings button, etc) that is common for both the empty state and the
actions menu. During this copy, two unused lines were also copied. These
lines basically create the trigger for the actions menu (the “ellipsis”
or “cog” icon button at the bottom right corner of non-empty ULS), which
is not rendered for the ULS empty state.

This patch removes these unused lines.

Change-Id: I4776c2038cb6e1c74401c4caa6705e98181c6dca
2022-11-02 05:07:32 +00:00
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