Posts: 4
Threads: 2
Joined: Oct 2015
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/symbols/CKEDITOR.config.html#.enableTabKeyTools
but no changes take effect.
maybe someone could help how to realize?
thank you in advance!
best regards
Posts: 6,267
Threads: 182
Joined: Sep 2011
Are you using the ckepatch plugin or branch? You should
Posts: 4
Threads: 2
Joined: Oct 2015
Posts: 6,267
Threads: 182
Joined: Sep 2011
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.
Posts: 6,267
Threads: 182
Joined: Sep 2011
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
Posts: 6,267
Threads: 182
Joined: Sep 2011
ok so it works, shift tab works fine, but tab inserts tab, so something is broken with this plugin.
Posts: 6,267
Threads: 182
Joined: Sep 2011
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
Posts: 6,267
Threads: 182
Joined: Sep 2011
I think this is fixed in the latest CKE actually
Ill try to update the cke_patch branch
Posts: 6,267
Threads: 182
Joined: Sep 2011
and it still doesnt work, wtf
Posts: 6,267
Threads: 182
Joined: Sep 2011
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
Posts: 6,267
Threads: 182
Joined: Sep 2011
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.
Posts: 6,267
Threads: 182
Joined: Sep 2011
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();
}
} );
}
Posts: 6,267
Threads: 182
Joined: Sep 2011
https://dev.ckeditor.com/ticket/13876#ticket