latin-language-toolkit/llt-annotation_environment — pull request #72 by LFDM (2014-05-21 10:59:53+00:00)
Title: Plugin context menus

Finally closes #38

- _Adds a general purpose context menu directive, that is meant to be used as an attribute_
Example:
```html

```

The directive also awaits a `menu-id` attribute that contains... well, the id of the context menu.
The menu will be properly positioned and can be triggered by a right-click. Can also be closed through hitting `ESC`.

-------------------------

- _Arethusa specific context menu handling_

This directive builds the context menu with the contents of plugins that decide to expose such information.
Plugins need to be configured to make this work: They now take a `contextMenu` as well as a `contextMenuTemplate` property. This change is already reflected in the `ConfEditor`.

The `arethusa-context-menu` directive awaits an array of plugins that expose context menus, the `MainCtrl` holds such information in `pluginsWithMenu`.
Also awaits a `token-id` attribute to know with token is the target of such a menu.

```html

```

This directive itself goes on and renders the `plugin-context-menu` directive for each plugin. This directive is very similar to the `plugin` directive and opens up a new scope for the plugin, which accesses this scope through it `contextMenuTemplate`.

```html

```

Scope variables exposed are `plugin` - the plugin object, `state` - the main state object, and `token` - the token the context menu is placed on.

Currently there has been no effort made to style the context menus (apparent from using a proper background color and the correct z-index), this will be done later.

All functionality is there though - it's only a matter of html scripting now.