/g,"");
strg=strg.replace(/<\/span>/g,"");
strg=strg.replace(/<\/*b>/g,"");
return strg;
}
function getLinks(loadUrl,resultLink) {
GM_xmlhttpRequest({
method: "GET",
url: loadUrl,
onload: function(response) {
code = response.responseText;
//Get source
source = $(code).find('.fSrc').html();
//Get dl links
var nbLines=0;
var urls = "";
$(code).find(".file-link-main").each(function(){
urls = urls + $(this).attr('href') + "\n";
nbLines=nbLines+1;
});
//Add copy button
copyId = 'successCopy' + idnb;
$(resultLink)
.nextAll("br:first")
.replaceWith("
");
jcopyId = "#" + copyId;
$(jcopyId).click(function() {
GM_setClipboard(urls);
$(this).after(" Links copied! ");
});
//Add DL links
if(nbLines < 6)
$(resultLink).parent().append(replaceURLWithHTMLLinks(urls));
else
$(resultLink).parent().append(""+replaceURLWithHTMLLinks(urls)+"
");
//Add source link
$(resultLink).parent().append("" + source + "");
idnb = idnb+1;
}
});
}
str = location.href;
$(document).ready(function(){
if( str.search(/filestube.to\/?$/ig) !== -1 ) { // Home page
//style
$(".logo").css("margin-top","50px");
//Hide unwanted items
GM_addStyle(".hB, .mcl {\ndisplay:none !important;\n}");
}
else if( (str.search(/filestube.to\/[^\/]+\/.+/ig) !== -1) || (str.search(/query\.html/ig) !== -1) ) { // Results page
//style
$("#results-holder").css("padding-left", "5%");
$("#results").css("width", "100%");
$(".iRss").clone().css("margin-right", "10%").css("padding", "0px 10px").appendTo(".cf");
$("#pager").css("padding", "0");
//links & source
$("a.rL").each(function(){
url = $(this).attr('href');
getLinks(url, $(this));
});
//Hide unwanted items
GM_addStyle("#most-popular-topics, .rBvi, #spla, .rQ, .rB, .spL, .rSt, .rS, .rate, .alt_button, #recent {\ndisplay:none !important;\n}");
}
else { // Download page
//smaller title
title = $(".fH > h1").html();
$(".fH > h1").replaceWith("" + title + "
");
//Hide unwanted items
$("#disqus_thread").remove();
GM_addStyle(".dsq-brlink, .lS, #ac_form, .sr, #ajx_rate, H2, .fSl, .rl > DL ~ * {\ndisplay:none !important;\n}");
//source
sourcelink=$('.fSrc').html();
$('.fSrc').attr('href',sourcelink);
}
//global ads
GM_addStyle("#stkTgl, #uB, .fBx, .ft, .ftP, .fdb, .rr, .spF {\ndisplay:none !important;\n}");
});