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