diff --git a/public/css/style.scss b/public/css/style.scss index 1769437b8..36d143b46 100644 --- a/public/css/style.scss +++ b/public/css/style.scss @@ -2108,7 +2108,8 @@ key { } &.languages, - &.layouts { + &.layouts, + &.funbox { grid-template-columns: repeat(4, 1fr); grid-auto-flow: unset; } diff --git a/public/index.html b/public/index.html index feae2e6c4..36bf9d8f5 100644 --- a/public/index.html +++ b/public/index.html @@ -1497,6 +1497,12 @@
language
+
+ +
+
funbox
+
+
diff --git a/public/js/account.js b/public/js/account.js index c3a17a112..e624dae82 100644 --- a/public/js/account.js +++ b/public/js/account.js @@ -428,6 +428,20 @@ Object.keys(words).forEach((language) => { } }); +$(".pageAccount .content .filterButtons .buttons.funbox").append( + `
none
` +); +getFunboxList().then((funboxModes) => { + funboxModes.forEach((funbox) => { + $(".pageAccount .content .filterButtons .buttons.funbox").append( + `
${funbox.name.replace( + /_/g, + " " + )}
` + ); + }); +}); + let activeFilters = ["all"]; $(document).ready((e) => { @@ -624,6 +638,7 @@ $(".pageAccount #currentConfigFilter").click((e) => { "timeFilter", "languages", "tags", + "funbox", ]; disableGroups.forEach((group) => { $.each( @@ -655,6 +670,9 @@ $(".pageAccount #currentConfigFilter").click((e) => { config.resultFilters.push(`lang_${config.language}`); toggleFilterButton(`lang_${config.language}`); + config.resultFilters.push(`funbox_${activeFunBox}`); + toggleFilterButton(`funbox_${activeFunBox}`); + let activeTags = []; try { dbSnapshot.tags.forEach((tag) => { @@ -723,8 +741,11 @@ function loadMoreLines() { icons += ``; } - if (result.theme === "nausea") { - icons += ``; + if (result.funbox !== "none" && result.funbox !== undefined) { + icons += ``; } let tagNames = ""; @@ -874,8 +895,14 @@ function refreshAccountPage() { } if (!activeFilters.includes(puncfilter)) return; - //check if the user has any tags defined + if (result.funbox === "none" || result.funbox === undefined) { + if (!activeFilters.includes("funbox_none")) return; + } else { + if (!activeFilters.includes("funbox_" + result.funbox)) return; + } + if (dbSnapshot.tags.length > 0) { + //check if the user has any tags defined //check if that result has any tags if (result.tags !== undefined && result.tags.length > 0) { let found = false; @@ -910,15 +937,6 @@ function refreshAccountPage() { if (datehide) return; - // if( - // (!activeFilters.includes("date_all")) && - // (activeFilters.includes("date_day") && timeSinceTest > 86400) && - // (activeFilters.includes("date_week") && timeSinceTest > 604800) && - // (activeFilters.includes("date_month") && timeSinceTest > 18144000) - // ){ - // return; - // } - filteredResults.push(result); //filters done diff --git a/public/js/script.js b/public/js/script.js index 376177b01..026132a34 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -2625,7 +2625,10 @@ function updateTestModesNotice() { if (activeFunBox !== "none") { $(".pageTest #testModesNotice").append( - `
${activeFunBox}
` + `
${activeFunBox.replace( + /_/g, + " " + )}
` ); }