PageSourceSearch

https://tjprc.org/wp-content/plugins/ays-popup-box/public/js/ays-pb-public.js?ver=3.4.9

js tjprc.org collected 2026-10-02 06:28:37 UTC 2,971 bytes, 90 lines download raw bytes

1(function( $ ) {
2	'use strict';
3
4	/**
5	 * All of the code for your public-facing JavaScript source
6	 * should reside in this file.
7	 *
8	 * Note: It has been assumed you will write jQuery code here, so the
9	 * $ function reference has been prepared for usage within the scope
10	 * of this function.
11	 *
12	 * This enables you to define handlers, for when the DOM is ready:
13	 *
14	 * $(function() {
15	 *
16	 * });
17	 *
18	 * When the window is loaded:
19	 *
20	 * $( window ).load(function() {
21	 *
22	 * });
23	 *
24	 * ...and/or other possibilities.
25	 *
26	 * Ideally, it is not considered best practise to attach more than a
27	 * single DOM-ready or window-load handler for a particular page.
28	 * Although scripts in the WordPress core, Plugins and Themes may be
29	 * practising this, we should strive to set a better example in our own work.
30	 */
31
32	$(document).ready(function (){
33		// Answer Sound Muter
34		$(document).on('click', '.ays_music_sound', function() {
35			var $this = $(this);
36			var audioEl = $(document).find('.ays_pb_sound').get(0);
37			if($this.hasClass('ays_sound_active')){
38				audioEl.volume = 0;
39				$this.find('.ays_pb_fa_volume').remove();
40				$this.html(pbLocalizeObj.icons.volume_mute_icon);
41				$this.find('.ays_pb_fa_volume').addClass('ays_pb_fa_volume_off').removeClass('ays_pb_fa_volume');
42				$this.removeClass('ays_sound_active');
43			} else {
44				audioEl.volume = 1;
45				$this.find('.ays_pb_fa_volume_off').remove();
46				$this.html(pbLocalizeObj.icons.volume_up_icon);
47				$this.find('.ays_pb_fa_volume_off').addClass('ays_pb_fa_volume').removeClass('ays_pb_fa_volume_off');
48				$this.addClass('ays_sound_active');
49			}
50		});
51
52		$(document).on('click', '#ays_pb_dismiss_ad', function(){
53			var expTime = $(this).parent().data('dismiss');
54			var id = $(this).parent().data('id');
55
56			if(expTime != ''){
57				set_cookies('ays_pb_dismiss_ad_'+id, 'ays_pb_dismiss_ad_'+id, parseInt(expTime));
58			}else{
59				var expiryDate = new Date();
60				expiryDate.setMonth(expiryDate.getMonth() + 1);
61				set_cookies('ays_pb_dismiss_ad_'+id, 'ays_pb_dismiss_ad_'+id, expiryDate);
62			}
63			$(document).find('.ays-pb-modal-close_'+id).trigger('click');
64		});
65
66		function set_cookies( cname, cvalue, exdays ) {
67			var expires = "expires=" +  (new Date(Date.now() + exdays)).toUTCString();  
68				document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
69		}
70	});
71})( jQuery );
72
73window.onload = function(){
74	var classList = document.body.classList;
75	document.ontouchmove = function(e){
76    	for( var i = 0; i < classList.length; i++ ){
77    		if( classList[i] == 'pb_disable_scroll' ){
78    			if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
79                    e.preventDefault(); 
80    			}
81    			break;
82    		}else if( classList[i] == 'pb_enable_scroll' ){
83    		    if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
84    		        true;
85    			}
86    			break;
87    		} 
88    	}
89	}
90}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.