Announcement

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

#1 2007-04-05 10:51:08

tissatussa
New member
From: Holland
Registered: 2007-04-05
Posts: 4

InsertWords plugin : position selectboxes in toolbar ?

Hi all,

I use the InsertWords plugin, and I have two selectboxes (combo's), so two arrays. I can place them at any position on the toolbar, but it seems they are always placed NEXT to each other. Is it possible? How?

I have pretty much experience with javascript, and I can hack the js files, but the OOP methods you guys are using is to much for me, sometimes ...

Here is some explanation and code I found in the XinhaCore.js but I don't understand it fully and after some experiments I still can not make it work.


===========================================
// this is about : Xinha.Config.prototype.addToolbarElement = function(id, where, position)

/** Helper Function: add buttons/drop-downs boxes with title or separator to the toolbar
* if the buttons/drop-downs boxes doesn't already exists.
* id: button or selectbox (as array with separator or title)
* where: button or selectbox (as array if the first is not found take the second and so on)
* position:
* -1 = insert button (id) one position before the button (where)
* 0 = replace button (where) by button (id)
* +1 = insert button (id) one position after button (where)
*
* cfg.addToolbarElement(["T[title]", "button_id", "separator"] , ["first_id","second_id"], -1);
===========================================

I customized the toolbar in XinhaCore.js, and in the insert-words.js file I put something like ..,"XNAME",.. (instead of ..,"seperator",.. or other) and it WORKS when I do like ..

cfg.addToolbarElement(toolbar,"XNAME",0)

.. : the "button" (?) called "XNAME" is replaced (0) by the InsertWords selectboxES.
I can insert a linebreak in the toolbar (yes, I did "this.flowToolbars = false" in XinhaCore.js to be able to do this), but my two selectboxes are always placed NEXT to each other.
BTW. is my XNAME called an "id" in the definition? What is meant by "first_id","second_id" ?

Maybe I can use the addToolbarElement function to get each InsertWords selectbox at a proper position in the toolbar, but how ... Even better : it looks like I can create a "button" instead of a selectbox to Insert Words, but I can not figure out how to do this also ...

Roelof


simple is not always best, but best is always simple

Offline

Board footer

Powered by FluxBB