diff options
author | BobIsMyManager <bimmgitsignature.nly8m@simplelogin.co> | 2022-07-26 22:28:50 +0100 |
---|---|---|
committer | BobIsMyManager <bimmgitsignature.nly8m@simplelogin.co> | 2022-07-26 22:28:50 +0100 |
commit | 2a0596f08fb54e2faef4bcb4548a28f5837fc067 (patch) | |
tree | cf5851f95c37da269a561623cee0d3967ca321ec /src/pages/options/index.js | |
parent | I should really inspect diffs before commiting (diff) | |
download | libredirect-2a0596f08fb54e2faef4bcb4548a28f5837fc067.zip |
Many things
Made all instances updateable Added hyperpipe Closes https://github.com/libredirect/libredirect/issues/398 Added cloudtube Closes https://github.com/libredirect/libredirect/issues/397 Start using prettier
Diffstat (limited to 'src/pages/options/index.js')
-rw-r--r-- | src/pages/options/index.js | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/pages/options/index.js b/src/pages/options/index.js index 39f9c8f3..409fa5b5 100644 --- a/src/pages/options/index.js +++ b/src/pages/options/index.js @@ -1,24 +1,23 @@ -for (const a of document.getElementById('links').getElementsByTagName('a')) { - a.addEventListener('click', e => { - const path = a.getAttribute('href').replace('#', ''); - loadPage(path); - e.preventDefault(); - }) +for (const a of document.getElementById("links").getElementsByTagName("a")) { + a.addEventListener("click", e => { + const path = a.getAttribute("href").replace("#", "") + loadPage(path) + e.preventDefault() + }) } function loadPage(path) { - for (const section of document.getElementById('pages').getElementsByTagName('section')) - section.style.display = 'none'; - document.getElementById(`${path}_page`).style.display = 'block'; + for (const section of document.getElementById("pages").getElementsByTagName("section")) section.style.display = "none" + document.getElementById(`${path}_page`).style.display = "block" - for (const a of document.getElementById('links').getElementsByTagName('a')) - if (a.getAttribute('href') == `#${path}`) a.classList.add('selected') - else a.classList.remove('selected') + for (const a of document.getElementById("links").getElementsByTagName("a")) + if (a.getAttribute("href") == `#${path}`) a.classList.add("selected") + else a.classList.remove("selected") - let stateObj = { id: "100" }; - window.history.pushState(stateObj, "Page 2", `/pages/options/index.html#${path}`); + let stateObj = { id: "100" } + window.history.pushState(stateObj, "Page 2", `/pages/options/index.html#${path}`) } const r = window.location.href.match(/#(.*)/) -if (r) loadPage(r[1]); -else loadPage('general'); \ No newline at end of file +if (r) loadPage(r[1]) +else loadPage("general") |