1
0
mirror of https://github.com/lovasoa/whitebophir.git synced 2021-09-10 00:01:52 +03:00

Adds support for query parameter "hideMenu"

This adds the ability to load a board with the menu hidden; it provides a form of "read-only" mode, but the key bindings are still active.
Use with, e.g.:
http://localhost:5001/boards/qYAZyGdym6HqjnfaGI4yNtpdx0IMHd9qp6kaJPwbJqE-?hideMenu=true

The alternative, proposed in #116, was to remove the menu completely, but this would require more substantial changes to board.js (which hangs on "Loading..." if the menu is removed).
Related to #150
Related to #116

Adds support for query parameter "hideMenu"

This adds the ability to load a board with the menu hidden; it provides a form of "read-only" mode, but the key bindings are still active.
Use with, e.g.:
http://localhost:5001/boards/qYAZyGdym6HqjnfaGI4yNtpdx0IMHd9qp6kaJPwbJqE-?hideMenu=true

The alternative, proposed in #116, was to remove the menu completely, but this would require more substantial changes to board.js (which hangs on "Loading..." if the menu is removed).
Related to #150
Related to #116
This commit is contained in:
Russ Tedrake
2021-02-16 21:18:00 -05:00
parent 5bc3f02dae
commit d5111afdc8
3 changed files with 7 additions and 1 deletions

View File

@@ -35,7 +35,7 @@
<div id="loadingMessage">{{translations.loading}}</div>
<div id="menu">
<div id="menu" {{#hideMenu}}style="display:none;"{{/hideMenu}}>
<div id="menuItems">
<ul id="tools" class="tools">
<li class="tool" tabindex="-1">

View File

@@ -68,6 +68,7 @@ class BoardTemplate extends Template {
const boardUriComponent = parts[1];
params["boardUriComponent"] = boardUriComponent;
params["board"] = decodeURIComponent(boardUriComponent);
params["hideMenu"] = parsedUrl.query.hideMenu == "true" || false;
return params;
}
}

View File

@@ -97,6 +97,11 @@ function testBoard(browser) {
page = testPencil(page);
page = testCircle(page);
page = testCursor(page);
// test hideMenu
browser.url(SERVER + '/boards/anonymous?lang=fr&hideMenu=true').waitForElementNotVisible('#menu');
browser.url(SERVER + '/boards/anonymous?lang=fr&hideMenu=false').waitForElementVisible('#menu');
page.end();
}