mirror of
				https://github.com/Jermolene/TiddlyWiki5
				synced 2025-10-31 15:42:59 +00:00 
			
		
		
		
	Move syncer event handlers into syncer module
This commit is contained in:
		| @@ -35,27 +35,6 @@ exports.startup = function() { | |||||||
| 	$tw.rootWidget.addEventListener("tw-scroll",function(event) { | 	$tw.rootWidget.addEventListener("tw-scroll",function(event) { | ||||||
| 		$tw.pageScroller.handleEvent(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(); | 	var fullscreen = $tw.utils.getFullScreenApis(); | ||||||
| 	if(fullscreen) { | 	if(fullscreen) { | ||||||
| 		$tw.rootWidget.addEventListener("tw-full-screen",function(event) { | 		$tw.rootWidget.addEventListener("tw-full-screen",function(event) { | ||||||
|   | |||||||
| @@ -66,6 +66,27 @@ function Syncer(options) { | |||||||
| 		$tw.rootWidget.addEventListener("tw-server-refresh",function() { | 		$tw.rootWidget.addEventListener("tw-server-refresh",function() { | ||||||
| 			$tw.syncer.handleRefreshEvent(); | 			$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 | 	// Listen out for lazyLoad events | ||||||
| 	if(this.syncadaptor) { | 	if(this.syncadaptor) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jermolene
					Jermolene