Compare commits

..

6 Commits

Author SHA1 Message Date
Kevin Jahns
f2052f95f8 Deploy 0.8.22 2016-02-22 12:38:21 +01:00
Kevin Jahns
81324dc7d4 Deploy 0.8.21 2016-02-18 16:57:27 +01:00
Kevin Jahns
6599cb20b4 Deploy 0.8.20 2016-02-16 16:08:50 +01:00
Kevin Jahns
74ed9e4107 Deploy 0.8.18 2016-02-15 15:22:51 +01:00
Kevin Jahns
ef6d63c19a Deploy 0.8.17 2016-02-04 23:13:47 +01:00
Kevin Jahns
941dd36e74 Deploy 0.8.16 2016-02-04 23:12:49 +01:00
8 changed files with 43 additions and 20 deletions

View File

@@ -2,7 +2,7 @@
<html>
<body>
<textarea style="width:80%;" rows=40 id="textfield" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
<script src="../bower_components/yjs/y.js"></script>
<script src="../bower_components/yjs/y.es6"></script>
<script src="./index.js"></script>
</body>
</html>

View File

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

View File

@@ -13,7 +13,7 @@ We already provide abstract data types for
|[map](https://github.com/y-js/y-map) | A shared Map implementation. Maps from text to any stringify-able object |
|[array](https://github.com/y-js/y-array) | A shared Array implementation |
|[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/>*). Also supports the [Ace Editor](https://ace.c9.io) |
|[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*>). Also supports the [Ace Editor](https://ace.c9.io) |
|[richtext](https://github.com/y-js/y-richtext) | Collaborate on rich text. Supports two way binding to the [Quill Rich Text Editor](http://quilljs.com/)|
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.

View File

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

44
y.es6
View File

@@ -718,9 +718,17 @@ module.exports = function (Y /* :any */) {
this.gc2 = this.gc2.filter(filter)
delete op.gc
}
destroy () {
* destroy () {
clearInterval(this.gcInterval)
this.gcInterval = null
for (var key in this.initializedTypes) {
var type = this.initializedTypes[key]
if (type._destroy != null) {
type._destroy()
} else {
console.error('The type you included does not provide destroy functionality, it will remain in memory (updating your packages will help).')
}
}
}
setUserId (userId) {
if (!this.userIdPromise.inProgress) {
@@ -756,8 +764,8 @@ module.exports = function (Y /* :any */) {
* check if was deleted, apply a delete operation after op was applied
*/
apply (ops) {
for (var key in ops) {
var o = ops[key]
for (var i = 0; i < ops.length; i++) {
var o = ops[i]
if (o.id == null || o.id[0] !== this.y.connector.userId) {
var required = Y.Struct[o.struct].requiredOps(o)
this.whenOperationsExist(required, o)
@@ -775,8 +783,8 @@ module.exports = function (Y /* :any */) {
missing: ids.length
}
for (let key in ids) {
let id = ids[key]
for (let i = 0; i < ids.length; i++) {
let id = ids[i]
let sid = JSON.stringify(id)
let l = this.listenersById[sid]
if (l == null) {
@@ -819,8 +827,8 @@ module.exports = function (Y /* :any */) {
if (op == null) {
store.listenersById[sid] = l
} else {
for (let key in l) {
let listener = l[key]
for (let i = 0; i < l.length; i++) {
let listener = l[i]
let o = listener.op
if (--listener.missing === 0) {
yield* store.tryExecute.call(this, o)
@@ -2252,6 +2260,12 @@ module.exports = function (Y /* : any*/) {
this.onevent = onevent
this.eventListeners = []
}
destroy () {
this.waiting = null
this.awaiting = null
this.onevent = null
this.eventListeners = null
}
/*
Call this when a new operation arrives. It will be executed right away if
there are no waiting operations, that you prematurely executed
@@ -2697,6 +2711,7 @@ class YConfig {
db: Y.AbstractDatabase;
connector: Y.AbstractConnector;
share: {[key: string]: any};
options: Object;
*/
constructor (opts, callback) {
this.options = opts
@@ -2734,10 +2749,17 @@ class YConfig {
return this.connector.reconnect()
}
destroy () {
this.disconnect()
this.db.destroy()
this.connector = null
this.db = null
if (this.connector.destroy != null) {
this.connector.destroy()
} else {
this.connector.disconnect()
}
var self = this
this.db.requestTransaction(function * () {
yield* self.db.destroy()
self.connector = null
self.db = null
})
}
}

File diff suppressed because one or more lines are too long

6
y.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long