![](/img/trans.png)
[英]How to programmatically execute undo and redo in CKEDITOR, and reset their stacks?
[英]How to use undo/redo in CKEditor without toolbar?
我正在使用沒有默認工具欄的CKEditor 4.2.2 ,因為我想使用自己的工具欄。
CKEditor具有UndoManager ,它具有我需要的4個功能: undo()
, redo()
undoable()
, redoable()
, redoable()
。
在我的html中,我有:
<textarea id='doc'>
在javascript中:
$('#' + textareaId).ckeditor();
m_Editor = CKEDITOR.instances[textareaId];
我嘗試使用:
m_Editor.undo
undefined
m_Editor.plugins.undo
這是控制台中當前textarea的CKEditor實例:
CKEditor注冊可以用CKEDITOR.editor.execCommand
執行的命令 。 我認為m_Editor.execCommand( 'undo' )
應該可以解決這個問題。
獎勵:檢查m_Editor.commands
以了解m_Editor.commands
命令。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.