concerto/concerto — pull request #1088 by simplysoft (2014-08-01 09:34:18+00:00)
Title: Frontend JS Hooks

Add the ability to hook into the frontendjs. The first implemented hook point is after the content is loaded. This allows e.g. client to modify the render details

There are two ways of doing this:

1. Screen configuration
```
var screenOptions = {
setupPath: '/frontend/1/setup.json',
isPreview: true,
hooks: {
"loadContent": function(data) {
alert(JSON.stringify(data));
}
}
};
window.concertoScreen = new concerto.frontend.Screen(1, div, screenOptions);
```

2. Dynamically when needed
```
speedHook = concertoScreen.addHook("loadContent", function(c) { c.duration = 1; });
concertoScreen.removeHook("loadContent", speedHook);
```