Over the past few weeks I've been exploring the free, open source, personal, portable, browser-based wiki system called TiddlyWiki, one of the most brilliant ideas I've seen for a long time. (I just discovered that some people call these types of applications
"single page applications", or SPAs, and Google Code features a page dedicated to them.
Last week I discussed two of the five key TiddlyWiki components (macros and plugins), so we have just one more cover, cookies.
Browser cookies, as we all know, are small data files that are uploaded and downloaded to and from Web sites to store persistent
site-specific information.
In the case of TiddlyWiki, cookies store configuration details, such as the wiki author's name and where backup files are
located, so they can be used across multiple local browser sessions.
While this data could be stored in a tiddler (a page or document) it would mean that someone else using a copy of that TiddlyWiki
would, erroneously, inherit the original author's configuration details.
The way that TiddlyWiki uses cookies when run locally reveals an interesting technical detail: The cookies use file URIs (as
opposed to the usual http URIs). Cookies with file URIs are supported by most modern browsers but are not well documented
and it's worth noting that the Google Chrome browser doesn't support them. (According to the Google Code page on SPAs there are good technical reasons for this limitation.)
Now that we have most of the important parts of TiddlyWiki covered we can look at the bigger context of these systems. As
I explained two weeks ago, many TiddlyWikis are available online. If you want to use their content – which might be macros
and plugins as well as text-based – rather than copy the content using cut and paste, you can import content from them.
In your TiddlyWiki (or mine on Tiddlyspot) you'll notice at the top right-hand corner of the user interface a link labeled "backstage". Click on the link and a menu
will open across the top of the display offering you a number of system management options.
One of these options is "import". You'll find that trying to import tiddlers into an online TiddlyWiki won't work because
of the limitations imposed by the "same origin" policy used by most JavaScript implementations (this prevents cross-site scripting). If you try the same operation, importing from an online or offline TiddlyWiki into a local TiddlyWiki, it will work fine
as the policy doesn't apply to scripts and content loaded from file URIs.
Comment