Skip to content

Commit

Permalink
Support tos and about links
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgodbolt committed Apr 20, 2024
1 parent 3c98f24 commit e3c6d22
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
35 changes: 33 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle },
navigation"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
Expand Down Expand Up @@ -137,6 +136,9 @@
<ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="navbarMore">
<li><a href="#" id="fs" class="dropdown-item">Fullscreen</a></li>
<li><a href="#help" class="dropdown-item" data-bs-toggle="modal" data-bs-target="#help">Help</a></li>
<li>
<a href="#pp-tos" class="dropdown-item" data-bs-toggle="modal" data-bs-target="#pp-tos">Privacy Policy &amp; ToS</a>
</li>
<li><a href="mailto:matt@godbolt.org" class="dropdown-item">Contact the Author</a></li>
<li>
<a href="http://xania.org/MattGodbolt" class="dropdown-item" rel="author" target="_blank">
Expand Down Expand Up @@ -378,6 +380,35 @@ <h5 class="modal-title" id="infoModalLabel">About jsbeeb</h5>
</div>
</div>

<div class="modal fade" id="pp-tos" tabindex="-1" aria-labelledby="infoModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="infoModalLabel">Privacy Policy &amp; Terms of Service</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div>
jsbeeb uses cookies for simple analytics. Those analytics are used to track usage and improve
user experience. If you'd like to run a local copy of jsbeeb instead, the source is on
<a href="https://github.com/mattgodbolt/jsbeeb">GitHub</a>. There's no server logs or information
kept on the jsbeeb servers, we just serve up this HTML from an AWS bucket.
</div>
<div>No personal information is kept. If you choose to access Google Drive for disc storage,
only the minimal information needed to log in and access your own discs is kept in cookies.
That information is never shared with the jsbeeb developers.
</div>
<div>Use of jsbeeb is at your own risk. Reasonable efforts are used to keep the site up to
date and working. You may use jsbeeb for whatever lawful purpose you wish.
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>

<div class="modal fade" id="help" tabindex="-1" aria-labelledby="helpModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
Expand Down
10 changes: 10 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1575,6 +1575,16 @@ function stop(debug) {
window.setTimeout(resizeTv, 500);
})();

const $infoModal = new bootstrap.Modal(document.getElementById("info"));
const $ppTosModal = new bootstrap.Modal(document.getElementById("pp-tos"));

if (Object.hasOwn(parsedQuery, "about")) {
$infoModal.show();
}
if (Object.hasOwn(parsedQuery, "pp-tos")) {
$ppTosModal.show();
}

// Handy shortcuts. bench/profile stuff is delayed so that they can be
// safely run from the JS console in firefox.
window.benchmarkCpu = _.debounce(benchmarkCpu, 1);
Expand Down

0 comments on commit e3c6d22

Please sign in to comment.