-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify TiddlyWiki extension interface for file access #396
Comments
I'd like to add:
|
I'll add some notes on TiddlySaver soon, but am wondering: HTML5 file APIs are currently asynchronous (there is a synchronous definition but current browsers don't implement it). TiddlySaver is currently inherently synchronous as is the TWC code. Should we imagine a future for TiddlySaver (in terms of whitelisting) that has both a synchronous and an asynchronous version? (That is: separate TWC and TW5 versions.) If so we can leave things much as they are for a TWC TiddlySaver version except for adding a whitelist feature. |
The new JavaScript APIs should be async. We'll need to use several techniques to work with the existing synchronous TWC API:
To answer your implied question, as to whether we're talking about a refactoring of the existing TiddlySaver code, or a completely new beast: I'd really like to retain compatbility with TWC. |
If I'm reading you correctly TiddlyFox will change to an async loadFile() for the future HTML5-like API and keep a sync interface for backward compatibility, and TiddlySaver should do the same. I've only been able to get local XMLHttpRequest file loading working with Firefox; the others restrict local file loading according to everything I've read and tried (though I just found something I'll try out some time). I imagine FF will restrict access at some point too, though this won't affect TiddlyFox's elevated privileges. (I don't see the need to implement XMLHttpRequest in Java if that's what you meant; the current methods could be implemented both ways, I think.) |
Unlike TWC, TW5 doesn't need to load the file before saving it; TW5 can generate the entire source file (it's a true quine!). So the new interface can focus on saving (and handling backups etc). So, it probably makes sense to just keep the loadFile() call in TiddlySaver for TWC. |
Thanks Jeremy -- I had to remind myself what a quine was (I so miss university days!). Once again I look forward to getting a chance to go through the code for TW5. |
The single file configuration of TiddlyWiki cannot directly access files. In response to a request to save changes it just uses standard HTML5 features to download a fresh copy of the file. The new file will not overwrite the existing file without manual intervention.
A variety of extensions exist on different platforms to give TiddlyWiki the capability of accessing the file system directly:
The goal is to unify these disparate extensions so that:
The text was updated successfully, but these errors were encountered: