Opened 6 years ago

Last modified 6 years ago

#10005 confirmed New Feature

Offer a simpler way to enable external plugins

Reported by: Wiktor Walc Owned by:
Priority: Low Milestone:
Component: General Version: 4.0
Keywords: Drupal Cc:

Description

Currently enabling external plugins is a two step process. First one have to call CKEDITOR.plugins.addExternal(), then add the plugin to config.extraPlugins.

It would be cool if there was an easier way to do this, without searching in the documentation how to point CKEditor to a plugin in a different folder.

The current string sytax could be preserved, plus we could allow users to specify an object with plugin => url:

config.extraPlugins = {
  plugin1 : url1,
  plugin2 : url2
}

If one wants to mix external and non-external plugins, something like this could do the trick:

config.extraPlugins = {
  plugin1 : url1,
  plugin2 : url2,
  plugin3 : '', // equals config.extraPlugins = 'plugin3'
}

Change History (4)

comment:1 Changed 6 years ago by Jakub Ś

Status: newconfirmed

comment:2 Changed 6 years ago by Alfonso Martínez de Lizarrondo

The way that most people expect it to work (at least those that discover addExternal) is just a single call to

CKEDITOR.plugins.addExternal("plugin url")

changing the syntax of extraPlugins from a string to an object (IMHO) seems more complex.

comment:3 Changed 6 years ago by Alfonso Martínez de Lizarrondo

After sleeping:

I guess that you really meant that most of the people doesn't know at all about

CKEDITOR.plugins.addExternal

and you're right. In that case my suggestion would be to allow a full url in extraPlugins and mark addExternal as deprecated pointing new users to the new syntax:

extraPlugins = "plugin1,http://server.com/path2,/path3"

comment:4 Changed 6 years ago by Wiktor Walc

Yep, exactly. The previous solution:

CKEDITOR.plugins.addExternal("plugin url")

would not work well in a situation when an external plugin should be enabled in only one instance among many on the same page.

extraPlugins = "plugin1,http://server.com/path2,/path3"

This on the other side looks interesting, if a part of extraPlugins contains / let's treat it like a URL to a plugin.

After all resoucemanager could be adopted to work even if the plugin name is not specified, using simply the URL as the key to prevent against loading the same URL more than once. It will not work properly if the plugin is already included in ckeditor.js and then specified again in extraPlugins but it's an user error anyway so I think we can live with it.

Also the URL could not contain commas (happens, unfortunately).

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy