diff options
author | FChannel <> | 2021-06-28 20:45:56 -0700 |
---|---|---|
committer | FChannel <> | 2021-06-28 20:45:56 -0700 |
commit | 9b67a65d76eb98a6e405b677a20c6215e1271753 (patch) | |
tree | c70109d50a97624820d090c53e53a3965404a684 /static/ncatalog.html | |
parent | 2e53eddedd4b3e5c444bea5a101a719cba3a4cc9 (diff) |
tor placeholder image for catalog page
Diffstat (limited to 'static/ncatalog.html')
-rw-r--r-- | static/ncatalog.html | 20 |
1 files changed, 14 insertions, 6 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"); |