Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f609c22be8 | ||
|
|
670854e9d8 | ||
|
|
2bb7ba03cd | ||
|
|
686be484fc |
15
README.md
15
README.md
@@ -12,9 +12,9 @@ In the future, we want to enable users to implement their own collaborative type
|
|||||||
|
|
||||||
Unlike other frameworks, Yjs supports P2P message propagation and is not bound to a specific communication protocol. Therefore, Yjs is extremely scalable and can be used in a wide range of application scenarios.
|
Unlike other frameworks, Yjs supports P2P message propagation and is not bound to a specific communication protocol. Therefore, Yjs is extremely scalable and can be used in a wide range of application scenarios.
|
||||||
|
|
||||||
We support several communication protocols as so called *Connectors*. You find a bunch of Connectors in the [y-connectors](https://github.com/rwth-acis/y-connectors) repository. Currently supported communication protocols:
|
We support several communication protocols as so called *Connectors*. You can create your own connector too - as it is described [here](https://dadamonad.github.io/yjs/connector/Howto-create-your-own-Connector.html). Currently, we support the following communication protocols:
|
||||||
* [XMPP-Connector](http://xmpp.org) - Propagates updates in a XMPP multi-user-chat room
|
* [XMPP-Connector](http://xmpp.org) - Propagates updates in a XMPP multi-user-chat room
|
||||||
* [WebRTC-Connector](http://peerjs.com/) - Propagate updates directly with WebRTC
|
* [WebRTC-Connector](http://peerjs.com) - Propagate updates directly with WebRTC
|
||||||
* [IWC-Connector](http://dbis.rwth-aachen.de/cms/projects/the-xmpp-experience#interwidget-communication) - Inter-widget Communication
|
* [IWC-Connector](http://dbis.rwth-aachen.de/cms/projects/the-xmpp-experience#interwidget-communication) - Inter-widget Communication
|
||||||
|
|
||||||
You can use Yjs client-, and server- side. You can get it as via npm, and bower. We even provide a polymer element for Yjs!
|
You can use Yjs client-, and server- side. You can get it as via npm, and bower. We even provide a polymer element for Yjs!
|
||||||
@@ -61,9 +61,14 @@ But I would become really motivated if you gave me some feedback :) ([github](ht
|
|||||||
* Reimplement support for XML as a data type
|
* Reimplement support for XML as a data type
|
||||||
* Custom data types
|
* Custom data types
|
||||||
|
|
||||||
## Support
|
|
||||||
Please report _any_ issues to the [Github issue page](https://github.com/rwth-acis/yjs/issues)!
|
## Get help
|
||||||
I would appreciate if developers give me feedback on how _convenient_ the framework is, and if it is easy to use. Particularly the XML-support may not support every DOM-methods - if you encounter a method that does not cause any change on other peers, please state function name, and sample parameters. However, there are browser-specific features, that Y won't support.
|
[](https://gitter.im/rwth-acis/yjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||||
|
|
||||||
|
Please report _any_ issues to the [Github issue page](https://github.com/rwth-acis/yjs/issues)! I try to fix them very soon, if possible.
|
||||||
|
|
||||||
|
## Contribution
|
||||||
|
I created this framework during my bachelor thesis at the chair of computer science 5 [(i5)](http://dbis.rwth-aachen.de/cms), RWTH University. Since December 2014 I'm working on Yjs as a part of my student worker job at the i5.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
Yjs is licensed under the [MIT License](./LICENSE.txt).
|
Yjs is licensed under the [MIT License](./LICENSE.txt).
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "yjs",
|
"name": "yjs",
|
||||||
"version": "0.3.2",
|
"version": "0.4.1",
|
||||||
"homepage": "https://github.com/DadaMonad/yjs",
|
"homepage": "https://github.com/DadaMonad/yjs",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Kevin Jahns <kevin.jahns@rwth-aachen.de>"
|
"Kevin Jahns <kevin.jahns@rwth-aachen.de>"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -137,7 +137,7 @@ module.exports = function(HB) {
|
|||||||
while (true) {
|
while (true) {
|
||||||
if (o instanceof types.Delimiter && (o.prev_cl != null)) {
|
if (o instanceof types.Delimiter && (o.prev_cl != null)) {
|
||||||
o = o.prev_cl;
|
o = o.prev_cl;
|
||||||
while (o.isDeleted() || !(o instanceof types.Delimiter)) {
|
while (o.isDeleted() && (o.prev_cl != null)) {
|
||||||
o = o.prev_cl;
|
o = o.prev_cl;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ module.exports = function(HB) {
|
|||||||
if (((_ref = this.content) != null ? _ref.getUid : void 0) != null) {
|
if (((_ref = this.content) != null ? _ref.getUid : void 0) != null) {
|
||||||
json['content'] = this.content.getUid();
|
json['content'] = this.content.getUid();
|
||||||
} else {
|
} else {
|
||||||
json['content'] = this.content;
|
json['content'] = JSON.stringify(this.content);
|
||||||
}
|
}
|
||||||
return json;
|
return json;
|
||||||
};
|
};
|
||||||
@@ -82,6 +82,9 @@ module.exports = function(HB) {
|
|||||||
types.TextInsert.parse = function(json) {
|
types.TextInsert.parse = function(json) {
|
||||||
var content, next, origin, parent, prev, uid;
|
var content, next, origin, parent, prev, uid;
|
||||||
content = json['content'], uid = json['uid'], prev = json['prev'], next = json['next'], origin = json['origin'], parent = json['parent'];
|
content = json['content'], uid = json['uid'], prev = json['prev'], next = json['next'], origin = json['origin'], parent = json['parent'];
|
||||||
|
if (typeof content === "string") {
|
||||||
|
content = JSON.parse(content);
|
||||||
|
}
|
||||||
return new types.TextInsert(content, uid, prev, next, origin, parent);
|
return new types.TextInsert(content, uid, prev, next, origin, parent);
|
||||||
};
|
};
|
||||||
types.Array = (function(_super) {
|
types.Array = (function(_super) {
|
||||||
@@ -362,14 +365,20 @@ module.exports = function(HB) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
writeContent = function(content) {
|
writeContent = function(content) {
|
||||||
var append;
|
var c, content_array, i, _j, _len1, _results;
|
||||||
append = "";
|
content_array = content.replace(new RegExp("\n", 'g'), " ").split(" ");
|
||||||
if (content[content.length - 1] === " ") {
|
textfield.innerText = "";
|
||||||
content = content.slice(0, content.length - 1);
|
_results = [];
|
||||||
append = ' ';
|
for (i = _j = 0, _len1 = content_array.length; _j < _len1; i = ++_j) {
|
||||||
|
c = content_array[i];
|
||||||
|
textfield.innerText += c;
|
||||||
|
if (i !== content_array.length - 1) {
|
||||||
|
_results.push(textfield.innerHTML += ' ');
|
||||||
|
} else {
|
||||||
|
_results.push(void 0);
|
||||||
}
|
}
|
||||||
textfield.textContent = content;
|
}
|
||||||
return textfield.innerHTML += append;
|
return _results;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
writeContent(this.val());
|
writeContent(this.val());
|
||||||
@@ -420,11 +429,11 @@ module.exports = function(HB) {
|
|||||||
}
|
}
|
||||||
creator_token = true;
|
creator_token = true;
|
||||||
char = null;
|
char = null;
|
||||||
if (event.key != null) {
|
if (event.keyCode === 13) {
|
||||||
|
char = '\n';
|
||||||
|
} else if (event.key != null) {
|
||||||
if (event.charCode === 32) {
|
if (event.charCode === 32) {
|
||||||
char = " ";
|
char = " ";
|
||||||
} else if (event.keyCode === 13) {
|
|
||||||
char = '\n';
|
|
||||||
} else {
|
} else {
|
||||||
char = event.key;
|
char = event.key;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -131,7 +131,7 @@ module.exports = (HB)->
|
|||||||
# for the current array. Therefore we reach a Delimiter.
|
# for the current array. Therefore we reach a Delimiter.
|
||||||
# Then, we'll just return the last character.
|
# Then, we'll just return the last character.
|
||||||
o = o.prev_cl
|
o = o.prev_cl
|
||||||
while o.isDeleted() or not (o instanceof types.Delimiter)
|
while o.isDeleted() and o.prev_cl?
|
||||||
o = o.prev_cl
|
o = o.prev_cl
|
||||||
break
|
break
|
||||||
if position <= 0 and not o.isDeleted()
|
if position <= 0 and not o.isDeleted()
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ module.exports = (HB)->
|
|||||||
if @content?.getUid?
|
if @content?.getUid?
|
||||||
json['content'] = @content.getUid()
|
json['content'] = @content.getUid()
|
||||||
else
|
else
|
||||||
json['content'] = @content
|
json['content'] = JSON.stringify @content
|
||||||
json
|
json
|
||||||
|
|
||||||
types.TextInsert.parse = (json)->
|
types.TextInsert.parse = (json)->
|
||||||
@@ -87,6 +87,8 @@ module.exports = (HB)->
|
|||||||
'origin' : origin
|
'origin' : origin
|
||||||
'parent' : parent
|
'parent' : parent
|
||||||
} = json
|
} = json
|
||||||
|
if typeof content is "string"
|
||||||
|
content = JSON.parse(content)
|
||||||
new types.TextInsert content, uid, prev, next, origin, parent
|
new types.TextInsert content, uid, prev, next, origin, parent
|
||||||
|
|
||||||
|
|
||||||
@@ -348,12 +350,12 @@ module.exports = (HB)->
|
|||||||
s.removeAllRanges()
|
s.removeAllRanges()
|
||||||
s.addRange(r)
|
s.addRange(r)
|
||||||
writeContent = (content)->
|
writeContent = (content)->
|
||||||
append = ""
|
content_array = content.replace(new RegExp("\n",'g')," ").split(" ")
|
||||||
if content[content.length - 1] is " "
|
textfield.innerText = ""
|
||||||
content = content.slice(0,content.length-1)
|
for c, i in content_array
|
||||||
append = ' '
|
textfield.innerText += c
|
||||||
textfield.textContent = content
|
if i isnt content_array.length-1
|
||||||
textfield.innerHTML += append
|
textfield.innerHTML += ' '
|
||||||
|
|
||||||
writeContent this.val()
|
writeContent this.val()
|
||||||
|
|
||||||
@@ -390,11 +392,11 @@ module.exports = (HB)->
|
|||||||
return true
|
return true
|
||||||
creator_token = true
|
creator_token = true
|
||||||
char = null
|
char = null
|
||||||
if event.key?
|
if event.keyCode is 13
|
||||||
|
char = '\n'
|
||||||
|
else if event.key?
|
||||||
if event.charCode is 32
|
if event.charCode is 32
|
||||||
char = " "
|
char = " "
|
||||||
else if event.keyCode is 13
|
|
||||||
char = '\n'
|
|
||||||
else
|
else
|
||||||
char = event.key
|
char = event.key
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "yjs",
|
"name": "yjs",
|
||||||
"version": "0.3.2",
|
"version": "0.4.1",
|
||||||
"description": "A Framework that enables Real-Time Collaboration on arbitrary data structures.",
|
"description": "A Framework that enables Real-Time Collaboration on arbitrary data structures.",
|
||||||
"main": "./build/node/y.js",
|
"main": "./build/node/y.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user