You can execute/call/trigger any toolbar command you want from outside the FCKeditor.
This can be done through the FCKeditor API, see http://wiki.fckeditor.net/Developer%27s ... script_API
Then you need to use the GetCommand method of the Commands Object and execute your command. The different command can be found in the file 'editor/_source/internals/fckcommands.js' and for ease of use I have extracted them to list them here:
DocProps, Templates, Link, Unlink, Anchor, BulletedList, NumberedList, About, Find, Replace, Image, Flash, SpecialChar, Smiley, Table, TableProp, TableCellProp, UniversalKey, Style, FontName, FontSize, FontFormat, Source, Preview, Save, NewPage, PageBreak, TextColor, BGColor, PasteText, PasteWord, TableInsertRow, TableDeleteRows, TableInsertColumn, TableDeleteColumns, TableInsertCell, TableDeleteCells, TableMergeCells, TableSplitCell, TableDelete, Form, Checkbox, Radio, TextField, Textarea, HiddenField, Button, Select, ImageButton, SpellCheck, FitWindow, Undo, Redo
So for example to run a command onload of the editor, copy the code below and put it in the page that creates the editor. Replace 'FCKeditor1' by the instanceName you chose for you editor. Then pick your command and fill it in in the GetCommand method. When you now visit your webpage containing the FCKeditor, the command should be triggered as quick as the editorArea appears.
<script type="text/javascript">
function FCKeditor_OnComplete( editorInstance )
{
FCKeditorAPI.GetInstance('FCKeditor1').Commands.GetCommand('FitWindow').Execute();
}
</script>
Mon, 08/21/2006 - 13:56
#1
RE: HOWTO - trigger toolbar button externally
Could you explain how to do that?
Thanks!
Alex
RE: HOWTO - trigger toolbar button externally
see https://sourceforge.net/forum/forum.php ... _id=257180