|
|
|
|
|
|
|
|
|
|
|
function delay(x) { |
|
setTimeout(() => { |
|
var isLoaded = x.getElementsByTagName('img')[0].complete |
|
console.log('is Loaded: ', isLoaded) |
|
if(!isLoaded){ |
|
delay(x) |
|
}else{ |
|
x.getElementsByClassName('submit-btn')[0].innerText = 'Drag It!' |
|
} |
|
|
|
}, 2000); |
|
} |
|
|
|
function mdFunc(x) { |
|
let counter = 0; |
|
var imgUrl = x.getElementsByTagName('img')[0].src; |
|
var rx = RegExp('(.*)\\=w320.*'); |
|
var imgUrl = imgUrl.replace(rx, "$1"); |
|
x.getElementsByTagName('img')[0].src = imgUrl; |
|
x.getElementsByClassName('submit-btn')[0].innerText = 'Loading...' |
|
delay(x) |
|
var imgID = imgUrl.replace('https://lh3.google.com/u/0/d/', ''); |
|
magicFunc(imgID) |
|
} |