updated connector functionality

This commit is contained in:
DadaMonad 2015-01-30 11:29:05 +00:00
parent 7c842efd52
commit cbcdebf33e
11 changed files with 529 additions and 80 deletions

View File

@ -34,7 +34,7 @@ Either clone this git repository, install it with [bower](http://bower.io/), or
### Bower
```
bower install yjs
bower install rwth-acis/yjs
```
Then you include the libraries directly from the installation folder.
```

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -55,14 +55,12 @@ adaptConnector = function(connector, engine, HB, execution_listener) {
connector.getStateVector = getStateVector;
connector.getHB = getHB;
connector.applyHB = applyHB;
connector.whenReceiving(function(sender, op) {
connector.receive_handlers.push(function(sender, op) {
if (op.uid.creator !== HB.getUserId()) {
return engine.applyOp(op);
}
});
if (connector._whenBoundToY != null) {
return connector._whenBoundToY();
}
return connector.setIsBoundToY();
};
module.exports = adaptConnector;

View File

@ -17,7 +17,7 @@ createY = function(connector) {
user_id = connector.id;
} else {
user_id = "_temp";
connector.whenUserIdSet(function(id) {
connector.onUserIdSet(function(id) {
user_id = id;
return HB.resetUserId(id);
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -46,11 +46,10 @@ adaptConnector = (connector, engine, HB, execution_listener)->
connector.getHB = getHB
connector.applyHB = applyHB
connector.whenReceiving (sender, op)->
connector.receive_handlers.push (sender, op)->
if op.uid.creator isnt HB.getUserId()
engine.applyOp op
if connector._whenBoundToY?
connector._whenBoundToY()
connector.setIsBoundToY()
module.exports = adaptConnector

View File

@ -10,7 +10,7 @@ createY = (connector)->
user_id = connector.id # TODO: change to getUniqueId()
else
user_id = "_temp"
connector.whenUserIdSet (id)->
connector.onUserIdSet (id)->
user_id = id
HB.resetUserId id
HB = new HistoryBuffer user_id

File diff suppressed because one or more lines are too long

2
y.js

File diff suppressed because one or more lines are too long