From d90cb9b61cd2e033b46f4780ad1340c5f35b7751 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 16 Jul 2017 17:26:58 -0700 Subject: Add image viewing and downloading (#63) * Commence aggressive image caching * Add glide toggle and css url parsing * Add image hook and refractor activities * Update version analytics * Implemented imageactivity but glide will not load * Create working image loader * Finalize image view * Finalize image view logic * Remove custom cache experiment --- app/src/main/assets/js/context_a.min.js | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'app/src/main/assets/js/context_a.min.js') diff --git a/app/src/main/assets/js/context_a.min.js b/app/src/main/assets/js/context_a.min.js index 82f89e8b..5c5f033a 100644 --- a/app/src/main/assets/js/context_a.min.js +++ b/app/src/main/assets/js/context_a.min.js @@ -1,20 +1,28 @@ if(!window.hasOwnProperty("frost_context_a")){ console.log("frost_context_a frost_click_a"), window.frost_context_a=!0 -;var longClick=!1,_frostAContext=function(t){ -Frost.longClick(!0),longClick=!0 -;var e=t.target||t.currentTarget||t.srcElement -;if(e&&("A"!==e.tagName&&(e=e.parentNode), -"A"!==e.tagName&&(e=e.parentNode),"A"===e.tagName&&"#"!==e.getAttribute("href"))){ -var o=e.getAttribute("href") -;if(o.includes("photoset_token"))return -;var n=e.parentNode.innerText -;console.log("Context Content",o,n),Frost.contextMenu(o,n), -t.stopPropagation(),t.preventDefault() +;var longClick=!1,_frostAContext=function(e){ +"undefined"!=typeof Frost&&Frost.longClick(!0), +longClick=!0 +;var t=e.target||e.currentTarget||e.srcElement +;if(t&&("A"!==t.tagName&&(t=t.parentNode), +"A"!==t.tagName&&(t=t.parentNode),"A"===t.tagName&&"#"!==t.getAttribute("href"))){ +var o=t.getAttribute("href") +;if(!o)return +;var n=t.parentNode.innerText,r=t.parentNode.querySelector('[style*="background-image: url("]') +;if(r){ +var a=window.getComputedStyle(r,null).backgroundImage.slice(5,-2) +;console.log("Context image",a), +"undefined"!=typeof Frost&&Frost.loadImage(a,n) +}else{ +if(o.includes("photoset_token"))return +;console.log("Context Content",o,n),"undefined"!=typeof Frost&&Frost.contextMenu(o,n) } +e.stopPropagation(),e.preventDefault() } -;document.addEventListener("contextmenu",_frostAContext,!0),document.addEventListener("touchend",function(t){ -longClick&&(Frost.longClick(!1), +} +;document.addEventListener("contextmenu",_frostAContext,!0),document.addEventListener("touchend",function(e){ +longClick&&("undefined"!=typeof Frost&&Frost.longClick(!1), longClick=!1) },!0) } \ No newline at end of file -- cgit v1.2.3