Rejigging syncer structuring

The goal is to separate out the saver handling from the syncadaptor
handling; it will take a few steps to get there
This commit is contained in:
Jermolene
2014-08-14 11:12:25 +01:00
parent 82860aea33
commit 27f1f82a70
5 changed files with 40 additions and 28 deletions
+10 -1
View File
@@ -62,8 +62,17 @@ exports.startup = function() {
document: document
});
}
// Find a working syncadaptor
$tw.syncadaptor = undefined;
$tw.modules.forEachModuleOfType("syncadaptor",function(title,module) {
if(!$tw.syncadaptor && module.adaptorClass) {
$tw.syncadaptor = new module.adaptorClass({wiki: $tw.wiki});
}
});
// Set up the syncer object
$tw.syncer = new $tw.Syncer({wiki: $tw.wiki});
if($tw.syncadaptor) {
$tw.syncer = new $tw.Syncer({wiki: $tw.wiki, syncadaptor: $tw.syncadaptor});
}
// Host-specific startup
if($tw.browser) {
// Install the popup manager