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 failOk: true, 21 load: dojo.hitch( this, function(o) { this.loadSuccess(o, url); }), 22 error: dojo.hitch( this, function(o) { this.loadFail(o, url); }) 23 }); 24 }; 25 26 Store.prototype.setLoaded = function() { 27 this.loaded = true; 28 this.hideAll(); 29 this.changed(); 30 }; 31 32 33 Store.prototype.hideAll = function() { 34 }; 35 36 37 Store.prototype.changed = function() { 38 }; 39