jquery.textSelection: Add ability to register custom implementation
authorDerk-Jan Hartman <hartman.wiki@gmail.com>
Mon, 28 Jul 2014 20:28:29 +0000 (22:28 +0200)
committerTimo Tijhof <krinklemail@gmail.com>
Thu, 23 Oct 2014 02:58:09 +0000 (03:58 +0100)
commitf049e0b49be9b783051a7dc05e4ef88da8cfe406
treec2f1d86d9d6b9530db90b3fa2f609a9d7dd7cb61
parent28d45b2cdf8c5c329b789bf52878d73571b9e9d0
jquery.textSelection: Add ability to register custom implementation

At times we replace the textarea with a different implementation, for
instance in the former iframe code of WikiEditor and now in CodeEditor.

Obviously only one implementation of this API can be in control at a
time, but in order to disable/enable which one exactly is currently
determined by the existence of function in the core WikiEditor
context. This is a remnant of when this code was still in WikiEditor.

I added two commands, "register" and "unregister", that take an object
that has alternative function implementations for one or more commands.

Bug: 29328
Change-Id: I14492572f7eb9bbd1af68872dbfef5159126f107
resources/src/jquery/jquery.textSelection.js