Domanda

I tried to create a plugin for CKEditor 4.4

The main idea was to have a button in the toolbar, when you click on it, there will be a dialog window with its content loaded from another site.

I thought the Dialog.addIframe() function would help and put it into my plugin.js like this:

CKEDITOR.plugins.add( 'insertVariable', {
  icons: 'insertvariable',
  init: function( editor ) {
    for(e in CKEDITOR.dialog){
      alert(e + "   " + editor[e]);
    }
    alert(CKEDITOR.dialog.addIframe());
    editor.addCommand( 'varDialog', new CKEDITOR.dialogCommand( 'varDialog' ) );

    CKEDITOR.dialog.addIframe('varDialog','varDialog','http://www.cksource.com/',500,400);

    editor.ui.addButton( 'insertVariable', {
      label: 'Insert Variable',
      command: 'varDialog',
      icon: this.path + 'icons/InsertVariable.gif'
    });

  }
});

When I run the code, I get the following error in the console:

addiframe is not a function

I am using the latest version of CKEditor (4.4 Full Version) and have the Iframe plugin running. All other plugins work just fine, only this one with an Iframe is causing problems.

È stato utile?

Soluzione

Problem solved: there was another plugin i had to install: iframe Dialog plugin. This one was nowhere mentioned. With this plugin all my dialogs shown up as they should

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top