Live data from Hacker News

A collaborative spreadsheet in less than 45 lines of JS, one library used

jsfiddle.net

21–30 of 69 posts

Re: A collaborative spreadsheet in less than 45 lines of JS, one library used

#21
post #10

I like the craziness that this devolved into. It's funny when a bunch of people are all editing like mad. I had the thought that it'd be fun to have a contest using jsfiddle to start from some point, like the excel (lite) clone in 30 lines, and add the best/coolest feature in some limit of lines. It's really wonderful how ingenuity stacks.

Such hax.

I wonder if a collaborative drawing app could be made with this, using canvas.. I keep trying to figure out exactly how it works but then sparkleponies and alerts everywhere...

Re: A collaborative spreadsheet in less than 45 lines of JS, one library used

#22
post #2

Sweet. How do you do I make it so not every Joe can hack the sheet?

You'd have to parse the cells as some sort of DSL that only allows mathematical tokens, as opposed to eval which allows access to the full arsenal of the JS language. But I think excel is Turing complete

Brings up the interesting question -- I wonder what turing-complete DSLs have drop-in JS libraries you could use to replace the call to "eval" here.

Re: A collaborative spreadsheet in less than 45 lines of JS, one library used

#24
post #20

Collaborative eval with the world, I'm glad I wasn't logged into jsfiddle when I opened that.

Since jsFiddles run user-generated code by design, I hope that they correctly sandbox and use HTTP-only cookies anyway.

Re: A collaborative spreadsheet in less than 45 lines of JS, one library used

#25
post #20

Collaborative eval with the world, I'm glad I wasn't logged into jsfiddle when I opened that.

Since jsFiddles run user-generated code by design, I hope that they correctly sandbox and use HTTP-only cookies anyway.

That's a great point. A restricted iframe on a separate domain + httpOnly session cookies just to be safe would do it.

Re: A collaborative spreadsheet in less than 45 lines of JS, one library used

#27
post #11
post #9

It would be nice if people could lay off the script injections. It's clearly insecure, but that's not really the point. It makes the experience worse for everyone if you alert(), etc.

yup. I guess some couldn't resist the urge. I hope there aren't more malicious minds, trying to steal cookies or stuff.

Almost certainly someone is stealing cookies and this should be taken down soon. However, I actually enjoyed this post and was really informative all around.

Re: A collaborative spreadsheet in less than 45 lines of JS, one library used

#30
post #27
post #11

Earlier quoted context omitted.

yup. I guess some couldn't resist the urge. I hope there aren't more malicious minds, trying to steal cookies or stuff.

Almost certainly someone is stealing cookies and this should be taken down soon. However, I actually enjoyed this post and was really informative all around.

Fiddles run unsecure code by design, so they do in a separate domain.
Post reply on HN