summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2020-04-01 06:13:08 -0400
committerDaniel Micay <danielmicay@gmail.com>2020-04-01 06:15:48 -0400
commitb23ea7474c6c3d806dc5cc620fdfd13843e5d415 (patch)
tree1ba27b60c3e9c7b32e64b6cf80b3f751d532e045
parentb945ab3cac79b113d976b429b0fffa3c72a49fdf (diff)
use ES6 modules for all JavaScript
-rw-r--r--.jshintrc1
-rwxr-xr-xdeploy_static2
-rw-r--r--static/build.html2
-rw-r--r--static/faq.html2
-rw-r--r--static/index.html2
-rw-r--r--static/redirect.js2
-rw-r--r--static/releases.html4
-rw-r--r--static/releases.js2
-rw-r--r--static/usage.html2
9 files changed, 8 insertions, 11 deletions
diff --git a/.jshintrc b/.jshintrc
index 1a275e76..5379688d 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -1,5 +1,6 @@
{
"browser": true,
+ "module": true,
"devel": true,
"esversion": 6,
"strict": "global"
diff --git a/deploy_static b/deploy_static
index 7571afb4..7eb0fcb6 100755
--- a/deploy_static
+++ b/deploy_static
@@ -7,7 +7,7 @@ set -o errexit
rm -rf static_tmp
cp -a static static_tmp
json_reformat -m < static_tmp/manifest.webmanifest | sponge static_tmp/manifest.webmanifest
-find static_tmp -name '*.js' -exec terser -cmo {} {} \;
+find static_tmp -name '*.js' -exec terser --module -cmo {} {} \;
find static_tmp -regex '\(.+/LICENSE\|.+\.\(css\|html\|ico\|js\|svg\|txt\|webmanifest\|xml\)\)' -exec zopfli {} \; -exec touch -r {} {}.gz \;
remote=www-data@grapheneos.org
diff --git a/static/build.html b/static/build.html
index feb4c4fc..7b0aef37 100644
--- a/static/build.html
+++ b/static/build.html
@@ -23,6 +23,7 @@
<link rel="stylesheet" href="/grapheneos.css?16"/>
<link rel="manifest" href="/manifest.webmanifest"/>
<link rel="canonical" href="https://grapheneos.org/build"/>
+ <script type="module" src="/redirect.js?6"></script>
</head>
<body>
<nav>
@@ -935,6 +936,5 @@ export PATH="$PATH:$HOME/sdk/tools:$HOME/sdk/tools/bin:$HOME/sdk/platform-tools:
<li><a href="https://reddit.com/r/GrapheneOS">Reddit</a></li>
</ul>
</footer>
- <script src="/redirect.js?5"></script>
</body>
</html>
diff --git a/static/faq.html b/static/faq.html
index 7388d30e..c1f36ad7 100644
--- a/static/faq.html
+++ b/static/faq.html
@@ -23,6 +23,7 @@
<link rel="stylesheet" href="/grapheneos.css?16"/>
<link rel="manifest" href="/manifest.webmanifest"/>
<link rel="canonical" href="https://grapheneos.org/faq"/>
+ <script type="module" src="/redirect.js?6"></script>
</head>
<body>
<nav>
@@ -653,6 +654,5 @@
<li><a href="https://reddit.com/r/GrapheneOS">Reddit</a></li>
</ul>
</footer>
- <script src="/redirect.js?5"></script>
</body>
</html>
diff --git a/static/index.html b/static/index.html
index 8f936186..e1c227c4 100644
--- a/static/index.html
+++ b/static/index.html
@@ -23,6 +23,7 @@
<link rel="stylesheet" href="/grapheneos.css?16"/>
<link rel="manifest" href="/manifest.webmanifest"/>
<link rel="canonical" href="https://grapheneos.org/"/>
+ <script type="module" src="/redirect.js?6"></script>
</head>
<body>
<nav>
@@ -114,6 +115,5 @@
<li><a href="https://reddit.com/r/GrapheneOS">Reddit</a></li>
</ul>
</footer>
- <script src="/redirect.js?5"></script>
</body>
</html>
diff --git a/static/redirect.js b/static/redirect.js
index cbc198cc..54c5be82 100644
--- a/static/redirect.js
+++ b/static/redirect.js
@@ -1,7 +1,5 @@
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT
-"use strict";
-
// Client-side redirects for fragments (anchors)
//
// It should be possible to do this with server-side redirects, but it was never implemented or
diff --git a/static/releases.html b/static/releases.html
index 99a9b133..a2f23e2f 100644
--- a/static/releases.html
+++ b/static/releases.html
@@ -23,6 +23,8 @@
<link rel="stylesheet" href="/grapheneos.css?16"/>
<link rel="manifest" href="/manifest.webmanifest"/>
<link rel="canonical" href="https://grapheneos.org/releases"/>
+ <script type="module" src="/releases.js?12"></script>
+ <script type="module" src="/redirect.js?6"></script>
</head>
<body>
<nav>
@@ -1098,7 +1100,5 @@
<li><a href="https://reddit.com/r/GrapheneOS">Reddit</a></li>
</ul>
</footer>
- <script src="/releases.js?11"></script>
- <script src="/redirect.js?5"></script>
</body>
</html>
diff --git a/static/releases.js b/static/releases.js
index 83297850..bf786163 100644
--- a/static/releases.js
+++ b/static/releases.js
@@ -1,7 +1,5 @@
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT
-"use strict";
-
const baseUrl = "https://releases.grapheneos.org/";
const versionBaseUrl = "https://github.com/GrapheneOS/platform_manifest/releases/tag/";
const devices = ["bonito", "sargo", "crosshatch", "blueline", "taimen", "walleye"];
diff --git a/static/usage.html b/static/usage.html
index 72f43b07..428624ec 100644
--- a/static/usage.html
+++ b/static/usage.html
@@ -23,6 +23,7 @@
<link rel="stylesheet" href="/grapheneos.css?16"/>
<link rel="manifest" href="/manifest.webmanifest"/>
<link rel="canonical" href="https://grapheneos.org/usage"/>
+ <script type="module" src="/redirect.js?6"></script>
</head>
<body>
<nav>
@@ -335,6 +336,5 @@
<li><a href="https://reddit.com/r/GrapheneOS">Reddit</a></li>
</ul>
</footer>
- <script src="/redirect.js?5"></script>
</body>
</html>