Initial commit
[yaffs-website] / node_modules / livereload-js / lib / startup.js
1 (function() {
2   var CustomEvents, LiveReload, k;
3
4   CustomEvents = require('./customevents');
5
6   LiveReload = window.LiveReload = new (require('./livereload').LiveReload)(window);
7
8   for (k in window) {
9     if (k.match(/^LiveReloadPlugin/)) {
10       LiveReload.addPlugin(window[k]);
11     }
12   }
13
14   LiveReload.addPlugin(require('./less'));
15
16   LiveReload.on('shutdown', function() {
17     return delete window.LiveReload;
18   });
19
20   LiveReload.on('connect', function() {
21     return CustomEvents.fire(document, 'LiveReloadConnect');
22   });
23
24   LiveReload.on('disconnect', function() {
25     return CustomEvents.fire(document, 'LiveReloadDisconnect');
26   });
27
28   CustomEvents.bind(document, 'LiveReloadShutDown', function() {
29     return LiveReload.shutDown();
30   });
31
32 }).call(this);