From c78d2f1d22e49868870166ead4b115731e054b4f Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Wed, 7 Jul 2021 10:46:04 -0700 Subject: added media proxy for remote links --- static/posts.html | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'static/posts.html') diff --git a/static/posts.html b/static/posts.html index 319da03..d16f780 100644 --- a/static/posts.html +++ b/static/posts.html @@ -16,7 +16,7 @@ [Delete Attachment] [Mark Sensitive] {{ end }} - File: {{ (index .Attachment 0).Name }}({{ (index .Attachment 0).Size }}) + File: {{ (index .Attachment 0).Name }}({{ (index .Attachment 0).Size }})
@@ -49,13 +49,13 @@ img.setAttribute("id", "img") img.setAttribute("main", "1") img.setAttribute("enlarge", "0") - img.setAttribute("attachment", "{{ (index .Attachment 0).Href }}") + img.setAttribute("attachment", "{{ proxy (index .Attachment 0).Href }}") {{ if .Preview.Href }} - img.setAttribute("src", "{{ .Preview.Href }}") - img.setAttribute("preview", "{{ .Preview.Href }}") + img.setAttribute("src", "{{ proxy .Preview.Href }}") + img.setAttribute("preview", "{{ proxy .Preview.Href }}") {{ else }} - img.setAttribute("src", "{{ (index .Attachment 0).Href }}") - img.setAttribute("preview", "{{ (index .Attachment 0).Href }}") + img.setAttribute("src", "{{ proxy (index .Attachment 0).Href }}") + img.setAttribute("preview", "{{ proxy (index .Attachment 0).Href }}") {{ end }} media.appendChild(img) } @@ -64,7 +64,7 @@ var audio = document.createElement("audio") audio.controls = 'controls' audio.preload = 'metadata' - audio.src = '{{ (index .Attachment 0).Href }}' + audio.src = '{{ proxy (index .Attachment 0).Href }}' audio.type = '{{ (index .Attachment 0).MediaType }}' audio.style = "float: left; margin-right: 10px; margin-bottom: 10px; max-width: 250px; max-height: 250px;" audio.innerText = 'Audio is not supported.' @@ -76,7 +76,7 @@ video.controls = 'controls' video.preload = 'metadata' video.muted = 'muted' - video.src = '{{ (index .Attachment 0).Href }}' + video.src = '{{ proxy (index .Attachment 0).Href }}' video.type = '{{ (index .Attachment 0).MediaType }}' video.style = "float: left; margin-right: 10px; margin-bottom: 10px; max-width: 250px; max-height: 250px;" video.innerText = 'Video is not supported.' @@ -106,7 +106,7 @@ [Delete Attachment] [Mark Sensitive] {{ end }} - File {{ (index .Attachment 0).Name }} ({{ (index .Attachment 0).Size }}) + File {{ (index .Attachment 0).Name }} ({{ (index .Attachment 0).Size }})
@@ -140,14 +140,14 @@ img.setAttribute("id", "img") img.setAttribute("main", "1") img.setAttribute("enlarge", "0") - img.setAttribute("attachment", "{{ (index .Attachment 0).Href }}") + img.setAttribute("attachment", "{{ proxy (index .Attachment 0).Href }}") img.setAttribute("post", "{{ .Id }}") {{ if and .Preview.Href . }} - img.setAttribute("src", "{{ .Preview.Href }}") - img.setAttribute("preview", "{{ .Preview.Href }}") + img.setAttribute("src", "{{ proxy .Preview.Href }}") + img.setAttribute("preview", "{{ proxy .Preview.Href }}") {{ else }} - img.setAttribute("src", "{{ (index .Attachment 0).Href }}") - img.setAttribute("preview", "{{ (index .Attachment 0).Href }}") + img.setAttribute("src", "{{ proxy (index .Attachment 0).Href }}") + img.setAttribute("preview", "{{ proxy (index .Attachment 0).Href }}") {{ end }} media.appendChild(img) } @@ -156,7 +156,7 @@ var audio = document.createElement("audio") audio.controls = 'controls' audio.preload = 'metadata' - audio.src = '{{ (index .Attachment 0).Href }}' + audio.src = '{{ proxy (index .Attachment 0).Href }}' audio.type = '{{ (index .Attachment 0).MediaType }}' audio.style = "float: left; margin-right: 10px; margin-bottom: 10px; max-width: 250px; max-height: 250px;" audio.innerText = 'Audio is not supported.' @@ -168,7 +168,7 @@ video.controls = 'controls' video.preload = 'metadata' video.muted = 'muted' - video.src = '{{ (index .Attachment 0).Href }}' + video.src = '{{ proxy (index .Attachment 0).Href }}' video.type = '{{ (index .Attachment 0).MediaType }}' video.style = "float: left; margin-right: 10px; margin-bottom: 10px; max-width: 250px; max-height: 250px;" video.innerText = 'Video is not supported.' -- cgit v1.2.3