GetSimple Support Forum

Full Version: TAB-Key in ckeditor (move to next cell)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,

i'm using v3.3.7 and it works great.

i use the html editor for editing tables.
when using the tab key in a cell the cursor should move to the next cell.

i did some config settings in admin/template/js/ckeditor/ckeditor.js found on
http://docs.cksource.com/ckeditor_api/sy...abKeyTools

but no changes take effect.

maybe someone could help how to realize?

thank you in advance!

best regards
Are you using the ckepatch plugin or branch? You should
same again..............
EDIT: this is bugged when using tabspaces greater than 0, I will update, its fixed in latest cke

why not just use the right arrow key ?
maybe install
http://ckeditor.com/addon/tab

The tab plugin is NOT included in the FULL install of ckeditor which is odd.

Maybe we should add it.

hmm must be cke bug, cause it is in our config, but I do not see the assets for it.
ckeditor.js contains ( this is compressed )

Code:
CKEDITOR.plugins.add("tab", {
            init: function(c) {
                for (var d = !1 !== c.config.enableTabKeyTools, e = c.config.tabSpaces || 0, b = ""; e--;) b += " ";
                if (b) c.on("key", function(a) {
                    9 == a.data.keyCode && (c.insertHtml(b), a.cancel())
                });
                if (d) c.on("key", function(a) {
                    (9 == a.data.keyCode && c.execCommand("selectNextCell") || a.data.keyCode == CKEDITOR.SHIFT + 9 && c.execCommand("selectPreviousCell")) && a.cancel()
                });
                c.addCommand("blur",
                    CKEDITOR.tools.extend(g, h));
                c.addCommand("blurBack", CKEDITOR.tools.extend(f, h));
                c.addCommand("selectNextCell", i());
                c.addCommand("selectPreviousCell", i(!0))
            }
        })

But i do not see the source file for tab.js but maybe since we are using minified compressed and its broken
ok so it works, shift tab works fine, but tab inserts tab, so something is broken with this plugin.
This plugin is not compatible with tabspaces

you need to also override this with 0, seems to work for me. ( our config uses tabspaces = 10 )

config.tabSpaces = 0;

enableTabKeyTools defaults to true so that is not actually needed
I think this is fixed in the latest CKE actually

Ill try to update the cke_patch branch
and it still doesnt work, wtf
yeah its bugged, damn ckeditor I swear.

we have tabSpaces hardcoded in edit.php, so a workaround is impossible without modifying it yourself.

Ill try to bugfix this bullshit to ckeditor
So yeah this plugin sucks, it does not support both
tabSpaces AND keyTabTools at the same time

If tabSpaces is set to anything but 0, the table code is simply ignored.
I think it would be better to modify it so that it checks if its inside a table and skips the tab to nbsp code.
Actually it works if you just swap the functions around, ugh.

This block needs to be reversed.

Code:
            if ( tabTools ) {
                editor.on( 'key', function( ev ) {
                    if ( ev.data.keyCode == 9 && editor.execCommand( 'selectNextCell' ) || // TAB
                    ev.data.keyCode == ( CKEDITOR.SHIFT + 9 ) && editor.execCommand( 'selectPreviousCell' ) ) // SHIFT+TAB
                    ev.cancel();
                } );
            }
            if ( tabText ) {
                editor.on( 'key', function( ev ) {
                    // TAB.
                    if ( ev.data.keyCode == 9 ) {
                        editor.insertText( tabText );
                        ev.cancel();
                    }
                } );
            }