diff options
author | FChannel <> | 2021-07-28 15:31:37 -0700 |
---|---|---|
committer | FChannel <> | 2021-07-28 15:31:37 -0700 |
commit | 98d72c9b94b5dda9a987dfe41552f00512d43574 (patch) | |
tree | ef75468766c6c5e2d4392cfc567eb29cb90d0c9d /static/ncatalog.html | |
parent | ea12d0f741455c542accf24a003a62ab85bfbfa3 (diff) | |
parent | 87fc54c9d41bdbe7eaa8769386776a3723580b34 (diff) |
v0.0.13-release
Diffstat (limited to 'static/ncatalog.html')
-rw-r--r-- | static/ncatalog.html | 51 |
1 files changed, 3 insertions, 48 deletions
diff --git a/static/ncatalog.html b/static/ncatalog.html index 68bb01a..c7f5b30 100644 --- a/static/ncatalog.html +++ b/static/ncatalog.html @@ -37,8 +37,8 @@ {{ 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 id="{{ .Id }}-anchor" href="/{{ $board.Name }}/{{ short $board.Actor.Outbox .Id}}"> + <div id="media-{{ .Id }}" style="width:180px;"> {{ parseAttachment . true }}</div> </a> <script> media = document.getElementById("media-{{ .Id }}") @@ -61,51 +61,9 @@ sensitive.style = "display: block" media.style = "display: none;" } - - if(getMIMEType({{ (index .Attachment 0).MediaType }}) == "image"){ - var img = document.createElement("img"); - img.style = "max-width: 180px; max-height: 180px;" - img.setAttribute("id", "img") - img.setAttribute("main", "1") - img.setAttribute("enlarge", "0") - img.setAttribute("attachment", "{{ proxy (index .Attachment 0).Href }}") - {{ if .Preview.Href }} - img.setAttribute("src", "{{ proxy .Preview.Href }}") - img.setAttribute("preview", "{{ proxy .Preview.Href }}") - {{ else }} - img.setAttribute("src", "{{ proxy (index .Attachment 0).Href }}") - img.setAttribute("preview", "{{ proxy (index .Attachment 0).Href }}") - {{ end }} - media.appendChild(img) - } - - if(getMIMEType({{ (index .Attachment 0).MediaType }}) == "audio"){ - var audio = document.createElement("audio") - audio.controls = 'controls' - audio.preload = 'metadata' - audio.src = '{{ proxy (index .Attachment 0).Href }}' - audio.type = '{{ (index .Attachment 0).MediaType }}' - audio.style = "margin-right: 10px; margin-bottom: 10px; max-width: 180px; max-height: 180px;" - 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.preload = 'metadata' - video.muted = 'muted' - video.src = '{{ proxy (index .Attachment 0).Href }}' - video.type = '{{ (index .Attachment 0).MediaType }}' - video.style = "margin-right: 10px; margin-bottom: 10px; max-width: 180px; max-height: 180px;" - video.innerText = 'Video is not supported.' - media.appendChild(video) - } - - document.getElementById("{{ .Id }}-anchor").href = "/{{ $board.Name }}/" + shortURL("{{$board.Actor.Id}}", "{{ .Id }}") </script> {{ end }} - <a id="{{ .Id }}-link" href="/{{ $board.Name }}/"> + <a id="{{ .Id }}-link" href="/{{ $board.Name }}/{{ short $board.Actor.Outbox .Id }}"> <div> {{ $replies := .Replies }} {{ if $replies }} @@ -121,9 +79,6 @@ </div> </a> </div> - <script> - document.getElementById("{{ .Id }}-link").href = "/{{ $board.Name }}/" + shortURL("{{$board.Actor.Id}}", "{{ .Id }}") - </script> {{ end }} </div> <hr> |