updated examples to new version

This commit is contained in:
Kevin Jahns 2016-04-26 14:39:49 +02:00
parent f21e1c549a
commit 5c7bab422f
8 changed files with 7279 additions and 326 deletions

View File

@ -38,12 +38,14 @@ Y({
cleanupChat()
// whenever content changes, make sure to reflect the changes in the DOM
y.share.chat.observe(function (events) {
for (var i = 0; i < events.length; i++) {
if (events[i].type === 'insert') {
appendMessage(events[i].value, events[i].index)
} else if (events[i].type === 'delete') {
chat.children[events[i].index].remove()
y.share.chat.observe(function (event) {
if (event.type === 'insert') {
for (var i = 0; i < event.length; i++) {
appendMessage(event.values[i], event.index + i)
}
} else if (event.type === 'delete') {
for (var i = 0; i < event.length; i++) {
chat.children[event.index].remove()
}
}
// concurrent insertions may result in a history > 7, so cleanup here

View File

@ -9,7 +9,6 @@ Y({
connector: {
name: 'websockets-client',
room: 'richtext-example'
// url: 'http://127.0.0.1:1234'
},
sourceDir: '/bower_components',
share: {

View File

@ -7,7 +7,6 @@ Y({
},
connector: {
name: 'websockets-client',
// url: 'http://127.0.0.1:1234',
room: 'Xml-example'
},
sourceDir: '/bower_components',

View File

@ -1,10 +1,14 @@
# ![Yjs](http://y-js.org/images/yjs.png)
Yjs is a framework for optimistic concurrency control and automatic conflict resolution on shared data. The framework provides similar functionality as [ShareJs] and [OpenCoweb], but supports peer-to-peer communication protocols by default. Yjs was designed to handle concurrent actions on arbitrary data like Text, Json, and XML. We also provide support for storing and manipulating your shared data offline. For more information and demo applications visit our [homepage](http://y-js.org/).
Yjs is a framework for optimistic concurrency control and automatic conflict resolution on shared data.
The framework provides similar functionality as [ShareJs] and [OpenCoweb], but supports peer-to-peer
communication protocols by default. Yjs was designed to handle concurrent actions on arbitrary data
like Text, Json, and XML. We also provide support for storing and manipulating your shared data offline.
For more information and demo applications visit our [homepage](http://y-js.org/).
You can create you own shared types easily.
Therefore, you can design the sturcture of your custom type,
Therefore, you can design the structure of your custom type,
and ensure data validity, while Yjs ensures data consistency (everyone will eventually end up with the same data).
We already provide abstract data types for
@ -36,8 +40,6 @@ You are not limited to use a specific database to store the shared data. We prov
|[memory](https://github.com/y-js/y-memory) | In-memory storage. |
|[indexeddb](https://github.com/y-js/y-indexeddb) | Offline storage for the browser |
You can use Yjs client-, and server- side. You can get it as via npm, and bower. We even provide polymer elements for Yjs!
The advantages over similar frameworks are support for
* .. P2P message propagation and arbitrary communication protocols
* .. share any type of data. The types provide a convenient interface
@ -177,6 +179,14 @@ If you want to see an issue fixed, please subscribe to the thread (or remind me
## Changelog
### 11.0.0
* **All types now return a single event instead of list of events**
* Insert events contain a list of values
* Improved performance for large insertions & deletions
* Several bugfixes (offline editing related)
* Native support for node 4 (see #49)
### 10.0.0
* Support for more complex types (a type can be a composition of several types)

869
y.es6

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

6698
y.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long