mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 17:06:16 -04:00
merge develop
This commit is contained in:
commit
4ea7ccd104
60 changed files with 6957 additions and 232 deletions
44
out/doc/api/hooks_overview.html
Normal file
44
out/doc/api/hooks_overview.html
Normal file
|
@ -0,0 +1,44 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Hooks - Etherpad Lite v1.2.81 Manual & Documentation</title>
|
||||
<link rel="stylesheet" href="assets/style.css">
|
||||
</head>
|
||||
<body class="apidoc" id="api-section-hooks_overview">
|
||||
<header id="header">
|
||||
<h1>Etherpad-Lite v1.2.81 Manual & Documentation</h1>
|
||||
</header>
|
||||
|
||||
<div id="toc">
|
||||
<h2>Table of Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#hooks_overview_hooks">Hooks</a><ul>
|
||||
<li><a href="#hooks_overview_return_values">Return values</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="apicontent">
|
||||
<h1>Hooks<span><a class="mark" href="#hooks_overview_hooks" id="hooks_overview_hooks">#</a></span></h1>
|
||||
<p>All hooks are called with two arguments:
|
||||
|
||||
</p>
|
||||
<ol>
|
||||
<li>name - the name of the hook being called</li>
|
||||
<li>context - an object with some relevant information about the context of the call</li>
|
||||
</ol>
|
||||
<h2>Return values<span><a class="mark" href="#hooks_overview_return_values" id="hooks_overview_return_values">#</a></span></h2>
|
||||
<p>A hook should always return a list or undefined. Returning undefined is equivalent to returning an empty list.
|
||||
All the returned lists are appended to each other, so if the return values where <code>[1, 2]</code>, <code>undefined</code>, <code>[3, 4,]</code>, <code>undefined</code> and <code>[5]</code>, the value returned by callHook would be <code>[1, 2, 3, 4, 5]</code>.
|
||||
|
||||
</p>
|
||||
<p>This is, because it should never matter if you have one plugin or several plugins doing some work - a single plugin should be able to make callHook return the same value a set of plugins are able to return collectively. So, any plugin can return a list of values, of any length, not just one value.</p>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue