Some wishful refactoring thinking about Saving.js and Filesystem.js

11 views
Skip to first unread message

David

unread,
Jun 26, 2009, 1:40:24 PM6/26/09
to TiddlyWiki
I'm using tiddlywiki's browser-independent file interface to load/save
files for a javascript application I'm writing (and will soon share to
the tiddlywiki list). Overall I've found it very easy and useful.
There's one small rought spot, however. I use tiddlywiki's
getLocalPath method (from Saving.js) to generate an appropriate
filename. While getLocalPath seems very generic and useful, it is
entangled in the broader tiddlywiki codebase in two ways. First, it
is in Saving.js which is devoted to thinking about tiddlers and the
tiddlywiki-specific file format. Second, its first line makes a
reference to config.options, which is part of the Config.js file,
which is full of lots of tiddlywiki-specific stuff. As a result, I
choose to copy getLocalPath our of Saving.js and modify the first line
to omit needing to load all of Saving.js and config.js and whatever
they depend on.

Given that pathname computation seems a highly useful and general
mechanism that is relevant to saving any file, not just tiddlywikis,
it would seem natural to me to make some version of getLocalPath a
part of your lower-level file load/save mechanism, which seems lately
to be migrating into http://svn.tiddlywiki.org/Trunk/core/jquery/plugins/jQuery.twFile.js
.

Thanks for reading. I'd certainly welcome any feedback, but won't be
upset if I don't get any.
-David Karger

wolfgang

unread,
Jun 26, 2009, 2:21:43 PM6/26/09
to TiddlyWiki
> I'm using tiddlywiki's browser-independent file interface to load/save
> files for a javascript application I'm writing (and will soon share to
> the tiddlywiki list).
>

Would you like to describe this application a bid more?

regards..

FND

unread,
Jun 29, 2009, 1:58:29 AM6/29/09
to Tiddl...@googlegroups.com
N.B.:
Strictly development-related issues are better discussed on the dev group:
http://groups.google.com/group/TiddlyWikiDev/
You're more likely to get competent help there.

> I'm using tiddlywiki's browser-independent file interface to load/save
> files for a javascript application I'm writing

Great, we're always excited to see TiddlyWiki code being reused!

> While getLocalPath seems very generic and useful, it is entangled
> in the broader tiddlywiki codebase

Indeed. I'm hoping we'll eventually create an extension to $.twFile
which provides the self-saving capabilities without TiddlyWiki-specific
dependencies. I've raised a ticket:
http://trac.tiddlywiki.org/ticket/1086
Any help would be most welcome.


-- F.

Reply all
Reply to author
Forward
0 new messages