Fixed bookmarklet.js to allow uploading from Gelbooru. (was broken before)
This commit is contained in:
parent
4fd58019e5
commit
9d8bcbce37
1 changed files with 17 additions and 8 deletions
|
@ -142,14 +142,23 @@ else if(document.getElementById("tags") !== null) {
|
||||||
|
|
||||||
// Can't seem to grab source due to url containing a &
|
// Can't seem to grab source due to url containing a &
|
||||||
// var source="http://" + document.location.hostname + document.location.href.match("\/index\.php?page=post&s=view\\&id=.*");
|
// var source="http://" + document.location.hostname + document.location.href.match("\/index\.php?page=post&s=view\\&id=.*");
|
||||||
var gmi = document.getElementById("image").src.match(".*img[0-9]+\.gelbooru\.com\/\/images\/[0-9]+\/[a-z0-9]+\.[a-z0-9]+")[0];
|
|
||||||
|
|
||||||
// Since Gelbooru does not allow flash, no need to search for flash tag.
|
// Updated Nov. 24, 2013 by jgen.
|
||||||
// Gelbooru doesn't show file size in statistics either...
|
var gmi;
|
||||||
if(supext.search(gmi.match("http\:\/\/.*\\.([a-z0-9]+)")[1]) !== -1){
|
try {
|
||||||
location.href = ste+gmi+"&tags="+tag+"&rating="+rating;//+"&source="+source;
|
gmi = document.getElementById("image").src.match(".*img[0-9]*\.gelbooru\.com[\/]+images[\/]+[0-9]+[\/]+[a-z0-9]+\.[a-z0-9]+")[0];
|
||||||
|
|
||||||
|
// Since Gelbooru does not allow flash, no need to search for flash tag.
|
||||||
|
// Gelbooru doesn't show file size in statistics either...
|
||||||
|
if(supext.search(gmi.match("http\:\/\/.*\\.([a-z0-9]+)")[1]) !== -1){
|
||||||
|
location.href = ste+gmi+"&tags="+tag+"&rating="+rating;//+"&source="+source;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert(notsup);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else{
|
catch (err)
|
||||||
alert(notsup);
|
{
|
||||||
|
alert("Unable to locate the image on the page!\n(Gelbooru may have changed the structure of their page, please file a bug.)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue