diff --git a/public/dark.css b/public/dark.css
index 100f070..b80590a 100644
--- a/public/dark.css
+++ b/public/dark.css
@@ -77,6 +77,9 @@ input[type=text], input[type=password], textarea {
color: #ddd;
border-color: #666;
}
+.expando > div > details {
+ color: white;
+}
.side .stats {
background-color: #393939;
border-color: #666;
diff --git a/public/style.css b/public/style.css
index db495c3..0fe1509 100644
--- a/public/style.css
+++ b/public/style.css
@@ -83,6 +83,12 @@ summary {
.expando > div {
text-align: center;
}
+.comment .content details img {
+ display: none;
+}
+.comment .content details[open] img {
+ display: unset;
+}
.comment.hidden {
padding-bottom:5px;
padding-left: 4px;
@@ -526,7 +532,7 @@ form.blockpost {
cursor: pointer;
float:left;
}
-.expando-button::before{
+.expando-button::before,.collapse .expando-button::before{
content: "+";
float: left;
position: relative;
@@ -534,11 +540,17 @@ form.blockpost {
font-size: 12px;
left: 12px;
top: 7px;
+ line-height: normal;
+ font-weight: normal;
+ font-family: unset;
}
-.open.expando-button {
+.open.expando-button, .collapse .open.expando-button {
border-radius: 30px;
}
-.open.expando-button::before {
+.collapse .expando-button {
+ border-radius: 4px;
+}
+.open.expando-button::before, .collapse .open.expando-button::before {
content: "✖";
color: #fff;
font-weight: bold;
@@ -614,10 +626,16 @@ form.blockpost {
#settingspopup.open, #mycommunities.open {
display: inline-block;
}
-.expando.open{
+.expando.open, .collapse .expando.text{
display: block;
clear: left;
}
+.collapse .expando .image {
+ display: none;
+}
+.collapse .expando.open .image {
+ display: block;
+}
.expando .image {
max-width: 100%;
cursor: nwse-resize;
@@ -735,7 +753,11 @@ main {
}
}
@media (min-width: 800px) {
- .expando .thumb, .expando .score, .expando .rank {
+ .collapse .open.expando .thumb, .collapse .open.expando .score, .collapse .open.expando .rank {
+ display: none;
+ }
+ .collapse.post .text.expando .thumb, .collapse.post .text.expando .score, .collapse.post .text.expando .rank,
+ .post .expando.open .thumb, .post .expando.open .score, .post .expando.open .rank {
display: block;
}
.expando .image {
diff --git a/public/utils.js b/public/utils.js
index 561e9a8..5d7fb39 100644
--- a/public/utils.js
+++ b/public/utils.js
@@ -521,6 +521,16 @@ function setup() {
if (st) {
st.addEventListener("click", sideToggle)
}
+var collapseMedia = document.querySelectorAll(".content summary a, .expando > div > details summary a")
+ for (var i = 0; i < collapseMedia.length; i++) {
+ collapseMedia[i].onclick = toggleDetails
+ }
+}
+function toggleDetails(e) {
+ if (e.target.parentNode.tagName == 'SUMMARY') {
+ e.target.parentNode.click();
+ }
+ return false
}
function sideToggle(e) {
e.preventDefault();
diff --git a/routes.go b/routes.go
index 7d4ddb8..df11f2b 100644
--- a/routes.go
+++ b/routes.go
@@ -190,6 +190,10 @@ var funcMap = template.FuncMap{
body = RegReplace(body, `::: ?spoiler (.*?)\n([\S\s]*?):::`, "$1
$2