summaryrefslogtreecommitdiff
path: root/static/redirect.js
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2021-01-05 02:43:55 -0500
committerDaniel Micay <danielmicay@gmail.com>2021-01-05 02:43:55 -0500
commitf9328e24c1b4adf2d6e5f36a471fd504fa8dd8f7 (patch)
tree415db24e9f12f1a91bb0ef30d80d47d16aaed51d /static/redirect.js
parente1ddbd94b0a975b4ee08f8936672b6da80e4d113 (diff)
move javascript files to js directory
Diffstat (limited to 'static/redirect.js')
-rw-r--r--static/redirect.js36
1 files changed, 0 insertions, 36 deletions
diff --git a/static/redirect.js b/static/redirect.js
deleted file mode 100644
index e11560d1..00000000
--- a/static/redirect.js
+++ /dev/null
@@ -1,36 +0,0 @@
-// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT
-
-// Client-side redirects for fragments (anchors)
-//
-// It should be possible to do this with server-side redirects, but it was never implemented or
-// standardized. For reference:
-//
-// https://www.w3.org/People/Bos/redirect
-// https://www.w3.org/Protocols/HTTP/Fragment/draft-bos-http-redirect-00.txt
-
-const redirects = new Map([
- ["/#device-support", "/faq#device-support"],
- ["/#roadmap", "/faq#roadmap"],
- ["/#copyright-and-licensing", "/faq#copyright-and-licensing"],
- ["/usage#default-connections", "/faq#default-connections"],
- ["/releases#marlin-stable", "/faq#legacy-devices"],
- ["/releases#sailfish-stable", "/faq#legacy-devices"],
- ["/releases#marlin-beta", "/faq#legacy-devices"],
- ["/releases#sailfish-beta", "/faq#legacy-devices"],
- ["/faq#dns", "/faq#custom-dns"],
- ["/build#upgrading-to-android-10", "/build#generating-release-signing-keys"],
-]);
-
-function handle_hash() {
- if (window.location.hash) {
- const redirect = redirects.get(window.location.pathname + window.location.hash);
- if (redirect) {
- window.location.replace(redirect);
- }
- }
-}
-
-handle_hash();
-addEventListener("hashchange", handle_hash, false);
-
-// @license-end