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:
parent
854e8d7083
commit
71aa79013d
@ -62,13 +62,6 @@ exports.startup = function() {
|
|||||||
document.addEventListener("tw-modal",function(event) {
|
document.addEventListener("tw-modal",function(event) {
|
||||||
$tw.modal.display(event.param);
|
$tw.modal.display(event.param);
|
||||||
},false);
|
},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
|
// Install the scroller
|
||||||
$tw.pageScroller = new $tw.utils.PageScroller();
|
$tw.pageScroller = new $tw.utils.PageScroller();
|
||||||
document.addEventListener("tw-scroll",$tw.pageScroller,false);
|
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.
|
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
|
// Listen out for lazyLoad events
|
||||||
this.wiki.addEventListener("lazyLoad",function(title) {
|
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
|
// Get the login status
|
||||||
this.getStatus(function (err,isLoggedIn,json) {
|
this.getStatus(function (err,isLoggedIn,json) {
|
||||||
if(isLoggedIn) {
|
if(isLoggedIn) {
|
||||||
@ -101,6 +107,7 @@ var TiddlyWebSyncer = function(options) {
|
|||||||
self.syncFromServer();
|
self.syncFromServer();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
this.log("Initialising with host:",this.host);
|
||||||
};
|
};
|
||||||
|
|
||||||
TiddlyWebSyncer.titleIsLoggedIn = "$:/plugins/tiddlyweb/IsLoggedIn";
|
TiddlyWebSyncer.titleIsLoggedIn = "$:/plugins/tiddlyweb/IsLoggedIn";
|
||||||
@ -130,7 +137,7 @@ TiddlyWebSyncer.prototype.log = function(/* arguments */) {
|
|||||||
/*
|
/*
|
||||||
Lazily load a skinny tiddler if we can
|
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
|
// Queue up a sync task to load this tiddler
|
||||||
this.enqueueSyncTask({
|
this.enqueueSyncTask({
|
||||||
type: "load",
|
type: "load",
|
||||||
|
Loading…
Reference in New Issue
Block a user