I'd like to enable autogrow plugin, and all I need to do is to write
FCKConfig.Plugins.Add( 'autogrow' ) ;
But using Drupal+Wysiwig adds some complexity to this task :)
I've tried to add such hook in my custom module:
function sitekit_wysiwyg_plugin($editor, $version=0) {
$plugins = array();
switch ($editor) {
case 'fckeditor':
if ($version > 2) {
$plugins['noneditable'] = array(
'path' => drupal_get_path('module', 'wysiwyg') .'/fckeditor/editor/plugins/autogrow/fckplugin.js',
'extensions' => array('autogrow' => t('Autogrow')),
'load' => TRUE,
);
}
break;
}
return $plugins;
}
I see the 'autogrow' checkbox on editor settings page, I enable it - and no success.
I've also tried to add FCKConfig.Plugins.Add( 'autogrow' ) to sites\all\modules\wysiwyg\editors\js\fckeditor.config.js which I believe must be loaded on every page where wysiwig is loaded - but this file is not loaded at all. (checked this by adding alert('test')
Can anyone give me an idea what's wrong with me and my code?
Comment | File | Size | Author |
---|---|---|---|
#9 | wysiwyg-HEAD.tinymce-plugin-settings.patch | 892 bytes | sun |
#7 | wysiwyg-HEAD.fckeditor-native-plugins.patch | 11.93 KB | sun |
#5 | wysiwyg_fckeditor_native_plugins.patch | 3 KB | TwoD |
#2 | wysiwyg_fckeditor_focus3.patch | 2.44 KB | TwoD |
Comments
Comment #1
sunAs of now, I don't think that we support native (internal) editor plugins for FCKeditor.
http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Customization/P... describes that the Add method searches in the internal plugins directory by default. So, to add support for native editor plugins, we probably only need to add them to the list of native plugins, but add some code to initialize/load them appropriately in JS.
Comment #2
TwoDI don't see what we have to lose by always including the config file if it seems necessary.
I made a patch for this which includes the above patch.
I've only made a quick test to see there were no errors just to see the logic still works if we've not explicitly enabled any buttons.
EDIT: This patch was meant for http://drupal.org/node/445826. I wonder how it ended up here? Thanks Sun for finding it anyway. =)
Comment #3
sunheheh... btw, I wonder whether we should tag all FCKeditor (related to Wysiwyg API) issues? :)
Comment #4
sunActually, I'm looking at http://drupal.org/project/user/sun?text=fckeditor&status[]=Open and wonder whether that would work out, too? :)
Sorry for derailing this issue.
Comment #5
TwoDThis patch should allow native plugins to be found by FCKeditor, as long as the proper hook_wysiwyg_plugin() function to define it is available.
I tested this using both the internal version of Autogrow present in FCKeditor default dir (set the 'internal' key to true), and a copy of the same plugin using the configuration below.
It's not 100% done as I'm still a bit unsure about the logic involved in deciding when a plugin should be loaded or not.
I have not tested this using a plugin working as a button rather than just an extension yet, but I think it should work.
Comment #6
sunI see now that wysiwyg_add_plugin_settings() is completely broken. Patch on the way.
Comment #7
sunSo here we go.
Completely revamped wysiwyg_add_plugin_settings(). Also tweaked native plugin loading for FCKeditor a bit on your last patch and added the plugins, which are shipped with FCKeditor.
From those default plugins, all seem to work, except the autogrow plugin. Looking at FCKeditor's configuration in Firebug reveals that the plugin is indeed loaded and the configuration setting is also present. However, the editor isn't auto-growing for me - for any reason.
Comment #8
sunThanks for reporting, reviewing, and testing! Committed to all branches.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.
Feel free to re-open this issue if you want to make the autogrow plugin work.
Comment #9
sunFor reference: Additionally committed attached patch for TinyMCE. The new processing didn't break TinyMCE's old logic, but this patch brings it more in-line with FCKeditor's plugin definition/processing.
So understanding the plugin properties should hopefully work faster in the future :)
Comment #11
plebe CreditAttribution: plebe commentedAutoGrow was not working for me for a long time, then I searched for an answer. I found a tiny bug in the plugin which keeps it from working. I believe it's the adding of "px" to the end of the height parameter.
On line 65:
window.frameElement.height = iMainFrameSize ;
Add this line
window.frameElement.style.height = (iMainFrameSize+25)+"px"; // fix for working autogrow
This seems to fix it.
How does one get custom plug-ins to work with WYSIWYG API and FCKEditor? I have some commercial plugins which work fine with the FCKEditor module, but not with WYSIWYG API module. Any ideas how to get these working?
J
Comment #12
TwoDYou need to write a small custom module which uses the plugin hook from Wysiwyg module to tell the editors there are one or more native editor plugins available. See comment #5, and some projects like Wysiwyg Spellcheck, IMCE Wysiwyg bridge and Wysiwyg Template and also the api documentation in wysiwyg/wysiwyg.api.php (latest dev snapshot should have updated docs).