aboutsummaryrefslogtreecommitdiff
path: root/static/js/footerscript.js
diff options
context:
space:
mode:
authorFChannel <=>2021-01-22 21:12:26 -0800
committerFChannel <=>2021-01-22 21:12:26 -0800
commit2566e314e8351ffbceae9a2688d90a5c811d49e5 (patch)
treee802622593c540265e464beecf76696b65e229ed /static/js/footerscript.js
parent626fee35bacd68baf6e9bb38ca71d88fff700b13 (diff)
client to server conversion
Diffstat (limited to 'static/js/footerscript.js')
-rw-r--r--static/js/footerscript.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/static/js/footerscript.js b/static/js/footerscript.js
new file mode 100644
index 0000000..bd36daa
--- /dev/null
+++ b/static/js/footerscript.js
@@ -0,0 +1,40 @@
+var imgs = document.querySelectorAll('#img');
+var imgArray = [].slice.call(imgs);
+
+imgArray.forEach(function(img, i){
+ img.addEventListener("click", function(e){
+ if(img.getAttribute("enlarge") == "0")
+ {
+ var attachment = img.getAttribute("attachment")
+ img.setAttribute("enlarge", "1");
+ img.setAttribute("style", "float: left; margin-right: 10px; cursor: move;");
+ img.src = attachment
+ }
+ else
+ {
+ 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: move;");
+ img.src = preview
+ }
+ else
+ {
+ img.setAttribute("style", "float: left; margin-right: 10px; max-width: 125px; max-height: 125px; cursor: move;");
+ img.src = preview
+ }
+ }
+ });
+})
+
+
+function viewLink(board, actor) {
+ var posts = document.querySelectorAll('#view');
+ var postsArray = [].slice.call(posts);
+
+ postsArray.forEach(function(p, i){
+ var id = p.getAttribute("post")
+ p.href = "/" + board + "/" + shortURL(actor, id)
+ })
+}