From 05d9cb60fc9ba917de98e96292695739da657ac6 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Thu, 12 Jul 2012 16:58:49 +0100 Subject: [PATCH] Passed host wiki to saver constructors --- core/modules/savers/download.js | 3 ++- core/modules/savers/firefox.js | 2 +- core/modules/wiki.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/modules/savers/download.js b/core/modules/savers/download.js index 58cc05b20..00999deeb 100644 --- a/core/modules/savers/download.js +++ b/core/modules/savers/download.js @@ -15,7 +15,7 @@ Handles saving changes via HTML5's download APIs /* Select the appropriate saver module and set it up */ -var DownloadSaver = function() { +var DownloadSaver = function(wiki) { }; DownloadSaver.prototype.save = function(text) { @@ -28,6 +28,7 @@ DownloadSaver.prototype.save = function(text) { link.setAttribute("download","tiddlywiki.html"); } link.click(); + return true; }; /* diff --git a/core/modules/savers/firefox.js b/core/modules/savers/firefox.js index d43c3e680..12ea68a2e 100644 --- a/core/modules/savers/firefox.js +++ b/core/modules/savers/firefox.js @@ -12,7 +12,7 @@ Handles saving changes via Firefox's XUL APIs /*global $tw: false */ "use strict"; -var FirefoxSaver = function() { +var FirefoxSaver = function(wiki) { }; FirefoxSaver.prototype.save = function(text) { diff --git a/core/modules/wiki.js b/core/modules/wiki.js index 76fde42f7..8a73cb409 100644 --- a/core/modules/wiki.js +++ b/core/modules/wiki.js @@ -488,7 +488,7 @@ exports.initSavers = function(moduleType) { for(var t=0; t<$tw.plugins.moduleTypes[moduleType].length; t++) { var saver = $tw.plugins.moduleTypes[moduleType][t]; if(saver.canSave()) { - this.savers.push(saver.create()); + this.savers.push(saver.create(this)); } } // Sort the savers into priority order