403Webshell
Server IP : 208.122.213.31  /  Your IP : 216.73.216.183
Web Server : Apache
System : Linux msd6191.mjhst.com 4.18.0-553.137.1.el8_10.x86_64 #1 SMP Wed Jun 24 11:40:24 UTC 2026 x86_64
User : WHMCS_MIA_382 ( 1001)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/httpd/html/cafemilfs.com/public_html/members/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/httpd/html/cafemilfs.com/public_html/members/js/helper.js
enable_vid_swiping  = 1;
enable_vid_autoplay = 1;
enable_vid_hover    = 1;


// Code that only executes after there hasn't been other calls in X ms
// See here for license and more info - http://yckart.github.io/jquery.unevent.js/

;(function ($) {
    var on = $.fn.on, timer;
    $.fn.on = function () {
        var args = Array.apply(null, arguments);
        var last = args[args.length - 1];

        if (isNaN(last) || (last === 1 && args.pop())) return on.apply(this, args);

        var delay = args.pop();
        var fn = args.pop();

        args.push(function () {
            var self = this, params = arguments;
            clearTimeout(timer);
            timer = setTimeout(function () {
                fn.apply(self, params);
            }, delay);
        });

        return on.apply(this, args);
    };
}(this.jQuery));

// End unevent code


// Diagnostic code that will append text at the bottom of the page

function customlog(html)
{	
	if ($("#customexlog").length == 0)
	{
		$('<div id="customexlog">footer</div>').appendTo('body');
		
		$("#customexlog").css("background-color", "#BBBBBB");
		$("#customexlog").css("width", "100%");
		$("#customexlog").css("position", "fixed");
		$("#customexlog").css("z-index", "1000");
		$("#customexlog").css("bottom", "0px");
		$("#customexlog").css("padding", "20px");
		$("#customexlog").css("max-height", "100px");
		$("#customexlog").css("overflow-y", "scroll");

		$("#customexlog").html((new Date) + " - " + html);		
	}
	else
	{
		$("#customexlog").html((new Date) + " - " + html + "<BR>" +  $("#customexlog").html());
	}
}



$( document ).ready(function() {


	$(".convert_unixtime").each( function(e) { 
		
		vx = $(this).html();
		vs = new Date(vx * 1000);
		
		$(this).html( convert_fromunixtime(vs) );
	});
	
	$(".hide_if_live").each( function(e) { 
		var t = $(this).data("time");
		var u = new Date(t * 1000);
		
		var c = new Date();
		
		if (c < u)
		{
			$(this).show();
		}
	});

	$(".show_if_live").each( function(e) { 
		
		var t = $(this).data("time");
		var u = new Date(t * 1000);
		
		var c = new Date();
		
		if (c >= u)
		{
			$(this).show();
		}
	});


	lsb = $("#live_show_box");

	st = $("#live_show_box").data("start")
	ed = $("#live_show_box").data("end")
	if (st == undefined) return;
	ct = $("#live_show_box").data("currtime")
	
	var s = new Date(st * 1000);
	var e = new Date(ed * 1000);
	
	var live_int = setInterval(function(){ 

		var c = new Date();
		
		fullt = convert_fromunixtime(s);
		
		if (c > e)
		{
			$(".live_show_wrapper").fadeOut();
			clearInterval(live_int);
		}		
		else if (s > c)
		{
			$("#live_show_fulltime").html(fullt);
			$("#live_show_fulltime").fadeIn();

			
			tm = Math.floor(s.getTime() - c.getTime() ) / 1000;
			
			st = Math.floor(tm / 86400);
			if (st < 10) st = "0" + st;
			tm = tm % 86400;
			$("#live_show_days").html(st);
			
			st = Math.floor(tm / 3600);
			if (st < 10) st = "0" + st;
			tm = tm % 3600;
			$("#live_show_hours").html(st);
			
			st = Math.floor(tm / 60);
			if (st < 10) st = "0" + st;
			tm = tm % 60;
			$("#live_show_minutes").html(st);
			
			st = Math.floor(tm);
			if (st < 10) st = "0" + st;
			tm = tm;
			$("#live_show_seconds").html(st);
			
			$("#live_show_now").fadeOut("400", function() { 
				$("#live_show_future").fadeIn();			
			});

		}
		else
		{
			if (lsb.data("refresh") == "1")
			{
				clearInterval(live_int);
				document.location.reload(); 
				return;
			}
			
			$("#live_show_days").html("00");		
			$("#live_show_hours").html("00");		
			$("#live_show_minutes").html("00");		
			$("#live_show_seconds").html("00");
			
			$("#live_show_fulltime").fadeOut(400, function() {
				$("#live_show_watchnow").fadeIn();
			});
			
			$("#live_show_future").fadeOut(400, function() { 			
				$("#live_show_now").fadeIn();	
			});
		}

	}, 1000);
});

