Item11367: Add Javascript callbacks to get notified after editor changes to/from Raw or WYSIWYG mode.
| Priority: |
CurrentState: |
AppliesTo: |
Component: |
WaitingFor: |
| Enhancement |
Closed |
Extension |
TinyMCEPlugin |
|
Current callback functions, stored in arrays
tml2html and
html2tml, are called before a text change.
If you want to update the editor state (specifically: to update the textarea height), you need a callback
after the text has been changed.
Proposal: Add
transformCbs Array to
FoswikiTiny:
tml2html: new Array(),
// callbacks, attached in plugins
html2tml: new Array(),
// callbacks, attached in plugins
transformCbs: new Array(),
// callbacks, attached in plugins
In the 2 transform "success" functions (both
switchToRaw and
switchToWYSIWYG), do:
// Call post-transform callbacks attached from plugins
for (var i = 0; i < FoswikiTiny.transformCbs.length; i++) {
var cb = FoswikiTiny.transformCbs[i];
cb.apply(editor, [editor, text]);
}
--
ArthurClemens - 18 Dec 2011
Needs to be merged with release branch.
--
ArthurClemens - 18 Dec 2011
Picked up on sync from trunk to 1.1.5
--
GeorgeClark - 23 Mar 2012
Change summary:
Before it has been possible to pass javascript callback functions to get notified on text changes.
In some situations it is useful to get notified when the editor state is changed, for instance from WYSIWYG to Wiki text. This enhancement allows to pass editor state change callbacks in
transformCbs.
--
ArthurClemens - 23 Mar 2012