dokieli icon indicating copy to clipboard operation
dokieli copied to clipboard

Start new article by postponing the actual naming and saving

Open csarven opened this issue 9 years ago • 3 comments

Raised by @bigbluehat

Currently when "New" is triggered user is asked to enter a location where the new article will be stored. Can we postpone the naming until user commits to saving? One option:

as in only keep it in localStorage/offline some place and (re)name it later (using a UUID or something for the article in the interim)

csarven avatar Oct 12 '16 19:10 csarven

I'd actually recommend using http://pouchdb.com/ over something "raw" like localStorage. PouchDB doesn't care if it stores JSON-LD or "just" JSON, and it also keeps attachements (images, etc), so you're all prepped and ready for storing All The Things.

When you're ready to persist them on the Web someplace, PUT it there +/- removing (or syncing) the offline copy. That's the idea anyhow. 😄

🎩

BigBlueHat avatar Oct 12 '16 19:10 BigBlueHat

Wouldn't localStorage suffice? Right now I can't think of doing anything more than RW an 'html' key with the result of DO.U.getDocument() - a normalised HTML string.. same as what comes out in "Export"/"Save"/"Save As". Smallest footprint.

The URI bit interests me quite a bit. Would the idea be to change the window history state to the "temp" / while in "new". Would an URN or a data URI will do? Right now there is /new (which is a skeleton HTML more or less) but that's not really reliable since it is not likely to be there for anything beyond what comes with dokieli on the root directory (and if publicly available).

Beyond this issue is getting https://github.com/linkeddata/dokieli/issues/110 working so that 'new' is actually usable.

csarven avatar Oct 12 '16 20:10 csarven

I'd vote for something like urn:uuid: https://tools.ietf.org/html/rfc4122 and depending on how things are setup in the code you could do something like /new#uri=urn:uuid:{uuid} to load it out of localStorage. Once it's stored some place else, you could keep that URL in localStorage (perhaps), so that any later attempt to revisit the localStorage copy (the urn:uuid: one) could/would redirect/load the "permanent" one.

Maybe. :wink:

BigBlueHat avatar Oct 12 '16 20:10 BigBlueHat