Announcement

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

#1 2008-05-06 10:10:56

Ugo
New member
Registered: 2008-04-15
Posts: 5

Creating buttons with a switch-like behaviour (like I and B)

Hello,
I created some buttons using the method described in the documentation. Example:

        config.registerButton({
            id       : "my-blockquote",
            tooltip  : "Blockquote",
            image    : _editor_url + "images/my-blockquote.gif",
            textMode : false,
            action   : function(editor) {
                            editor.surroundHTML('<blockquote>', '</blockquote>');
                        },
        });

In this way, if I understood well, the editor will immediately put opening and closing tags to both sides of cursor or selected text.
But I need to have a switch behaviour, like we have with italic, bold, underline buttons: when you press the button for the first time the editor writes the opening tag and the button is highlighted; then. when you press it for the second time, you get the closing tag.

Thanks in advance for your help!

Offline

Board footer

Powered by FluxBB