Compare commits

...

8 Commits

Author SHA1 Message Date
Kevin Jahns
b471c91d1d added es6 distribution 2015-11-30 15:24:35 +01:00
Kevin Jahns
14a3fbc638 changed to memory adapter 2015-11-15 02:13:32 +01:00
Kevin Jahns
4efc428ce0 Deploy 0.6.40 2015-11-15 02:11:41 +01:00
Kevin Jahns
ded8ef07bb Deploy 0.6.39 2015-11-15 02:09:37 +01:00
Kevin Jahns
dcf6212436 example update 2015-11-11 17:18:57 +01:00
Kevin Jahns
acfce06912 removed disconnect button for example 2015-11-10 18:38:21 +01:00
Kevin Jahns
6c13be376f updated examples 2015-11-09 03:04:03 +01:00
Kevin Jahns
0292181830 Deploy 0.6.36 2015-11-07 22:17:25 +01:00
11 changed files with 3488 additions and 58 deletions

View File

@@ -1,11 +1,8 @@
<!DOCTYPE html>
<html>
<body>
<button id="button">Disconnect</button>
<h1 id="contenteditable" contentEditable></h1>
<textarea style="width:80%;" rows=40 id="textfield"></textarea>
<script src="../../node_modules/simplewebrtc/simplewebrtc.bundle.js"></script>
<script src="../bower_components/yjs/y.js"></script>
<script src="./index.js"></script>
</body>

View File

