Permalink
Browse files

introducing sync events to the client

  • Loading branch information...
callmephilip committed Sep 22, 2012
1 parent 0fe64be commit 4444b414970e16d950e62edef2dc0f913d8c2084
Showing with 37 additions and 9 deletions.
  1. +18 −4 dist/remotes.dev.js
  2. +18 −4 dist/remotes.js
  3. +1 −1 dist/remotes.min.js
View
@@ -1602,12 +1602,18 @@ define('oats/ApiSpecification',[], function(){
CLIENT_REGISTER : "oats.client.register",
CLIENT_REGISTERED : "oats.client.registered",
-
- all : [ this.CLIENT_REGISTER, this.CLIENT_REGISTERED ]
+ CLIENT_SYNCED : "oats.client.synced",
+ CLIENT_OUT_OF_SYNC : "oats.client.out_of_sync"
},
isValidSignal : function(signal){
- return [this.signals.CLIENT_REGISTER, this.signals.CLIENT_REGISTERED].indexOf(signal) !== -1;
+ return [
+ this.signals.CLIENT_REGISTER,
+ this.signals.CLIENT_REGISTERED,
+ this.signals.CLIENT_SYNCED,
+ this.signals.CLIENT_OUT_OF_SYNC
+ ].indexOf(signal) !== -1;
+
}
};
@@ -1747,7 +1753,15 @@ define('oats/Client',[ "underscore",
switch(data.signal){
case ApiSpecification.signals.CLIENT_REGISTERED:
- this.trigger("Ready");
+ this.trigger("ready");
+ break;
+
+ case ApiSpecification.signals.CLIENT_SYNCED:
+ this.trigger("synced");
+ break;
+
+ case ApiSpecification.signals.CLIENT_OUT_OF_SYNC:
+ this.trigger("out-of-sync");
break;
}
View
@@ -1602,12 +1602,18 @@ define('oats/ApiSpecification',[], function(){
CLIENT_REGISTER : "oats.client.register",
CLIENT_REGISTERED : "oats.client.registered",
-
- all : [ this.CLIENT_REGISTER, this.CLIENT_REGISTERED ]
+ CLIENT_SYNCED : "oats.client.synced",
+ CLIENT_OUT_OF_SYNC : "oats.client.out_of_sync"
},
isValidSignal : function(signal){
- return [this.signals.CLIENT_REGISTER, this.signals.CLIENT_REGISTERED].indexOf(signal) !== -1;
+ return [
+ this.signals.CLIENT_REGISTER,
+ this.signals.CLIENT_REGISTERED,
+ this.signals.CLIENT_SYNCED,
+ this.signals.CLIENT_OUT_OF_SYNC
+ ].indexOf(signal) !== -1;
+
}
};
@@ -1747,7 +1753,15 @@ define('oats/Client',[ "underscore",
switch(data.signal){
case ApiSpecification.signals.CLIENT_REGISTERED:
- this.trigger("Ready");
+ this.trigger("ready");
+ break;
+
+ case ApiSpecification.signals.CLIENT_SYNCED:
+ this.trigger("synced");
+ break;
+
+ case ApiSpecification.signals.CLIENT_OUT_OF_SYNC:
+ this.trigger("out-of-sync");
break;
}
Oops, something went wrong.

0 comments on commit 4444b41

Please sign in to comment.