Location: A review of cardiac cellular electrophysiology models @ f954e5918331 / dojo-presentation / js / dojo / dojox / rpc / OfflineRest.js

Author:
David Nickerson <david.nickerson@gmail.com>
Date:
2021-09-16 00:41:19+12:00
Desc:
Updating Noble 1962 model: * Exposing the membrane potential to the top-level model; * adding SED-ML for the paced and pacemaker variants of the model. Using OpenCOR Snapshot release 2021-09-14.
Permanent Source URI:
https://models.fieldml.org/workspace/a1/rawfile/f954e59183314cd37f86c8832dc81317d01c8ec5/dojo-presentation/js/dojo/dojox/rpc/OfflineRest.js

dojo.provide("dojox.rpc.OfflineRest");

dojo.require("dojox.off.offline");
dojo.require("dojox.rpc.LocalStorageRest");

dojox.rpc.OfflineRest = dojo.mixin({
	initialize: function(/*String*/applicationName){
		// summary:
		// 		Sets up an offline Rest application
		//	applicationName: 
		//		You must provide an application to start the OfflineRest
		//	Store:
		//		Any data stores that you are using should be included here
		
		dojox.off.ui.appName = applicationName;
		dojox.off.files.slurp();
		dojox.off.initialize();
	
		var lsr = dojox.rpc.LocalStorageRest;
		dojo.connect(dojox.off.sync, "onSync", this, function(type){
			if(type == "upload"){
				lsr.sendChanges();
			}
			if(type == "download"){
				lsr.downloadChanges(); // FIXME: Do this async?
				dojox.off.sync.finishedDownloading();
			}
		});
	}
},dojox.rpc.LocalStorageRest);