startup.js 765 B

1234567891011121314151617181920212223242526272829303132
  1. (function() {
  2. var CustomEvents, LiveReload, k;
  3. CustomEvents = require('./customevents');
  4. LiveReload = window.LiveReload = new (require('./livereload').LiveReload)(window);
  5. for (k in window) {
  6. if (k.match(/^LiveReloadPlugin/)) {
  7. LiveReload.addPlugin(window[k]);
  8. }
  9. }
  10. LiveReload.addPlugin(require('./less'));
  11. LiveReload.on('shutdown', function() {
  12. return delete window.LiveReload;
  13. });
  14. LiveReload.on('connect', function() {
  15. return CustomEvents.fire(document, 'LiveReloadConnect');
  16. });
  17. LiveReload.on('disconnect', function() {
  18. return CustomEvents.fire(document, 'LiveReloadDisconnect');
  19. });
  20. CustomEvents.bind(document, 'LiveReloadShutDown', function() {
  21. return LiveReload.shutDown();
  22. });
  23. }).call(this);