aboutsummaryrefslogtreecommitdiff
path: root/static/posts.html
diff options
context:
space:
mode:
authorFChannel <>2021-07-30 17:47:45 -0700
committerFChannel <>2021-07-30 17:47:45 -0700
commitf0ce5bc6d4146bc1191b8f8428c387a9085217e5 (patch)
tree4df91733e71859fef5195c6eac9455c7d87ab005 /static/posts.html
parentb413f9a7d72284a05d8802f06c51e4a23771d95d (diff)
removed shortImg and convertSize javascript to serverside
Diffstat (limited to 'static/posts.html')
-rw-r--r--static/posts.html16
1 files changed, 2 insertions, 14 deletions
diff --git a/static/posts.html b/static/posts.html
index 928a51d..8ee3844 100644
--- a/static/posts.html
+++ b/static/posts.html
@@ -18,7 +18,7 @@
<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 }}
- <span style="display: block;">File: <a id="{{ .Id }}-img" href="{{ proxy (index .Attachment 0).Href}}">{{ (index .Attachment 0).Name }}</a><span id="{{ .Id }}-size">({{ (index .Attachment 0).Size }})</span></span>
+ <span style="display: block;">File: <a id="{{ .Id }}-img" href="{{ proxy (index .Attachment 0).Href}}">{{ shortImg (index .Attachment 0).Name }}</a><span id="{{ .Id }}-size"> ({{ convertSize (index .Attachment 0).Size }})</span></span>
<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: 250px; max-height: 250px;" src="/static/sensitive.png"><div id="sensitive-text-{{ .Id }}" style="width: 240px; position: absolute; margin-top: 110px; padding: 5px; background-color: black; color: white; cursor: default; ">NSFW Content</div></div></div>
<div id="media-{{ .Id }}">{{ parseAttachment . false }}</div>
@@ -68,7 +68,7 @@
<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 }}
- <span style="display: block;">File <a id="{{ .Id }}-img" href="{{ proxy (index .Attachment 0).Href}}">{{ (index .Attachment 0).Name }}</a> <span id="{{ .Id }}-size">({{ (index .Attachment 0).Size }})</span></span>
+ <span style="display: block;">File <a id="{{ .Id }}-img" href="{{ proxy (index .Attachment 0).Href}}">{{ shortImg (index .Attachment 0).Name }}</a> <span id="{{ .Id }}-size"> ({{ convertSize (index .Attachment 0).Size }})</span></span>
<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: 250px; max-height: 250px;" src="/static/sensitive.png"><div id="sensitive-text-{{ .Id }}" style="width: 240px; position: absolute; margin-top: 110px; padding: 5px; background-color: black; color: white; cursor: default; ">NSFW Content</div></div></div>
<div> </div>
@@ -108,21 +108,9 @@
</div>
</div>
</div>
- <script>
- {{ if .Attachment }}
- document.getElementById("{{ .Id }}-size").innerText = " (" + convertSize({{ (index .Attachment 0).Size }}) + ")";
- document.getElementById("{{ .Id }}-img").innerText = shortImg("{{ (index .Attachment 0).Name }}");
- {{ end }}
- </script>
{{ end }}
{{ end }}
</div>
</div>
-<script>
- {{ if .Attachment }}
- document.getElementById("{{ .Id }}-size").innerText = " (" + convertSize({{ (index .Attachment 0).Size }}) + ")";
- document.getElementById("{{ .Id }}-img").innerText = shortImg("{{ (index .Attachment 0).Name }}");
- {{ end }}
-</script>
{{ end }}
{{ end }}