Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98085b2807 | ||
|
|
e48608a7d4 | ||
|
|
ddbe19d78e | ||
|
|
f9a9edcc26 | ||
|
|
4340f028b5 |
@@ -2,18 +2,28 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<style type="text/css" media="screen">
|
<style type="text/css" media="screen">
|
||||||
#editor {
|
#ace {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
|
.inserted {
|
||||||
|
position:absolute;
|
||||||
|
z-index:20;
|
||||||
|
background-color: #FFC107;
|
||||||
|
}
|
||||||
|
.deleted {
|
||||||
|
position:absolute;
|
||||||
|
z-index:20;
|
||||||
|
background-color: #FFC107;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div id="editor"></div>
|
<div id="ace"></div>
|
||||||
<script src="../bower_components/yjs/y.es6"></script>
|
<script src="../bower_components/yjs/y.es6"></script>
|
||||||
<script src="../bower_components/ace-builds/src/ace.js"></script>
|
<script src="../bower_components/ace-builds/src/ace.js"></script>
|
||||||
|
|
||||||
|
|||||||
@@ -7,22 +7,20 @@ Y({
|
|||||||
},
|
},
|
||||||
connector: {
|
connector: {
|
||||||
name: 'websockets-client',
|
name: 'websockets-client',
|
||||||
room: 'ace-example-dev'
|
room: 'ace-example',
|
||||||
// debug: true
|
url: 'localhost:1234'
|
||||||
// url: 'http://127.0.0.1:2345'
|
|
||||||
},
|
},
|
||||||
sourceDir: '/bower_components',
|
sourceDir: '/bower_components',
|
||||||
share: {
|
share: {
|
||||||
ace: 'Text' // y.share.textarea is of type Y.Text
|
ace: 'Text' // y.share.textarea is of type Y.Text
|
||||||
}
|
}
|
||||||
}).then(function (y) {
|
}).then(function (y) {
|
||||||
window.y = y
|
window.yAce = y
|
||||||
|
|
||||||
// bind the textarea to a shared text element
|
// bind the textarea to a shared text element
|
||||||
var editor = ace.edit('editor')
|
var editor = ace.edit('ace')
|
||||||
editor.setTheme('ace/theme/monokai')
|
editor.setTheme('/bower_components/ace-builds/src-min/chrome')
|
||||||
editor.getSession().setMode('ace/mode/javascript')
|
editor.getSession().setMode('ace/mode/javascript')
|
||||||
|
|
||||||
y.share.ace.bindAce(editor)
|
y.share.ace.bindAce(editor)
|
||||||
// thats it..
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -9,15 +9,13 @@ Y({
|
|||||||
connector: {
|
connector: {
|
||||||
name: 'websockets-client',
|
name: 'websockets-client',
|
||||||
room: 'chat-example'
|
room: 'chat-example'
|
||||||
// debug: true,
|
|
||||||
// url: 'http://127.0.0.1:2345'
|
|
||||||
},
|
},
|
||||||
sourceDir: '/bower_components',
|
sourceDir: '/bower_components',
|
||||||
share: {
|
share: {
|
||||||
chat: 'Array'
|
chat: 'Array'
|
||||||
}
|
}
|
||||||
}).then(function (y) {
|
}).then(function (y) {
|
||||||
window.y = y
|
window.yChat = y
|
||||||
// This functions inserts a message at the specified position in the DOM
|
// This functions inserts a message at the specified position in the DOM
|
||||||
function appendMessage(message, position) {
|
function appendMessage(message, position) {
|
||||||
var p = document.createElement('p')
|
var p = document.createElement('p')
|
||||||
|
|||||||
@@ -8,9 +8,7 @@ Y({
|
|||||||
},
|
},
|
||||||
connector: {
|
connector: {
|
||||||
name: 'websockets-client',
|
name: 'websockets-client',
|
||||||
room: 'Puzzle-example2'
|
room: 'Puzzle-example'
|
||||||
// debug: true,
|
|
||||||
// url: 'http://127.0.0.1:2345'
|
|
||||||
},
|
},
|
||||||
sourceDir: '/bower_components',
|
sourceDir: '/bower_components',
|
||||||
share: {
|
share: {
|
||||||
@@ -20,6 +18,7 @@ Y({
|
|||||||
piece4: 'Map'
|
piece4: 'Map'
|
||||||
}
|
}
|
||||||
}).then(function (y) {
|
}).then(function (y) {
|
||||||
|
window.yJigsaw = y
|
||||||
var origin // mouse start position - translation of piece
|
var origin // mouse start position - translation of piece
|
||||||
var drag = d3.behavior.drag()
|
var drag = d3.behavior.drag()
|
||||||
.on('dragstart', function (params) {
|
.on('dragstart', function (params) {
|
||||||
|
|||||||
@@ -4,12 +4,11 @@
|
|||||||
|
|
||||||
Y({
|
Y({
|
||||||
db: {
|
db: {
|
||||||
name: 'indexeddb',
|
name: 'memory'
|
||||||
idbVersion: 20
|
|
||||||
},
|
},
|
||||||
connector: {
|
connector: {
|
||||||
name: 'websockets-client',
|
name: 'websockets-client',
|
||||||
room: 'richtext-example24',
|
room: 'richtext-example',
|
||||||
debug: true
|
debug: true
|
||||||
// url: 'http://127.0.0.1:1234'
|
// url: 'http://127.0.0.1:1234'
|
||||||
},
|
},
|
||||||
@@ -18,7 +17,7 @@ Y({
|
|||||||
richtext: 'Richtext' // y.share.richtext is of type Y.Richtext
|
richtext: 'Richtext' // y.share.richtext is of type Y.Richtext
|
||||||
}
|
}
|
||||||
}).then(function (y) {
|
}).then(function (y) {
|
||||||
window.yquill = y
|
window.yQuill = y
|
||||||
|
|
||||||
// create quill element
|
// create quill element
|
||||||
window.quill = new Quill('#editor', {
|
window.quill = new Quill('#editor', {
|
||||||
|
|||||||
@@ -7,16 +7,14 @@ Y({
|
|||||||
},
|
},
|
||||||
connector: {
|
connector: {
|
||||||
name: 'websockets-client',
|
name: 'websockets-client',
|
||||||
room: 'Textarea-example-dev'
|
room: 'Textarea-example'
|
||||||
// debug: true
|
|
||||||
// url: 'http://127.0.0.1:2345'
|
|
||||||
},
|
},
|
||||||
sourceDir: '/bower_components',
|
sourceDir: '/bower_components',
|
||||||
share: {
|
share: {
|
||||||
textarea: 'Text' // y.share.textarea is of type Y.Text
|
textarea: 'Text' // y.share.textarea is of type Y.Text
|
||||||
}
|
}
|
||||||
}).then(function (y) {
|
}).then(function (y) {
|
||||||
window.y = y
|
window.yTextarea = y
|
||||||
|
|
||||||
// bind the textarea to a shared text element
|
// bind the textarea to a shared text element
|
||||||
y.share.textarea.bind(document.getElementById('textfield'))
|
y.share.textarea.bind(document.getElementById('textfield'))
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "yjs",
|
"name": "yjs",
|
||||||
"version": "0.8.12",
|
"version": "0.8.15",
|
||||||
"homepage": "y-js.org",
|
"homepage": "y-js.org",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Kevin Jahns <kevin.jahns@rwth-aachen.de>"
|
"Kevin Jahns <kevin.jahns@rwth-aachen.de>"
|
||||||
|
|||||||
11
y.es6
11
y.es6
@@ -1944,12 +1944,11 @@ module.exports = function (Y/* :any */) {
|
|||||||
yield* this.setState(state)
|
yield* this.setState(state)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (this.store.forwardAppliedOperations) {
|
||||||
if (this.store.forwardAppliedOperations) {
|
var ops = []
|
||||||
for (let c = del[1]; c < del[1] + del[2]; c++) {
|
for (let c = del[1]; c < del[1] + del[2]; c++) {
|
||||||
var ops = deletions.map(function (d) {
|
ops.push({struct: 'Delete', target: [d[0], c]}) // TODO: implement Delete with deletion length!
|
||||||
return {struct: 'Delete', target: [d[0], c]} // TODO: implement Delete with deletion length!
|
}
|
||||||
})
|
|
||||||
this.store.y.connector.broadcastOps(ops)
|
this.store.y.connector.broadcastOps(ops)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user