Page MenuHomePhabricator

Quickly open a template page by modifier + clicking on the wiki markup
Open, Needs TriagePublicFeature

Description

As an editor who uses wiki markup and often edits pages with a lot of templates, I would like to be able to (modifier +) click on a {{template}} (e.g. {{support}}) to quickly go to that template's page (e.g. [[Template:Support]]).
This would speed up editing complex pages with lots of templates, as it would save me having to copy/paste the template name.

I'd previously written a user script (linkThings.js) which adds this functionality via ctrl + clicking on any {{template}} to both the visual source editor and the CodeMirror editor.

Event Timeline

@TheresNoTime: Hi, which editor software is this about? https://www.mediawiki.org/wiki/Editor

(Also removing Editing-team as it's up to each team what they'd like to see on their list.)

Bhsd subscribed.

This seems to me only possible with CodeMirror enabled.

Can we support modifier + click on the [[wikilink]] syntax as well?

Can we support modifier + click on the [[wikilink]] syntax as well?

Of course! Please feel free to modify the task description.

Change #1104959 had a related patch set uploaded (by Bhsd; author: Bhsd):

[mediawiki/extensions/CodeMirror@master] openLinksExtension: open links by modifier-click

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

Change #1104959 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] openLinksExtension: open links by modifier-click

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

The merged implementation does not support VE yet.

Brilliant work as always! Thank you Bhsd :)

I have updated the extension page, and added a section on the help page.


A follow-up to this task: I think it would be best if the cursor: pointer is only shown when the Mod key is held. Right now it always has cursor: pointer yet it isn't clickable, and is selectable like normal text.

Change #1106051 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/CodeMirror@master] openLinksExtension: apply CSS only when Mod key is held

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

Change #1106051 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] openLinksExtension: style links on hover while Mod key is pressed

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