diff options
author | FChannel <> | 2021-07-07 10:46:04 -0700 |
---|---|---|
committer | FChannel <> | 2021-07-07 10:46:04 -0700 |
commit | c78d2f1d22e49868870166ead4b115731e054b4f (patch) | |
tree | 0a3e696fa278097b07331245279c3a73eb135aae /static | |
parent | e859b3bc4e7e9c5a77ec2283088a042eb7b1b6e1 (diff) |
added media proxy for remote links
Diffstat (limited to 'static')
-rw-r--r-- | static/faq.html | 4 | ||||
-rw-r--r-- | static/index.html | 20 | ||||
-rw-r--r-- | static/ncatalog.html | 6 | ||||
-rw-r--r-- | static/posts.html | 32 |
4 files changed, 30 insertions, 32 deletions
diff --git a/static/faq.html b/static/faq.html index f98fd9c..35c07f0 100644 --- a/static/faq.html +++ b/static/faq.html @@ -10,7 +10,7 @@ <h1 style="text-align: center;">FAQ</h1> <div> <h4>What is fchan?</h4> - <p>fchan, short for FChannel, is a federated image board based on <a href="https://activitypub.rocks/">ActivityPub</a>, a protocol which allows social sites like social media and image boards to be decentralized. Boards across sites which are on the opposite sides of the Globe can be connected and feeds can be shared or followed. It strives to be familiar looking to regular *chan users.</p><p> You can get the source code on <a href="https://github.com/FChannel0">https://github.com/FChannel0</a> which is available under <a href="https://en.wikipedia.org/wiki/Affero_General_Public_License">AGPLv3</a>, which means that you can modify the source code of fchan however you like as long as you share your source code with everyone else. We appreciate and encourage any positive contributions to the source code!</p> + <p>fchan, short for FChannel, is a federated image board based on <a href="https://activitypub.rocks/">ActivityPub</a>, a protocol which allows social sites like social media and image boards to be decentralized. Boards across sites which are on the opposite sides of the Globe can be connected and feeds can be shared or followed. It pulls likeness from other chans for ease of familiarity and use.</p><p> You can get the source code on <a href="https://github.com/FChannel0">https://github.com/FChannel0</a> which is available under <a href="https://en.wikipedia.org/wiki/Affero_General_Public_License">AGPLv3</a>, which means that you can modify the source code of fchan however you like as long as you share your source code with everyone else. We appreciate and encourage any positive contributions to the source code!</p> <h4 id="options">What are the "Options" used for when posting?</h4> <p>The "Options" field can be used for special options when posting.</p> @@ -56,7 +56,7 @@ <p>Soon™.</p> <h4 id="version">What version is this FChannel instance?</h4> - <p>v0.6.1-dev</p> + <p>v0.0.7-dev</p> </div> <div style="width: 500px; margin:0 auto; margin-top: 50px; text-align: center;"> <a href="/">[Home]</a><a href="/static/rules.html">[Rules]</a><a href="/static/faq.html">[FAQ]</a> diff --git a/static/index.html b/static/index.html index 667efd4..b706e6b 100644 --- a/static/index.html +++ b/static/index.html @@ -64,17 +64,15 @@ {{ end }} <div class="popup-box" style="margin-top:50px;"> - <table style="text-align: left; margin: 25px;"> - <th> - <tr><h4>Current known instances</h4></tr> - </th> - - {{ range .InstanceIndex }} - <tr> - <td><a href="{{ .Id }}">{{ .Id }}</a></td> - </tr> - {{ end }} - </table> + <h4 style="margin-bottom:5px;">Current known instances</h4> + <span>(always use a proxy)</span> + <table style="text-align: left; margin: 25px;"> + {{ range .InstanceIndex }} + <tr> + <td><a href="{{ .Id }}">{{ .Id }}</a></td> + </tr> + {{ end }} + </table> </div> </div> {{ end }} diff --git a/static/ncatalog.html b/static/ncatalog.html index 1f6fc69..4c6c589 100644 --- a/static/ncatalog.html +++ b/static/ncatalog.html @@ -67,7 +67,7 @@ img.style = "max-width: 180px; max-height: 180px;" img.setAttribute("id", "img") img.setAttribute("main", "1") - img.setAttribute("src", "{{ (index .Attachment 0).Href }}") + img.setAttribute("src", "{{ proxy (index .Attachment 0).Href }}") media.appendChild(img) } @@ -75,7 +75,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 = "margin-right: 10px; margin-bottom: 10px; max-width: 180px; max-height: 180px;" audio.innerText = 'Audio is not supported.' @@ -87,7 +87,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 = "margin-right: 10px; margin-bottom: 10px; max-width: 180px; max-height: 180px;" video.innerText = 'Video is not supported.' 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 @@ <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="{{ (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}}">{{ (index .Attachment 0).Name }}</a><span id="{{ .Id }}-size">({{ (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 }}"></div> @@ -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 @@ <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="{{ (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}}">{{ (index .Attachment 0).Name }}</a> <span id="{{ .Id }}-size">({{ (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> @@ -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.' |