@@ -3,24 +3,23 @@
// create a shared object. This function call will return a promise!
Y({
db: {
name: 'IndexedDB',
name: 'memory',
namespace: 'offlineEditingDemo'
},
connector: {
name: 'WebRTC',
name: 'websockets-client',
room: 'offlineEditingDemo',
debug: true
}
},
types: ['Array', 'Text'],
sourceDir: '/bower_components'
}).then(function (yconfig) {
// yconfig holds all the information about the shared object
window.yconfig = yconfig
// yconfig.root holds the shared element
window.y = yconfig.root
// now we bind the textarea and the contenteditable h1 element
// to a shared element
var textarea = document.getElementById('textfield')
var contenteditable = document.getElementById('contenteditable')
yconfig.root.observePath(['text'], function (text) {
// every time the 'text' property of the yconfig.root changes,
// this function is called. Then we bind it to the html elements
@@ -28,23 +27,12 @@ Y({
// when the text property is deleted, text may be undefined!
// This is why we have to check if text exists..
text.bind(textarea)
text.bind(contenteditable)
}
})
// create a shared TextBind
// create a shared Text
var textpromise = yconfig.root.get('text')
if (textpromise == null) {
yconfig.root.set('text', Y.TextBind)
}
// We also provide a button for disconnecting/reconnecting the shared element
var button = document.querySelector('#button')
button.onclick = function () {
if (button.innerText === 'Disconnect') {
yconfig.disconnect()
button.innerText = 'Reconnect'
} else {
yconfig.reconnect()
button.innerText = 'Disconnect'
}
// Set the text type if it does not yet exist
yconfig.root.set('text', Y.Text)
}
})

View File

@@ -5,8 +5,7 @@
<h1 id="contenteditable" contentEditable></h1>
<textarea style="width:80%;" rows=40 id="textfield"></textarea>
<script src="../../node_modules/simplewebrtc/simplewebrtc.bundle.js"></script>
<script src="../../y.js"></script>
<script src="../bower_components/yjs/y.js"></script>
<script src="./index.js"></script>
</body>
</html>

View File

@@ -3,13 +3,15 @@
// create a shared object. This function call will return a promise!
Y({
db: {
name: 'Memory'
name: 'memory'
},
connector: {
name: 'WebRTC',
room: 'TextBindDemo',
name: 'websockets-client',
room: 'textEditingDem0',
debug: true
}
},
types: ['Array', 'Text'],
sourceDir: '/bower_components/'
}).then(function (yconfig) {
// yconfig holds all the information about the shared object
window.yconfig = yconfig
@@ -30,8 +32,8 @@ Y({
text.bind(contenteditable)
}
})
// create a shared TextBind
yconfig.root.set('text', Y.TextBind)
// create a shared Text
yconfig.root.set('text', Y.Text)
// We also provide a button for disconnecting/reconnecting the shared element
var button = document.querySelector('#button')

View File

@@ -1,30 +1,30 @@
# ![Yjs](http://y-js.org/files/layout/yjs.svg)
[![Build Status](https://travis-ci.org/y-js/yjs.svg)](https://travis-ci.org/y-js/yjs)
# ![Yjs](http://y-js.org/images/yjs.png)
Yjs is a framework for optimistic concurrency control and automatic conflict resolution on shared data types. The framework implements a new OT-like concurrency algorithm and provides similar functionality as [ShareJs] and [OpenCoweb]. Yjs was designed to handle concurrent actions on arbitrary complex data types like Text, Json, and XML. We provide a tutorial and some applications for this framework on our [homepage](http://y-js.org/).
**NOTE** This project is currently migrating. So there may exist some information that is not true anymore..
You can create you own shared types easily. Therefore, you can take matters into your own hand by defining the meaning of the shared types and ensure that it is valid, while Yjs ensures data consistency (everyone will eventually end up with the same data). We already provide data types for
| Name | Description
| ---------------------------------------------------- | ---------------------------------------------
y-object | Add, update, and remove properties of an object. Circular references are supported. Included in Yjs
[y-list](https://github.com/y-js/y-list) | A shared linked list implementation. Circular references are supported
[y-selections](https://github.com/y-js/y-selections) | Manages selections on types that use linear structures (e.g. the y-list type). You can select a range of elements and assign meaning to them.
[y-xml](https://github.com/y-js/y-xml) | An implementation of the DOM. You can create a two way binding to Browser DOM objects
[y-text](https://github.com/y-js/y-text) | Collaborate on text. You can create a two way binding to textareas, input elements, or HTML elements (e.g. *h1*, or *p*)
[y-richtext](https://github.com/y-js/y-richtext) | Collaborate on rich text. You can create a two way binding to several editors
| Name | Description |
|----------|-------------------|
| map | Add, update, and remove properties of an object. Included in Yjs|
|[array](https://github.com/y-js/y-array) | A shared linked list implementation |
|[selections](https://github.com/y-js/y-selections) | Manages selections on types that use linear structures (e.g. the y-array type). Select a range of elements, and assign meaning to them.|
|[xml](https://github.com/y-js/y-xml) | An implementation of the DOM. You can create a two way binding to Browser DOM objects|
|[text](https://github.com/y-js/y-text) | Collaborate on text. Supports two way binding to textareas, input elements, or HTML elements (e.g. *h1*, or *p*)|
|[richtext](https://github.com/y-js/y-richtext) | Collaborate on rich text. Supports two way binding to several editors|
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 can create your own connector too - read [this wiki page](https://github.com/y-js/yjs/wiki/Custom-Connectors). Currently, we support the following communication protocols:
Name | Description
---------------------------------------- | -------------------------------------------------------
[y-xmpp](https://github.com/y-js/y-xmpp) | Propagate updates in a XMPP multi-user-chat room ([XEP-0045](http://xmpp.org/extensions/xep-0045.html))
[y-webrtc](https://github.com/y-js/y-webrtc) | Propagate updates Browser2Browser via WebRTC
[y-test](https://github.com/y-js/y-test) | A Connector for testing purposes. It is designed to simulate delays that happen in worst case scenarios
|Name | Description |
|----------------|-----------------------------------|
|[xmpp](https://github.com/y-js/y-xmpp) | Propagate updates in a XMPP multi-user-chat room ([XEP-0045](http://xmpp.org/extensions/xep-0045.html))|
|[webrtc](https://github.com/y-js/y-webrtc) | Propagate updates Browser2Browser via WebRTC|
|[test](https://github.com/y-js/y-test) | A Connector for testing purposes. It is designed to simulate delays that happen in worst case scenarios|
You can use Yjs client-, and server- side. You can get it as via npm, and bower. We even provide polymer elements for Yjs!
@@ -36,7 +36,6 @@ The advantages over similar frameworks are support for
* .. AnyUndo: Undo *any* action that was executed in constant time (coming..)
* .. Intention Preservation: When working on Text, the intention of your changes are preserved. This is particularily important when working offline. Every type has a notion on how we define Intention Preservation on it.
## Use it!
You can find a tutorial, and examples on the [website](http://y-js.org). Furthermore, the [github wiki](https://github.com/y-js/yjs/wiki) offers more information about how you can use Yjs in your application.
@@ -122,7 +121,7 @@ There are some friendly people on [![Gitter](https://badges.gitter.im/Join%20Cha
Please report _any_ issues to the [Github issue page](https://github.com/y-js/yjs/issues)! I try to fix them very soon, if possible.
## Changelog
##### 1.0
### 1.0
This is a complete rewrite of the 0.5 version of Yjs. Since Yjs 1.0 it is possible to work asynchronously on a persistent database, which enables offline support.
* Switched to semver versioning
* Requires a promise implementation in environment (es6 promises suffice, included in all the major browsers). Otherwise you have to include a polyfill
@@ -132,6 +131,7 @@ This is a complete rewrite of the 0.5 version of Yjs. Since Yjs 1.0 it is possib
* The Connector definition slightly changed (I'll update the wiki)
* The Type definitions completely changed, so you have to rewrite them (I'll rewrite the article in the wiki)
* Support for several packaging systems
* Flowtype
## Contribution
@@ -142,4 +142,5 @@ Yjs is licensed under the [MIT License](./LICENSE.txt).
<yjs@dbis.rwth-aachen.de>
[ShareJs]: https://github.com/sh
[ShareJs]: https://github.com/share/ShareJS
[OpenCoweb]: https://github.com/opencoweb/coweb/wiki

View File

@@ -1,6 +1,6 @@
{
"name": "yjs",
"version": "0.6.33",
"version": "0.6.42",
"homepage": "y-js.org",
"authors": [
"Kevin Jahns <kevin.jahns@rwth-aachen.de>"

View File

@@ -1,19 +1,22 @@
{
"name": "yjs",
"version": "0.6.33",
"version": "0.6.42",
"description": "A framework for real-time p2p shared editing on arbitrary complex data types",
"main": "y.js",
"scripts": {
"test": "node --harmony ./node_modules/.bin/gulp test",
"lint": "./node_modules/.bin/standard"
},
"pre-commit": [
"lint"
"lint",
"test"
],
"standard": {
"parser": "babel-eslint",
"ignore": [
"build/**",
"dist/**",
"declarations/**",
"./y.js",
"./y.js.map"
]
@@ -39,7 +42,35 @@
},
"homepage": "http://y-js.org",
"devDependencies": {
"babel-plugin-transform-runtime": "^6.1.18",
"babel-preset-es2015": "^6.1.18",
"babelify": "^7.2.0",
"browserify": "^12.0.1",
"eslint": "^1.10.2",
"gulp": "^3.9.0",
"gulp-bump": "^1.0.0",
"gulp-concat": "^2.6.0",
"gulp-filter": "^3.0.1",
"gulp-git": "^1.6.0",
"gulp-if": "^2.0.0",
"gulp-jasmine": "^2.0.1",
"gulp-jasmine-browser": "^0.2.3",
"gulp-load-plugins": "^1.0.0",
"gulp-prompt": "^0.1.2",
"gulp-rename": "^1.2.2",
"gulp-serve": "^1.2.0",
"gulp-shell": "^0.5.1",
"gulp-sourcemaps": "^1.5.2",
"gulp-tag-version": "^1.3.0",
"gulp-uglify": "^1.5.1",
"gulp-util": "^3.0.6",
"gulp-watch": "^4.3.5",
"minimist": "^1.2.0",
"pre-commit": "^1.1.1",
"standard": "^5.2.2"
"regenerator": "^0.8.42",
"run-sequence": "^1.1.4",
"standard": "^5.2.2",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0"
}
}

3412
y.es6 Normal file

File diff suppressed because it is too large Load Diff

1
y.es6.map Normal file

File diff suppressed because one or more lines are too long

5
y.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long