function convert_fromunixtime(s)
{
	w = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
	m = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
	
	h = s.getHours();
	ampm = (h > 11) ? "pm" : "am";
	h -= (h > 11) ? 12 : 0;
	h = (h == 0) ? 12 : h;
	min = s.getMinutes();
	if (min < 10) min = "0" + min;
	
	return w[s.getDay()] + " " + m[s.getMonth()] + " " + s.getDate() + ", " + s.getFullYear() + " " + h + ":" + min + ampm;
}



var interv;

var animate_selector = '.stdvideo:not([controls]), .stdimage[cnt][cnt!=1]';

this.stdthis = function(idx){

	if (idx == null) { return; }

	cnt = idx.attr('cnt');
	v = idx.attr('v');
	v = parseInt(v);
	v = (v + 1) % cnt;

	var imageinfo = getSuffixFileZoom( idx[0] );
	var suffix = imageinfo.suffix;
				
	if ( idx.attr('src' + v + suffix) != undefined )
	{
		sr = idx.attr('src' + v + suffix)			
	}
	else
	{
		sr = idx.attr('src' + v)	
	}

	idx.attr('v', v);
	idx.attr('src', sr);
	
	if (v == 0 && idx.attr("nolooptrigger") == "1")
	{
		clearInterval(interv);
	    ovidimg = currvidimg;
	    currvidimg = (currvidimg + 1) % $(animate_selector).length;
		startvidimg();
		return;		
	}
	
}

// Determines the image zoom level
// If iwidth and swidth aren't passed along, this is a general purpose
// combination of retina level * zoom level

// If iwidth and width are passed along, the zoom level
// for an individual image is calculated.

function pixelRatioZoom(iwidth, swidth)
{	
	zr = 1;
	
	if (!!("undefined" != typeof document.documentElement.ontouchstart))
	{
		zr = screen.width / $(window).width();		
	}
	
	var dpr = (window.devicePixelRatio) ? window.devicePixelRatio : 1;
	
	var zm = NaN;

	if (isNaN(zm))
	{
		try
		{
			zm = document.documentElement.clientWidth / window.innerWidth;
		}
		catch(e)
		{
			zm = NaN;
		}
	}
	
	if (isNaN(zm))
	{
		try
		{		
			zm = screen.deviceXDPI / screen.logicalXDPI 
		}
		catch(e)
		{
			zm = NaN;
		}
	}
	
	zm = (isNaN(zm)) ? 1 : zm;
	
	ret = zm * dpr * zr;
	
	if (typeof iwidth == "undefined" || iwidth == 0)
	{
		return ret;
	}
	
	if (typeof swidth == "undefined" || swidth == 0)
	{
		return ret;
	}
	
	// If the image display width and the actual image width are defined, factor that into image zoom.

	return zm * dpr * zr * (iwidth / swidth);	
}

// Given an image, calculate the zoom level for the image
// And subsequently, what suffix it recommends.

function getSuffixFileZoom(v, pfix)
{
	var ret = {};
	
	if (typeof pfix == "undefined")
	{
		pfix = "src0";
	}
	
	ret.zoom = pixelRatioZoom(v.width, $(v).attr(pfix + "_1x_width"))
	ret.suffix = "_1x";
	ret.src="";
	
	// Uncomment this if you want to disable retina images.
	// Uncomment and change to 2.0 if you want to force retina images.
	// ret.zoom = 1.0;

	if (ret.zoom > 3.3 && ($(v).attr(pfix + "_4x") != undefined))
	{
		ret.src = $(v).attr(pfix + "_4x");
		ret.suffix = "_4x"
	}
	else if (ret.zoom > 2.3 && ($(v).attr(pfix + "_3x") != undefined))
	{
		ret.src = $(v).attr(pfix + "_3x");
		ret.suffix = "_3x"
	}
	else if (ret.zoom > 1.3 && ($(v).attr(pfix + "_2x") != undefined))
	{
		ret.src = $(v).attr(pfix + "_2x");
		ret.suffix = "_2x"
	}
	else
	{
		if ($(v).attr(pfix + "_1x") != undefined)
		{
			ret.src = $(v).attr(pfix + "_1x");
		}
		else
		{
			ret.src = $(v).attr(pfix);
		}
	}
	
	return ret;
}


