Compare commits

...

3 Commits

Author SHA1 Message Date
Kevin Jahns
98085b2807 Deploy 0.8.14 2016-02-04 15:26:28 +01:00
Kevin Jahns
e48608a7d4 update ace example 2016-02-04 12:53:27 +01:00
Kevin Jahns
ddbe19d78e Deploy 0.8.13 2016-02-04 12:47:05 +01:00
7 changed files with 26 additions and 19 deletions

View File

@@ -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>

View File

@@ -7,9 +7,8 @@ Y({
}, },
connector: { connector: {
name: 'websockets-client', name: 'websockets-client',
room: 'ace-example' room: 'ace-example',
// debug: true url: 'localhost:1234'
// url: 'http://127.0.0.1:2345'
}, },
sourceDir: '/bower_components', sourceDir: '/bower_components',
share: { share: {
@@ -19,10 +18,9 @@ Y({
window.yAce = 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..
}) })

View File

@@ -1,6 +1,6 @@
{ {
"name": "yjs", "name": "yjs",
"version": "0.8.13", "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
View File

@@ -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)
} }
} }

File diff suppressed because one or more lines are too long

4
y.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long