Re: how to customize buttons
Christian Stocker <[email protected]> Wed, 15 Dec 2004 08:33:10 +0100
| Newsgroups | gmane.editors.bitflux.general |
|---|---|
| Message-ID | <[email protected]> |
On 14.12.2004 23:56 Uhr, LiuCougar wrote:
> Thanks. However I only want to add another function to deal with my
> special needs, so that I do not have to change existing functions.
Ok, here we go
BXE has something like an eventsystem. The default events are defined in
js/bxeConfig in the bxeConfig.parseConfig method. You can override them
within your config.xml with eg:
<events>
<event name="Exit">my_own_exit_function</event>
</events>
This will override the built-in "Exit" event with your own function.
The event, you're most likely looking for is "OrderedList"
The best way to add your own JS functions, is to make a new .js file and
load that again with defining it in config.xml:
<scripts>
<!-- js files to include, you can add your owns here too -->
<file>my_own_js_file.js</file>
</scripts>
(or making a plugin out of it, but if it's just some functions, the
above approach is more than enough)
You can also override "built-in" BXE functions with that:
BuiltInBXEFunction = function (param1,param2) {
will override the "BuiltInBXEFunction" with your implementation.
(just make sure you're definition is loaded after our definition)
You can also define, what should happen if a button is clicked (if an
event should be called or a function, or just an element inserted). This
is explained in http://wiki.bitfluxeditor.org/ButtonDefinitions
Hope that helps
I opened up a new FAQ page on the wiki
http://wiki.bitfluxeditor.org/FAQ, I'll try to add some of those
questions asked here lately there (and others can of course add their
own ideas as well.)
chregu
>
> Anyway, looking forward to longer explanation.
>
> Regards,
> Cougar
>
>
> On Tue, 14 Dec 2004 23:17:24 +0100, Christian Stocker <[email protected]> wrote:
>
>>
>>On 14.12.2004 23:04 Uhr, LiuCougar wrote:
>>
>>>Hi,
>>>I want to change the behavior of some buttons: say the UnorderedList button:
>>>now when I click it, it will insert something like:
>>><a0:ul xmlns:a0="http://www.w3.org/1999/xhtml"><a0:li ...
>>>(http://scim-im.org/bxe/examples/inline/)
>>>
>>>I want it insert <ul><li>...
>>>How can I achieve this please?
>>
>>Short answer: In mozile/eDOMXHTML.js the listLinesToggle function. you
>>should especially change the call to "documentCreateXHTMLElement"
>>something like document.createElement()
>>
>>Long answer about buttons and changing them: hoepfully tomorrow
>>
>>chregu
>>
>>>Regards,
>>>
>>
>>--
>>christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
>>phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71
>>http://www.bitflux.ch | [email protected] | gnupg-keyid 0x5CE1DECB
>>
>
>
>
--
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71
http://www.bitflux.ch | [email protected] | gnupg-keyid 0x5CE1DECB
--
bx-editor-users mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-users