Browse Source

Adds support for query parameter "hideMenu" (#170)

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

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
dev_h
Russ Tedrake 4 years ago
parent
commit
71d8be5df1
No account linked to committer's email address
2 changed files with 2 additions and 1 deletions
  1. 1
    1
      client-data/board.html
  2. 1
    0
      server/templating.js

+ 1
- 1
client-data/board.html View File

35
 
35
 
36
 	<div id="loadingMessage">{{translations.loading}}</div>
36
 	<div id="loadingMessage">{{translations.loading}}</div>
37
 
37
 
38
-	<div id="menu">
38
+	<div id="menu" {{#hideMenu}}style="display:none;"{{/hideMenu}}>
39
 		<div id="menuItems">
39
 		<div id="menuItems">
40
 			<ul id="tools" class="tools">
40
 			<ul id="tools" class="tools">
41
 				<li class="tool" tabindex="-1">
41
 				<li class="tool" tabindex="-1">

+ 1
- 0
server/templating.js View File

68
     const boardUriComponent = parts[1];
68
     const boardUriComponent = parts[1];
69
     params["boardUriComponent"] = boardUriComponent;
69
     params["boardUriComponent"] = boardUriComponent;
70
     params["board"] = decodeURIComponent(boardUriComponent);
70
     params["board"] = decodeURIComponent(boardUriComponent);
71
+    params["hideMenu"] = parsedUrl.search.includes("hideMenu");
71
     return params;
72
     return params;
72
   }
73
   }
73
 }
74
 }

Loading…
Cancel
Save