Skip to content

Commit

Permalink
prepare for running first npm version
Browse files Browse the repository at this point in the history
  • Loading branch information
dauglyon committed Feb 16, 2018
1 parent e49ee09 commit 06aafba
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
19 changes: 17 additions & 2 deletions example_src/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,28 @@
vals[entry.name] = entry.value
return vals
},{});

var base_url = form.server;
if (base_url.slice(0,8)!="https://" && base_url.slice(0,7)!="http://"){
base_url ="https://"+base_url;
}
if (base_url.slice(-1)!="/"){
base_url+="/";
}

var server_url = base_url+"brapi/v1";
var auth = form.username ? {'username':username,'password':password} : undefined;
var studyIds = form.study.split(",").map(function(s){return s.trim()});

$("#load-spin").show();
BrAPI(form.server, form.username?{'username':username,'password':password}:undefined)

BrAPI(server_url, auth)
.phenotypes_search({
"studyDbIds" : form.study.split(",").map(function(s){return s.trim()}),
"studyDbIds" : studyIds,
"observationLevel" : form.unit,
"pageSize" : 10000000})
.all(createSComp);

return false;
})
});
Expand Down
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
{
"name": "@solgenomics/brapi-study-comparison",
"version": "1.0.0",
"version": "0.0.0",
"description": "",
"main": "build/StudyComparison.js",
"directories": {
"doc": "docs"
},
"scripts": {
"prepare": "rm -rf build && mkdir build && rollup -f umd -n StudyComparison -o build/StudyComparison.js -- main.js",
"build_example": "rm -rf docs/example && mkdir docs/example && wrapbrapp && cp build/StudyComparison.js node_modules/@solgenomics/brapijs/build/BrAPI.js docs/example",
"version": "npm run prepare && npm run build_example"
"build_example": "rm -rf example && mkdir example && wrapbrapp && cp build/StudyComparison.js node_modules/@solgenomics/brapijs/build/BrAPI.js example/",
"version": "npm run prepare && npm run build_example && git add example"
},
"repository": {
"type": "git",
Expand All @@ -28,7 +25,7 @@
"rollup": "^0.56.1"
},
"brapp": {
"out": "docs/example/index.html",
"out": "example/index.html",
"name": "Study Comparison",
"link": "https://github.com/solgenomics/BrAPI-Study-Comparison",
"forward": "example_src/forward.html",
Expand Down

0 comments on commit 06aafba

Please sign in to comment.