Sharing

@jorin-vogel let’s get this going again! :)
Before I can edit it, apparently it needs to be rebased and there was a JS error. Can you fix that?


Copying what you said in #19:

Ok, basic, sharing already works.

- [x] Updating of the shared version on change also works in theory however the server gives back a 500 for some reason even if the location is correct. 
Since I use a 5apps account for testing, I were wondering if this maybe is a server bug and not my fault. @skddc any ideas? Do you now anything about this behavior? Did you ever tested updating a stored file ( via storeFile() ) ? Maybe you can test it yourself.
Just checkout the `sharing` branch, login, click the share button, open the shared document, see that it works, make some changes to the document, notice the PUT 500 in the console, see that the PUT location is the same as the working shared document.

- [x] Right now we just use the direct link to the shared file in your storage for sharing. @jancborchardt I'm afraid that I have to disappoint you but I think we have to use this url for sharing and not a litewrite.net/user@host.tld/(id)-title url. Not only we don't have to load any js this way but also we can never guarantee that the litewrite.net url works. The app should be completely independent from any url and even work when you run litewrite on localhost.

- [ ] We need some styling for the share button. @jancborchardt can you handle this?

- [ ] The shared document should be styled too. All the styles should fit into one file. No external files (like stylesheets or images) should be necessary. The document should look exactly like the editable version. 
The shared document can be styled in [templates/share.html](https://github.com/litewrite/litewrite/blob/sharing/src/templates/share.html). @jancborchardt would be awesome if you can check that out.

- [x] One more thing is that the share button should only be visibily if the user is logged in. I know that there is a `disconnect`event. @nilclass is there also a `connect` event or some other way to get notified as soon as a user is connected?