Page MenuHomePhabricator

[October] Update to user styles and scripts required: .menu, .vectorTabs and .vectorMenu, .menu and .vectorMenuCheckbox no longer supported
Open, Needs TriagePublic

Description

The HTML structure of menus is changing and this will impact various gadgets. For example, dropdowns in Vector e.g. more menu currently apply a .menu class. This will soon no longer the case. After the change has applied, a new class .mw-portlet will be available. With time this class will be used across skins making gadget development easier.

ACTION REQUIRED: Please review the following user scripts to use nav ul instead, or .vector-menu ul / .vector-menu / .vector-menu-tabs if targetting Vector only.

Examples of selectors that will no longer work:

#p-cactions > .menu > ul
div.vectorMenu
.vectorTabs

Example

Before HTML:

<nav id="p-cactions" class="vector-menu-empty vector-menu vector-menu-dropdown vectorMenu" aria-labelledby="p-cactions-label" role="navigation" style="margin-right: initial;">
	<input type="checkbox" class="vector-menu-checkbox vectorMenuCheckbox" aria-labelledby="p-cactions-label">
	<h3 id="p-cactions-label">
		<span>More</span>
	</h3>
	<!-- Please do not use the .body class, it is deprecated. -->
	<div class="body vector-menu-content">
		<!-- Please do not use the .menu class, it is deprecated. -->
		<ul class="menu vector-menu-content-list"><li id="ca-purge"><a href="/w/index.php?title=Main_Page&amp;action=purge" title="Purge the server cache of this page [⌃⌥*]" accesskey="*">Purge</a></li></ul>
		
	</div>
</nav>

After HTML:

<nav id="p-cactions" class="vector-menu-empty vector-menu vector-menu-dropdown" aria-labelledby="p-cactions-label" role="navigation" style="margin-right: initial;">
	<input type="checkbox" class="vector-menu-checkbox" aria-labelledby="p-cactions-label">
	<h3 id="p-cactions-label">
		<span>More</span>
	</h3>
	<!-- Please do not use the .body class, it is deprecated. -->
	<div class="vector-menu-content">
		<!-- Please do not use the .menu class, it is deprecated. -->
		<ul class="vector-menu-content-list"><li id="ca-purge"><a href="/w/index.php?title=Main_Page&amp;action=purge" title="Purge the server cache of this page [⌃⌥*]" accesskey="*">Purge</a></li></ul>
		
	</div>
</nav>

Compatibility script

JS Gadgets can prepend the following to their code to maintain compatibility as they migrate:

$('.vector-menu-tabs').addClass( 'vectorTabs' );
$('.vector-menu-content').addClass('body');
$('.vector-menu-checkbox').addClass('vectorMenuCheckbox');
$('.vector-menu-dropdown').addClass('vectorMenu');
$('.vector-menu-content-list').addClass('menu');

Scripts should update their selectors

Impacted

Only Vector will be impacted by this change.

Suspected to impact < 3000 pages
https://global-search.toolforge.org/?q=%28%5C.vectorMenu%7C%5C.vectorTabs%29&regex=1&namespaces=&title=.*%2F.*%28js%7Ccss%29

Event Timeline

Jdlrobson created this task.Fri, Sep 4, 7:35 PM
Restricted Application added subscribers: jeblad, Danmichaelo, Cosine02 and 2 others. · View Herald TranscriptFri, Sep 4, 7:35 PM

Change 624908 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/Vector@master] Drop support for vectorMenu, vectorTabs and menu selectors

https://gerrit.wikimedia.org/r/624908

Od1n updated the task description. (Show Details)Tue, Sep 8, 6:16 AM
Od1n updated the task description. (Show Details)

Why is it only about user scripts? How media wiki script are going to be updated?

@Uziel302: Please provide a specific, existing example for "MediaWiki scripts" which need(s) to be updated. Thanks.

From the description, it is not that clear on how the scripts should be fixed.
Is it simply the following replacements?

.menu -> nav ul
.vectorTabs -> .vector-menu-tabs
.vectorMenu -> .vector-menu

(By the way, I am not sure how we should fix https://ja.wikipedia.org/wiki/User:Hiroakikawa/_vector.css)

From the description, it is not that clear on how the scripts should be fixed.
Is it simply the following replacements?

.menu -> nav ul
.vectorTabs -> .vector-menu-tabs
.vectorMenu -> .vector-menu

(By the way, I am not sure how we should fix https://ja.wikipedia.org/wiki/User:Hiroakikawa/_vector.css)

Not exactly. If your script is for Vector only and lives in vector.css/js then using .vector-menu and .vector-menu-tabs is fine, but if you can it's better to use tag based selectors or ID selectors e.g. #p-personal or nav > div

In your example I think #right-navigation div.vectorTabs ul > #right-navigation nav ul should suffice.

Jdlrobson renamed this task from Update to user styles and scripts required: .menu, .vectorTabs and .vectorMenu no longer supported to [October] Update to user styles and scripts required: .menu, .vectorTabs and .vectorMenu, .menu and .vectorMenuCheckbox no longer supported.Mon, Sep 14, 8:53 PM
Jdlrobson updated the task description. (Show Details)

Change 615322 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/Vector@master] Use newly available Skin::getPortletData method

https://gerrit.wikimedia.org/r/615322

Change 624908 abandoned by Jdlrobson:
[mediawiki/skins/Vector@master] Drop support for vectorMenu, vectorTabs and menu selectors

Reason:
Merged into https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/ /615322 which also provides the generic and new standard mw-portlet class.

https://gerrit.wikimedia.org/r/624908

Jdlrobson updated the task description. (Show Details)Mon, Sep 14, 8:59 PM

Change 629487 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/Vector@master] WIP: Drop unsupported skin classes

https://gerrit.wikimedia.org/r/629487