Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-24860

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

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 18.7.0
    • CKEditor
    • None
    • Unknown

    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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mflorea Marius Dumitru Florea
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: