Commit 61fab8f7 authored by Marc Duez's avatar Marc Duez
Browse files

model.js : debug parsejson from url

parent 67744b02
......@@ -154,13 +154,7 @@ Model.prototype = {
oFReader.readAsText(oFile);
oFReader.onload = function (oFREvent) {
try {
var data = jQuery.parseJSON(oFREvent.target.result)
} catch (e) {
myConsole.popupMsg(myConsole.msg.file_error);
return 0
}
self.parseJsonData(data, limit)
self.parseJsonData(oFREvent.target.result, limit)
.loadGermline()
.loadAnalysis(analysis);
self.dataFileName = document.getElementById(id)
......@@ -224,7 +218,16 @@ Model.prototype = {
this.dataCluster = []
this.clusters = []
console.log(data)
if (typeof data == "string") {
var json_text = data
try {
var data = jQuery.parseJSON(json_text)
} catch (e) {
myConsole.popupMsg(myConsole.msg.file_error);
return 0
}
}
if ((typeof (data.vidjil_json_version) == 'undefined') || (data.vidjil_json_version < VIDJIL_JSON_VERSION)) {
myConsole.popupMsg(myConsole.msg.version_error);
return 0;
......
......@@ -30,7 +30,7 @@ import datetime
from operator import itemgetter
VIDJIL_JSON_VERSION = "2014.09"
VIDJIL_JSON_VERSION = "2014.10"
GERMLINES_ORDER = ['TRA', 'TRB', 'TRG', 'TRD', 'DD', 'IGH', 'DHJH', 'IJK', 'IJL']
......
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