Earlier quoted context omitted.
Basically on keyup I ship the whole contents of the editor and the cursor position to firebase. I'm also keeping track of all the active connections to a scratchpad document so I know who is typing. Anytime the code changes on the server, it triggers a callback function on each client that will update the contents of the textarea. If someone else is typing, the document is locked so only 1 person can type at a time.…
Do you know what/how Firebase is doing the realtime updates? Websockets with fallback to flash?
Show HN: Scratchpad.io - a real-time HTML and CSS editor
31–40 of 89 posts
Re: Show HN: Scratchpad.io - a real-time HTML and CSS editor
#32Earlier quoted context omitted.
Basically on keyup I ship the whole contents of the editor and the cursor position to firebase. I'm also keeping track of all the active connections to a scratchpad document so I know who is typing. Anytime the code changes on the server, it triggers a callback function on each client that will update the contents of the textarea. If someone else is typing, the document is locked so only 1 person can type at a time.…
OT (See: http://en.wikipedia.org/wiki/Operational_transformation ) is one of the technology solutions to the problem that you've solved through a locking mechanism. Not sure what server architecture you're using, but in Node.js there is a pretty amazing package that integrates with ACE called ShareJS ( http://sharejs.org/ ). Have you experimented with synchronizing cursors at all?
When you say synchronizing cursors, do you mean having multiple cursors (google docs style) or having a single cursor be in the same position for all clients? We are doing the latter, and I wasn't aware it was possible to do the former with ace but I would love to do it if I can
Re: Show HN: Scratchpad.io - a real-time HTML and CSS editor
#33Bug:
Open the about panel by clicking the icon in top left (three horizontal bars). Close the panel by clicking the same icon.
Maximize the preview window by clicking the arrow in the top right of the edit panel. Click the arrow to view the code panel again.
The about panel pops out as well and the arrow button covers the show/hide about (three horizontal bars) button. Expected behavior: it should return to the view that I had before maximizing.
Re: Show HN: Scratchpad.io - a real-time HTML and CSS editor
#34Pretty nice, I'll probably be using this for debugging and examples. Bug: Open the about panel by clicking the icon in top left (three horizontal bars). Close the panel by clicking the same icon. Maximize the preview window by clicking the arrow in the top right of the edit panel. Click the arrow to view the code panel again. The about panel pops out as well and the arrow button covers the show/hide about (three hori…
Re: Show HN: Scratchpad.io - a real-time HTML and CSS editor
#35Other commenters have pointed out a myriad of similar such services. I'm surprised Codepen hasn't come up already.
@brycecolquitt, you are obviously very talented, and I look forward to whatever you come up with in the future. I just hope it's not in a space as hotly contested as this.
Re: Show HN: Scratchpad.io - a real-time HTML and CSS editor
#36Re: Show HN: Scratchpad.io - a real-time HTML and CSS editor
#37I don't wanna down a nice looking project, very well done on the interface but, another one? There are already like 7+ of these I don't really see the need to produce another one especially one that is HTML+CSS only when many of the others feature JavaScript and more. What features do you provide that say, http://jsfiddle.net/ , http://cssdesk.com/ , http://dabblet.com/ , http://rendera.heroku.com/ , doesn't? (Just t…
Re: Show HN: Scratchpad.io - a real-time HTML and CSS editor
#38Earlier quoted context omitted.
Basically on keyup I ship the whole contents of the editor and the cursor position to firebase. I'm also keeping track of all the active connections to a scratchpad document so I know who is typing. Anytime the code changes on the server, it triggers a callback function on each client that will update the contents of the textarea. If someone else is typing, the document is locked so only 1 person can type at a time.…
Do you know what/how Firebase is doing the realtime updates? Websockets with fallback to flash?
We use a mix of different methods to maintain a connection. We normally start with our custom long polling implementation and move to websockets when they are available. We do not currently make use of any flash sockets.
Re: Show HN: Scratchpad.io - a real-time HTML and CSS editor
#39Earlier quoted context omitted.
How did you accomplish the real-time text editing? Is there any OT engine that you hacked into Firebase?
Basically on keyup I ship the whole contents of the editor and the cursor position to firebase. I'm also keeping track of all the active connections to a scratchpad document so I know who is typing. Anytime the code changes on the server, it triggers a callback function on each client that will update the contents of the textarea. If someone else is typing, the document is locked so only 1 person can type at a time.…
ACE is quite ridiculously powerful. On its primary implementation (http://c9.io), it supports multiple cursors with concurrent editing.
I've been able to use ShareJS to get concurrent editing working (see: http://plnkr.co/edit/?p=preview&s=HN4933608) but haven't had a chance to display visual cursors for all simultaneous users. I was thinking that I could get that working using Firebase.
Re: Show HN: Scratchpad.io - a real-time HTML and CSS editor
#40Not to detract from what is a pretty cool project, and I hope OP had fun making it, but: http://codepen.io is this and quite a bit more. It supports HTML+JS+CSS as well as e.g. Jade, SASS and CoffeeScript- if that's what floats your boat- and some nice social features, like featured pens and saving to Gists. Other commenters have pointed out a myriad of similar such services. I'm surprised Codepen hasn't come up alre…
I'm not sure if codepen supports the realtime google-docs-style collaboration, either, which Scratchpad is good for. It's simple product with no superfluous features.