Javascript Hooks

Using the javascript launcher

Hooking into muut.js events via javascript requires that you use the javascript launcher instead of the quick embed method.

here is some iformation on the javascript launcher and whatnot so people know what's up. (I think I can handle this one)

Hooking into events

Hooking into events uses the muut javascript object to pull information. So, some things I don't understand happen and this is the result. I will need tero or jay's help to figure this one out.

muut(function(app) {
   app.on('post', function(post) {'meta', post.meta)

A good example of this in action is below

<!-- without this CSS you'll just get a page full of text -->
<link rel="stylesheet" href="">
<!-- here is the client :D the type of tag used isn't that important
only that it's class is the same as the one in the script
You can use an ID as well, just be sure to use # in the launcher instead of . -->
    <div class="client"></div>
<!-- the page requires jquery since we're using the javascript launcher -->
<script src=""></script>
<!-- The muut.min.js should always come after jquery and the launcher class (.client in this case) -->
  <script src=""></script>
// This bit is the part that actually processes the metadata
 muut(function(app) {
   app.on('post', function(post) {'meta', post.meta)
// javascript launcher. This is how Muut shows up on the page and it must come last relative to the stuff above
 $('.client').muut({ url: '[community-name]'

Events list

app events
'before:post', post
'post', post
'before:load', page
'load', page

page events — first argument for app.load() listener
'before:more' — when more threads are about to be loaded
'more', page

'collapse' — when the whole page is collapsed
'moot' — when a new thread is rendered
'reload' — when the whole page is reloaded

real time events trough
'moot', moot. For example: —'moot', function(thread) { ... })
'beforethread', moot
'reply', post
'type', user, path
'error', key, data

thread events
'before:reply', post
'reply', For example: thread.on('reply', function(post) { ... })
'load', data

post events
'meta', meta
'more', more

user events trough app.user
'update', properties
'newcount', amount