* Author: John Q. Public <john@myfriendicasite.com>
*/
+Please also add a README or README.md file to the addon directory.
+It will be displayed in the admin panel and should include some further information in addition to the header information.
+
+PHP addon hooks
+---
+
Register your addon hooks during installation.
Addon::registerHook($hookname, $file, $function);
-$hookname is a string and corresponds to a known Friendica hook.
+$hookname is a string and corresponds to a known Friendica PHP hook.
$file is a pathname relative to the top-level Friendica directory.
-This *should* be 'addon/addon_name/addon_name.php' in most cases.
+This *should* be 'addon/*addon_name*/*addon_name*.php' in most cases.
$function is a string and is the name of the function which will be executed when the hook is called.
-Please also add a README or README.md file to the addon directory.
-It will be displayed in the admin panel and should include some further information in addition to the header information.
-
-Arguments
----
+#### Arguments
Your hook callback functions will be called with at least one and possibly two arguments
function myhook_function(App $a, &$b) {
If you wish to make changes to the calling data, you must declare them as reference variables (with '&') during function declaration.
-#### $a
+##### $a
$a is the Friendica 'App' class.
It contains a wealth of information about the current state of Friendica:
It is recommeded you call this '$a' to match its usage elsewhere.
-#### $b
+##### $b
$b can be called anything you like.
This is information specific to the hook currently being processed, and generally contains information that is being immediately processed or acted on that you can use, display, or alter.
Remember to declare it with '&' if you wish to alter it.
+JavaScript addon hooks
+---
+
+Register your addon hooks in file 'addon/*addon_name*/*addon_name*.js'.
+
+ Addon_registerHook(type,hookfnstr);
+
+*type* is the name of the hook and corresponds to a known Friendica JavaScript hook.
+*hookfnstr* is the name of your JavaScript function to execute.
+
+No arguments are provided to your JavaScript callback function. Example:
+
+ function myhook_function() {
+
+ }
+
Modules
---
See also the wiki page [Quick Template Guide](https://github.com/friendica/friendica/wiki/Quick-Template-Guide).
-Current hooks
+Current PHP hooks
-------------
### 'authenticate'
'item' => item array (input)
'html' => converted item body (input/output)
+Current JavaScript hooks
+-------------
+
+### 'postprocess_liveupdate'
+Called at the end of the live update process (XmlHttpRequest)
+
Complete list of hook callbacks
---
Addon::callHooks('atom_feed_end', $atom);
Addon::callHooks('atom_feed_end', $atom);
+
+### view/js/main.js
+
+ callAddonHooks("postprocess_liveupdate");
\ No newline at end of file