Drupal 6
ckeditor 3.6.4

I have a form element that is returned dynamically via ajax request. I am able to place a ckeditor on it using replace:

CKEDITOR.replace( 'textarea-id');

The problem is that this loads the full toolbar.
I am able to customize the toolbar and plugins programmatically, but this isnt ideal either.

  CKEDITOR.replace( 'agenda-text',
        { toolbar: [ [ 'blah']]}

Ideally, I would like to the simplified toolbar as defined in the ckeditor admin pages. How do I access this information? Suggestions are welcome, thank you!

CommentFileSizeAuthor
#2 full-page-load.png121.69 KBjriggs
#2 ajax.png100.73 KBjriggs
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jriggs’s picture

Issue summary: View changes

clarifying post

dczepierga’s picture

Status: Active » Postponed (maintainer needs more info)

Do u see any CKEditor setting in the source of the page?
Do u have any editors on the page (loaded without ajax)?

Greetings

jriggs’s picture

Status: Postponed (maintainer needs more info) » Active
FileSize
100.73 KB
121.69 KB

Hi, I am using the javascript function CKEDITOR.replace as part of the ajax callback that loads the ckeditor. If I dont call it, then there are not any ckeditors on the page, just a text area.

The problem is (I think) that when I call the CKEDITOR.replace function the settings information is not populated as well. I am posting a couple screenshots that will hopefully show what info I have to work with

'full-page-load.png' shows a normal pages' ckeditor settings fully populated
'ajax.png' shows the same settings if loaded via javascript.

Please let me know any other information that I can provide.

My current solution is to make a database call to retrieve settings data

dczepierga’s picture

Status: Active » Postponed (maintainer needs more info)

@jriggs, do u try to do sth like this:

        $.ajax({
          url: path + 'admin/ckeditor/get_settings',
          dataType: 'json',
          data: {'id': imagefield_id, 'url': url, 'token': Drupal.settings.ckeditor.ajaxToken},
          type: 'POST',
          success: function( data ) {
            Drupal.settings.ckeditor.settings[imagefield_id] = data;
            if ($(data).length > 0) {
              Drupal.settings.ckeditor.autostart[imagefield_id] = true;
              Drupal.ckeditorOn(imagefield_id);
            }
          }
        });

I copy this from source of CKEditor module... it possible to get CKEditor settings by AJAX call and then enable it with this settings. It was designed to imagefield ajax calls with editors, but u can also use it...
May be this help you? :)

Greetings
Greetings

jriggs’s picture

Thanks for your help dczepierga, I used a similar approach

Load Configuration Settings On Dynamic Page

jriggs’s picture

Issue summary: View changes

tpyos