commit 4dde496fd3fc70fa2a7bb19d8da5131801419c76
parent c8e405496221d6bd7e72b937a14614ee6b675aa4
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date: Fri, 13 Sep 2024 10:34:41 -0700
Add debug parameter to editor page
When set, this enables menu's and such that probably won't be visible
in production, or at least in the current form cluttering up the
display. (This is of course unnecessary right now, but I'm tired
of the cluttered look.)
Diffstat:
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/files/floorplans/floorplan/main.js b/files/floorplans/floorplan/main.js
@@ -23,6 +23,9 @@ function init() {
etc.authorize()
etc.bar()
+ // Just to get stuff out of the way for now
+ let debug = (new URLSearchParams(new URL(document.URL).search)).get("debug") != undefined
+
let floorplan = (new URLSearchParams(new URL(document.URL).search)).get("name")
if (!floorplan) {
document.location.href = "/floorplans"
@@ -108,16 +111,19 @@ function init() {
toolbar.append(undoRedo)
toolbar.append(pushpull)
- toolbar.append(item(
- selector(editor, editor.modes, function(mode) { editor.useMode(mode) },
- { current: editor.mode, text: "Modes:" }
- )
- ))
- toolbar.append(item(
- selector(editor, editor.units.systems, function(system) { editor.useUnits(system) },
- { current: editor.unitSystem, text: "Units:" }
- )
- ))
+
+ if (debug) {
+ toolbar.append(item(
+ selector(editor, editor.modes, function(mode) { editor.useMode(mode) },
+ { current: editor.mode, text: "Modes:" }
+ )
+ ))
+ toolbar.append(item(
+ selector(editor, editor.units.systems, function(system) { editor.useUnits(system) },
+ { current: editor.unitSystem, text: "Units:" }
+ )
+ ))
+ }
editor.backend.pull()
.then(function() {