function hoverLine(id) {
$('#line_'+id).addClass('hover');
}
function unhoverLine(id){
$('#line_'+id).removeClass('hover');
}
function downloadStatusOfCurrentItem(itemId, statusURL, hash) {
url = statusURL;
if (hash != '') {
url += '&hash=' + hash;
}
$.getJSON(url, function(data) {
if (typeof data.error == 'undefined') {
var dwn_pr = data.downloaded_percent > 100 ? 100 : data.downloaded_percent;
var dec_pr = data.decoded_percent > 100 ? 100 : data.decoded_percent;
var progress = ((dwn_pr + dec_pr) / 2).toFixed();
if(progress == 100){
progress = 99;
}
$(itemId + ' .downloading-progress span').text(progress + '%');
$(itemId + ' #js-progressbar').val(progress);
}
if (data.finished != 1) {
downloadStatusOfCurrentItem(itemId, statusURL, data.hash);
}else {
$(itemId + ' .downloads-btns-wrap').show();
$(itemId + ' .downloading-progress').remove();
}
});
}
function downloadStatus(id, statusURL) {
var viewAllLink = "/downloads/info/" + id;
var itemId = "#download_item_" + id;
$.getJSON(statusURL, function(data) {
if (data.error == null) {
let progress = data.progress >= 100 ? 99 : Math.round(data.progress);
$(itemId + ' .downloading-progress span').text(progress + '%');
$(itemId + ' #js-progressbar').val(progress);
}
if (data.status != "FINISHED") {
downloadStatus(id, statusURL);
}else {
let countFiles = data.count_files;
let url = countFiles > 1 ? data.url : data.files[0]['url'];
if(countFiles > 1){
$(itemId + ' .show-info')
}
$(itemId).addClass('download-finished');
$(itemId + ' .link-for-zip').attr('href', url);
$(itemId + ' .downloads-btns-wrap').show();
$(itemId + ' .downloading-progress').remove();
$(itemId + ' .download-set-data').html("Files: " + data.count_files + " | View all files
Size: " + data.size);
}
});
}
var nzbSizeSet = 0;
var nzbFilesSet = 0;
var statusURL = '';
var filesURL = '';
var filesLimit = 200;
var filesReloaded = 0;
function updateStatus(hash) {
if (hash != '') {
url = statusURL + '&hash=' + hash;
} else {
url = statusURL;
}
$.getJSON(url, function(data) {
//console.log(data);
if (typeof data.error == 'undefined') {
// Global data
if (nzbSizeSet==0 && data.files_size_formatted.length > 0) {
$('#nzb_size').html(data.files_size_formatted);
nzbSizeSet = 1;
}
if (nzbFilesSet==0 && data.files_amount_formatted.length > 0) {
$('#nzb_files').html(data.files_amount_formatted);
nzbFilesSet = 1;
}
// Status data
$('#status_downloaded_amount').html(data.downloaded_amount);
$('#status_downloaded_size').html(data.downloaded_size_formatted);
$('#status_decoded_amount').html(data.decoded_amount);
$('#status_decoded_size').html(data.decoded_size_formatted);
if (data.errors_amount > 0) {
$('#status_errors_amount').html(data.errors_amount);
$('#status_errors').show();
}
downloaded_width = data.downloaded_percent;
if (downloaded_width > 100 ) downloaded_width = 100;
$('#status_downloaded_progress').width(downloaded_width+'%');
decoded_width = data.decoded_percent;
if (decoded_width > 100 ) decoded_width = 100;
$('#status_decoded_progress').width(decoded_width+'%');
}
if (data.finished != 1) {
updateStatus(data.hash);
if (data.files_amount > 0) {
$('#download_status').show();
// Reload files
if (data.decoded_amount > 0) {
if (data.decoded_amount > filesLimit) {
files_need = filesLimit;
} else {
files_need = data.decoded_amount;
}
if (files_need > $('.file_ready').length) {
reloadFiles(force = 0);
}
}
}
} else {
// Download button
$('#download_loading').hide();
if (data.files_amount > 1) {
$('.downloads-btns-wrap').show();
} else {
$('.download_file').show();
}
$('#download_status').hide();
$('#download_finished').show();
// Reload files
reloadFiles(1);
}
});
}
function reloadFiles(force)
{
min_update_delay = 3000; // 3 sec
if (new Date()-filesReloaded < min_update_delay && force == 0) {
return false;
}
filesReloaded = new Date();
$.get(filesURL, function(data) {
$('#files_content').html(data);
$('#files_container').show();
});
}
function validate_email(field)
{
with (field)
{
apos=field.indexOf("@");
dotpos=field.lastIndexOf(".");
if (apos<1||dotpos-apos<2) {
return false;
} else {
return true;
}
}
}
function support()
{
var errors = 0;
email = $('#email').val();
subject = $('#subject').val();
problem = $('#problem').val();
//captcha = $('#captcha').val();
// Check email
if (email.length==0 || validate_email(email) == false) {
$('#error_email').show();
errors = errors+1;
} else {
$('#error_email').hide();
}
// Check subject
if (subject.length==0) {
$('#error_subject').show();
errors = errors+1;
} else {
$('#error_subject').hide();
}
// Check problem
if (problem.length==0) {
$('#error_problem').show();
errors = errors+1;
} else {
$('#error_problem').hide();
}
// Check captcha
/*if (captcha.length != 4) {
$('#error_captcha').show();
errors = errors+1;
} else {
$('#error_captcha').hide();
}*/
if (errors > 0) {
return false;
}
$('#support_submit').attr('disabled', 'disabled');
return true;
}
function ticket_message()
{
var errors = 0;
problem = $('#problem').val();
// Check problem
if (problem.length==0) {
$('#error_problem').show();
errors = errors+1;
} else {
$('#error_problem').hide();
}
if (errors > 0) {
return false;
}
$('#ticket_message_submit').attr('disabled', 'disabled');
return true;
}
var zxcTO;
function Scroll(id,dis){
var obj=document.getElementById(id)
obj.scrollLeft=obj.scrollLeft+dis;
zxcTO=setTimeout( function(){ Scroll(id,dis); },10);
}
//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2008 Adobe Systems Incorporated. All rights reserved.
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
function ControlVersion()
{
var version;
var axo;
var e;
// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
try {
// version will be set for 7.X or greater players
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
version = axo.GetVariable("$version");
} catch (e) {
}
if (!version)
{
try {
// version will be set for 6.X players only
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
// installed player is some revision of 6.0
// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
// so we have to be careful.
// default to the first public version
version = "WIN 6,0,21,0";
// throws if AllowScripAccess does not exist (introduced in 6.0r47)
axo.AllowScriptAccess = "always";
// safe to call for 6.0r47 or greater
version = axo.GetVariable("$version");
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 4.X or 5.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = axo.GetVariable("$version");
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 3.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = "WIN 3,0,18,0";
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 2.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
version = "WIN 2,0,0,11";
} catch (e) {
version = -1;
}
}
return version;
}
// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
// NS/Opera version >= 3 check for Flash plugin in plugin array
var flashVer = -1;
if (navigator.plugins != null && navigator.plugins.length > 0) {
if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
var descArray = flashDescription.split(" ");
var tempArrayMajor = descArray[2].split(".");
var versionMajor = tempArrayMajor[0];
var versionMinor = tempArrayMajor[1];
var versionRevision = descArray[3];
if (versionRevision == "") {
versionRevision = descArray[4];
}
if (versionRevision[0] == "d") {
versionRevision = versionRevision.substring(1);
} else if (versionRevision[0] == "r") {
versionRevision = versionRevision.substring(1);
if (versionRevision.indexOf("d") > 0) {
versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
}
}
var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
}
}
// MSN/WebTV 2.6 supports Flash 4
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
// WebTV 2.5 supports Flash 3
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
// older WebTV supports Flash 2
else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
else if ( isIE && isWin && !isOpera ) {
flashVer = ControlVersion();
}
return flashVer;
}
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
versionStr = GetSwfVer();
if (versionStr == -1 ) {
return false;
} else if (versionStr != 0) {
if(isIE && isWin && !isOpera) {
// Given "WIN 2,0,0,11"
tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
tempString = tempArray[1]; // "2,0,0,11"
versionArray = tempString.split(","); // ['2', '0', '0', '11']
} else {
versionArray = versionStr.split(".");
}
var versionMajor = versionArray[0];
var versionMinor = versionArray[1];
var versionRevision = versionArray[2];
// is the major.revision >= requested major.revision AND the minor version >= requested minor
if (versionMajor > parseFloat(reqMajorVer)) {
return true;
} else if (versionMajor == parseFloat(reqMajorVer)) {
if (versionMinor > parseFloat(reqMinorVer))
return true;
else if (versionMinor == parseFloat(reqMinorVer)) {
if (versionRevision >= parseFloat(reqRevision))
return true;
}
}
return false;
}
}
function AC_AddExtension(src, ext)
{
if (src.indexOf('?') != -1)
return src.replace(/\?/, ext+'?');
else
return src + ext;
}
function AC_Generateobj(objAttrs, params, embedAttrs)
{
var str = '';
if (isIE && isWin && !isOpera)
{
str += '';
}
else
{
str += '';
}
document.write(str);
}
function AC_FL_RunContent(){
var ret =
AC_GetArgs
( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
, "application/x-shockwave-flash"
);
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_SW_RunContent(){
var ret =
AC_GetArgs
( arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
, null
);
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
var ret = new Object();
ret.embedAttrs = new Object();
ret.params = new Object();
ret.objAttrs = new Object();
for (var i=0; i < args.length; i=i+2){
var currArg = args[i].toLowerCase();
switch (currArg){
case "classid":
break;
case "pluginspage":
ret.embedAttrs[args[i]] = args[i+1];
break;
case "src":
case "movie":
args[i+1] = AC_AddExtension(args[i+1], ext);
ret.embedAttrs["src"] = args[i+1];
ret.params[srcParamName] = args[i+1];
break;
case "onafterupdate":
case "onbeforeupdate":
case "onblur":
case "oncellchange":
case "onclick":
case "ondblclick":
case "ondrag":
case "ondragend":
case "ondragenter":
case "ondragleave":
case "ondragover":
case "ondrop":
case "onfinish":
case "onfocus":
case "onhelp":
case "onmousedown":
case "onmouseup":
case "onmouseover":
case "onmousemove":
case "onmouseout":
case "onkeypress":
case "onkeydown":
case "onkeyup":
case "onload":
case "onlosecapture":
case "onpropertychange":
case "onreadystatechange":
case "onrowsdelete":
case "onrowenter":
case "onrowexit":
case "onrowsinserted":
case "onstart":
case "onscroll":
case "onbeforeeditfocus":
case "onactivate":
case "onbeforedeactivate":
case "ondeactivate":
case "type":
case "codebase":
case "id":
ret.objAttrs[args[i]] = args[i+1];
break;
case "width":
case "height":
case "align":
case "vspace":
case "hspace":
case "class":
case "title":
case "accesskey":
case "name":
case "tabindex":
ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
break;
default:
ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
}
}
ret.objAttrs["classid"] = classid;
if (mimeType) ret.embedAttrs["type"] = mimeType;
return ret;
}
/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/
var offsetfrommouse=[50,50]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=5; //duration in seconds image should remain visible. 0 for always.
var currentimageheight = 500; // maximum image size.
if (document.getElementById || document.all){
document.write('
Set #' + title + ' | ||
'; if(set_pht_amount.length > 1){ newHTML = newHTML + 'Photos inside: ' + set_pht_amount + ''; } newHTML = newHTML + ' | ';
if(set_publication.length > 1){
newHTML = newHTML + ' Published: ' + set_publication + ' ';
}
newHTML = newHTML + ' | ';
if(set_views.length > 1){
newHTML = newHTML + ' Popularity: ' + set_views + ' views ';
}
newHTML = newHTML + ' |
' + description + ' | ||
Tags
'); $('.profile-data-wrapper').clone().prependTo('.overlayMenu'); } if($('.tag-list-menu').children().length == 0){ $('#navToggle').css({'display':'none'}); } $("#navToggle").click(function() { $(this).toggleClass("active"); $(".overlay").toggleClass("open"); // this line ▼ prevents content scroll-behind $("body").toggleClass("locked"); }); }); // end mobile-menu // mobile-search-form $(document).ready(function() { var searchBtnStart = $('.mobile-search-btn').html(); if($('.search-form').length == 0){ $('.mobile-search-btn').css({'display':'none'}); } $('.mobile-search-btn').click(function(){ var show = $(this).attr('data-show'); if(show == 'false'){ $('.search-form').removeClass('mobile-hidden-search-form'); $('.search-form .q').focus(); $(this).attr('data-show', 'true'); $(this).html(''); }else{ $('.search-form').addClass('mobile-hidden-search-form'); $(this).attr('data-show', 'false'); $(this).html(searchBtnStart); } }); }); // end mobile-search-form // download page refresh timer $(document).ready(function() { if($('#refresh-timer-on').length > 0){ var $refreshBtnText = $('.update-page-btn').text(); var time = 15; $('.update-page-btn').text($refreshBtnText + ' (' + time + ')'); setInterval(function() { if(time >= 0){ $('.update-page-btn').text($refreshBtnText + ' (' + time-- + ')'); } if(time == 0){ location.reload(); } }, 1000); } }); // end download page refresh timer var RotatingThumbs = { interval : 500, timer : null, img : null, origSRC : '', thumbs : [], current : 0, debug : false, rotate : function(img,thumbIDs) { if ( this.timer ) window.clearTimeout(this.timer); img.onmouseout = function() { RotatingThumbs.img.onload = function(){}; RotatingThumbs.img.onmouseout = function(){}; window.clearTimeout(RotatingThumbs.timer); RotatingThumbs.img.src = RotatingThumbs.origSRC; for ( var i=0; i