DownloadTiddlyWikiPlugin

/***

Name: DownloadTiddlyWikiPlugin
Description: Download TiddlyWiki according to browser type
Version: 0.0.9
Date: Jul 18, 2012
Source: http://www.tiddlywiki.com/#DownloadTiddlyWikiPlugin
License: BSD open source license
~CoreVersion: 2.4.1
      • /

//{{{
if(!version.extensions.DownloadTiddlyWikiPlugin) {
version.extensions.DownloadTiddlyWikiPlugin = {installed:true};

config.macros.download = {};

merge(config.macros.download,{
label: "download",
prompt: "Download TiddlyWiki",
className: "chunkyButton"});

config.macros.download.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
var span = createTiddlyElement(place,"span",null,this.className);
createTiddlyButton(span,params[0]||this.label,params[1]||this.prompt,this.onClick);
};

config.macros.download.onClick = function(ev)
{
// display the tiddler containing the instructions
var e = ev || window.event;
var title = "Downloading";
var url = 'empty.zip';
if(config.browser.isOpera || config.browser.isWindows) {
story.displayTiddler(target,title);
window.setTimeout(function() {document.location.href = url;},300);
} else {
// put an iframe in the target instructions tiddler to start the download
var html = '