Move syncer event handlers into syncer module

print-window-tiddler
Jermolene 2014-08-13 20:25:23 +01:00
rodzic 449edf99b5
commit 35fcdd270e
2 zmienionych plików z 21 dodań i 21 usunięć

Wyświetl plik

@ -35,27 +35,6 @@ exports.startup = function() {
$tw.rootWidget.addEventListener("tw-scroll",function(event) {
$tw.pageScroller.handleEvent(event);
});
// Install the save action handlers
$tw.rootWidget.addEventListener("tw-save-wiki",function(event) {
$tw.syncer.saveWiki({
template: event.param,
downloadType: "text/plain"
});
});
$tw.rootWidget.addEventListener("tw-auto-save-wiki",function(event) {
$tw.syncer.saveWiki({
method: "autosave",
template: event.param,
downloadType: "text/plain"
});
});
$tw.rootWidget.addEventListener("tw-download-file",function(event) {
$tw.syncer.saveWiki({
method: "download",
template: event.param,
downloadType: "text/plain"
});
});
var fullscreen = $tw.utils.getFullScreenApis();
if(fullscreen) {
$tw.rootWidget.addEventListener("tw-full-screen",function(event) {

Wyświetl plik

@ -66,6 +66,27 @@ function Syncer(options) {
$tw.rootWidget.addEventListener("tw-server-refresh",function() {
$tw.syncer.handleRefreshEvent();
});
// Install the save action handlers
$tw.rootWidget.addEventListener("tw-save-wiki",function(event) {
$tw.syncer.saveWiki({
template: event.param,
downloadType: "text/plain"
});
});
$tw.rootWidget.addEventListener("tw-auto-save-wiki",function(event) {
$tw.syncer.saveWiki({
method: "autosave",
template: event.param,
downloadType: "text/plain"
});
});
$tw.rootWidget.addEventListener("tw-download-file",function(event) {
$tw.syncer.saveWiki({
method: "download",
template: event.param,
downloadType: "text/plain"
});
});
}
// Listen out for lazyLoad events
if(this.syncadaptor) {