Commit 56b44b57 authored by Marc Duez's avatar Marc Duez
Browse files

germline_builder : add germlineList object > ajax loader for germlines.data

parent 8bee7be3
......@@ -17,6 +17,47 @@
* along with "Vidjil". If not, see <http://www.gnu.org/licenses/>
*/
function GermlineList () {
this.init()
}
GermlineList.prototype = {
init : function () {
this.load();
},
//load germlines.data file from server
load : function () {
var self=this;
$.ajax({
url: window.location.origin + "/germline/germlines.data",
success: function (result) {
try {
//remove comment
var json = result.replace(/ *\/\/[^\n]*\n */g , "")
json = json.replace("germlines = " , "")
self.list = jQuery.parseJSON(json);
}
catch(err){
myConsole.flash("server : germlines.data malformed");
}
},
error: function (request, status, error) {
myConsole.flash("server : error impossible to retrieve germlines.data");
},
dataType: "text"
});
},
//add a list of custom germlines
add : function () {
}
}
function Germline (model) {
this.m = model
}
......
......@@ -58,6 +58,7 @@ function Model() {
this.view = [];
this.reset();
this.checkBrowser();
this.germlineList = new GermlineList()
}
......@@ -79,7 +80,6 @@ Model.prototype = {
this.isPlaying = false;
this.clusters = [];
this.clones = [];
this.germline = {}
this.germlineV = new Germline(this)
this.germlineD = new Germline(this)
this.germlineJ = new Germline(this)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment