Webclient: HTML based topic rendering pt.1 (#505).

Begin of a new concept: Topics are rendered as HTML, instead of being drawn on the canvas. Thus drawing, event handling, object click detection relies on the native browser capabilities. This simplifies the development of DeepaMehta View Customizers tremendously.

This is in experimental stage. There is a new branch "topic-html". Not fully usable.

Works in conjunction with the Box Renderer "topic-html" branch.

See #505.
Webclient: HTML based topic rendering pt.2 (#505).

- Canvas-drawn topics are actually replaced by HTML topics
- Translating the canvas works

Not yet fully usable.

BREAKING CHANGES

1) The Webclient's DOM hierarchy (left panel) is changed:

{{{
div#topicmap-panel          // topicmap container, stays in document all the time, former ID was "canvas-panel"
    div.topicmap-renderer   // renderer-specific container, replaced when switching renderer, class is set by framework
        canvas#canvas       // in case CanvasRenderer is active: the <canvas> element
}}}

Before:
{{{
div#canvas-panel            // topicmap container, stays in document all the time, new ID is "topicmap-panel"
    canvas#canvas           // in case CanvasRenderer is active: the <canvas> element
}}}

2) The topicmap renderer developer is not responsible anymore to equip the renderers DOM element with the ID "canvas".

See #505.
Webclient: HTML based topic rendering pt.3 (#505).

In conjunction with the Box Renderer the new HTML-based rendering approaches the original (canvas drawn) state:
    - switching topicmaps work
    - topics can't exceed the topicmap panel space
    - long labels are wrapped

New hook in View Customizer Framework:
{{{
topic_dom_appendix(topic_view, topic_dom)
}}}
Invoked once the topic's DOM (as provided by the `topic_dom` hook) is added to the document. At this time the topic DOM is positioned and have a size. The customizer can use this information e.g. to add further geometry-dependent elements to the topic DOM.

BREAKING CHANGES

Webclient convenience method renamed:
{{{
dm4c.get_icon_src() -> dm4c.get_type_icon_src()
}}}

See #505.
Merge branch 'master' into topic-html
Webclient: HTML based topic rendering pt.4 (#505).

Updating topics work.

The topic DOM is hold in the TopicView objects ("dom" property).
This allows for direct access of the topic DOM. No DOM traversal is required. No topic IDs are stored in the DOM.

See #505.
Webclient: HTML based topic rendering pt.5 (#505).

- Hiding and deleting topics works.
- Creating associations works (both, via content menu and via mini icon).

View Customizer Framework:

1. Another hook for HTML-based topic rendering:
{{{
topic_dom_draggable_handle(topic_dom, handles)
}}}
By using this hook a View Customizer can control which part of the topic DOM can initiate dragging, e.g. the Box Renderer excludes the topic's mini icon from being draggable as it serves for creating associations. By default the entire topic DOM can initiate dragging.

2. The canvas view facade (passed to a view customizer constructor) has another property:
{{{
pos -- a function that takes an "event" argument
}}}
View Customizers can call this function to convert a mouse event into a canvas coordinate. This works also if the event occurred in any element of the HTML topic overlay.

BREAKING CHANGES

Changed signature of one Webclient controller method:
{{{
dm4c.do_create_association(type_uri, topic_id_1, topic_id_2)
}}}
Now it takes 2 topic IDs (instead of a single topic) and can connect arbitrary topics (instead of only the selected one).

See #505.
HTML based topic rendering BREAKTHROUGH (#505).

HTML based topic rendering has reached a crucial state. It can now friendly coexist with Canvas based topic rendering. A DM View Customizer can be HTML-based, or Canvas-based, or hybrid. Various View Customizers (possibly provided by different DM plugins) can be active at the same time and perform together.

Note: also with HTML based topic rendering a Canvas is always involved, mainly for drawing the associations.

For the moment a DM View Customizer provides 7 hooks (all are optional):

General:
    - update_topic() -- sync the view once the model has changed (topic content change or retype)
    - move_topic() -- sync the view once the model has changed (topic position change)
Canvas based:
    - draw_topic() -- draw a topic on the canvas
    - on_mousedown() -- intercept mouse events on the canvas
HTML based:
    - topic_dom() -- provide the topic's basic DOM
    - topic_dom_appendix() -- modify the topic DOM once it is added to the document
    - topic_dom_draggable_handle() -- configure which part of the topic DOM initiates dragging

To demonstrate HTML based topic rendering the demo Box Renderer plugin is now divided into 2 plugins:
    https://github.com/jri/dm4-box-renderer-canvas
    https://github.com/jri/dm4-box-renderer-html

So the known dm4-box-renderer (which is now defunct) is actually renamed to dm4-box-renderer-canvas. The new dm4-box-renderer-html provides the very same look & feel but renders topics as HTML. So you can e.g. inspect the topic DOM in the Web Console as usual.

HTML based topic rendering has several advantages. Because drawing, event handling and object click detection is performed natively by the browser, implementing a HTML based DM View Customizer is much more comfortable due to the power of the DOM. Furthermore the topic style is customizable via CSS. In contrast on a Canvas there are no objects, just pixels. It means laborious work for the View Customizer developer to emulate clickable and movable objects on a Canvas.

The heart of the Canvas based Box Renderer consist of 100 lines of code (mostly boring geometry calculations). The HTML version consist of 50 lines of code (mostly handy jQuery DOM manipulations).

You have 3 choices:
- Do not install a Box Renderer and get the "classic" DM look & feel (which should be as stable as before).
- Install the Canvas Box Renderer to get Torsten's "modern" look & feel (should be stable as well).
- Install the HTML Box Renderer to get (nearly) the very same modern look & feel (there are still minor issues).
You can even install both Box Renderers together to get a mixed experience. This is not very useful in this case, just to demonstrate the flexibility.

Testing all 3 scenarios is very appreciated.

We are ready for merging into master now.

See #505.