Opened 10 years ago

Last modified 8 years ago

#10954 confirmed New Feature

Add external anchors to link dialog

Reported by: Joel Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

It would be great to be able to add a list of anchors from an external source to the editor. For example the content being edited might exist as a part of a page with tons of anchors, which all should be linkable to within CKEditor, but CKEditor doesn't know of the existance of those anchors so they are not listed in the link dialog.

Something like this for example:

config.extraAnchors = [{id: "Top", name: "Top"}, {name:"Ponies"}];

Additionally, it would be great if that list could be edited when ckeditor is already loaded with config.extraAnchors[2] = {name:"Foo"};.

Change History (2)

comment:1 Changed 10 years ago by Joel

This seems like such a simple thing to add as well as far as I can see. In plugins/link/dialogs/link.js around line 209 or such something like this might just something like:

var extra = editor.config.extraAnchors;
if(typeof extra !== 'undefined') {
    for (i = 0, count = extra.length; i < count; i++) {
        anchors[i] = {name: extra[i].name, id: extra[i].id};
    }
}

comment:2 Changed 8 years ago by Jakub Ś

Status: newconfirmed

Providing a list of external anchors seems like an interesting idea IMO.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy