Refactor saver handler

Fixing problems caused by c4b76ceb0b:

* We still need to initialise the saver-handler even when syncing to a
server, otherwise offline snapshots can’t be saved
* We need to override the default save template a bit further up the
stack, to avoid the server side serving the offline version of the wiki
at `/`
This commit is contained in:
Jermolene
2014-08-20 10:02:44 +01:00
parent fbf307c648
commit a105b52399
6 changed files with 43 additions and 30 deletions
+4 -4
View File
@@ -69,12 +69,12 @@ exports.startup = function() {
$tw.syncadaptor = new module.adaptorClass({wiki: $tw.wiki});
}
});
// Set up the syncer object if we've got a syncadaptor, otherwise setup the saverhandler
// Set up the syncer object if we've got a syncadaptor
if($tw.syncadaptor) {
$tw.syncer = new $tw.Syncer({wiki: $tw.wiki, syncadaptor: $tw.syncadaptor});
} else {
$tw.saverHandler = new $tw.SaverHandler({wiki: $tw.wiki});
}
}
// Setup the saver handler
$tw.saverHandler = new $tw.SaverHandler({wiki: $tw.wiki, dirtyTracking: !$tw.syncadaptor});
// Host-specific startup
if($tw.browser) {
// Install the popup manager