suffix = "_1x";

var zoom = pixelRatioZoom();
var z_w = NaN;
var z_h = NaN;

try
{
	z_w = window.innerWidth;
	z_h = window.innerHeight;
}
catch(e)
{
	alert(e)
}


// This will swap in new images if page is scrolled
// Or zoomed in.

function szhandler()
{
    var newzoom = pixelRatioZoom();

	var z_nw = NaN;
	var z_nh = NaN;

	try
	{
		z_nw = window.innerWidth;
		z_nh = window.innerHeight;
	}
	catch(e)
	{
		return;
	}

	if (isNaN(z_w) || isNaN(z_h) || isNaN(z_nw) || isNaN(z_nh))
	{
		return;
	}

	// If this is just scrolling, return
	// If zooming or resizing, do not return.

	if ((z_w == z_nw) && (z_h == z_nh) && (newzoom == zoom))
	{
		return;
	}

	z_w = z_nw;
	z_h = z_nh;
        
	zoom = newzoom

	$(".stdimage").each(function(index) {

		o_img = $(this).attr("src");
		var imageinfo = getSuffixFileZoom(this);			
		n_img = imageinfo.src;
		
		if (n_img != o_img)
		{
			$(this).attr("src", n_img);
		}
	});
	
	$(".stdvideo").each(function(index) {

		o_img = $(this).attr("poster");
		var imageinfo = getSuffixFileZoom(this, "poster");			
		n_img = imageinfo.src;
		
		if (n_img != o_img)
		{
			$(this).attr("poster", n_img);
		}
	});
	
}

// zoom / scroll handler.

sch = 0;

if (sch == 0)
{
	try
	{
		document.addEventListener("scroll", szhandler, true);
		sch = 1;
	}
	catch(e) {}
}

if (sch == 0)
{
	try
	{
		window.attachEvent ("onscroll", szhandler);
		sch = 1;
	}
	catch(e) {}
}

$(window).resize(function() {
	szhandler();
});

interv = 0;



// video loading code

var loadnew = 0;
var currvidimg = -1;
var ovidimg = -1;
var disable_vidimgcheck = 0;



this.StdImageHandler = function(){	

	imgs = [];
	
	

	$(".stdimage").ready(function() {

		//! Put .stdimage images into place.

		$(".stdimage").each(function(index) {
			var imageinfo = getSuffixFileZoom(this);			
			$(this).attr("src", imageinfo.src);
		});
	
	
		//! Preload .stdimage rotated images.
		$(".stdimage").each(function(index) {

			cnt = $(this).attr('cnt')
	
			if (cnt < 2)
			{
				return;
			}
				
			var imageinfo = getSuffixFileZoom(this);
			var suffix = imageinfo.suffix;
						
			for(c=0; c < cnt; c++)
			{
				if ( $(this).attr('src' + c + suffix) != undefined )
				{
					itr = imgs.length;
					imgs[itr] = new Image;				
					imgs[itr].src = $(this).attr('src' + c + suffix)					
				}

				if ( $(this).attr('src' + c) != undefined )
				{
					itr = imgs.length;
					imgs[itr] = new Image;				
					imgs[itr].src = $(this).attr('src' + c)					
				}
			}
		});
	});	
	
	//! Load .stdvideo 1x/2x/3x/4x poster into place.
	
	$(".stdvideo").ready(function() {

		$(".stdvideo").each(function(index) {

			var imageinfo = getSuffixFileZoom(this, "poster");			
			$(this).attr("poster", imageinfo.src);
		});		
	});
	
	//! Different behavior for mouse vs tablet
	
	
	if (matchMedia('(pointer:fine)').matches)
	{	
		if (enable_vid_hover == 1)
		{
			init_mousehoverbehavior();
		}
	}
	else
	{
		init_touchbehavior();
	}	
}

