");
*/
// Hides Porn link from menu [TODO: make this a form checkbox filter]
if (!showPorn)
{
$.each($(".tdlinkfull2"), function() {
var targetText = $(this).text().toLowerCase();
if (targetText == "xxx")
{
$(this).parent().parent().remove();
}
});
$.each($(".divadvscat a"), function() {
var targetText = $(this).text().toLowerCase();
if(targetText == "xxx (18+)")
{
$(this).parent().remove();
}
});
}
// Hides torrents with seeders equal to or lower than 10 [TODO: make this a form input filter]
/*
if (parseInt(title.indexOf("720p")) > 0)
{
$(this).parents(".lista2").remove();
}
*/
/*
* BEGIN: CATEGORY SPECIFIC =================================================================================================
*/
// Iterates through line items
$.each($(".lista a"), function(index, value) {
var title = $(this).attr("title");
var icon = $(this).find("img").attr("src");
/*
* BEGIN: MOVIES AND TV =================================================================================================
*/
if (showMoviesTVFilters)
{
// Skips torrents without titles
if (title !== undefined)
{
// Loop through every span tag inside the lista class anchor tag
$.each($("span"), function(index, value) {
var ratings = $(this).text();
var imdb = ratings.indexOf("IMDB: ") + 6;
// Continue if this span has IMDB rating information
if (ratings !== undefined && imdb !== -1)
{
var rateValue = parseFloat(ratings.substring(imdb,ratings.length-3));
// Continue if this IMDB rating is a number
if (!isNaN(rateValue))
{
// Continue if the torrent's rating is equal to or less than the minRating
if (rateValue <= minRating)
{
$(this).parents(".lista2").remove();
}
}
}
});
// Hides low-quality KORSUB torrents [TODO: make this a form checkbox filter]
if (parseInt(title.indexOf("KORSUB")) > 0)
{
$(this).parents(".lista2").remove();
}
// Hides 720p torrents [TODO: make this a form checkbox filter]
if (parseInt(title.indexOf("720p")) > 0)
{
$(this).parents(".lista2").remove();
}
}
}
/*
* BEGIN: PORNOGRAPHY =================================================================================================
*/
if (!showPorn)
{
// Hides Porn from list [TODO: make this a form checkbox filter]
if (title !== undefined)
{
title = title.indexOf("XXX");
if (title >= 0)
{
$(this).parents(".lista2").remove();
}
}
// Hides Porn based on icon
if (icon !== undefined)
{
icon = icon.indexOf("cat_new4.gif");
if (icon >= 0)
{
$(this).parents(".lista2").remove();
}
}
}
});
/*
* BEGIN: NON-CATEGORY =================================================================================================
*/
// Hides the icons [TODO: make this a form checkbox filter]
if (!showThumbnails)
{
$(".lista2t tr td:nth-of-type(1)").attr("style","display:none;");
}
else
{
// Replaces category icons with torrent thumbnail images
$.each($(".lista2t .lista2"), function() {
var anchor = $(this);
$.each(anchor.find(".lista"), function() {
var image = $(this).find("a");
var target = anchor.find(":nth-child(1) a");
if (image.attr("onmouseover") !== undefined)
{
var sourceThumb = image.attr("onmouseover");
var val1 = sourceThumb.lastIndexOf("//dyncdn.me/");
var val2 = sourceThumb.indexOf("\' border=0>')")-1;
var imageID = sourceThumb.substring(val1,val2);
var thumbnailImage = "";
image.removeAttr("onmouseover").removeAttr("onmouseout");
target.find("img").replaceWith(thumbnailImage);
anchor.find("td:nth-child(1)").attr( "align", "center" );
}
});
});
}
/*
TODO: Filter counter [ALPHA]
$(".container-sales").prepend("