Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ examples/models/*.header
examples/models/*.headers
examples/models/*.raw
examples/models/*.json
package-lock.json
43 changes: 30 additions & 13 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* Author: Tarek Sherif <tsherif@gmail.com> (http://tareksherif.ca/)
*/

module.exports = function(grunt) {
module.exports = function (grunt) {
"use strict";

grunt.initConfig({
Expand Down Expand Up @@ -61,15 +61,15 @@ module.exports = function(grunt) {
options: {
report: "min",
banner: "<%= license %>\n" +
"/*\n" +
"* BrainBrowser v<%= pkg.version %>\n" +
"*\n" +
"* Author: Tarek Sherif <tsherif@gmail.com> (http://tareksherif.ca/)\n" +
"* Author: Nicolas Kassis\n" +
"* Author: Paul Mougel\n" +
"*\n" +
"* three.js (c) 2010-2014 three.js authors, used under the MIT license\n" +
"*/\n"
"/*\n" +
"* BrainBrowser v<%= pkg.version %>\n" +
"*\n" +
"* Author: Tarek Sherif <tsherif@gmail.com> (http://tareksherif.ca/)\n" +
"* Author: Nicolas Kassis\n" +
"* Author: Paul Mougel\n" +
"*\n" +
"* three.js (c) 2010-2014 three.js authors, used under the MIT license\n" +
"*/\n"
},
surface: {
files: {
Expand Down Expand Up @@ -191,8 +191,24 @@ module.exports = function(grunt) {
src: "brainbrowser-<%= BRAINBROWSER_VERSION %>/**"
}
},
connect: {
server: {
options: {
port: 8000,
base: "."
}
}
},
qunit: {
all: ["test/*.html"]
all: {
options: {
puppeteer: {
args: ["--no-sandbox", "--disable-setuid-sandbox"]
},
httpBase: "http://localhost:8000"
},
src: ["test/*.html"]
}
},
docular: {
docular_webapp_target: "docs/docular",
Expand Down Expand Up @@ -225,6 +241,7 @@ module.exports = function(grunt) {
});

grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-clean");
Expand All @@ -234,7 +251,7 @@ module.exports = function(grunt) {

grunt.registerTask("compile", ["clean", "concat", "uglify"]);
grunt.registerTask("build", ["test", "compile", "compress"]);
grunt.registerTask("test", ["jshint", "qunit"]);
grunt.registerTask("test", ["jshint", "connect", "qunit"]);
grunt.registerTask("docs", ["docular", "clean:docs"]);
grunt.registerTask("default", "test");
};
};
4 changes: 2 additions & 2 deletions examples/bigbrain-viewer-demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2070,7 +2070,7 @@ $(function() {
var j=0;

if ((viewer.model.children.length !== 0) && (user_defined_grid_length === "no")){
for (i = 0; i < m1_model_data_get.shapes.length; i++) {
for (var i = 0; i < m1_model_data_get.shapes.length; i++) {
if ((viewer.model.children[i].name !== "axes") && (viewer.model.children[i].name !== "marker") && (viewer.model.children[i].name !== "grid")){
// Include this shape for computing bounding box of visible shapes if opacity >25% and if not turned off
if ((viewer.model.children[i].material.opacity > 0.25) && (document.getElementById("opacity-slider-" + i).style.visibility !== "hidden")){
Expand All @@ -2092,7 +2092,7 @@ $(function() {
}

if ( m > 1 ) {
for (var i = m1_model_data_get.shapes.length; i < (m1_model_data_get.shapes.length + m2_model_data_get.shapes.length); i++) {
for (i = m1_model_data_get.shapes.length; i < (m1_model_data_get.shapes.length + m2_model_data_get.shapes.length); i++) {
if ((viewer.model.children[i].name !== "axes") && (viewer.model.children[i].name !== "marker") && (viewer.model.children[i].name !== "grid")){
if ((viewer.model.children[i].material.opacity > 0.25) && (document.getElementById("opacity-slider-" + i).style.visibility !== "hidden")){ //Include this shape for computing bounding box of visible shapes if opacity >25% and if not turned off
bounding_box_min_x[i] = m2_model_data_get.shapes[j].bounding_box.min_x;
Expand Down
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
"license": "GNU Affero GPL 3.0",
"devDependencies": {
"bower": "~1.8.8",
"grunt": "^1.3.0",
"grunt-contrib-jshint": "~0.6.4",
"grunt-contrib-uglify": "~0.2.4",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-clean": "~0.5.0",
"grunt": "^1.6.1",
"grunt-contrib-connect": "^3.0.0",
"grunt-contrib-jshint": "^3.2.0",
"grunt-contrib-uglify": "^5.2.2",
"grunt-contrib-concat": "^2.1.0",
"grunt-contrib-clean": "^2.0.1",
"grunt-docular": "~0.1.2",
"grunt-contrib-compress": "~0.5.3",
"grunt-contrib-qunit": "~0.5.1"
"grunt-contrib-compress": "^2.0.0",
"grunt-contrib-qunit": "^9.0.0",
"qunit": "^2.21.0"
},
"scripts" : {
"test": "grunt"
"scripts": {
"test": "grunt"
}
}
}
4 changes: 2 additions & 2 deletions test/event-model-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
<head>
<meta charset="utf-8">
<title>BrainBrowser Event Model Tests</title>
<link rel="stylesheet" href="lib/qunit-1.14.0.css">
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script src="lib/qunit-1.14.0.js"></script>
<script src="../node_modules/qunit/qunit/qunit.js"></script>
<script src="brainbrowser/brainbrowser.js"></script>
<script src="brainbrowser/lib/utils.js"></script>
<script src="brainbrowser/lib/events.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions test/tree-store-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
<head>
<meta charset="utf-8">
<title>BrainBrowser Tree Store Tests</title>
<link rel="stylesheet" href="lib/qunit-1.14.0.css">
<link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css">
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script src="lib/qunit-1.14.0.js"></script>
<script src="../node_modules/qunit/qunit/qunit.js"></script>
<script src="brainbrowser/brainbrowser.js"></script>
<script src="brainbrowser/core/tree-store.js"></script>
<script src="tree-store-test.js"></script>
Expand Down