diff --git a/static/css/custom.css b/static/css/custom.css index d196abb..2d1f2b0 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -503,4 +503,8 @@ a > code { color: #FFF; height: 1em; padding: 0.15em; +} + +.page-all-track-badge { + display: none; } \ No newline at end of file diff --git a/static/js/page_all_track_display.js b/static/js/page_all_track_display.js new file mode 100644 index 0000000..f96c4c1 --- /dev/null +++ b/static/js/page_all_track_display.js @@ -0,0 +1,29 @@ +function setDefaultTrackBadgePreference() { + localStorage.setItem("track_badge", "1"); +} + +function setTrackBadgeDisplayStatus(selectElement) { + localStorage.setItem("track_badge", String(selectElement.value)); + + displayTrackBadgeElement(); +} + +function displayTrackBadgeElement() { + let status = localStorage.getItem("track_badge"); + if (status === null) { + setDefaultTrackBadgePreference(); + status = "1"; + } + + if (status === "0") { + setElementDisplay("page-all-track-badge", "none"); + } + else if (status === "1") { + setElementDisplay("page-all-track-badge-stats", "inline-block"); + setElementDisplay("page-all-track-badge-tags", "none"); + } + else if (status === "2") { + setElementDisplay("page-all-track-badge-stats", "none"); + setElementDisplay("page-all-track-badge-tags", "inline-block"); + } +} \ No newline at end of file