diff --git a/tf_oss_dashboard/script.js b/tf_oss_dashboard/script.js index 3e1ed3fc00bdd9b0b4eb23c09330577b6d579deb..5ddb7069872ba55d85cd5e95bbfb318fc7692fa3 100644 --- a/tf_oss_dashboard/script.js +++ b/tf_oss_dashboard/script.js @@ -1,3 +1,12 @@ +// Display warning banner if use of analytics cookies hasn't been acknowledged +if (location.hostname !== "" && !Cookies.get("tf-cookies-accepted")) { + $(".tf-cookie-warning").removeClass("d-none") +} +$("#tf-accept-cookies").click(function() { + $(this).addClass("d-none") + Cookies.set("tf-cookies-accepted", true) +}) + // Navbar toggle switches // When the page loads or when the navbar toggles are switched, toggle the // class on the HTML <body> tag that controls those features (colorblind or @@ -20,6 +29,7 @@ $('#tf-show-buildcop').change(function () { $('body').toggleClass('tf-show-buildcop') }) + // Update the human-readable timestamp once per minute and when the page loads // Uses moment.js, which is included in the top of the HTML page function humanizeTimestamp () { @@ -166,13 +176,4 @@ $(function () { revealed = $(this).attr("data-tf-reveal") $(".badge[data-bs-target='" + revealed + "']").removeClass("tf-last-clicked").addClass("tf-revealed") }) - - // Display warning banner if use of analytics cookies hasn't been acknowledged - if (location.hostname !== "" && !Cookies.get("tf-cookies-accepted")) { - $(".tf-cookie-warning").removeClass("d-none") - } - $("#tf-accept-cookies").click(function() { - $(this).addClass("d-none") - Cookies.set("tf-cookies-accepted", true) - }) })