Jag gissar på att nån av dessa är 207 och 212 men vilka? Vore mkt tacksam för hjälp
Kod:
//Show button 'Show all' in the top left of each post containing images
if (showButtons)
{
var postTd;
for (var i = 0; i < allAnchors.length; i++)
{
if (!(allAnchors[i].id.match("postcount"))) // Wrong anchor
{
continue;
}
postTd = allAnchors[i].parentNode;
postTd.id = 'TD_' + allAnchors[i].id;
var postImages = postTd.parentNode.parentNode.parentNode.getElementsByTagName('img');
//Images can be smilies, check for images inserted by this script
var hasInsertedImages = false;
for (var j=0; j < postImages.length; j++)
{
if (postImages[j].id.match("insertedImage"))
{
hasInsertedImages = true;
break;
}
}
if (!hasInsertedImages)
continue;
var postButton = document.createElement('input');
postButton.type = 'button';
postButton.value = showImages ? 'Hide all' : 'Show all';
postButton.setAttribute('style', "font-size:9px;margin:0px;padding:0px;");
var onClickCode;
onClickCode = "var postBtnElements=document.getElementById('post_message_";
onClickCode += allAnchors[i].id.substring(9); //Post ID-number
onClickCode += "').getElementsByTagName('input'); ";
onClickCode += "for (i=0;i<postBtnElements.length;i++) { ";
onClickCode += " if (postBtnElements[i].id.match(\"insertedButton\")) { ";
onClickCode += "if ((this.value.match(\"Show\") && postBtnElements[i].value.match(\"Show\")) || ";
onClickCode += "(this.value.match(\"Hide\") && postBtnElements[i].value.match(\"Hide\"))) ";
onClickCode += "postBtnElements[i].click(); }}";
onClickCode += "this.value = this.value.match(\"Show\") ? \"Hide all\" : \"Show all\";";
postButton.setAttribute('onClick',onClickCode);
postTd.insertBefore(postButton, postTd.firstChild);
}
}
}
function FixLink(link)
{
if (link.match(leave + "www"))
{
return link.replace(leave, "http://");
}
else if (link.match(leave))
{
return link.replace(leave, "");
}
else if (!(link.match("://"))) //"www.example.com/image.jpg"
{
return "http://" + link;
}
else
return link;
}
function getRealImageUrl(url, imageId)
{
if (url.match(/((imageshack\.us)|(exs\.cx)|(echo\.cx))\/my\.php/)) //Imageshack html with image
fixImageshackLink(url, imageId);
else if (url.match("imagevenue.com/img.php"))
fixImagevenueLink(url, imageId);
}
//Asynchronus, so it can't return a value.
function fixImageshackLink(linkUrl, imageId)
{
var imageUrl;
GM_xmlhttpRequest
(
{
method: 'GET',
url: linkUrl,
onload: function(results)
{
page = results.responseText;
var regexpStr = "http://img[0-9]*?\.imageshack\.us.*?\.(?:jpg|jpeg|gif|png|bmp|tif|tiff)";
imageUrl = page.match(regexpStr);
if (!imageUrl)
{
imageUrl = linkUrl;
}
var image = document.getElementById(imageId);
image.alt = imageUrl;
if (showImages)
{
image.src = imageUrl;
}
}
}
);
}
function fixImagevenueLink(linkUrl, imageId)
{
var imageUrl;
GM_xmlhttpRequest
(
{
method: 'GET',
url: linkUrl,
onload: function(results)
{
page = results.responseText;
var temp = page.match(/src=(?:.*?)\.(?:jpg|jpeg|gif|png|bmp|tif|tiff)\"><\/td>/i).toString();
imageUrl = linkUrl.match(/http:\/\/img[0-9]*?\.imagevenue\.com\//);
temp = temp.match(/.*(?:jpg|jpeg|png|gif|bmp|tif|tiff)/i);
imageUrl += temp.toString().substring(5);
if (!imageUrl)
{
imageUrl = linkUrl;
}
var image = document.getElementById(imageId);
image.alt = imageUrl;
if (showImages)
{
image.src = imageUrl;
}
}
}
);
}