mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
82 lines
3.1 KiB
HTML
82 lines
3.1 KiB
HTML
<!DOCTYPE html
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<title>jsTree v.1.0 - hotkeys documentation</title>
|
|
<script type="text/javascript" src="../_lib/jquery.js"></script>
|
|
<script type="text/javascript" src="../_lib/jquery.cookie.js"></script>
|
|
<script type="text/javascript" src="../_lib/jquery.hotkeys.js"></script>
|
|
<script type="text/javascript" src="../jquery.jstree.js"></script>
|
|
|
|
<link type="text/css" rel="stylesheet" href="syntax/!style.css"/>
|
|
<link type="text/css" rel="stylesheet" href="!style.css"/>
|
|
<script type="text/javascript" src="syntax/!script.js"></script>
|
|
</head>
|
|
<body>
|
|
<div id="container">
|
|
|
|
<h1 id="dhead">jsTree v.1.0</h1>
|
|
<h1>hotkeys plugin</h1>
|
|
<h2>Description</h2>
|
|
<div id="description">
|
|
<p>The <code>hotkeys</code> plugin enables keyboard navigation and shortcuts. Depends on the <a href="http://github.com/jeresig/jquery.hotkeys/">jquery.hotkeys plugin</a>.</p>
|
|
</div>
|
|
|
|
<h2 id="configuration">Configuration</h2>
|
|
<div class="panel configuration">
|
|
<p>Expects an object:<br />each key is the keyboard shortcut (for possible values check <a href="http://github.com/jeresig/jquery.hotkeys/">the hotkeys plugin</a>)<br />each value is a function executed in the instance's context, the return value is used as a return value for the event.</p>
|
|
<p>Simple example:</p>
|
|
<p><code>"del" : function () { this.remove(); }</code></p>
|
|
<p>By default <code>"up"</code>, <code>"ctrl+up"</code>, <code>"shift+up"</code>, <code>"down"</code>, <code>"ctrl+down"</code>, <code>"shift+down"</code>, <code>"left"</code>, <code>"ctrl+left"</code>, <code>"shift+left"</code>, <code>"right"</code>, <code>"ctrl+right"</code>, <code>"shift+right"</code>, <code>"space"</code>, <code>"ctrl+space"</code>, <code>"shift+space"</code>, <code>"f2"</code>, <code>"del"</code> are bound.<br />To override any of those - just specify your own function, to disable - just set to <code>false</code>.
|
|
</div>
|
|
|
|
<h2 id="demos">Demos</h2>
|
|
<div class="panel">
|
|
|
|
<h3>Using the hotkeys plugin</h3>
|
|
<p>Try pressing <code>up</code>/<code>down</code>/<code>left</code>/<code>right</code>/<code>space</code>/<code>f2</code>/<code>del</code>.</p>
|
|
<div id="demo1" class="demo">
|
|
<ul>
|
|
<li id="phtml_1">
|
|
<a href="#">Root node 1</a>
|
|
<ul>
|
|
<li id="phtml_2">
|
|
<a href="#">Child node 1</a>
|
|
</li>
|
|
<li id="phtml_3">
|
|
<a href="#">Child node 2</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li id="phtml_4">
|
|
<a href="#">Root node 2</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<script type="text/javascript" class="source">
|
|
$(function () {
|
|
$("#demo1").jstree({
|
|
"core" : { "initially_open" : [ "phtml_1" ] },
|
|
"plugins" : ["themes","html_data","ui","crrm","hotkeys"]
|
|
});
|
|
});
|
|
</script>
|
|
|
|
</div>
|
|
|
|
<h2 id="api">API</h2>
|
|
<div class="panel api">
|
|
|
|
<h3 id="enable_hotkeys">.enable_hotkeys ( )</h3>
|
|
<p>Enable shortcuts on the instance (enabled by default).</p>
|
|
|
|
<h3 id="disable_hotkeys">.disable_hotkeys ( )</h3>
|
|
<p>Disable shortcuts on the instance.</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</body>
|
|
</html> |