Upload app.js
Browse files- static/app.js +1 -9
static/app.js
CHANGED
|
@@ -302,7 +302,6 @@ function syncUrl(replace = true) {
|
|
| 302 |
if (STATE.exact) params.set("exact", "1");
|
| 303 |
if (STATE.fulltext) params.set("fulltext", "1");
|
| 304 |
if (!STATE.historyEnabled) params.set("history", "0");
|
| 305 |
-
if (STATE.isMobile) params.set("view", "mobile");
|
| 306 |
const basePath = STATE.source ? `/${encodeURIComponent(STATE.source)}` : "/";
|
| 307 |
const nextUrl = params.toString() ? `${basePath}?${params.toString()}` : basePath;
|
| 308 |
if (replace) history.replaceState(null, "", nextUrl);
|
|
@@ -320,9 +319,6 @@ function loadUrlState() {
|
|
| 320 |
STATE.fulltext = params.get("fulltext") === "1";
|
| 321 |
STATE.historyEnabled = params.get("history") !== "0";
|
| 322 |
const sort = params.get("sort") || "relevance";
|
| 323 |
-
const view = params.get("view");
|
| 324 |
-
if (view === "mobile") STATE.isMobile = true;
|
| 325 |
-
if (view === "desktop") STATE.isMobile = false;
|
| 326 |
DOM.searchInput.value = STATE.query;
|
| 327 |
DOM.exactToggle.checked = STATE.exact;
|
| 328 |
DOM.fulltextToggle.checked = STATE.fulltext;
|
|
@@ -686,7 +682,6 @@ function attachEvents() {
|
|
| 686 |
});
|
| 687 |
DOM.mobileToggleBtn.addEventListener("click", () => {
|
| 688 |
STATE.isMobile = !STATE.isMobile;
|
| 689 |
-
localStorage.setItem("mobileMode", STATE.isMobile ? "mobile" : "desktop");
|
| 690 |
applyMobileMode();
|
| 691 |
});
|
| 692 |
DOM.searchInput.addEventListener("focus", renderHistoryDropdown);
|
|
@@ -907,10 +902,7 @@ async function init() {
|
|
| 907 |
cacheDom();
|
| 908 |
STATE.isDark = localStorage.getItem("theme") !== "light";
|
| 909 |
applyTheme();
|
| 910 |
-
|
| 911 |
-
if (savedMobile === "mobile") STATE.isMobile = true;
|
| 912 |
-
else if (savedMobile === "desktop") STATE.isMobile = false;
|
| 913 |
-
else STATE.isMobile = window.innerWidth <= 768;
|
| 914 |
syncRoute();
|
| 915 |
loadUrlState();
|
| 916 |
applyMobileMode();
|
|
|
|
| 302 |
if (STATE.exact) params.set("exact", "1");
|
| 303 |
if (STATE.fulltext) params.set("fulltext", "1");
|
| 304 |
if (!STATE.historyEnabled) params.set("history", "0");
|
|
|
|
| 305 |
const basePath = STATE.source ? `/${encodeURIComponent(STATE.source)}` : "/";
|
| 306 |
const nextUrl = params.toString() ? `${basePath}?${params.toString()}` : basePath;
|
| 307 |
if (replace) history.replaceState(null, "", nextUrl);
|
|
|
|
| 319 |
STATE.fulltext = params.get("fulltext") === "1";
|
| 320 |
STATE.historyEnabled = params.get("history") !== "0";
|
| 321 |
const sort = params.get("sort") || "relevance";
|
|
|
|
|
|
|
|
|
|
| 322 |
DOM.searchInput.value = STATE.query;
|
| 323 |
DOM.exactToggle.checked = STATE.exact;
|
| 324 |
DOM.fulltextToggle.checked = STATE.fulltext;
|
|
|
|
| 682 |
});
|
| 683 |
DOM.mobileToggleBtn.addEventListener("click", () => {
|
| 684 |
STATE.isMobile = !STATE.isMobile;
|
|
|
|
| 685 |
applyMobileMode();
|
| 686 |
});
|
| 687 |
DOM.searchInput.addEventListener("focus", renderHistoryDropdown);
|
|
|
|
| 902 |
cacheDom();
|
| 903 |
STATE.isDark = localStorage.getItem("theme") !== "light";
|
| 904 |
applyTheme();
|
| 905 |
+
STATE.isMobile = window.innerWidth <= 768;
|
|
|
|
|
|
|
|
|
|
| 906 |
syncRoute();
|
| 907 |
loadUrlState();
|
| 908 |
applyMobileMode();
|