updated examples

This commit is contained in:
Kevin Jahns
2015-11-09 03:04:03 +01:00
parent 0292181830
commit 6c13be376f
5 changed files with 2442 additions and 17 deletions

View File

@@ -3,7 +3,7 @@
// create a shared object. This function call will return a promise!
Y({
db: {
name: 'IndexedDB',
name: 'indexeddb',
namespace: 'offlineEditingDemo'
},
connector: {
@@ -11,8 +11,8 @@ Y({
room: 'offlineEditingDemo',
debug: true
},
types: [],
sourceDir: '/bower_components/'
types: ['Array', 'Text'],
sourceDir: '/bower_components'
}).then(function (yconfig) {
// yconfig holds all the information about the shared object
window.yconfig = yconfig
@@ -33,10 +33,10 @@ Y({
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)
yconfig.root.set('text', Y.Text)
}
// We also provide a button for disconnecting/reconnecting the shared element
var button = document.querySelector('#button')