function init_touchbehavior()
{
	if ( $(animate_selector).length != 0 )
	{		
		$(window).on('load',function () {
			
			if (enable_vid_autoplay == 1)
			{
				$(document).on( 'scroll', function(){
					vidimgcheck();
				}, 250);
				
				$( window ).resize(function() {
					vidimgcheck();
				}, 250);
		
				$(".owl-carousel").on('translated.owl.carousel', function(event) {
					loadnew = 0;
					vidimgcheck();
				})
			}
			
			startvidimg();
		});

			
	}		
}


function init_mousehoverbehavior()
{	
	$(".stdvideo:not([controls])").hover( function(e) {
	
		$(this).next(".videoloadline").addClass("videoloadline_on");
		$(this).get(0).play();
	
	}, function() { 
	
		$(".videoloadline").removeClass("videoloadline_on");
	
		$(this).get(0).pause();
		$(this).load();

	});	
	
    $('.stdvideo:not([controls])').on('playing',function(){
		$(".videoloadline").removeClass("videoloadline_on");  
    });
    

	$(".stdimage").hover(function(e){
		stdthis($(this));
		interv = setInterval(stdthis, 800, $(this));
	},
	function(e){
		clearvidimg(this)
    });
}

function clearvidimg(e)
{
	if ($(e)[0].nodeName == "VIDEO")
	{
		$(e).load();
		$(e).removeAttr("loop");
		$(".videoloadline").removeClass("videoloadline_on");
	}
	else
	{
		cnt = $(e).attr('cnt')
		
		if (cnt > 1)
		{
			var imageinfo = getSuffixFileZoom(e);
			var suffix = imageinfo.suffix;
		
			$(e).attr('v' ,0);
			
			if ( $(e).attr('src0' + suffix) != undefined )
			{
				$(e).attr('src', $(e).attr('src0' + suffix))
			}
			else
			{
				$(e).attr('src', $(e).attr('src0'))			
			}
		}
	}
	
	clearInterval(interv)
	interv = 0;
}

var restart_check = 0;

function vidimgcheck()
{
	if (disable_vidimgcheck == 1)
	{
		return;
	}
	
	if (restart_check == 1)
	{
		startvidimg();
		restart_check = 0;
		return;
	}

	var is_new = 0;
	if (currvidimg == -1)
	{
		currvidimg = 0;
		is_new = 1;
	}
	
	vd = $(animate_selector).get(currvidimg);
	if (vd == undefined)
	{
		currvidimg = 0;
		startvidimg();
		return;
	}
	
	if ($(vd)[0].nodeName == "VIDEO")
	{
		if (!loadnew && !vd.paused && !isScrolledIntoView(vd))
		{
			loadnew = 1;

			if (is_new == 0)
			{
				clearvidimg(vd)
				$( animate_selector ).off();
			}
			startvidimg();
			is_new = 0;
			return;
		}	
	}
	else
	{	
		if (!loadnew && !isScrolledIntoView(vd))
		{
			clearvidimg(vd)
			$( animate_selector ).off();
			startvidimg();
			return;
		}		
	}
}




