aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/assets/js
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-07-25 15:18:12 -0700
committerGitHub <noreply@github.com>2017-07-25 15:18:12 -0700
commitd94bc858c8a0c273d87d705eb06d35cfd9cf9e08 (patch)
tree05220a36a87a73388b89901f4fe5cd09d3fd48d5 /app/src/main/assets/js
parent913eaf7ea029030d7354a3969dc6aa87b0a51b1a (diff)
downloadfrost-d94bc858c8a0c273d87d705eb06d35cfd9cf9e08.tar.gz
frost-d94bc858c8a0c273d87d705eb06d35cfd9cf9e08.tar.bz2
frost-d94bc858c8a0c273d87d705eb06d35cfd9cf9e08.zip
Update image downloads , IAB, and many issue reports (#95)v1.4
* Remove iab proguard line * Remove dup vending aidl * Fix double calling issue * Change pro logging * Remove async call * Allow for multiple result flags from settings * Rename restore to get * Remove remaining async * Add null checks across web clients * Do not delete temp file on save * Implement image logic * Update file chooser * Update travis * Add intent checker * Update dependencies * Update dependencies * Add debugging option * Switch context for login glide * Scan newly added files * Update theme * Allow image downloading in messages * Finalize beta release * Build to beta * Update strings
Diffstat (limited to 'app/src/main/assets/js')
-rw-r--r--app/src/main/assets/js/context_a.js23
-rw-r--r--app/src/main/assets/js/context_a.min.js20
2 files changed, 33 insertions, 10 deletions
diff --git a/app/src/main/assets/js/context_a.js b/app/src/main/assets/js/context_a.js
index 689c6f0d..6ffa517b 100644
--- a/app/src/main/assets/js/context_a.js
+++ b/app/src/main/assets/js/context_a.js
@@ -32,11 +32,26 @@ if (!window.hasOwnProperty('frost_context_a')) {
var imageUrl = window.getComputedStyle(image, null).backgroundImage.slice(5, -2);
console.log('Context image', imageUrl);
if (typeof Frost !== 'undefined') Frost.loadImage(imageUrl, text);
- } else {
- if (url.includes('photoset_token')) return;
- console.log('Context Content', url, text);
- if (typeof Frost !== 'undefined') Frost.contextMenu(url, text);
+ e.stopPropagation();
+ e.preventDefault();
+ return;
}
+
+ //check if true img exists
+ var img = element.querySelector('img[src*=scontent]')
+ if (img) {
+ var imgUrl = img.src;
+ console.log('Context img', imgUrl);
+ if (typeof Frost !== 'undefined') Frost.loadImage(imgUrl, text);
+ e.stopPropagation();
+ e.preventDefault();
+ return;
+ }
+
+ if (url.includes('photoset_token')) return;
+ console.log('Context Content', url, text);
+ if (typeof Frost !== 'undefined') Frost.contextMenu(url, text);
+
e.stopPropagation();
e.preventDefault();
}
diff --git a/app/src/main/assets/js/context_a.min.js b/app/src/main/assets/js/context_a.min.js
index 97799c33..89e7c2f6 100644
--- a/app/src/main/assets/js/context_a.min.js
+++ b/app/src/main/assets/js/context_a.min.js
@@ -13,13 +13,21 @@ var o=t.getAttribute("href")
;if(r||(r=t.parentNode.querySelector('[style*="background-image: url("]')),
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)
+;return console.log("Context image",a),
+"undefined"!=typeof Frost&&Frost.loadImage(a,n),
+e.stopPropagation(),void e.preventDefault()
+}
+var i=t.querySelector("img[src*=scontent]")
+;if(i){
+var l=i.src
+;return console.log("Context img",l),"undefined"!=typeof Frost&&Frost.loadImage(l,n),
+e.stopPropagation(),
+void e.preventDefault()
}
-e.stopPropagation(),e.preventDefault()
+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(e){