Announcement

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

#1 2006-12-16 03:56:25

sinasalek
New member
From: Iran
Registered: 2006-09-17
Posts: 8
Website

filtering characters by handling onkeypress

I found the solution by reviewing core source code and it's HTMLArea._addEvents
here is a example :

hookXinhaEditorsSimple = function (xinhaEditors) {
    var editorId;
    var xinhaEditor;
    if (xinhaEditors) {
        for (editorId in xinhaEditors) {
            xinhaEditor=xinhaEditors[editorId];
            HTMLArea._addEvents(
                xinhaEditor._doc,
                ['keypress'],
                function (event) {
                    event=HTMLArea.is_ie ? xinhaEditor._iframe.contentWindow.event : event;
                    /*
                    below line is important because ie has a global event object for each
                    document and as long as htmlarea is inside iframe source element should 
                    indicate that iframe
                    */
                    convert(event.srcElement, event);
                    return xinhaEditor._editorEvent(event);
                }
            );
            document.getElementById(editorId).onkeypress=function (e) {};
        }
    }
}

hope you enjoy ;-)

Last edited by sinasalek (2006-12-16 05:25:42)


Sina.Salek.WS

Offline

Board footer

Powered by FluxBB