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
OOUI widgets are required for the actions menu dialog, but no need
to have them loaded unconditionally.
Bug: T309793
Change-Id: Icc09b88aa70af1316bd67a56b13a411ebc8f7f8a
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
"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
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
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
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
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
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
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
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
- 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
* 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
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
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
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
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
* $(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
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
Jomolhari is inactive upstream for years and BabelStone is an active
fork with improvement for better script support.
Bug: T197596
Change-Id: I5c3c1ce5ad2a80c78e93304d4023342a66382942
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
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
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
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
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
composer:
* mediawiki/minus-x: 1.1.0 → 1.1.1
npm:
* eslint-config-wikimedia: 0.17.0 → 0.19.0
The following rules are failing and were disabled:
* compat/compat
Additional changes:
* Added the "composer phan" command to conveniently run phan.
* eslint: Renamed `wikimedia/client` profile to `client-es5` (T277085).
Change-Id: Ib31cbcd8c615d2e6abf9ee30f0f4d7b7baa54e2e
In development environment, ev.currentTarget is the button.
In Beta Cluster, however, once ext.uls.mediawiki is loaded,
it is now the document (the event has bubbled up). I do not
know what causes the difference, but we can use the target.
Bug: T276255
Change-Id: Ie4c425510293a6f2ce81e4bf4a353f2c8d86d412
Small dialogs were resizing after loading when display and input
setting buttons were added to it. Now delay showing the dialog until
they are loaded.
Bug: T276248
Change-Id: I7033903737afedbd4be908c84d07656c468ce801
Unrelated behavior change: ULS language selection dialog is hidden while
display or input settings is open.
Also simplified dead code in addDisplaySettings.
Bug: T276248
Change-Id: Ia91a2b83e7ad4072016649230e2376b0793cbbff
Reported in
https://github.com/wikimedia/jquery.uls/pull/383#pullrequestreview-613761459
Instead of checking the left edge of the trigger, check the midpoint.
This is more reliable and does not cause the dialog to incorrectly
swap sides in narrow screens in LTR direction,
This patch does not touch the compact language links variant.
Bug: T276248
Change-Id: Ic734abb7b350852f8c5c10ced8456bf146df62d8
New Vector introduced a new content language selector trigger. This
code was hardcoding a behavior that works for compact language links
but is not so appropriate for other uses in the skin, which are out
of our control.
This patch aims to be a minimal change to allow other kinds of
behavior without changing the amount of tech debt. This changes
the default ULS dialog behavior to match the requirements shown
in the task. Compact language links specific behavior is retained but
only enabled for the compact language links trigger. The behavior
is chosen depending on the value of isUsingStandaloneLanguageButton().
For future changes, I propose that mw-interlanguage-selector class will
not have any styles attached to it. Whoever creates the trigger would
be in charge of styling it. Ideally that code would also define the
positioning and other behavior, but it is less clear how that can be
abstracted in a nice and decoupled way.
Bug: T276248
Change-Id: I52da6c2f5a1f25d64f322a3c8f6105da3b244b66
Changes to comments, naming and code to increase clarity of the code
and explain better what it does and why. No change in behavior.
Change-Id: I998fcfd620c2ee737618c3ab8f41fb6dfdd2c99a
Translate's pagetranslation.uls module needs to override the action
that happens after language code is set. Currently it uses setlang
url parameter, which (no longer) works with Special:MyLanguage.
After this patch, it can use mw.uls.setLanguage and does not need
to reimplement it's functionality.
Turned mw.uls.changeLanguage into simple utility that calls
location.reload when the promise is resolved.
Change-Id: I9a648b146188dd252c239085bbe276165dc5f393
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