Hi Andreas
>
> Changed it to "indexeddb", the output of a demo edition (indexeddbdemo) is
> uploaded here, still need to improve the layout a bit:
>
> http://tw5-dev.cibm.de/
>
Looks great, thank you.
> I had two suggestions, which you may well have thought of too.
>>
>> Firstly, I wondered about hashing the URL of the TiddlyWiki file into the
>> database name, to make it easier to work with multiple file:// wikis at
>> once. Perhaps we'd need some clever trick to cope with files being renamed
>> or moved.
>>
>
> Absolutely, I already thought about that as well. I would go for adding
> different object stores, which is the layer just below database, because
> there currently doesn't seem to be a standard way to enumerate databases,
> whereas there is one to enumerate object stores within a database. I think
> we could also build one additional object store which acts like a
> catalogue, meaning it lists all the hashes and filenames etc.
>
Yes, that makes sense.
> So to cope with renaming the not-so-clever way could be to ask the user to
> pick the right hash by displaying a list of the previous URLs in a config
> tiddler, so we can move the DB to the new hash. Well, I'd prefer something
> more clever, but the problem is we would need to keep some information
> within the html file and we can't rely on that in my opinion. Perhaps an
> option would be to hash the whole DOM or something like that, but that
> wouldn't work well when starting from the same files, as they would produce
> the same hash and wouldn't be changed as everything is synced to IndexedDB.
> What's your opinion on that? I think in any case we would need the
> not-so-clever approach as a robust alternative to whatever could be a
> clever trick.
>
I agree that letting the user pick from a list is reasonable. There are
privacy concerns with leaving tiddler text in the browser - I wondered
about encrypting the data in IndexedDB using SJCL, but of course the
practicalities of managing passwords is pretty hairy.
> Secondly, I wondered whether at startup the plugin might delete any
>> tiddlers in the indexedDB store that precisely match tiddlers that were
>> loaded from the HTML file at startup. That way, during repeated saves and
>> reloads we'd avoid building up unneeded tiddlers in the indexedDB database.
>>
>
> I didn't think about that yet. IndexedDB is supposed to be able to hold a
> huge amount of objects, on the other hand there are quotas, which are
> unfortunately inconsistent across the different browser. I liked the idea
> to take an empty file and have all my tiddlers displayed back from
> indexedDB. On the other hand you are right, if we have them already in a
> backup-file, which we open, there is no need to store them in indexedDB any
> longer. So indexedDB would serve as an intermediary storage and the manual
> backups would be the durable storage.
> I would have to dig through some core code I guess, cause I did just pay
> attention to syncer.js and the plugin system so far, if you had a hint
> where to start to get a list of all tiddlers from the file I'd appreciate
> that. Would be to bad if I deleted the wrong tiddlers ;-)
>
You'll need to add a startup module that is marked to just run in the
browser. It can enumerate the tiddlers in the store with something like:
$tw.wiki.each(function(tiddler,title) {dostuff;});
Sorry to load you up with extra work!
Best wishes
Jeremy.
>
> Cheers
> Andreas
>
>
--
Jeremy Ruston
mailto:[email protected]
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.