Every time user visits some edit page, my gadget adds some special buttons (for source editor under edit field; for VE over edit field). But if user switches between VE and source editor, my special buttons are gone. What I want to achieve: If user switches 50 times between editors, I want 50 times to load these special buttons. Therefore I ask for adding some hook, that is thrown every time if user switches between editors.
Other possible solutions:
- ?veswitched=1 in url + url parse: well, this is thrown if user switches once, but doesn't change if user switches twice or more -> doesn't work
- jQuery + jQuery.initialize external library + check if there is VE or SE top bar loaded: well, this works, but it is too complicated, without IE 10 or lower support, loads external libraries
Better solution:
Fire something like mw.hook( 'editor.switched' ) right from code, that makes the switch!