mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-11 18:00:26 +00:00
Remove invokeSyncers() method from wiki.js
This commit is contained in:
parent
854e8d7083
commit
71aa79013d
@ -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);
|
||||
|
@ -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.
|
||||
*/
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user