Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

client

  • Loading branch information...
commit 09ae6d8aa155e033c4290e6f79dc7f5336b8feef 1 parent 08fa977
@lancejpollard authored
View
12 Cakefile
@@ -10,8 +10,10 @@ task 'coffee', ->
#coffee2.stderr.on 'data', (data) -> console.log data.toString().trim()
task 'build', ->
- fs.readFile "./src/design.io/client.coffee", "utf-8", (error, result) ->
- mint.coffee result, (error, result) ->
- fs.writeFile "design.io.js", result
- mint.uglifyjs result, (error, compressed) ->
- fs.writeFile "design.io.min.js", compressed
+ result = fs.readFileSync "./src/design.io/client.coffee", "utf-8"
+ mint.coffee result, {}, (error, result) ->
+ fs.writeFileSync "design.io.js", result
+ mint.uglifyjs result, (error, compressed) ->
+ fs.writeFile "design.io.min.js", compressed
+
+ setTimeout((=>), 1000)
View
10 design.io.js
@@ -1,11 +1,13 @@
+
window.DesignIO = (function() {
- function DesignIO(options) {
+ function DesignIO(namespace, options) {
options || (options = {});
this.callbacks = {};
this.watchers = [];
this.port = options.port || 4181;
- this.url = options.url || ("" + window.location.protocol + "//" + window.location.hostname + ":" + this.port + "/design.io");
+ this.namespace = namespace;
+ this.url = options.url || ("" + window.location.protocol + "//" + window.location.hostname + ":" + this.port);
this.socket = io.connect(this.url);
this.connect();
}
@@ -76,6 +78,7 @@ window.DesignIO = (function() {
if (typeof data === "object") {
data.userAgent = window.navigator.userAgent;
data.url = window.location.href;
+ data.namespace = this.namespace;
}
return this.socket.emit('log', JSON.stringify(data, this.replacer));
};
@@ -83,7 +86,8 @@ window.DesignIO = (function() {
DesignIO.prototype.userAgent = function() {
return {
userAgent: window.navigator.userAgent,
- url: window.location.href
+ url: window.location.href,
+ namespace: this.namespace
};
};
View
2  package.json
@@ -36,7 +36,7 @@
"socket.io": ">= 0.8.6",
"seq": ">= 0.3.5",
"findit": ">= 0.1.2",
- "mint": ">= 0.3.0",
+ "mint": ">= 0.3.1",
"pathfinder": ">= 0.3.0-1",
"async": ">= 0.1.15",
"node-uuid": ">= 1.2.0",
View
8 src/design.io/client.coffee
@@ -5,7 +5,7 @@ class window.DesignIO
@watchers = []
@port = options.port || 4181
@namespace = namespace
- @url = options.url || "#{window.location.protocol}//#{window.location.hostname}:#{@port}/#{namespace}"
+ @url = options.url || "#{window.location.protocol}//#{window.location.hostname}:#{@port}"
@socket = io.connect(@url)
@connect()
@@ -55,14 +55,16 @@ class window.DesignIO
# id, path, then anything else
log: (data) ->
if typeof(data) == "object"
- data.userAgent = window.navigator.userAgent
- data.url = window.location.href
+ data.userAgent = window.navigator.userAgent
+ data.url = window.location.href
+ data.namespace = @namespace
@socket.emit 'log', JSON.stringify(data, @replacer)
userAgent: ->
userAgent: window.navigator.userAgent
url: window.location.href
+ namespace: @namespace
replacer: (key, value) ->
if typeof value == "function"
View
2  src/design.io/project.coffee
@@ -62,7 +62,7 @@ class Project
throw new Error("Only one project per namespace") if store.hasOwnProperty(@namespace)
store[@namespace] = @
- @hook = new Hook(name: "design.io-watcher::#{@namespace}", debug: true, silent: false)
+ @hook = new Hook(name: "design.io-watcher::#{@namespace}", debug: false, silent: true)
watch: ->
hook = @hook
Please sign in to comment.
Something went wrong with that request. Please try again.