josephernest / bigpicture.js

bigpicture.js is a Javascript library that allows infinite panning and infinite zooming in HTML pages.
https://josephernest.github.io/bigpicture.js/index.html
MIT License
809 stars 58 forks source link

How do we save things? #16

Closed sg-s closed 9 years ago

sg-s commented 9 years ago

I see there's a save feature on `bigpicture.bi, but this is not there in the main repo.

josephernest commented 9 years ago

Hi @sg-s . In order to keep things simple, this library bigpicture.js only contains the "core" : infinite zooming, panning, etc. All the rest (saving, etc.) is not in it.

So http://www.bigpicture.bi uses bigpicture.js + some other code (PHP, etc.) to save data on the server.

In order to add save feature, you need to add a server + database, etc. , as it's impossible to silently save a file to disk with JavaScript only.

What are you looking for? I can probably help you to find the right tool to choose.

sg-s commented 9 years ago

Hi. thanks for the reply! bigpicture.js is the best white-boarding solution I've seen to date, and the only thing missing preventing me form using it is the ability to save things. I have a server running PHP, mySQL, node, etc. so any solution you suggest would work for me. my ideal solution would be something like bigpicture.bi -- in fact, it's perfect, except for the fact that I can't host it on my own server.

  1. Do you have any plans for releasing the backend running bigpicture.bi?
  2. If not, could you point me in the right direction to get a minimal solution to what you have on bigpicture.bi? thanks!
josephernest commented 9 years ago

Thanks @sg-s for these nice comments! Yes I have really designed this tool primarily for my own whiteboard-writing needs...

  1. In fact bigpicture.bi 's backend is not ready to be released (I would need some more cleaning / documentation work to make it portable to any other server) but haven't time to do this soon
  2. Minimal solution for saving : a) In the JS code, attach a keyboard shortcut for "Save" such as CTRL+S, b) when "Save" is launched (see http://bigpicture.bi/bigpicture.nonminified.js, line 380), do some ajax query to /php/save.php on your server, and send the full content of textbox container serialized with new XMLSerializer().serializeToString(document.getElementById("containername")) c) in the php code of save.php, save it to disk on the server... d) on the loading of your main whiteboard page, load from disk with php
sg-s commented 9 years ago

thanks! that helps!