aboutsummaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorFChannel <=>2021-02-04 12:33:42 -0800
committerFChannel <=>2021-02-04 12:33:42 -0800
commit1df70fec27ab5e4aa3dff8521767454be6b5498c (patch)
tree4902b557879b46f37103ac7a62c62833796c8c22 /static
parentf6eecc720abaefb954fda9a26aab78bb1d706ba4 (diff)
when merging boards into a feed show the board color based on posts restrictions
Diffstat (limited to 'static')
-rw-r--r--static/catalog.html189
-rw-r--r--static/faq.html2
-rw-r--r--static/main.html8
-rw-r--r--static/manage.html10
-rw-r--r--static/rules.html6
5 files changed, 200 insertions, 15 deletions
diff --git a/static/catalog.html b/static/catalog.html
new file mode 100644
index 0000000..b5b361e
--- /dev/null
+++ b/static/catalog.html
@@ -0,0 +1,189 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>{{ .Title }}</title>
+ </head>
+ <style>
+ a, a:link, a:visited, a:hover, a:active {
+ text-decoration: none
+ }
+
+ a:link, a:visited, a:active {
+ color: black;
+ }
+
+ a:hover {
+ color: #de0808;
+ }
+ </style>
+ <script>
+
+ function getMIMEType(type)
+ {
+ re = /\/.+/g
+ return type.replace(re, "")
+ }
+
+ function shortURL(url)
+ {
+ var check = url.replace("{{.Board.Actor}}/", "")
+ re = /.+\//g;
+ temp = re.exec(url)
+ if(temp[0] == "{{ .Board.Actor }}/")
+ {
+ var short = url.replace("https://", "");
+ short = short.replace("http://", "");
+ short = short.replace("www.", "");
+
+ var re = /^.{3}/g;
+
+ var u = re.exec(short);
+
+ re = /\w+$/g;
+
+ u = re.exec(short);
+
+ return u;
+ }else{
+ var short = url.replace("https://", "");
+ short = short.replace("http://", "");
+ short = short.replace("www.", "");
+
+ var re = /^.{3}/g;
+
+ var u = re.exec(short);
+
+ re = /\w+$/g;
+
+ u = re.exec(short);
+
+
+ replace = short.replace(/\/+/g, " ")
+ replace = replace.replace(u, " ").trim()
+ re = /\w+$/;
+ v = re.exec(replace)
+
+ v = "f" + v[0] + "-" + u
+
+ return v;
+ }
+ }
+
+ </script>
+ <body style="background-color: #eef2fe;">
+ <ul id="top" style="padding:0; display: inline;">
+ {{range .Boards}}
+ <li style="display: inline;"><a href="{{.Location}}">{{.Name }}</a></li>
+ {{end}}
+ </ul>
+ {{ $board := .Board }}
+ {{ if $board.IsMod }}
+ <span style="float: right;"><a href="/{{ .Key }}/{{ .Board.Name }}">[Manage Board]</a></span>
+ {{ end }}
+ <div style="margin: 0 auto; width: 400px; margin-bottom: 100px;">
+ <h1 style="color: #af0a0f;">/{{ $board.Name }}/ - {{ $board.PrefName }}</h1>
+ <form id="new-post" action="/post" method="post" enctype="multipart/form-data">
+ <label for="name">Name:</label><br>
+ <input type="text" id="name" name="name" placeholder="Anonymous"><br>
+ <label for="options">Options:</label><br>
+ <input type="text" id="options" name="options"><br>
+ <label for="subject">Subject:</label><br>
+ <input type="text" id="subject" name="subject"><input type="submit" value="Post"><br>
+ <label for="comment">Comment:</label><br>
+ <textarea rows="10" cols="50" id="comment" name="comment"></textarea><br>
+ <input type="hidden" id="inReplyTo" name="inReplyTo" value="{{ $board.InReplyTo }}">
+ <input type="hidden" id="sendTo" name="sendTo" value="{{ $board.To }}">
+ <input type="hidden" id="boardName" name="boardName" value="{{ $board.Name }}">
+ <input type="hidden" id="captchaCode" name="captchaCode" value="{{ $board.CaptchaCode }}">
+ <input type="file" id="file" name="file"><br><br>
+ <label stye="display: inline-block;" for="captcha">Captcha:</label><br>
+ <input style="display: inline-block;" type="text" id="captcha" name="captcha"><br>
+ <div style="height: 65px;">
+ <img src="{{ $board.Captcha }}">
+ </div>
+ </form>
+ </div>
+
+ <hr>
+ <ul style="margin: 0; padding: 0; display: inline">
+ <li style="display: inline"><a href="/{{ $board.Name }}">[Return]</a></li>
+ <li style="display: inline"><a href="#bottom">[Bottom]</a></li>
+ <li style="display: inline"><a href="javascript:location.reload()">[Refresh]</a></li>
+ </ul>
+ <hr>
+
+ <div style="padding: 10px; text-align: center;">
+ {{ range .Posts }}
+ <div style="overflow: hidden; vertical-align: top; margin: 0 auto; display: inline-block; width: 180px; max-height: 320px; margin-bottom: 10px;">
+ {{ if $board.IsMod }}
+ <a href="/delete?id={{ .Id }}">[Delete Post]</a>
+ {{ end }}
+ {{ if .Attachment }}
+ {{ if $board.IsMod }}
+ <a href="/deleteattach?id={{ .Id }}">[Delete Attachment]</a>
+ {{ end }}
+ <a id="{{ .Id }}-anchor" href="/{{ $board.Name }}/">
+ <div id="media-{{ .Id }}"></div>
+ <script>
+ media = document.getElementById("media-{{ .Id }}")
+ if(getMIMEType({{ (index .Attachment 0).MediaType }}) == "image"){
+ var img = document.createElement("img");
+ img.style = "float: left; margin-right: 10px; margin-bottom: 10px; max-width: 150px; max-height: 150px; cursor: move;"
+ img.setAttribute("id", "img")
+ img.setAttribute("main", "1")
+ img.setAttribute("src", "{{ (index .Attachment 0).Href }}")
+ media.appendChild(img)
+ }
+
+ if(getMIMEType({{ (index .Attachment 0).MediaType }}) == "audio"){
+ var audio = document.createElement("audio")
+ audio.controls = 'controls'
+ audio.muted = 'muted'
+ audio.src = '{{ (index .Attachment 0).Href }}'
+ audio.type = '{{ (index .Attachment 0).MediaType }}'
+ audio.style = "float: left; margin-right: 10px; margin-bottom: 10px; width: 150px;"
+ audio.innerText = 'Audio is not supported.'
+ media.appendChild(audio)
+ }
+
+ if(getMIMEType({{ (index .Attachment 0).MediaType }}) == "video"){
+ var video = document.createElement("video")
+ video.controls = 'controls'
+ video.muted = 'muted'
+ video.src = '{{ (index .Attachment 0).Href }}'
+ video.type = '{{ (index .Attachment 0).MediaType }}'
+ video.style = "float: left; margin-right: 10px; margin-bottom: 10px; width: 150px;"
+ video.innerText = 'Video is not supported.'
+ media.appendChild(video)
+ }
+ </script>
+
+
+ {{ end }}
+ <div>
+ {{ $replies := .Replies }}
+ <span style="display: block">R: {{ $replies.TotalItems }}{{ if $replies.TotalImgs }}/ A: {{ $replies.TotalImgs }}{{ end }}</span>
+ {{ if .Name }}
+ <span style="display: block; color: #0f0c5d;"><b>{{ .Name }}</b></span>
+ {{ end }}
+ {{ if .Content }}
+ <span style="display: block">{{.Content}}</span>
+ {{ end }}
+ </div>
+ </a>
+ </div>
+ <script>
+ document.getElementById("{{ .Id }}-anchor").href = "/{{ $board.Name }}/" + shortURL("{{ .Id }}")
+ </script>
+ {{ end }}
+ </div>
+ <hr>
+ <ul style="margin: 0; padding: 0; display: inline">
+ <li style="display: inline"><a href="/{{ $board.Name }}">[Return]</a></li>
+ <li style="display: inline"><a id="bottom" href="#top">[Top]</a></li>
+ <li style="display: inline"><a href="javascript:location.reload()">[Refresh]</a></li>
+ </ul>
+ <hr>
+ </body>
+</html>
+
diff --git a/static/faq.html b/static/faq.html
index 2b81e43..66c053d 100644
--- a/static/faq.html
+++ b/static/faq.html
@@ -5,7 +5,7 @@
<h1 style="text-align: center;">FAQ</h1>
<div>
<h4>What is fchan</h4>
- <p>fchan short for fchannel and is a federated image board based on activity pub. it removes the centralization aspect that so many of us have become accustom to. it is not trying to re-invent the wheel and draws likeness from other chans for ease of familiarity. you can get the source code here https://github.com/FChannel0 any help is appreciated.</p>
+ <p>fchan short for fchannel and is a federated image board based on activity pub. it removes the need for centeralized boards. many boards can be connected and feeds shared or followed. it draws likeness from other chans for ease of familiarity. you can get the source code here https://github.com/FChannel0 and modify how you choose, any help is appreciated.</p>
<h4>Options</h4>
<p>the options field when posting can be used for special options when posting. type noko in the options field to return to the thread you posting to. use sage to ignore updating the thread bump order. nokosage will do both.</p>
diff --git a/static/main.html b/static/main.html
index 7d5d236..dd9d0c0 100644
--- a/static/main.html
+++ b/static/main.html
@@ -19,7 +19,7 @@
}
body {
- {{ if .Board.Restricted }}
+ {{ if .Board.Post.Actor.Restricted }}
background-color: #eef2fe;
color: black;
{{ else }}
@@ -29,7 +29,7 @@
}
.popup-box {
- {{ if .Board.Restricted }}
+ {{ if .Board.Post.Actor.Restricted }}
border: 4px solid #d3caf0;
background-color: #eff5ff;
{{ else }}
@@ -43,7 +43,7 @@
}
.reply {
- {{ if .Board.Restricted }}
+ {{ if .Board.Post.Actor.Restricted }}
color:#af0a0f;
{{ else }}
color:#000080;
@@ -51,7 +51,7 @@
}
.post {
- {{ if .Board.Restricted }}
+ {{ if .Board.Post.Actor.Restricted }}
background-color: #d5daf0;
{{ else }}
background-color: #f0e0d6;
diff --git a/static/manage.html b/static/manage.html
index 06288cd..570c0f5 100644
--- a/static/manage.html
+++ b/static/manage.html
@@ -16,7 +16,7 @@
</ul>
</div>
<a href="/{{ .Board.Name }}">[Return]</a>
-{{ $actor := .Actor.Id }}
+{{ $actor := .Board.Actor.Id }}
{{ $board := .Board }}
{{ $key := .Key }}
{{ if .IsLocal }}
@@ -24,9 +24,9 @@
<h4>Subscribed</h4>
<form id="follow-form" action="/{{ .Key }}/{{ .Board.Name }}/follow" method="post" enctype="application/x-www-form-urlencoded">
<label>Subscribe:</label><br>
- <input id="follow" name="follow" style="margin-bottom: 12px;" placeholder="https://localhost:3000/g"></input>
+ <input id="follow" name="follow" style="margin-bottom: 12px;" placeholder="https://server.fchan.xyz/g"></input>
<input type="submit" value="Subscribe"><br>
- <input type="hidden" name="actor" value="{{ .Actor.Id }}">
+ <input type="hidden" name="actor" value="{{ $board.Actor.Id }}">
</form>
<ul style="display: inline-block; padding: 0; margin: 0;">
@@ -81,8 +81,8 @@
reportedArray.forEach(function(r, i){
var id = r.getAttribute("post")
- r.innerText = "/" + {{ .Board.Name }} + "/" + shortURL("{{ .Actor.Id }}", id)
- r.href = {{ .Domain }} + "/" + {{ .Board.Name }} + "/" + shortURL("{{ .Actor.Id }}", id)
+ r.innerText = "/" + {{ .Board.Name }} + "/" + shortURL("{{ .Board.Actor.Id }}", id)
+ r.href = {{ .Domain }} + "/" + {{ .Board.Name }} + "/" + shortURL("{{ .Board.Actor.Id }}", id)
})
</script>
{{ end }}
diff --git a/static/rules.html b/static/rules.html
index 1ca49ee..574435a 100644
--- a/static/rules.html
+++ b/static/rules.html
@@ -2,15 +2,11 @@
<html>
<body style="background-color:#ffffee; max-width: 800px; margin: 0 auto;">
<a style="color: black;" href="javascript:history.back()">[Back]</a>
- <h1 style="padding-left: 15px;">Rules and Agreements:</h1>
+ <h1 style="text-align: center;">Rules and Agreements:</h1>
<ol>
<li>Do not break or violate United States laws.</li>
<li>Age Restriction is 18 years and older.</li>
<li>Any blue boards are restricted to work safe posts only.</li>
</ol>
- <div style="padding-top: 500px;width: 500px; margin:0 auto; margin-top: 50px; text-align: center;">
- <a href="/">[Home]</a><a href="/static/rules.html">[Rules]</a><a href="/static/faq.html">[FAQ]</a>
- <p>All media are copyright to their respective owners.</p>
- </div>
</body>
</html>