Some of the jWYSIWYG major features are available as "addon" plugins/controls.
How can i integrate these features using the Wysiwyg module?

Say, in a "standard" use, i would add these plugins with a script tag. For example:

<script [..] src="/jwysiwyg/jquery.wysiwyg.js"></script>
<script [..] src="/jwysiwyg/plugins/wysiwyg.i18n.js"></script>
<script [..] src="/jwysiwyg/plugins/wysiwyg.fileManager.js"></script>
<script [..] src="/jwysiwyg/plugins/wysiwyg.image.js"></script>

I would like to integrate them, preferably in a manner which ables the user to select which features we wants and which he doesn't, using a GUI.

Can anyone help me with that?
Thanks,
Yotam.

Comments

twod’s picture

Status: Active » Fixed

We do not currently support native plugins for jWYSIWYG so this currently not possible without manually inserting the scripts.

I did wrote some patches to make cross-editor "Drupal plugins" work but I didn't put any focus on plugins written specifically for jWYSIWYG. See #483452: jWYSIWYG: Support for Drupal plugins and stylesheets. Native plugin support could probably be added in that issue as well. Progress stalled a bit when jWYSIWYG moved to a new site and release structure, see #923460: jwysiwyg: New website and release package structure.

Once our implementation/integration layer supports native plugins all you'd need to do for 3rd party plugins to show up in a buttons/plugins list is to implement hook_wysiwyg_plugin() (documented in wysiwyg.api.php). There you can provide some basic meta-data about the plugin and any buttons they provide so Wysiwyg can add them to the profile configuration.

I'm marking this support request "fixed" in hope that this answers your question and ask you to follow up in the previously mentioned issues. :)

sun’s picture

Status: Fixed » Active

Based on what I see in the example snippet in the OP, an important difference seems to be that jWYSIWYG doesn't implement a script-loader for plugins itself like the other libraries do.

Other libraries basically just pass on plugins to load - either native or external ones: (pseudo-code)

var config = {
  'basePath': '/sites/all/libraries/mylibrary',
  'plugins': ['foo', 'bar'],
  'externalPlugins': {
    'fooExt': 'fooExt', // uses pre-configured/built-in "plugins" path, possibly residing within the library
    'barExt': '/sites/all/modules/blah/blah.js',
  },
};
myLibrary.init(config);

While Wysiwyg's API allows editors to load additionally files, it doesn't allow individual plugins to load custom files when being enabled in the UI.

Yotamb’s picture

Is it possible to add an interface that will enable the selection of additional features?
For example, the i18n plugin cannot be loaded without complying with the locale required.
We need to both enable "on/off" option, and in addition to enable the selection of which locale is required (EN, RU, HE, etc).

Is this possible?

AND -
How can we send pull requests for this module?
Just create a Git diff file and upload it here? Send it to a developer?
Oh, and what branch should i work on?
I've read the "Git Instructions" but i just want to be sure :)

Yotam.