From d5c7d51dc458450cefd67a0e167d06b2cf961fa6 Mon Sep 17 00:00:00 2001 From: DadaMonad Date: Fri, 23 Jan 2015 22:29:08 +0000 Subject: [PATCH] change name --- bower.json | 4 +-- examples/XMPP/index.html | 21 ++++++++++++++ examples/XMPP/index.js | 60 ++++++++++++++++++++++++++++++++++++++++ npm-debug.log | 26 +++++++++++++++++ package.json | 6 ++-- 5 files changed, 112 insertions(+), 5 deletions(-) create mode 100644 examples/XMPP/index.html create mode 100644 examples/XMPP/index.js create mode 100644 npm-debug.log diff --git a/bower.json b/bower.json index 0fc4fc65..145f75cc 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { - "name": "Yatta", - "version": "0.2.0", + "name": "Y", + "version": "0.2.3", "homepage": "https://github.com/DadaMonad/Yatta", "authors": [ "Kevin Jahns " diff --git a/examples/XMPP/index.html b/examples/XMPP/index.html new file mode 100644 index 00000000..d19c6f79 --- /dev/null +++ b/examples/XMPP/index.html @@ -0,0 +1,21 @@ + + + + + PeerJs Json Example + + + + + +

PeerJs + Json Tutorial

+

Collaborative Json editing with Yatta +and PeerJs (WebRTC).

+ + + +

Yatta is a Framework for Real-Time collaboration on arbitrary data structures. +You can find the code for this example here. +

+ + diff --git a/examples/XMPP/index.js b/examples/XMPP/index.js new file mode 100644 index 00000000..9b8ffe50 --- /dev/null +++ b/examples/XMPP/index.js @@ -0,0 +1,60 @@ + +/** + ## PeerJs + JSON Example + Here, I will give a short overview on how to enable collaborative json with the + [PeerJs](http://peerjs.com/) Connector and the Json Framework. Open + [index.html](http://dadamonad.github.io/Yatta/examples/PeerJs-Json/index.html) in your Browser and + use the console to explore Yatta! + + [PeerJs](http://peerjs.com) is a Framework that enables you to connect to other peers. You just need the + user-id of the peer (browser/client). And then you can connect to it. + + First you have to include the following libraries in your html file: + ``` + + + + + ``` +### Create Connector + +The PeerJs Framework requires an API key, or you need to set up your own PeerJs server. +Get an API key from the [Website](http://peerjs.com/peerserver). +The first parameter of `createPeerJsConnector` is forwarded as the options object in PeerJs. +Therefore, you may also specify the server/port here, if you have set up your own server. + */ +var yatta, yattaHandler; + +/** + This will connect to the server owned by the peerjs team. + For now, you can use my API key. +*/ + +connector = new XMPPConnector("testy-xmpp-json2"); +connector.debug = true +/** + ### Yatta + yatta is the shared json object. If you change something on this object, + it will be instantly shared with all the other collaborators. +*/ +yatta = new Yatta(connector); + +window.onload = function(){ + var textbox = document.getElementById("textfield"); + yatta.observe(function(events){ + for(var i=0; i (/home/codio/.nvm/v0.10.33/lib/node_modules/npm/node_modules/read/lib/read.js:66:13) +4 error at Interface.emit (events.js:92:17) +4 error at Interface._ttyWrite (readline.js:620:16) +4 error at ReadStream.onkeypress (readline.js:99:10) +4 error at ReadStream.emit (events.js:98:17) +4 error at emitKey (readline.js:1095:12) +4 error at ReadStream.onData (readline.js:840:14) +4 error at ReadStream.emit (events.js:95:17) +4 error at ReadStream. (_stream_readable.js:764:14) +4 error at ReadStream.emit (events.js:92:17) +5 error If you need help, you may report this *entire* log, +5 error including the npm and node versions, at: +5 error +6 error System Linux 3.16.0-23-generic +7 error command "/home/codio/.nvm/v0.10.33/bin/node" "/home/codio/.nvm/v0.10.33/bin/npm" "adduser" +8 error cwd /home/codio/workspace/Yatta +9 error node -v v0.10.33 +10 error npm -v 1.4.28 +11 verbose exit [ 1, true ] diff --git a/package.json b/package.json index 24e02d87..2372bbe3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "yatta", - "version": "0.2.1", + "name": "Y", + "version": "0.2.3", "description": "A Framework that enables Real-Time Collaboration on arbitrary data structures.", "main": "./build/node/yatta.js", "scripts": { @@ -25,7 +25,7 @@ "bugs": { "url": "https://github.com/DadaMonad/Yatta/issues" }, - "homepage": "https://dadamonad.github.io/Yattay/", + "homepage": "https://dadamonad.github.io/Yatta/", "dependencies": { }, "devDependencies": {