Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

design.io

  • Loading branch information...
commit 2d43f86dd01960982a8ffdc4852be4d08f1b67e2 1 parent 06f0ea8
@lancejpollard authored
View
29 lib/design.io/connection.js
@@ -1,29 +0,0 @@
-
- module.exports = function(portOrIo) {
- var Watcher, designer, io;
- if (typeof portOrIo === "object") {
- io = portOrIo;
- } else {
- io = require("socket.io").listen(portOrIo);
- }
- Watcher = require("./watcher");
- io.set('log level', 1);
- designer = io.of("/design.io");
- designer.on("connection", function(socket) {
- socket.on("userAgent", function(data) {
- return socket.set("userAgent", data, function() {
- socket.emit("ready");
- Watcher.connect();
- return true;
- });
- });
- socket.on("log", function(data) {
- Watcher.log(data);
- return true;
- });
- return socket.on("disconnect", function() {
- return socket.emit("user disconnected");
- });
- });
- return designer;
- };
View
10 lib/design.io/process.js
@@ -1,10 +0,0 @@
-(function() {
- var command, forever;
-
- global._console || (global._console = require('underscore.logger'));
-
- forever = require("forever");
-
- command = new (require("" + __dirname + "/command"))(process.argv);
-
-}).call(this);
View
64 lib/design.io/script/start.js
@@ -1,64 +0,0 @@
-(function() {
- var Hook, Watcher, command, connect, designer, express, hook, io;
-
- command = require(__dirname)(process.argv);
-
- Hook = require("hook.io").Hook;
-
- io = require('socket.io');
-
- express = require("express");
-
- connect = require('connect');
-
- io = require('socket.io').listen(app);
-
- designer = io.of("/design.io");
-
- Watcher = require("../../lib/design.io/watcher");
-
- designer.on("connection", function(socket) {
- socket.on("userAgent", function(data) {
- return socket.set("userAgent", data, function() {
- socket.emit("ready");
- Watcher.connect();
- return true;
- });
- });
- socket.on("log", function(data) {
- Watcher.log(data);
- return true;
- });
- return socket.on("disconnect", function() {
- return socket.emit("user disconnected");
- });
- });
-
- app.listen(command.program.port);
-
- app.use(express.static(__dirname + '/../..'));
-
- app.use(connect.bodyParser());
-
- hook = new Hook({
- name: "design.io-server",
- debug: true
- });
-
- hook.on("hook::ready", function(data) {
- return console.log("hook started");
- });
-
- hook.on("design.io-watcher::change", function(data) {
- var action, date, path, root, slug;
- action = data.action, date = data.date, path = data.path, root = data.root, slug = data.slug;
- return designer.broadcast(action, JSON.stringify(data));
- });
-
- hook.start();
-
- app.get("design.io", function(request, response) {});
-
- _console.info("Design.io started on port " + command.program.port);
-
-}).call(this);
View
35 lib/design.io/script/stop.js
@@ -1,35 +0,0 @@
-(function() {
-
- #!/usr/bin/env node;
-
- var Hook, command, hook;
-
- command = require(__dirname)(process.argv);
-
- Hook = require("hook.io").Hook;
-
- hook = new Hook({
- name: "design.io-stop",
- debug: true
- });
-
- hook.on("hook::ready", function(data) {
- return hook.emit("ready", data);
- });
-
- hook.on("design.io::change", function(data) {
- var action, date, path, root, slug;
- return action = data.action, date = data.date, path = data.path, root = data.root, slug = data.slug, data;
- });
-
- hook.start();
-
- /*
- forever.list false, (error, processes) ->
- for process, index in processes
- if process.file == file
- forever.stop(index)
- break
- */
-
-}).call(this);
View
27 lib/design.io/script/watch.js
@@ -1,27 +0,0 @@
-(function() {
-
- #!/usr/bin/env node;
-
- var Hook, command, hook;
-
- command = require(__dirname)(process.argv);
-
- Hook = require("hook.io").Hook;
-
- hook = new Hook({
- name: "design.io-watcher",
- debug: true
- });
-
- hook.on("hook::ready", function(data) {
- return hook.emit("ready", data);
- });
-
- hook.on("design.io::change", function(data) {
- var action, date, path, root, slug;
- return action = data.action, date = data.date, path = data.path, root = data.root, slug = data.slug, data;
- });
-
- hook.start();
-
-}).call(this);
Please sign in to comment.
Something went wrong with that request. Please try again.