This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-c07191f7-a45a-435b-8da1-8c7d0e9c7ddc XWIKI-24860 Open

Preselect the image resource reference as link target when creating a link from an image selection

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-4544e17b-0db8-4c18-a3ae-2b487f6c0ab3 Marius Dumitru Florea created this issue on 10/Sep/26 18:00
 
Summary: Preselect the image resource reference as link target when creating a link from an image selection
Issue Type: cid:jira-generated-image-avatar-c07191f7-a45a-435b-8da1-8c7d0e9c7ddc Improvement
Assignee: Unassigned
Components: CKEditor
Created: 10/Sep/26 18:00
Priority: cid:jira-generated-image-static-major-7e6a5a07-3495-4624-a030-84243f08917d Major
Reporter: Marius Dumitru Florea
Description:

Motivation

When you select an image in the WYSIWYG editor and open the link dialog to create a link, the link target is left empty, so you have to look the image up yourself in order to link to it. The most common intent in this case is to link the image to its own source, e.g. so that readers can open the full size image, so the link target can be preselected from the image that is selected.

Proposal

When the link dialog is opened to create a new link and the content selection is an image:

  • preselect the link target with the resource reference of the image source
  • select the resource type that matches that source: attach when the image is attached to a wiki page, url when the image is external

Notes

  • This is the counterpart, for an image selection, of the link target preselection done for a text selection in XWIKI-24834. An image selection has no text to compute a page name from, which is why the link target is currently left empty.
  • The implementation belongs in the CKEditor link plugin (xwiki-link/plugin.js), which is the layer that knows about the image widget and its resource reference. The shared resource picker code (xwiki-platform-wysiwyg-webjar) is editor agnostic, so it shouldn't be coupled to a CKEditor selection.