1 /** 2 * Base class for all JBrowse data stores. 3 * @class 4 */ 5 6 function Store( args ) { 7 }; 8 9 Store.prototype.loadSuccess = function( data, url ) { 10 }; 11 12 Store.prototype.loadFail = function(error) { 13 this.empty = true; 14 this.setLoaded(); 15 }; 16 17 Store.prototype.load = function(url) { 18 dojo.xhrGet({ url: url || this.url, 19 handleAs: "json", 20 load: dojo.hitch( this, function(o) { this.loadSuccess(o, url); }), 21 error: dojo.hitch( this, function(o) { this.loadFail(o, url); }) 22 }); 23 }; 24 25 Store.prototype.setLoaded = function() { 26 this.loaded = true; 27 this.hideAll(); 28 this.changed(); 29 }; 30 31 32 Store.prototype.hideAll = function() { 33 }; 34 35 36 Store.prototype.changed = function() { 37 }; 38