diff --git a/package.json b/package.json
index 8d46571a..77e38dc4 100644
--- a/package.json
+++ b/package.json
@@ -58,7 +58,7 @@
"multer": "^1.4.2",
"mustache-express": "^1.3.0",
"neuroweblab": "github:neuroanatomy/neuroweblab",
- "nwl-components": "^0.0.20",
+ "nwl-components": "^0.0.21",
"pako": "^1.0.11",
"passport": "^0.4.1",
"passport-github": "^1.1.0",
diff --git a/templates/project.mustache b/templates/project.mustache
index cad5862d..63d88598 100644
--- a/templates/project.mustache
+++ b/templates/project.mustache
@@ -141,11 +141,14 @@
-
+
+
+
+
@@ -180,6 +183,14 @@
padding: 10px;
width: 200px;
}
+ .text {
+ opacity: 0.5;
+ width: 100%;
+ height: 100%;
+ }
+ .text:hover {
+ opacity: 1;
+ }
diff --git a/test/integration/client.js b/test/integration/client.js
index 3245a96f..27aa2049 100644
--- a/test/integration/client.js
+++ b/test/integration/client.js
@@ -89,12 +89,13 @@ describe('TESTING CLIENT-SIDE RENDERING', function () {
// OPEN PROJECT PAGE
it('Project page renders as expected', async function () {
await page.goto(U.serverURL + '/project/' + U.projectTest.shortname);
- await page.waitForSelector('#sliderBlock');
- await page.waitForSelector('#buttonsBlock');
- await page.waitForSelector('#penSizeBlock');
+ await page.waitForSelector('.editor .tools');
+ await page.waitForSelector('.editor .tools .range-slider');
+ await page.waitForSelector('.editor .tools button[title="Change pen size to 1"]');
+ await page.waitForSelector('.editor .tools button[title="Change pen size to 15"]');
await page.waitForSelector('canvas');
- await page.waitForSelector('#notificationsBlock');
- await page.waitForSelector('#textInputBlock');
+ await page.waitForSelector('.editor .tools .notifications');
+ await page.waitForSelector('.editor .tools .chat input[type=text]');
const annotation = await page.waitForSelector('#volAnnotations tbody tr td:first-child');
assert.equal('Cerebrum', await page.evaluate((el) => el.textContent, annotation));
diff --git a/view/atlasmaker/src/atlasmaker.js b/view/atlasmaker/src/atlasmaker.js
index 907813e5..7df14fbe 100755
--- a/view/atlasmaker/src/atlasmaker.js
+++ b/view/atlasmaker/src/atlasmaker.js
@@ -332,23 +332,15 @@ var me = {
me._createOffscreenCanvases();
me._createOnscreenCanvases(elem);
+ // load tools
+ me.loadTools();
+
// event connect: Configure mouse events for desktop computers
// (touch events are configured in the initCursor function)
me.canvas.onmousedown = me.mousedown;
me.canvas.onmousemove = me.mousemove;
me.canvas.onmouseup = me.mouseup;
-
- // text input
- Promise.all([
- me.loadScript('https://unpkg.com/codeflask/build/codeflask.min.js'),
- me.loadScript('https://cdn.jsdelivr.net/gh/r03ert0/consolita.js@v0.1.1/consolita.js')
- ]).then(() => {
- window.onload = () => {
- Consolita.init('#logScript');
- };
- });
-
// long-press event
me.loadScript('https://cdn.jsdelivr.net/gh/john-doherty/long-press-event@2.1.0/dist/long-press-event.min.js')
.then(() => {
diff --git a/view/atlasmaker/src/html/img/3drender.svg b/view/atlasmaker/src/html/img/3drender.svg
deleted file mode 100644
index 6bd92f22..00000000
--- a/view/atlasmaker/src/html/img/3drender.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/html/img/adjust.svg b/view/atlasmaker/src/html/img/adjust.svg
deleted file mode 100644
index 4164f2fb..00000000
--- a/view/atlasmaker/src/html/img/adjust.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/html/img/bars.svg b/view/atlasmaker/src/html/img/bars.svg
deleted file mode 100644
index 9b125ad8..00000000
--- a/view/atlasmaker/src/html/img/bars.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/html/img/caret-square-o-left.svg b/view/atlasmaker/src/html/img/caret-square-o-left.svg
deleted file mode 100644
index 238fd7ba..00000000
--- a/view/atlasmaker/src/html/img/caret-square-o-left.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/html/img/caret-square-o-right.svg b/view/atlasmaker/src/html/img/caret-square-o-right.svg
deleted file mode 100644
index 1ffa0e42..00000000
--- a/view/atlasmaker/src/html/img/caret-square-o-right.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/html/img/chat.svg b/view/atlasmaker/src/html/img/chat.svg
deleted file mode 100644
index 3b879ba3..00000000
--- a/view/atlasmaker/src/html/img/chat.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/html/img/download.svg b/view/atlasmaker/src/html/img/download.svg
deleted file mode 100644
index 9583f1cc..00000000
--- a/view/atlasmaker/src/html/img/download.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/html/img/erase.svg b/view/atlasmaker/src/html/img/erase.svg
deleted file mode 100644
index 2d0b0116..00000000
--- a/view/atlasmaker/src/html/img/erase.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/html/img/eyedropper.svg b/view/atlasmaker/src/html/img/eyedropper.svg
deleted file mode 100644
index df54ea54..00000000
--- a/view/atlasmaker/src/html/img/eyedropper.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/html/img/fill.svg b/view/atlasmaker/src/html/img/fill.svg
deleted file mode 100644
index ec7f1264..00000000
--- a/view/atlasmaker/src/html/img/fill.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/html/img/floppy.svg b/view/atlasmaker/src/html/img/floppy.svg
deleted file mode 100644
index 8277beb8..00000000
--- a/view/atlasmaker/src/html/img/floppy.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/html/img/fullscreen.svg b/view/atlasmaker/src/html/img/fullscreen.svg
deleted file mode 100644
index c00355c4..00000000
--- a/view/atlasmaker/src/html/img/fullscreen.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/html/img/landmark.svg b/view/atlasmaker/src/html/img/landmark.svg
deleted file mode 100644
index 8ec34991..00000000
--- a/view/atlasmaker/src/html/img/landmark.svg
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
- image/svg+xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/view/atlasmaker/src/html/img/link.svg b/view/atlasmaker/src/html/img/link.svg
deleted file mode 100644
index 0f108c14..00000000
--- a/view/atlasmaker/src/html/img/link.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/html/img/paint.svg b/view/atlasmaker/src/html/img/paint.svg
deleted file mode 100644
index dfeabdec..00000000
--- a/view/atlasmaker/src/html/img/paint.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/html/img/preciseCursor.svg b/view/atlasmaker/src/html/img/preciseCursor.svg
deleted file mode 100644
index f4471526..00000000
--- a/view/atlasmaker/src/html/img/preciseCursor.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/html/img/ruler.svg b/view/atlasmaker/src/html/img/ruler.svg
deleted file mode 100644
index 36830932..00000000
--- a/view/atlasmaker/src/html/img/ruler.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/html/img/scroll.svg b/view/atlasmaker/src/html/img/scroll.svg
deleted file mode 100644
index 326116d8..00000000
--- a/view/atlasmaker/src/html/img/scroll.svg
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
- image/svg+xml
-
-
-
-
-
-
-
-
-
diff --git a/view/atlasmaker/src/html/img/show.svg b/view/atlasmaker/src/html/img/show.svg
deleted file mode 100644
index 56c20d6f..00000000
--- a/view/atlasmaker/src/html/img/show.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/html/img/times-circle.svg b/view/atlasmaker/src/html/img/times-circle.svg
deleted file mode 100644
index 62d8d0f6..00000000
--- a/view/atlasmaker/src/html/img/times-circle.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/html/img/undo.svg b/view/atlasmaker/src/html/img/undo.svg
deleted file mode 100644
index ba242318..00000000
--- a/view/atlasmaker/src/html/img/undo.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/html/img/upload.svg b/view/atlasmaker/src/html/img/upload.svg
deleted file mode 100644
index fb14a77d..00000000
--- a/view/atlasmaker/src/html/img/upload.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/html/toolsFull.html b/view/atlasmaker/src/html/toolsFull.html
deleted file mode 100644
index 8653e52e..00000000
--- a/view/atlasmaker/src/html/toolsFull.html
+++ /dev/null
@@ -1,208 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Label Set
-
-
-
- Labels
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Label
- Voxel Coordinates
- World Coordinates
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/view/atlasmaker/src/html/toolsLight.html b/view/atlasmaker/src/html/toolsLight.html
deleted file mode 100644
index ee188bb4..00000000
--- a/view/atlasmaker/src/html/toolsLight.html
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
diff --git a/view/atlasmaker/src/resources/ReadMe.md b/view/atlasmaker/src/resources/ReadMe.md
deleted file mode 100644
index 3c62a650..00000000
--- a/view/atlasmaker/src/resources/ReadMe.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# Notes on UI
-
-The file `flex-tools-full` shows the flex box design for the full tools bar. The file
-`flex-tools-light` shows the design for the reduced tools bar, including only the viewing
-functionalities.
-
-Aligning the different divs together is not simple. One important point is to use
-`box-sizing: border-box` as box-sizing model. With this setting, the `width: 100%` value
-takes into account not only the div's content, but also the padding and the border.
-Importantly, it does not take into account the margin, so it's better to avoid using
-margin.
-
-The main flex of the full tool bar has 5 children: (1) header, (2) slider, (3) buttons,
-(4) pen size and (5) chat. The size of the first 4 children is fixed, but the chat child's
-height stretches to fill the total height of main flex. A problem appears when we want to
-make a div inside this last children (the chat box) use 100% of the height. The solution
-is to make the chat box itself a flex container, and then make the div inside it flexible.
-
-In the chat box this pattern is used several times, like this:
-
-```
-
-```
diff --git a/view/atlasmaker/src/resources/flex-tools-full-tabs.html b/view/atlasmaker/src/resources/flex-tools-full-tabs.html
deleted file mode 100644
index d86a276d..00000000
--- a/view/atlasmaker/src/resources/flex-tools-full-tabs.html
+++ /dev/null
@@ -1,140 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/resources/flex-tools-full.html b/view/atlasmaker/src/resources/flex-tools-full.html
deleted file mode 100644
index b566d7de..00000000
--- a/view/atlasmaker/src/resources/flex-tools-full.html
+++ /dev/null
@@ -1,131 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/resources/flex-tools-light.html b/view/atlasmaker/src/resources/flex-tools-light.html
deleted file mode 100644
index b4731186..00000000
--- a/view/atlasmaker/src/resources/flex-tools-light.html
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
diff --git a/view/atlasmaker/src/resources/ui-tools-full.html b/view/atlasmaker/src/resources/ui-tools-full.html
deleted file mode 100644
index 64f76d99..00000000
--- a/view/atlasmaker/src/resources/ui-tools-full.html
+++ /dev/null
@@ -1,142 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/resources/ui-tools-light.html b/view/atlasmaker/src/resources/ui-tools-light.html
deleted file mode 100644
index 46738bb4..00000000
--- a/view/atlasmaker/src/resources/ui-tools-light.html
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/tools/adjust/adjust.svg b/view/atlasmaker/src/tools/adjust/adjust.svg
deleted file mode 100644
index 4164f2fb..00000000
--- a/view/atlasmaker/src/tools/adjust/adjust.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/tools/adjust/alpha.svg b/view/atlasmaker/src/tools/adjust/alpha.svg
deleted file mode 100644
index e16fb5e5..00000000
--- a/view/atlasmaker/src/tools/adjust/alpha.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/tools/adjust/icon.svg b/view/atlasmaker/src/tools/adjust/icon.svg
deleted file mode 100644
index 4164f2fb..00000000
--- a/view/atlasmaker/src/tools/adjust/icon.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/atlasmaker/src/tools/adjust/index.html b/view/atlasmaker/src/tools/adjust/index.html
deleted file mode 100644
index 6f3d439c..00000000
--- a/view/atlasmaker/src/tools/adjust/index.html
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/view/atlasmaker/src/tools/adjust/index.js b/view/atlasmaker/src/tools/adjust/index.js
deleted file mode 100644
index e8511f34..00000000
--- a/view/atlasmaker/src/tools/adjust/index.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/* global AtlasMakerWidget $ */
-import html from './index.html';
-
-// append HTML
-const el = document.createElement("div");
-el.id = "adjust";
-el.style.width = "calc(100% - 20px )";
-el.style.position ="absolute";
-el.style.bottom = 0;
-el.style.left = 0;
-el.style.padding = "10px";
-
-el.innerHTML = html;
-AtlasMakerWidget.container.querySelector("#resizable").appendChild(el);
-
-// Transparency
-AtlasMakerWidget.slider($('.slider#alphaLevel'), function (x) {
- $('#alphaLevel').data('val', x);
- $('#alphaLevel .thumb')[0].style.left = x + '%';
- AtlasMakerWidget.alphaLevel = x / 100;
- AtlasMakerWidget.drawImages();
-});
-$('.slider#alphaLevel').data({ max: 100, val: 50 });
-$('#alphaLevel .thumb')[0].style.left = (AtlasMakerWidget.alphaLevel * 100) + '%';
-
-// Brightness
-AtlasMakerWidget.slider($('.slider#minLevel'), function (x) {
- $('#minLevel').data('val', x);
- $('#minLevel .thumb')[0].style.left = x + '%';
-
- var b = (2 * x / 100);
- var c = (2 * $('#maxLevel').data('val') / 100);
- $('#canvas').css({
- 'webkit-filter': 'brightness(' + b + ') contrast(' + c + ')',
- 'filter': 'brightness(' + b + ') contrast(' + c + ')'
- });
-});
-$('.slider#minLevel').data({ max: 100, val: 50 });
-$('#minLevel .thumb')[0].style.left = '50%';
-
-// Contrast
-AtlasMakerWidget.slider($('.slider#maxLevel'), function (x) {
- $('#maxLevel').data('val', x);
- $('#maxLevel .thumb')[0].style.left = x + '%';
-
- var b = (2 * $('#minLevel').data('val') / 100);
- var c = (2 * x / 100);
- $('#canvas').css({
- 'webkit-filter': 'brightness(' + b + ') contrast(' + c + ')',
- 'filter': 'brightness(' + b + ') contrast(' + c + ')'
- });
-});
-$('.slider#maxLevel').data({ max: 100, val: 50 });
-$('#maxLevel .thumb')[0].style.left = '50%';
-
-var observer = new MutationObserver(function (mutations) {
- mutations.forEach(function (mutation) {
- if (mutation.attributeName === 'class') {
- console.log('mutation', mutation);
- var attributeValue = $(mutation.target).prop(mutation.attributeName);
- if (attributeValue === 'a sub') {
- $('#adjust').remove();
- }
- observer.disconnect();
- // delete observer;
- }
- });
-});
-observer.observe($('#paintTool [title="Adjust"]')[0], {
- attributes: true
-});
\ No newline at end of file
diff --git a/view/atlasmaker/src/tools/adjust/sun-o.svg b/view/atlasmaker/src/tools/adjust/sun-o.svg
deleted file mode 100644
index 2af83736..00000000
--- a/view/atlasmaker/src/tools/adjust/sun-o.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/view/brainbox/src/pages/project-page.js b/view/brainbox/src/pages/project-page.js
index 54578a56..01469530 100644
--- a/view/brainbox/src/pages/project-page.js
+++ b/view/brainbox/src/pages/project-page.js
@@ -13,6 +13,7 @@ import {
ProjectPage,
RangeSlider,
Row,
+ ScriptConsole,
Table,
TextAnnotations,
VolumeAnnotations
@@ -74,9 +75,9 @@ const PageContents = {
brightnessValue: Vue.ref(50),
contrastValue: Vue.ref(50),
linkPrefix: `${config.baseURL}/mri?url=`,
+ volumeAnnotations: Vue.ref([]),
// define a map associating annotations keys to value selectors
// to extract content within the TextAnnotations component
- volumeAnnotations: Vue.ref([]),
extractTextKeys: (_files) => {
if (!_files) {
return;
@@ -161,6 +162,7 @@ const PageContents = {
window.addEventListener('newMessage', this.handleNewChatMessages);
window.addEventListener('newNotification', this.handleNewNotification);
+
document.addEventListener('keydown', function(event) {
const selectedTr = document.querySelector('tr.selected');
if (!selectedTr) { return; }
@@ -473,6 +475,7 @@ app.component('Table', Table);
app.component('Row', Row);
app.component('Chat', Chat);
app.component('AdjustSettings', AdjustSettings);
+app.component('ScriptConsole', ScriptConsole);
app.provide('displaySettings', true);
app.provide('config', config);
app.provide('user', loggedUser);