Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

The keyboard shortcut handler component uses the Javascript library Mousetrap (https://github.com/ccampbell/mousetrap).

Installation:

To use the keyboard shortcuts handling, the following JavaScript resources must be included in the header of the used HTML template where all the other JavaScript libraries are defined (e.g. templates/Root.html):

mousetrap.min.js

Third-party library which provide the functionality for the shortcuts handling.

shortcuts.js

Library which binds the shortcuts functionality to the JAXFront Visualizer components.

Codeblock
themeEclipse
languagehtml/xml
titleshortcuts section:
<script language="JavaScript" src="js/jquery/plugins/mousetrap.min.js" type="text/javascript"></script>
<script language="JavaScript" src="js/jquery/plugins/shortcuts.js" type="text/javascript"></script>

Configuration

If the configuration is loaded properly, the registered shortcuts will be visible on the tooltip informations of the concerned actions (if a link is provided within the visualizer component)

The following configurations are possible:

Configuration general

To enable the keyboard shortcuts handling, the shortcuts must be registered in the main HTML template with the function:

Codeblock
themeEclipse
languagejavascript
titlegeneral configuration
initShortcuts(shortcutHolderClass, bindingConf);

shortcutHolderClass (String)

String which holds the class defining the starting point of an element for searching the shortcuts actions. (e.g. for lists the class is jax-list-general)

bindingConf (String)

For the mapping of the shortcut keys, each shortcut can be paired with an html element id which holds the action called by the fired shortcut.

Codeblock
themeEclipse
languagejavascript
titlebindingConf example
{"newLI":"alt+n", "cpLI":"alt+k", "delLI":"alt+r"}

Configuration for list related shortcuts

To enable the keyboard shortcuts handling for a list component the shortcuts could be registered with a list related constructor, which must be registered in the main HTML template:

Codeblock
themeEclipse
languagejavascript
titlelist related configuration
registerListShortcuts(simplifiedConf, searchGlobal); 

simplifiedConf (String)

JSON-String for mapping each list function to a corresponding key. ("function" : "key kombination")

Codeblock
themeEclipse
languagejavascript
titlebindingConf example
{"new":"alt+n", "copy":"alt+k", "delete":"alt+r", "moveUp":"alt+u", "moveDown":"alt+i"}

Available id's are:

iddescription
newAdd a new list entry
copyCopy the selected list entry
deleteDelete the selected list entry
moveUpMove the selected list entry up
moveDownMove the selected list entry down

searchGlobal (boolean)

Boolean parameter which indicates if the focus is not within a list, the first list in the view should be applied if available instead.