PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /home/trave494/bettingbin.com/wp-content/plugins/jetpack_bkp/_inc/lib/tracks/
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
IP: 209.182.202.254
Choose File :

Url:
Dir : /home/trave494/bettingbin.com/wp-content/plugins/jetpack_bkp/_inc/lib/tracks/tracks-ajax.js

/* global jpTracksAJAX, jQuery */
( function ( $, jpTracksAJAX ) {
	window.jpTracksAJAX = window.jpTracksAJAX || {};
	var debugSet = localStorage.getItem( 'debug' ) === 'dops:analytics';

	window.jpTracksAJAX.record_ajax_event = function ( eventName, eventType, eventProp ) {
		var data = {
			tracksNonce: jpTracksAJAX.jpTracksAJAX_nonce,
			action: 'jetpack_tracks',
			tracksEventType: eventType,
			tracksEventName: eventName,
			tracksEventProp: eventProp || false,
		};

		return $.ajax( {
			type: 'POST',
			url: jpTracksAJAX.ajaxurl,
			data: data,
			success: function ( response ) {
				if ( debugSet ) {
					// eslint-disable-next-line
					console.log( 'AJAX tracks event recorded: ', data, response );
				}
			},
		} );
	};

	$( document ).ready( function () {
		$( 'body' ).on( 'click', '.jptracks a, a.jptracks', function ( event ) {
			var $this = $( event.target );
			// We know that the jptracks element is either this, or its ancestor
			var $jptracks = $this.closest( '.jptracks' );
			// We need an event name at least
			var eventName = $jptracks.attr( 'data-jptracks-name' );
			if ( undefined === eventName ) {
				return;
			}

			var eventProp = $jptracks.attr( 'data-jptracks-prop' ) || false;

			var url = $this.attr( 'href' );
			var target = $this.get( 0 ).target;
			if ( url && target && '_self' !== target ) {
				var newTabWindow = window.open( '', target );
				newTabWindow.opener = null;
			}

			event.preventDefault();

			window.jpTracksAJAX.record_ajax_event( eventName, 'click', eventProp ).always( function () {
				// Continue on to whatever url they were trying to get to.
				if ( url && ! $this.hasClass( 'thickbox' ) ) {
					if ( newTabWindow ) {
						newTabWindow.location = url;
						return;
					}
					window.location = url;
				}
			} );
		} );
	} );
} )( jQuery, jpTracksAJAX );