Comments (9)
Wasn't this done?
from sharejs.
I think I got part-way there and hit some sort of road block, but I can't remember what.
BTW, your github avatar looks like an alien.
from sharejs.
Cheers :p
Yeah - for some reason I thought we had this working. Don't sub-documents (foo.at('bar')
) support the text API? If so, we should probably make an example.
from sharejs.
Has anyone had a chance to look at this yet, it would be incredibly useful.
from sharejs.
@josephg probably, mostly. You should try it :)
On reflection, I think the roadblock I hit was the events stuff, which should be mostly working now.
from sharejs.
Hi Guys,
I hacked around and managed to make it work but had to make a couple changes to the source. Luckily subdoc provides the same interface (mostly).
webclient\json.uncompressed.js
Need to make subdoc public
516c462,464
< window.sharejs.SubDoc = SubDoc = (function() {
---
>
> SubDoc = (function() {
webclient\textarea.js
attach "attach_textarea" to subdoc
23c22,23
< window.sharejs.SubDoc.prototype.attach_textarea = window.sharejs.Doc.prototype.attach_textarea = function(elem) {
---
>
> window.sharejs.Doc.prototype.attach_textarea = function(elem) {
26c26
< elem.value = this.getText();//snapshot;
---
> elem.value = this.snapshot;
Example use:
var el = $('input')[0];
var key = ['list', 0, 'title'];
var foo = doc.at(key);
if (foo) {
foo.attach_textarea(el);
}
from sharejs.
Can you make a pull request?
@nornagon - can you review it?
from sharejs.
This has been merged and seems to work fine for attach_textarea, too.
from sharejs.
Are we sure this works? In testing:
doc.at('editor').attach_ace(editor);
I get
TypeError: Cannot read property 'text' of undefined
at e.attach_ace (http://vm.vincentwoo.com:5000/share/ace.js:42:23)
at http://vm.vincentwoo.com:5000/:60:24
at exports.Doc (http://vm.vincentwoo.com:5000/share/share.uncompressed.js:1008:18)
at Connection.makeDoc (http://vm.vincentwoo.com:5000/share/share.uncompressed.js:891:16)
at Doc.open._openCallback (http://vm.vincentwoo.com:5000/share/share.uncompressed.js:752:49)
at Doc._onMessage (http://vm.vincentwoo.com:5000/share/share.uncompressed.js:596:64)
at Connection.socket.onmessage (http://vm.vincentwoo.com:5000/share/share.uncompressed.js:821:38)
at ce.c.channelHandleArray (http://vm.vincentwoo.com:5000/channel/bcsocket.js:91:346)
at Kd.t.Nb (http://vm.vincentwoo.com:5000/channel/bcsocket.js:81:351)
at uc (http://vm.vincentwoo.com:5000/channel/bcsocket.js:45:213)
and if I change the invocation to doc.at('editor').doc.attach_ace(editor);
Error: Only text documents can be attached to ace
at Doc.attach_ace (http://vm.vincentwoo.com:5000/share/ace.js:43:13)
at http://vm.vincentwoo.com:5000/:60:28
at exports.Doc (http://vm.vincentwoo.com:5000/share/share.uncompressed.js:1008:18)
at Connection.makeDoc (http://vm.vincentwoo.com:5000/share/share.uncompressed.js:891:16)
at Doc.open._openCallback (http://vm.vincentwoo.com:5000/share/share.uncompressed.js:752:49)
at Doc._onMessage (http://vm.vincentwoo.com:5000/share/share.uncompressed.js:596:64)
at Connection.socket.onmessage (http://vm.vincentwoo.com:5000/share/share.uncompressed.js:821:38)
at ce.c.channelHandleArray (http://vm.vincentwoo.com:5000/channel/bcsocket.js:91:346)
at Kd.t.Nb (http://vm.vincentwoo.com:5000/channel/bcsocket.js:81:351)
at uc (http://vm.vincentwoo.com:5000/channel/bcsocket.js:45:213)
from sharejs.
Related Issues (20)
- Serialization of custom OT types HOT 2
- 'createSubscribeQuery' only works when share is connected under WebSockets
- Main Example HOT 1
- Will encrypting operations ever be supported
- Issues with resubscribed docs removed HOT 1
- http://sharejs.org/ is down? HOT 3
- How to inform the client when init a `doc` that whether the `doc` exists or not?
- Linear performance issues with larger number of operations submitted
- Sharejs.org Demo Site Not Live HOT 2
- Require ShareJS with Browserify, cannot find module 'ot-json0' HOT 1
- Authorization with latest ShareJS
- Project status HOT 5
- Multiple Documents using sharejs HOT 1
- Is it possible to run ShareJS in a multi clustered environment ?
- Issue in ShareJS Codemirror editor
- Postgres for backend store
- What is the current status?
- Error: `make` failed with exit code: 2 HOT 2
- Cannot read property 'handle' of undefined HOT 1
- please delete
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharejs.