aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-03-26 01:52:19 +0100
committer0neGal <mail@0negal.com>2022-03-26 01:52:19 +0100
commitcd48513b061898601f2a52cf7d3f5f92ad9ce958 (patch)
treeb1eab77a4328e2f2a9842398c9c00fdbd20fed3b
parentbfbdfec664866ac9d968e29fd57119a03e747536 (diff)
downloadViper-cd48513b061898601f2a52cf7d3f5f92ad9ce958.tar.gz
Viper-cd48513b061898601f2a52cf7d3f5f92ad9ce958.zip
fixed error and removed browser on startup
For testing purposes I had the mod browser auto show on startup, that's removed now, I also when refactoring some code forgot to change the name of a function everywhere, leading to an error.
-rw-r--r--src/app/browser.js9
-rw-r--r--src/app/index.html8
-rw-r--r--src/lang/en.json5
3 files changed, 12 insertions, 10 deletions
diff --git a/src/app/browser.js b/src/app/browser.js
index b9ab165..40670bc 100644
--- a/src/app/browser.js
+++ b/src/app/browser.js
@@ -68,7 +68,7 @@ var Browser = {
return
} else if (! state) {
if (state != undefined) {
- Browser.filters(false);
+ Browser.filters.toggle(false);
overlay.classList.remove("shown")
browser.classList.remove("shown")
return
@@ -96,7 +96,7 @@ var Browser = {
},
loading: (string) => {
if (Browser.filters.get().unfiltered.length == 0) {
- string = "No mods found...";
+ string = lang("gui.browser.noresults");
}
if (string) {
@@ -116,7 +116,7 @@ var Browser = {
let res = fuse.search(string);
if (res.length < 1) {
- Browser.loading("No results...")
+ Browser.loading(lang("gui.browser.noresults"))
return
}
@@ -326,9 +326,6 @@ browser.addEventListener("scroll", () => {
Browser.filters.toggle(false);
})
-Browser.toggle(true);
-Browser.filters.toggle();
-
let checks = document.querySelectorAll(".check");
for (let i = 0; i < checks.length; i++) {
checks[i].setAttribute("onclick", "this.classList.toggle('checked');Browser.loadfront();search.value = ''")
diff --git a/src/app/index.html b/src/app/index.html
index eab84e3..8ad5ecf 100644
--- a/src/app/index.html
+++ b/src/app/index.html
@@ -88,10 +88,10 @@
<div class="popup" id="browser">
<div class="overlay" id="filters">
<div class="checks">
- <div class="check checked" value="Mods">Mods</div>
- <div class="check checked" value="Skins">Skins</div>
- <div class="check checked" value="Client-side">Client-side</div>
- <div class="check" value="Server-side">Server-side</div>
+ <div class="check checked" value="Mods">%%gui.browser.filter.mods%%</div>
+ <div class="check checked" value="Skins">%%gui.browser.filter.skins%%</div>
+ <div class="check checked" value="Client-side">%%gui.browser.filter.client%%</div>
+ <div class="check" value="Server-side">%%gui.browser.filter.server%%</div>
</div>
</div>
diff --git a/src/lang/en.json b/src/lang/en.json
index 04ecfdd..8defc7d 100644
--- a/src/lang/en.json
+++ b/src/lang/en.json
@@ -73,6 +73,11 @@
"gui.browser.reinstall": "Re-Install",
"gui.browser.loading": "Loading mods...",
"gui.browser.endoflist": "Maximum packages has been loaded.<br>Use the search for finding other packages!",
+ "gui.browser.noresults": "No results...",
+ "gui.browser.filter.mods": "Mods",
+ "gui.browser.filter.skins": "Skins",
+ "gui.browser.filter.client": "Client-side",
+ "gui.browser.filter.server": "Server-side",
"gui.settings.save": "Save",
"gui.settings.discard": "Discard",