diff options
Diffstat (limited to 'static')
-rw-r--r-- | static/bottom.html | 2 | ||||
-rw-r--r-- | static/js/posts.js | 2 | ||||
-rw-r--r-- | static/ncatalog.html | 20 | ||||
-rw-r--r-- | static/posts.html | 2 |
4 files changed, 22 insertions, 4 deletions
diff --git a/static/bottom.html b/static/bottom.html index 19c82c6..28750c8 100644 --- a/static/bottom.html +++ b/static/bottom.html @@ -1,5 +1,5 @@ {{ define "bottom" }} -<div id="reply-box" class="popup-box" style="display: none; "> +<div id="reply-box" class="popup-box" style="display: none;"> <div id="reply-header" style="display: inline-block; width: 370px; z-index: 0; cursor: move;"></div><div id="reply-close" style="display: inline-block; float: right;"><a href="javascript:closeReply()">[X]</a></div> <form id="reply-post" action="/post" method="post" enctype="multipart/form-data"> <input id="reply-name" name="name" size="43" type="text" placeholder="Name" maxlength="100"> diff --git a/static/js/posts.js b/static/js/posts.js index e46fed3..06aab77 100644 --- a/static/js/posts.js +++ b/static/js/posts.js @@ -224,7 +224,7 @@ function quote(actorName, opid, id) } - box.setAttribute("style", "display: block; position: absolute; width: 400px; height: 550px; z-index: 9; top: " + h + "px; left: " + w + "px; padding: 5px;"); + box.setAttribute("style", "display: block; position: absolute; width: 400px; height: 600px; z-index: 9; top: " + h + "px; left: " + w + "px; padding: 5px;"); if (inReplyTo.value != opid) diff --git a/static/ncatalog.html b/static/ncatalog.html index 027a938..deb8e27 100644 --- a/static/ncatalog.html +++ b/static/ncatalog.html @@ -33,15 +33,31 @@ {{ if .Attachment }} {{ if eq $board.ModCred $board.Domain $board.Actor.Id }} <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 }} - <a id="{{ .Id }}-anchor" href="/{{ $board.Name }}/"> + + {{ 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 }} + <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 }}){ + 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;"} + 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"); - img.style = "max-width: 180px; max-height: 180px; cursor: move;" + img.style = "max-width: 180px; max-height: 180px;" img.setAttribute("id", "img") img.setAttribute("main", "1") img.setAttribute("src", "{{ (index .Attachment 0).Href }}") diff --git a/static/posts.html b/static/posts.html index a6cac44..1b1d78b 100644 --- a/static/posts.html +++ b/static/posts.html @@ -96,8 +96,10 @@ <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> + {{ 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: 250px; max-height: 250px;" src="/static/sensitive.png"><div style="width: 240px; position: absolute; margin-top: 110px; padding: 5px; background-color: black; color: white; cursor: default; ">NSFW Content</div></div></div> + {{ end }} <div id="media-{{ .Id }}" sensitive="0"></div> <script> media = document.getElementById("media-{{ .Id }}") |