Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Commit

Permalink
Merge branch 'Issue-#1870' of https://github.com/mjshepherd/phenotips
Browse files Browse the repository at this point in the history
  • Loading branch information
sdumitriu committed Sep 27, 2015
2 parents c97bab6 + 5f85071 commit a81720e
Show file tree
Hide file tree
Showing 64 changed files with 21,911 additions and 21,532 deletions.
1,279 changes: 642 additions & 637 deletions components/pedigree/resources/src/main/resources/pedigree/controller.js

Large diffs are not rendered by default.

105 changes: 55 additions & 50 deletions components/pedigree/resources/src/main/resources/pedigree/disorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,62 +5,67 @@
* @param disorderID the id number for the disorder, taken from the OMIM database
* @param name a string representing the name of the disorder e.g. "Down Syndrome"
*/
define([
"pedigree/model/helpers"
], function(
Helpers
){
var Disorder = Class.create( {

var Disorder = Class.create( {
initialize: function(disorderID, name, callWhenReady) {
// user-defined disorders
if (name == null && !Helpers.isInt(disorderID)) {
name = disorderID;
}

this._disorderID = disorderID;
this._name = name ? name : "loading...";

initialize: function(disorderID, name, callWhenReady) {
// user-defined disorders
if (name == null && !isInt(disorderID)) {
name = disorderID;
}

this._disorderID = disorderID;
this._name = name ? name : "loading...";
if (!name && callWhenReady)
this.load(callWhenReady);
},

if (!name && callWhenReady)
this.load(callWhenReady);
},
/*
* Returns the disorderID of the disorder
*/
getDisorderID: function() {
return this._disorderID;
},

/*
* Returns the disorderID of the disorder
*/
getDisorderID: function() {
return this._disorderID;
},
/*
* Returns the name of the disorder
*/
getName: function() {
return this._name;
},

/*
* Returns the name of the disorder
*/
getName: function() {
return this._name;
},
load: function(callWhenReady) {
var baseOMIMServiceURL = Disorder.getOMIMServiceURL();
var queryURL = baseOMIMServiceURL + "&q=id:" + this._disorderID;
//console.log("queryURL: " + queryURL);
new Ajax.Request(queryURL, {
method: "GET",
onSuccess: this.onDataReady.bind(this),
//onComplete: complete.bind(this)
onComplete: callWhenReady ? callWhenReady : {}
});
},

load: function(callWhenReady) {
var baseOMIMServiceURL = Disorder.getOMIMServiceURL();
var queryURL = baseOMIMServiceURL + "&q=id:" + this._disorderID;
//console.log("queryURL: " + queryURL);
new Ajax.Request(queryURL, {
method: "GET",
onSuccess: this.onDataReady.bind(this),
//onComplete: complete.bind(this)
onComplete: callWhenReady ? callWhenReady : {}
});
},

onDataReady : function(response) {
try {
var parsed = JSON.parse(response.responseText);
//console.log(stringifyObject(parsed));
console.log("LOADED DISORDER: disorder id = " + this._disorderID + ", name = " + parsed.rows[0].name);
this._name = parsed.rows[0].name;
} catch (err) {
console.log("[LOAD DISORDER] Error: " + err);
onDataReady : function(response) {
try {
var parsed = JSON.parse(response.responseText);
//console.log(Helpers.stringifyObject(parsed));
console.log("LOADED DISORDER: disorder id = " + this._disorderID + ", name = " + parsed.rows[0].name);
this._name = parsed.rows[0].name;
} catch (err) {
console.log("[LOAD DISORDER] Error: " + err);
}
}
}
});

});

Disorder.getOMIMServiceURL = function() {
return new XWiki.Document('OmimService', 'PhenoTips').getURL("get", "outputSyntax=plain");
};

Disorder.getOMIMServiceURL = function() {
return new XWiki.Document('OmimService', 'PhenoTips').getURL("get", "outputSyntax=plain");
}
return Disorder;
});
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@
}
.node-type-options .person-type-option.square span {
display: inline-block;
width: 12px;
width: 12px;
height: 12px;
border: 1px solid black;
}
Expand All @@ -721,7 +721,7 @@
}
.node-type-options .person-type-option.diamond span {
display: inline-block;
width: 10px;
width: 10px;
height: 10px;
border: 1px solid black;
-webkit-transform: rotate(45deg);
Expand All @@ -733,7 +733,7 @@
}
.node-type-options .person-type-option.circle span {
display: inline-block;
width: 12px;
width: 12px;
height: 12px;
border-radius: 50%;
border: 1px solid black;
Expand All @@ -745,7 +745,7 @@
font-weight: bold;
font-size: 8px;
position: absolute;
top: 8px;
top: 8px;
left: 10px;
}
.expand-arrow {
Expand Down
Loading

0 comments on commit a81720e

Please sign in to comment.