function startvidimg()
{
	if (disable_vidimgcheck == 1)
	{
		return;
	}
	
    if ($(animate_selector).length == 0)
	{
		return;	
	}
	
	var loopcount = 0;
	
	do
	{
		loopcount++;

		vd = $(animate_selector).get(currvidimg);
		if (vd == undefined)
		{					
			currvidimg = (currvidimg + 1) % $(animate_selector).length;
			continue;
		}

		isv = isScrolledIntoView(vd)
		if (!isv)
		{
			currvidimg = (currvidimg + 1) % $(animate_selector).length;

			if (loopcount > $(animate_selector).length)
			{
				// Nothing is on screen. We wait until the user scrolls or screen is resized to try again.
				currvidimg = -1;
				loadnew = 0;
				restart_check = 1;
				return;
			}		
		}

	} while(!isv);
	
	if (currvidimg != ovidimg)
	{
		olvd = $(animate_selector).get(ovidimg);
		
		if ($(olvd)[0].nodeName == "VIDEO")
		{
			$(olvd).load();			
		}
		else
		{
			clearInterval(interv)
		}
	}

	
	if ($(vd)[0].nodeName == "VIDEO")
	{
		// Take out loops on video
		$(vd).removeAttr("loop");
	}
	
	
	$( animate_selector ).off();
	
	// Only applies for video
    $( animate_selector).on('ended',function(){
	    
	    ovidimg = currvidimg;
	    currvidimg = (currvidimg + 1) % $(animate_selector).length;
		startvidimg();
		return;		    
    });
    
    // Only applies for videos
    $(animate_selector).on('playing',function(){
		$(".videoloadline").removeClass("videoloadline_on");
    });
    
    
    if (enable_vid_swiping == 1)
    {
		$(animate_selector).bind('touchstart', function(e){
	
			$(this).attr("startX", event.touches[0].clientX);
			$(this).attr("startY", event.touches[0].clientY);
			$(this).attr("curX", event.touches[0].clientX);
			$(this).attr("curY", event.touches[0].clientY);
		});
		
		$(animate_selector).bind('touchmove', function(e){
			
			$(this).attr("curX", event.touches[0].clientX);
			$(this).attr("curY", event.touches[0].clientY);
		});
		
		$(animate_selector).bind('touchend', function(e){
			
			// Calculate angle of swipe
			
			var X = $(this).attr("startX") - $(this).attr("curX");
			var Y = $(this).attr("curY") - $(this).attr("startY");
	
			var Z = Math.round(Math.sqrt(Math.pow(X,2)+Math.pow(Y,2))); //the distance - rounded - in pixels
			var r = Math.atan2(Y,X); //angle in radians (Cartesian system)
	
			var a = Math.round(r*180/Math.PI); //angle in degrees
			if ( a < 0 ) { a =  360 - Math.abs(a); }
			
			// Set angle threshhold for what is swiping left or right.
			
			if ( (a <= 45) && (a >= 0) ) {
				d = 'left';
			} else if ( (a <= 360) && (a >= 315) ) {
				d = 'left';
			} else if ( (a >= 135) && (a <= 225) ) {
				d = 'right';
			} else if ( (a > 45) && (a < 135) ) {
				d = 'down';
			} else {
				d = 'up';
			}
			
			$(this).attr("startX", 0);
			$(this).attr("startY", 0);
			$(this).attr("curX", 0);
			$(this).attr("curY", 0);
									
			if (d != "left" && d != "right")
			{
				return;
			}
			
			// Only play movie if swiped left or right.
					
			disable_vidimgcheck = 1;
			
			
			vlx = this
	
			// Unbind all video activity
			$(animate_selector).unbind("ended");
			
			$(".stdvideo:not([controls])").each( function(e) { 
				
				if ( $(vlx)[0] !== $(this)[0] )
				{
					if (!$(this).get(0).paused)
					{
						$(this).load();
					}
					
					$(this).next(".videoloadline").removeClass("videoloadline_on");
				}
			});
			
			// Unbind all photo activity and reset to slot.
	
			$(".stdimage").each( function() { 
				clearvidimg(e);
			});
			
			if ( $(this)[0].nodeName == "VIDEO")
			{
				$(this).attr("loop", "loop")
	
				if (!$(this).get(0).paused)
				{
					$(this).next(".videoloadline").removeClass("videoloadline_on");			
				}
				else
				{
					$(this).next(".videoloadline").addClass("videoloadline_on");
					this.play();
				}
			}
			else
			{
				$(this).removeAttr("nolooptrigger");
				stdthis($(this));
				interv = setInterval(stdthis, 800, $(this));
			}
					
		});
	
	}
	
	
	if (enable_vid_autoplay == 1)
	{
		clearInterval(interv)
	  
		if ($(vd)[0].nodeName == "VIDEO")
		{
			$(vd).next(".videoloadline").addClass("videoloadline_on");
			vd.play();
			loadnew = 0;
		}
		else
		{
			//! Start mouseover hover play
			loadnew = 0;
			$(vd).attr("nolooptrigger", 1);
			stdthis($(vd));
			interv = setInterval(stdthis, 800, $(vd));
		}
	}
}




function isScrolledIntoView(elem)
{
	if (!$(elem).is(":visible"))
	{
		return false;
	}
	
    var docViewTop = $(window).scrollTop();
    var docViewBottom = docViewTop + $(window).height();
    var docViewLeft = $(window).scrollLeft();
    var docViewRight = docViewLeft + $(window).width();

    var elemTop = $(elem).offset().top;
    var elemBottom = elemTop + $(elem).height();
    var elemLeft = $(elem).offset().left;
    var elemRight = elemLeft + $(elem).width();

    return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop) && (elemRight <= docViewRight) && (elemLeft >= docViewLeft) );
}
		



Youez - 2016 - github.com/yon3zu
LinuXploit