aboutsummaryrefslogtreecommitdiff
path: root/static/js/footerscript.js
diff options
context:
space:
mode:
authorsageman_ <sageman@anomine.net>2021-07-03 16:48:50 +0200
committersageman_ <sageman@anomine.net>2021-07-03 16:48:50 +0200
commit8e3e745c2a8e9f1db6d15a67829b2aa320731c3f (patch)
tree23c320081c7a5b8230ac109ca37e7dd5fee494a5 /static/js/footerscript.js
parentdd6189378cbc4c8ad22b95951b103880dd39060d (diff)
Preserve reply and report window states
Especially important since auto-reload gets rid of what you wrote without this patch except for those who use the classic reply form. However, this introduces a lot of bloat to the code and a lot of data kept on the client-side. Perhaps we could implement a no JavaScript version? Also semicolons because apparently JavaScript is *this* forgiving.
Diffstat (limited to 'static/js/footerscript.js')
-rw-r--r--static/js/footerscript.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/static/js/footerscript.js b/static/js/footerscript.js
index a63f422..69e56e7 100644
--- a/static/js/footerscript.js
+++ b/static/js/footerscript.js
@@ -3,34 +3,34 @@ var imgArray = [].slice.call(imgs);
imgArray.forEach(function(img, i){
img.addEventListener("click", function(e){
- var id = img.getAttribute("id")
- var media = document.getElementById("media-" + id)
- var sensitive = document.getElementById("sensitive-" + id)
+ var id = img.getAttribute("id");
+ var media = document.getElementById("media-" + id);
+ var sensitive = document.getElementById("sensitive-" + id);
if(img.getAttribute("enlarge") == "0")
{
- var attachment = img.getAttribute("attachment")
+ var attachment = img.getAttribute("attachment");
img.setAttribute("enlarge", "1");
img.setAttribute("style", "float: left; margin-right: 10px; cursor: pointer;");
- img.src = attachment
+ img.src = attachment;
}
else
{
- var preview = img.getAttribute("preview")
+ var preview = img.getAttribute("preview");
img.setAttribute("enlarge", "0");
if(img.getAttribute("main") == 1)
{
img.setAttribute("style", "float: left; margin-right: 10px; max-width: 250px; max-height: 250px; cursor: pointer;");
- img.src = preview
+ img.src = preview;
}
else
{
img.setAttribute("style", "float: left; margin-right: 10px; max-width: 125px; max-height: 125px; cursor: pointer;");
- img.src = preview
+ img.src = preview;
}
}
});
-})
+});
function viewLink(board, actor) {
@@ -38,7 +38,7 @@ function viewLink(board, actor) {
var postsArray = [].slice.call(posts);
postsArray.forEach(function(p, i){
- var id = p.getAttribute("post")
- p.href = "/" + board + "/" + shortURL(actor, id)
- })
+ var id = p.getAttribute("post");
+ p.href = "/" + board + "/" + shortURL(actor, id);
+ });
}