When users click on the link "Move to Commons" on a file's wikipedia file page, they should proceed with the actual move in a new tab. This should help them not to lose context of where they come from - since the original page is still open.
Description
Details
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | None | T140462 Correctly move files from Wikipedia to Commons (2013) | |||
Resolved | None | T144480 Move files from Wikipedia to Commons | |||
Resolved | Addshore | T160676 Open a new tab when users click on "Move to Commons" |
Event Timeline
Change 343838 had a related patch set uploaded (by Addshore):
[mediawiki/extensions/FileExporter] Open a new tab when users click on link
Change 343838 merged by jenkins-bot:
[mediawiki/extensions/FileExporter] Open a new tab when users click on link
So it looks like target is not supported by the code that eventually handles the list of links that we modify in the hook https://www.mediawiki.org/wiki/Manual:Hooks/SkinTemplateNavigation
The links appear to be build on a skin by skin basis so this would probably mean touching every skin to allow them to handle a target here.
I'm going to poke someone to get a second opinion.
Change 362366 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/skins/Vector@master] Add target support for view_urls
The above patch fixes the issue for Vector.
We should decide if we want to do this & if so for which skins.
I think the real bug here is that Vector is not using $this->makeListItem() to render this menu and instead is generating HTML by hand. I think that should support custom attributes already. (And if it doesn't, you theoretically only need to fix it in one place rather than in every skin.)
(In fact the "Export file" link correctly opens in a new tab in other skins I tested, e.g. MonoBook and Timeless.)
Oooh, that is nice. Thanks for looking into this!
In which case the patch that is up is the only one that we probably need (covering the main WMF usecase).
We could work on making Vector use makeListItem, or leave that to someone that knows more about the skin system.
Interesting. From looking at Vector, the arbitrary attributes go to the list item. But looking at BaseTemplate, they go to the anchor link. This might complicate migration to $this->makeListItem() – but, this may just be an internal name match. I'd say it's worth trying.
Change 362366 merged by jenkins-bot:
[mediawiki/skins/Vector@master] Add target support for view_urls