summaryrefslogtreecommitdiff
path: root/src/http/tpl
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2023-08-25 21:04:59 +0200
committerBrian Picciano <mediocregopher@gmail.com>2023-08-25 21:12:57 +0200
commit78bbfa42fa1159bce12c2c1d29eeb0bb9a8a2f75 (patch)
tree041dd938346eddf0a4bcd098403c229555a654cb /src/http/tpl
parentc4ec9064063f3b15aeb25feb85a3afaaa02008ba (diff)
Remove mailinglist and proof-of-work functionality
Diffstat (limited to 'src/http/tpl')
-rw-r--r--src/http/tpl/finalize.html45
-rw-r--r--src/http/tpl/follow.html108
-rw-r--r--src/http/tpl/unsubscribe.html44
3 files changed, 0 insertions, 197 deletions
diff --git a/src/http/tpl/finalize.html b/src/http/tpl/finalize.html
deleted file mode 100644
index 8bdfceb..0000000
--- a/src/http/tpl/finalize.html
+++ /dev/null
@@ -1,45 +0,0 @@
-{{ define "body" }}
-
-<script async type="module" src="{{ StaticURL "api.js" }}"></script>
-
-<style>
-#result.success { color: green; }
-#result.fail { color: red; }
-</style>
-
-<span id="result"></span>
-
-<script>
-
-(async () => {
-
- const resultSpan = document.getElementById("result");
-
- try {
-
- const urlParams = new URLSearchParams(window.location.search);
- const subToken = urlParams.get('subToken');
-
- if (!subToken) throw "No subscription token provided";
-
- const api = await import("{{ StaticURL "api.js" }}");
-
- await api.call('/api/mailinglist/finalize', {
- body: { subToken },
- });
-
- resultSpan.className = "success";
- resultSpan.innerHTML = "Your email subscription has been finalized! Please go on about your day.";
-
- } catch (e) {
- resultSpan.className = "fail";
- resultSpan.innerHTML = e;
- }
-
-})();
-
-</script>
-
-{{ end }}
-
-{{ template "base.html" . }}
diff --git a/src/http/tpl/follow.html b/src/http/tpl/follow.html
index 88fee46..1958f95 100644
--- a/src/http/tpl/follow.html
+++ b/src/http/tpl/follow.html
@@ -1,113 +1,5 @@
{{ define "body" }}
-<script async type="module" src="{{ StaticURL "api.js" }}"></script>
-
-<p>
- Here's your options for receiving updates about new posts:
-</p>
-
-<h2>Option 1: Email</h2>
-
-<p>
- Email is by far my preferred option for notifying followers of new posts. The
- entire email list system for this site has been designed from scratch and is
- completely self-hosted in my living room.
-</p>
-
-<p>
- I solemnly swear that:
-</p>
-
-<ul>
-
- <li>
- You will never receive an email from me except to notify of a new post.
- </li>
-
- <li>
- Your email will never be provided or sold to anyone else for any reason.
- </li>
-
-</ul>
-
-<p>
- So smash that subscribe button!
-</p>
-
-<p>
- You will need to verify your email, so be sure to check your spam folder to
- complete the process if you don't immediately see anything in your inbox.
-</p>
-
-<p style="color: var(--nc-lk-2);">
- Unfortunately Google considers all emails from my mail server to be spam, so
- gmail emails are not allowed. Sorry (not sorry).
-</p>
-
-<style>
-
-#emailStatus.success {
- color: green;
-}
-
-#emailStatus.fail {
- color: red;
-}
-
-</style>
-
-<form action="javascript:void(0);">
- <input type="email" placeholder="name@host.com" id="emailAddress" />
- <input class="button-primary" type="submit" value="Subscribe" id="emailSubscribe" />
- <span id="emailStatus"></span>
-</form>
-
-<script>
-
-const emailAddress = document.getElementById("emailAddress");
-const emailSubscribe = document.getElementById("emailSubscribe");
-const emailSubscribeOrigValue = emailSubscribe.value;
-const emailStatus = document.getElementById("emailStatus");
-
-emailSubscribe.onclick = async () => {
-
- const api = await import("{{ StaticURL "api.js" }}");
-
- emailSubscribe.disabled = true;
- emailSubscribe.className = "";
- emailSubscribe.value = "Please hold...";
- emailStatus.innerHTML = '';
-
- try {
-
- if (!window.isSecureContext) {
- throw "The browser environment is not secure.";
- }
-
- await api.call('/api/mailinglist/subscribe', {
- body: { email: emailAddress.value },
- requiresPow: true,
- });
-
- emailStatus.className = "success";
- emailStatus.innerHTML = "Verification email sent (check your spam folder)";
-
- } catch (e) {
- emailStatus.className = "fail";
- emailStatus.innerHTML = e;
-
- } finally {
- emailSubscribe.disabled = false;
- emailSubscribe.className = "button-primary";
- emailSubscribe.value = emailSubscribeOrigValue;
- }
-
-};
-
-</script>
-
-<h2>Option 2: RSS</h2>
-
<p>
RSS is the classic way to follow a site's updates, and we're bringing it back!
Just give any RSS reader the following URL:
diff --git a/src/http/tpl/unsubscribe.html b/src/http/tpl/unsubscribe.html
deleted file mode 100644
index ad01735..0000000
--- a/src/http/tpl/unsubscribe.html
+++ /dev/null
@@ -1,44 +0,0 @@
-{{ define "body" }}
-
-<script async type="module" src="{{ StaticURL "api.js" }}"></script>
-
-<style>
-#result.success { color: green; }
-#result.fail { color: red; }
-</style>
-
-<span id="result"></span>
-
-<script>
-
-(async () => {
-
- const resultSpan = document.getElementById("result");
-
- try {
- const urlParams = new URLSearchParams(window.location.search);
- const unsubToken = urlParams.get('unsubToken');
-
- if (!unsubToken) throw "No unsubscribe token provided";
-
- const api = await import("{{ StaticURL "api.js" }}");
-
- await api.call('/api/mailinglist/unsubscribe', {
- body: { unsubToken },
- });
-
- resultSpan.className = "success";
- resultSpan.innerHTML = "You have been unsubscribed! Please go on about your day.";
-
- } catch (e) {
- resultSpan.className = "fail";
- resultSpan.innerHTML = e;
- }
-
-})();
-
-</script>
-
-{{ end }}
-
-{{ template "base.html" . }}