aboutsummaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorFChannel <>2021-06-28 20:45:56 -0700
committerFChannel <>2021-06-28 20:45:56 -0700
commit9b67a65d76eb98a6e405b677a20c6215e1271753 (patch)
treec70109d50a97624820d090c53e53a3965404a684 /static
parent2e53eddedd4b3e5c444bea5a101a719cba3a4cc9 (diff)
tor placeholder image for catalog page
Diffstat (limited to 'static')
-rw-r--r--static/ncatalog.html20
-rw-r--r--static/posts.html4
2 files changed, 16 insertions, 8 deletions
diff --git a/static/ncatalog.html b/static/ncatalog.html
index deb8e27..cbb3ae8 100644
--- a/static/ncatalog.html
+++ b/static/ncatalog.html
@@ -35,18 +35,15 @@
<a href="/deleteattach?id={{ .Id }}&board={{ $board.Actor.Name }}">[Delete Attachment]</a>
<a href="/marksensitive?id={{ .Id }}&board={{ $board.Actor.Name }}">[Mark Sensitive]</a>
{{ end }}
-
- {{ if and .Sensitive $board.Actor.Restricted }}
- <div id="hide-{{ .Id }}" style="display: none;">[Hide]</div>
- <div id="sensitive-{{ .Id }}" style="display: none;"><div style="position: relative; text-align: center;"><img style="float: left; margin-right: 10px; margin-bottom: 10px; max-width: 180px; max-height: 180px;" src="/static/sensitive.png"><div style="width: 170px; position: absolute; margin-top: 75px; padding: 5px; background-color: black; color: white; cursor: default; ">NSFW Content</div></div></div>
- {{ end }}
+ <div id="hide-{{ .Id }}" style="display: none;">[Hide]</div>
+ <div id="sensitive-{{ .Id }}" style="display: none;"><div style="position: relative; text-align: center;"><img id="sensitive-img-{{ .Id }}" style="float: left; margin-right: 10px; margin-bottom: 10px; max-width: 180px; max-height: 180px;" src="/static/sensitive.png"><div id="sensitive-text-{{ .Id }}" style="width: 170px; position: absolute; margin-top: 75px; padding: 5px; background-color: black; color: white; cursor: default; ">NSFW Content</div></div></div>
<a id="{{ .Id }}-anchor" href="/{{ $board.Name }}/">
<div id="media-{{ .Id }}" style="width:180px;"></div>
</a>
<script>
media = document.getElementById("media-{{ .Id }}")
- if({{ .Sensitive }} && {{ $board.Actor.Restricted }}){
+ if(({{ .Sensitive }} && {{ $board.Actor.Restricted }}) || isOnion("{{ .Id }}")){
sensitive = document.getElementById("sensitive-{{ .Id }}")
hide = document.getElementById("hide-{{ .Id }}")
sensitive.onclick = function(){document.getElementById("media-{{ .Id }}").style="display: block;"; document.getElementById("sensitive-{{ .Id }}").style="display: none;"; document.getElementById("hide-{{ .Id }}").style="display: block; cursor: pointer;"}
@@ -54,6 +51,17 @@
sensitive.style = "display: block"
media.style = "display: none;"
}
+
+ if(isOnion("{{ .Id }}")) {
+ sensitive = document.getElementById("sensitive-{{ .Id }}")
+ document.getElementById("sensitive-img-{{ .Id }}").src = "/static/onion.png"
+ document.getElementById("sensitive-text-{{ .Id }}").innerText = "Tor Instance"
+ hide = document.getElementById("hide-{{ .Id }}")
+ sensitive.onclick = function(){document.getElementById("media-{{ .Id }}").style="display: block;"; document.getElementById("sensitive-{{ .Id }}").style="display: none;"; document.getElementById("hide-{{ .Id }}").style="display: block; cursor: pointer;"}
+ hide.onclick = function(){document.getElementById("media-{{ .Id }}").style="display: none;"; document.getElementById("sensitive-{{ .Id }}").style="display: block;"; document.getElementById("hide-{{ .Id }}").style="display: none;"}
+ sensitive.style = "display: block"
+ media.style = "display: none;"
+ }
if(getMIMEType({{ (index .Attachment 0).MediaType }}) == "image"){
var img = document.createElement("img");
diff --git a/static/posts.html b/static/posts.html
index 8052767..cdefd14 100644
--- a/static/posts.html
+++ b/static/posts.html
@@ -35,7 +35,7 @@
if(isOnion("{{ .Id }}")) {
sensitive = document.getElementById("sensitive-{{ .Id }}")
document.getElementById("sensitive-img-{{ .Id }}").src = "/static/onion.png"
- document.getElementById("sensitive-text-{{ .Id }}").innerText = "Tor Node"
+ document.getElementById("sensitive-text-{{ .Id }}").innerText = "Tor Instance"
hide = document.getElementById("hide-{{ .Id }}")
sensitive.onclick = function(){document.getElementById("media-{{ .Id }}").style="display: block;"; document.getElementById("sensitive-{{ .Id }}").style="display: none;"; document.getElementById("hide-{{ .Id }}").style="display: block; cursor: pointer;"}
hide.onclick = function(){document.getElementById("media-{{ .Id }}").style="display: none;"; document.getElementById("sensitive-{{ .Id }}").style="display: block;"; document.getElementById("hide-{{ .Id }}").style="display: none;"}
@@ -126,7 +126,7 @@
if(isOnion("{{ .Id }}")) {
sensitive = document.getElementById("sensitive-{{ .Id }}")
document.getElementById("sensitive-img-{{ .Id }}").src = "/static/onion.png"
- document.getElementById("sensitive-text-{{ .Id }}").innerText = "Tor Node"
+ document.getElementById("sensitive-text-{{ .Id }}").innerText = "Tor Instance"
hide = document.getElementById("hide-{{ .Id }}")
sensitive.onclick = function(){document.getElementById("media-{{ .Id }}").style="display: block;"; document.getElementById("sensitive-{{ .Id }}").style="display: none;"; document.getElementById("hide-{{ .Id }}").style="display: block; cursor: pointer;"}
hide.onclick = function(){document.getElementById("media-{{ .Id }}").style="display: none;"; document.getElementById("sensitive-{{ .Id }}").style="display: block;"; document.getElementById("hide-{{ .Id }}").style="display: none;"}