Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2010-10-11 07:13:40

LeMacabre
New member
Registered: 2010-10-06
Posts: 8

Make own Dialog Plugin

Hi
Me again.
I created successfully a plugin in a popup window. But my target is to create one in a dialog (? right name?).
So I found a plugin which it using the dialog mode, too: Insert Special Chars.

I tried to copy the plugin and edit the plugin name from "CharacterMap" to "TestPlugin" and so on I changed the prototypnames.
But I find no second Icon in the menu. There is only the one which opens the original "CharacterMap".

My questions:
What do I have to do to create a plugin which opens in a dialog?

This Tutorial teaches you only how to create a plugin in popup-mode:
http://xinha.webfactional.com/wiki/PluginTutorial

Thx in ahead for your answers smile

Edit:

So ... now its possible to use the plugin. i edited the line with addtoolbarelement. ... but there is a big question ... how can I  load the popupwindow into the container?
Is there somewhere a good tutorial about this?


Or is there a good tutorial?

Last edited by LeMacabre (2010-10-11 07:52:47)

Offline

#2 2010-10-12 19:01:49

gogo
Xinha Leader
From: New Zealand
Registered: 2005-02-11
Posts: 1,015
Website

Re: Make own Dialog Plugin

CharacterMap is a very good and simple example, look at the prepareDialog method, and the addEntity method, you can't get much more simple.

You supply the HTML of your dialog to the dialog:

    this.dialog = new Xinha.Dialog(editor, html, 'CharacterMap',{width:300},{modal:false});

How you create that html, is up to you, if you have it in an external file you might do like

Xinha._getback( Xinha.getPluginDir("YourPlugin") + '/dialog.html', function(html) { /* do something with html here */ } );

(See Linker for an example).


James Sleeman

Offline

#3 2010-10-13 05:52:28

LeMacabre
New member
Registered: 2010-10-06
Posts: 8

Re: Make own Dialog Plugin

ah this should help smile
it was possible to open an Dialog but only with the code inside the function. there was no external file which was loaded.
I will try the code and make a response ;D

Offline

Board footer

Powered by FluxBB