From f9ab15e2713dfa7bf34bb5bd9845162554791164 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Sat, 30 Apr 2016 08:31:37 -0400 Subject: [PATCH] add debugging --- contrib/js/expand-image.js | 1 + contrib/static/nntpchan.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/js/expand-image.js b/contrib/js/expand-image.js index 3efbdc8..cae69d5 100644 --- a/contrib/js/expand-image.js +++ b/contrib/js/expand-image.js @@ -36,6 +36,7 @@ function setupInlineImageIn(element) { var url = thumbs[i].children[0].src; if (filenameIsImage(url)) { // match + console.log("matched url", url); setupInlineImage(thumbs[i], url); } } diff --git a/contrib/static/nntpchan.js b/contrib/static/nntpchan.js index 042e158..745b174 100644 --- a/contrib/static/nntpchan.js +++ b/contrib/static/nntpchan.js @@ -17,7 +17,7 @@ function inject_hover_for_element(elem){var elems=elem.getElementsByClassName("b for(var elem in ls){inject_hover(prefix,ls[elem]);}} function init(prefix){inject_hover_for_element(document);}var banner_count=3;function nntpchan_inject_banners(elem,prefix){var n=Math.floor(Math.random()*banner_count);var banner=prefix+"static/banner_"+n+".jpg";var e=document.createElement("img");e.src=banner;e.id="nntpchan_banner";elem.appendChild(e);}function filenameIsImage(fname){return/\.(gif|jpeg|jpg|png|webp)/.test(fname);} function setupInlineImage(thumb,url){if(thumb.inlineIsSetUp)return;thumb.inlineIsSetUp=true;var img=thumb.querySelector("img.thumbnail");var expanded=false;var oldurl=img.src;img.onclick=function(ev){if(expanded){img.setAttribute("class","thumbnail");img.src=oldurl;expanded=false;}else{img.setAttribute("class","thumbnail expanded");img.src=url;expanded=true;}}} -function setupInlineImageIn(element){var thumbs=element.querySelectorAll("a.file");for(var i=0;i