aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/assets/js/context_a.min.js
blob: 89e7c2f64a4ccc08864f17b9f1ad84b1e17de6e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
if(!window.hasOwnProperty("frost_context_a")){
console.log("frost_context_a frost_click_a"),
window.frost_context_a=!0
;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.querySelector('[style*="background-image: url("]')
;if(r||(r=t.parentNode.querySelector('[style*="background-image: url("]')),
r){
var a=window.getComputedStyle(r,null).backgroundImage.slice(5,-2)
;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()
}
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){
longClick&&("undefined"!=typeof Frost&&Frost.longClick(!1),
longClick=!1)
},!0)
}