Skip to content
This repository has been archived by the owner on Dec 25, 2018. It is now read-only.

Commit

Permalink
Merge pull request #306 from zhx828/style
Browse files Browse the repository at this point in the history
Adjust styles based on some feedbacks from cBioPortal team
  • Loading branch information
zhx828 authored Oct 11, 2016
2 parents e103477 + 22bcd2a commit 01d8d57
Show file tree
Hide file tree
Showing 24 changed files with 716 additions and 561 deletions.
32 changes: 31 additions & 1 deletion app/_components/cbio-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,35 @@ cbio.util = (function() {
return [minValue, maxValue, smallDataFlag];
}

function getDatahubStudiesList() {
var DATAHUB_GIT_URL =
'https://api.github.com/repos/cBioPortal/datahub/contents/public';
var def = new $.Deferred();

$.getJSON(DATAHUB_GIT_URL, function(data) {
var studies = {};
if (_.isArray(data)) {
_.each(data, function(fileInfo) {
if (_.isObject(fileInfo) &&
fileInfo.type === 'file' &&
_.isString(fileInfo.name)) {
var fileName = fileInfo.name.split('.tar.gz');
if (fileName.length > 0) {
studies[fileName[0]] = {
name: fileName[0],
htmlURL: fileInfo.html_url
};
}
}
})
}
def.resolve(studies);
}).fail(function(error) {
def.reject(error);
});
return def.promise();
}

return {
toPrecision: toPrecision,
getObjectLength: getObjectLength,
Expand All @@ -661,7 +690,8 @@ cbio.util = (function() {
replaceAll: replaceAll,
findExtremes: findExtremes,
deepCopyObject: deepCopyObject,
makeCachedPromiseFunction: makeCachedPromiseFunction
makeCachedPromiseFunction: makeCachedPromiseFunction,
getDatahubStudiesList: getDatahubStudiesList
};

})();
Expand Down
Loading

0 comments on commit 01d8d57

Please sign in to comment.