HI,
I don't know if this is where I should post this. I am using og_panels and this is my first experience with using panels so I don't know if the interfaces for panels is the same. My assumption is it probably is. I have ckeditor install and when I would edit a panel the ckeditor would show up fine, I would make changes and none of it would get saved. If I then opened pane to edit it again it would not show the ckeditor. After wrestling with it for a while I found that the edit window didn't appear to be binding the finish button or any of the other buttons. When the window would close the instance of ckeditor wasn't getting cleared properly so when the editor was opened again there where remnants of the previous window left over so it couldn't initialize properly.
I did finally get it to work. I am not that experienced with the guts of modules and I found a hack that at least gets it going for me. I am hoping someone can tell me the proper way to fix this and hopefully it will help other people.
I modified panels_renderer_editor.class.php in the plugins/display_renderers folder
after the following code on line 771
$form_info = array(
'path' => $this->get_url('edit-pane', $pid, '%step'),
'show cancel' => TRUE,
'next callback' => 'panels_ajax_edit_pane_next',
'finish callback' => 'panels_ajax_edit_pane_finish',
'cancel callback' => 'panels_ajax_edit_pane_cancel',
);
$output = ctools_content_form('edit', $form_info, $form_state, $content_type, $pane->subtype, $subtype, $pane->configuration, $step);
I put this code in
$output.= "<script>
if (CKEDITOR.instances['edit-body'] != 'undefined') {
Drupal.ckeditorOff('edit-body');
}
$('input#edit-return').bind('mouseup', Drupal.ckeditorSubmitAjaxForm);
$('.close').bind('mouseup', Drupal.ckeditorSubmitAjaxForm);
CKEDITOR.on('dialogDefinition', function (ev) {
var dialogDefinition = ev.data.definition;
var _onShow = dialogDefinition.onShow;
dialogDefinition.onShow = function () {
if ( _onShow ) {
_onShow.apply( this );
}
$('body').unbind('keypress');
};
});
$('input#edit-cancel').click(function () { Drupal.ckeditorOff('edit-body');});
</script>";
Most of this is from ckeditor.utils.js in the ckeditor module.
Thanks
Comments
Comment #1
merlinofchaos commentedYou need to update to 3.8 -- there are still known problems with wysiwyg.module in 3.7. Plus, the ONLY wysiwyg support that I feel confident will work is via wysiwyg.module
Comment #2
merlinofchaos commentedAnd no,I won't be putting ckeditor specific code into Panels itself.
Comment #3
Letharion commented