http://www.tinymce.com/tryit/jquery_plugin.php - here is a Tinymce package which allows to have access to Tinymce object through Jquery like this:

<a href="javascript:;" onmousedown="$('#textarea').tinymce().show();">[Show]</a>
<a href="javascript:;" onmousedown="$('#textarea').tinymce().hide();">[Hide]</a>

so besides adding tiny_mce.js (by default) I need to add jquery.tinymce.js file for Tinymce profile. I cannot do this because there is only one hook which allows to change something for existing profile (hook_wysiwyg_editor_settings_alter) but it is executed after gathering library files (calling drupal_add_js).
It should be hook which is executed before gathering library and where we can change profile settings.. something like this:

function hook_wisywig_pre_editor_alter(&$editor) {
   $editor['libraries']['']['files']['jquery.tinymce.js'] = array('preprocess' => FALSE);
}

Comments

radamiel’s picture

Issue summary: View changes

code tags added

radamiel’s picture

Issue summary: View changes

formatted breaklines

TwoD’s picture

If you want to use that plugin, you'd actually need to replace the tinymce.js and use jquery.tinymce.js instead, then include tinymce.js via the script_url setting sent when initializing TinyMCE.
Wysiwyg module's current TinyMCE integreation code is however not designed to completely replace the way in which TinyMCE is instantiated and we don't need the jQuery wrapper for anything.

You could however implement an alternate TinyMCE integration in another module using hook_wysiwyg_include_directory() and hook_INCLUDE_editor and replace any code you need to. See wysiwyg.api.php for the hook details. However, that would mean you'd need to use a internal/shortname other than 'tinymce' to avoid collisions with the existing integration. That also means any 3rd party module exposing native plugins for TinyMCE will need to be changed to return the same plugin meta data for your integration as they do for 'tinymce'.

If we add an alter hook like that, it would be even better if you would alter in a new library variant instead of changing the default ('') one and switched to that, since you could also add a 'js files' key there pointing to a replacement clientside integration file and Wysiwyg will automatically use that instead if that library variant was picked. (One hitch is that we don't actually have a way to pick the library variant to use yet.)

TwoD’s picture

Issue summary: View changes

change php part

TwoD’s picture

Issue summary: View changes
Priority: Major » Normal
Status: Active » Closed (duplicate)
Related issues: +#2415623: Add hook_editor_alter

Cleaning up the issue queue a bit, please follow this issue instead: #2415623: Add hook_editor_alter.
If we're going to support something like this, an alter hook it is.