a bit over a year ago, i hacked the fckeditor (v.2.5.1) to be used as dokuwiki's wysiwyg editor.
unfortunately, i had to hack directly into the core, because some things didn't seem possible else... this is why i am forced to stay at version 2.5.1.
this said, many many people use that editor these days, and there are just a few ever recurring requests from the users, which i am trying to fix those days.
i just hacked <th> and <td> support into it following the ideas in http://dev.fckeditor.net/attachment/ticket/822/822_2.patch, but there are two more things i'd love to be able to achieve:
(1) disable certain buttons and selects in the toolbar when editing a cell, such as <hr>, the table button itself, the format selection, and others, because the dokuwiki syntax does not allow such things
(2) have a button in the toolbar, which is enabled when editing a table cell, that would switch between <th> and <td>
before going back into the core and hack more dirty things, i'd like to find out, it there is some 'clean' way to achiefe these things...
thx in advance ...
as requested, some more info on point 2: right now, i can switch between a table header cell <th> or a regula table data cell <td> over the context menu: cell->cell properties ... this calls then some code from the patch 822 mentioned earier... now: i'd like to have an additional button in the toolbar, which is only enabled when the cursor is being in the context of a table cell ... it should toggle between <th> and <td> and change color accordingly ...
disable certain toolbar items when in a table
Re: disable certain actions when in a table
What follows is a related nugget of information but not exactly what you wanted to know. I write this because it just occured to me when reading your post and maybe it will ehlp you someway..
You can add a context menu item to call a function (typically a plugin execute function) that only is available when some condition is met (it is the 'context' menu afterall). Here is some code taken from http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Customization/Plug-ins/Context
Also it is possible to detect where the cursor is and it is possible to disable a button so I presume it is possible to disable a button depending on where the cursor is.
I think you could explain item 2 in your post a little better so that you could be more easily helped.
Re: disable certain toolbar items when in a table
let me rephrase what i want to do:
(1) disable certain core toolbar buttons (e.g. <hr>) when the cursor is in the context of a table cell
(2) write a toolbar button plugin which is only active when the cursor is in the context of a able cell
i hope this makes it a bit clearer ...