guardian/frontend — pull request #2536 by commuterjoy (2013-12-11 12:34:24+00:00)
Title: WIP Commercial slot loader

/cc @kenlim @kelvin-chappell @phamann

Included is a simple commercial component loader, packaged and managed as part of our applcation but designed provide an sensible interface for OAS/DFP to load our own adverts (based on AMD).

The ad server would have to execute this for each slot it wanted to display a component in:-

```
// load the 'travel' component
require('modules/commercial/loader', function (CommercialComponent) {
new CommercialComponent(document, { config: guardian.config }).load('travel', document.getElementById('ad-slot'));
})
```

Questions

- Is it ok to provide external interfaces like this from deep within our application?
- Perhaps the CommercialComponent needs a cleaner interface than this give it's external code.
- I've not added any tests. Yikes.

![tumblr_mwqfv2iv7p1sm2o07o1_1280](https://f.cloud.github.com/assets/84996/1723743/74770486-6260-11e3-8914-63758452e6be.png)