1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-28 15:08:46 +00:00

Remove invokeSyncers() method from wiki.js

This commit is contained in:
Jeremy Ruston 2013-03-16 10:58:47 +00:00
parent 854e8d7083
commit 71aa79013d
3 changed files with 10 additions and 23 deletions

View File

@ -62,13 +62,6 @@ exports.startup = function() {
document.addEventListener("tw-modal",function(event) {
$tw.modal.display(event.param);
},false);
// Install the syncer message mechanism
document.addEventListener("tw-login",function(event) {
$tw.wiki.invokeSyncers("handleLoginEvent",event);
},false);
document.addEventListener("tw-logout",function(event) {
$tw.wiki.invokeSyncers("handleLogoutEvent",event);
},false);
// Install the scroller
$tw.pageScroller = new $tw.utils.PageScroller();
document.addEventListener("tw-scroll",$tw.pageScroller,false);

View File

@ -602,19 +602,6 @@ exports.initSyncers = function() {
});
};
/*
Invoke all the active syncers
*/
exports.invokeSyncers = function(method /* ,args */) {
var args = Array.prototype.slice.call(arguments,1);
for(var name in this.syncers) {
var syncer = this.syncers[name];
if(syncer[method]) {
syncer[method].apply(syncer,args);
}
}
};
/*
Trigger a load for a tiddler if it is skinny. Returns the text, or undefined if the tiddler is missing, null if the tiddler is being lazily loaded.
*/

View File

@ -91,9 +91,15 @@ var TiddlyWebSyncer = function(options) {
});
// Listen out for lazyLoad events
this.wiki.addEventListener("lazyLoad",function(title) {
self.lazyLoad(title);
self.handleLazyLoadEvent(title);
});
this.log("Initialising with host:",this.host);
// Listen our for login/logout events
document.addEventListener("tw-login",function(event) {
self.handleLoginEvent(event);
},false);
document.addEventListener("tw-logout",function(event) {
self.handleLogoutEvent(event);
},false);
// Get the login status
this.getStatus(function (err,isLoggedIn,json) {
if(isLoggedIn) {
@ -101,6 +107,7 @@ var TiddlyWebSyncer = function(options) {
self.syncFromServer();
}
});
this.log("Initialising with host:",this.host);
};
TiddlyWebSyncer.titleIsLoggedIn = "$:/plugins/tiddlyweb/IsLoggedIn";
@ -130,7 +137,7 @@ TiddlyWebSyncer.prototype.log = function(/* arguments */) {
/*
Lazily load a skinny tiddler if we can
*/
TiddlyWebSyncer.prototype.lazyLoad = function(title) {
TiddlyWebSyncer.prototype.handleLazyLoadEvent = function(title) {
// Queue up a sync task to load this tiddler
this.enqueueSyncTask({
type: "load",