Every time user visits any 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, when 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
# jQuery + [[ https://github.com/adampietrasiak/jquery.initialize | 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
Fire `mw.hook( 'editor.switched' )` right from code, that makes the switch!