Foswiki on GitHub is open for business! Next release meeting: Monday September 29, 1300Z

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
 

ItemTemplate edit

Summary Add Javascript callbacks to get notified after editor changes to/from Raw or WYSIWYG mode.
ReportedBy ArthurClemens
Codebase 1.1.4, trunk
SVN Range
AppliesTo Extension
Component TinyMCEPlugin
Priority Enhancement
CurrentState Closed
WaitingFor
Checkins Foswikirev:13457
TargetRelease patch
ReleasedIn 1.1.5
CheckinsOnBranches trunk
trunkCheckins Foswikirev:13457
Release01x01Checkins
Topic revision: r8 - 11 Apr 2012, GeorgeClark
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License