﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
13885	Make Image2 widget linking possible without a direct dependency of Link Plugin.	Olek Nowodziński	Olek Nowodziński	"A followup of https://www.drupal.org/node/2510380.

= Problem

At the moment, linking of Image2 widgets depends strictly on Link Plugin's `CKEDITOR.plugins.link.(parse|get)LinkAttributes`

* https://github.com/ckeditor/ckeditor-dev/blob/7856fe93f844be5053fa62cad1ece1ba6fc8635b/plugins/image2/plugin.js#L412-L421
* https://github.com/ckeditor/ckeditor-dev/blob/7856fe93f844be5053fa62cad1ece1ba6fc8635b/plugins/image2/plugin.js#L615
* https://github.com/ckeditor/ckeditor-dev/blob/7856fe93f844be5053fa62cad1ece1ba6fc8635b/plugins/image2/plugin.js#L1355-L1356

Because of this hard dependency, when the Link plugin is not loaded, there's no way to enable Image2 widget linking with an external link parser/serialiser (like `(parse|get)LinkAttributes`).

= Cake recipe

The idea is quite straightforward: let's provide the link parsing/serialisation API via static `CKEDITOR.plugins.image2` namespace, which [https://github.com/ckeditor/ckeditor-dev/blob/7856fe93f844be5053fa62cad1ece1ba6fc8635b/plugins/image2/plugin.js#L495 already exists].

A method like `CKEDITOR.plugins.image2.getLinkAPI()` could return `CKEDITOR.plugins.link` namespace. Or a custom object, if one decided to overwrite it:

{{{
CKEDITOR.plugins.image2.getLinkAPI = function() {
    return {
        getLinkAttributes: function () { custom implementation },
        parseLinkAttributes: function () { custom implementation }
    }
}
}}}

Profits:

1. Re–enable linking when Link plugin is not loaded.
2. Allow a custom parsers/serialisers, which could be much simpler than default `CKEDITOR.plugins.link.(parse|get)LinkAttributes` implementations."	Task	closed	Normal	CKEditor 4.5.5	UI : Widgets		fixed	Drupal	wim.leers@… nate@…
