Skip to content

Commit

Permalink
Add exit button
Browse files Browse the repository at this point in the history
  • Loading branch information
RHJasonSmith committed Dec 13, 2024
1 parent 9cb97f0 commit 9605da9
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Some important environment variables are :
- `WBO_HISTORY_DIR` : configures the directory where the boards are saved. Defaults to `./server-data/`.
- `WBO_MAX_EMIT_COUNT` : the maximum number of messages that a client can send per unit of time. Increase this value if you want smoother drawings, at the expense of being susceptible to denial of service attacks if your server does not have enough processing power. By default, the units of this quantity are messages per 4 seconds, and the default value is `192`.
- `AUTH_SECRET_KEY` : If you would like to authenticate your boards using jwt, this declares the secret key.

- `WBO_SHOW_EXIT_BUTTON` : If set to `true`, an exit button will be shown on the board. This is useful if you want to run in kiosk mode and need a way to close the window.
## Troubleshooting

If you experience an issue or want to propose a new feature in WBO, please [open a github issue](https://github.com/lovasoa/whitebophir/issues/new).
Expand Down
1 change: 1 addition & 0 deletions client-data/board.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
<script src="../tools/grid/grid.js"></script>
<script src="../tools/download/download.js"></script>
<script src="../tools/zoom/zoom.js"></script>
<script src="../tools/exit/exit.js"></script>
{{#moderator}}<script src="../tools/clear/clear.js"></script>{{/moderator}}
<script src="../js/canvascolor.js"></script>
</body>
Expand Down
2 changes: 2 additions & 0 deletions client-data/tools/exit/attribution
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
exit.svg creative commons license: https://www.svgrepo.com/svg/240195/exit
https://www.svgrepo.com/page/licensing/#CC0
47 changes: 47 additions & 0 deletions client-data/tools/exit/exit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* WHITEBOPHIR
*********************************************************
* @licstart The following is the entire license notice for the
* JavaScript code in this page.
*
* Copyright (C) 2013 Ophir LOJKINE
*
*
* The JavaScript code in this page is free software: you can
* redistribute it and/or modify it under the terms of the GNU
* General Public License (GNU GPL) as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version. The code is distributed WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
*
* As additional permission under GNU GPL version 3 section 7, you
* may distribute non-source (e.g., minimized or compacted) forms of
* that code without the copy of the GNU GPL normally required by
* section 4, provided you include this license notice and a URL
* through which recipients can access the Corresponding Source.
*
* @licend
*/

(function () {
//Code isolation

const exitTool = {
name: "Exit",
shortcut: "Q",
listeners: {
},
draw: function (ctx) {},
onstart: function () {
if (confirm("Are you sure you want to exit?")) {
window.close();
}
},
onquit: function () {},
mouseCursor: "url('tools/pencil/cursor.svg'), crosshair",
icon: "tools/exit/exit.svg",
stylesheet: "tools/pencil/pencil.css",
};
Tools.server_config.SHOW_EXIT_BUTTON && Tools.add(exitTool);
})(); //End of code isolation
23 changes: 23 additions & 0 deletions client-data/tools/exit/exit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions server/client_configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ module.exports = {
BLOCKED_TOOLS: config.BLOCKED_TOOLS,
BLOCKED_SELECTION_BUTTONS: config.BLOCKED_SELECTION_BUTTONS,
AUTO_FINGER_WHITEOUT: config.AUTO_FINGER_WHITEOUT,
SHOW_EXIT_BUTTON: config.SHOW_EXIT_BUTTON,
};
3 changes: 3 additions & 0 deletions server/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,7 @@ module.exports = {

/** If this variable is set, automatically redirect to this board from the root of the application. */
DEFAULT_BOARD: process.env["WBO_DEFAULT_BOARD"],

/** If this variable is set, the exit button will be shown on the board */
SHOW_EXIT_BUTTON: process.env["WBO_SHOW_EXIT_BUTTON"],
};

0 comments on commit 9605da9

Please sign in to comment.