PageSourceSearch

https://www.ufone.com/business/wp-content/plugins/slick-popup/libs/js/custom.js?ver=6.9.8

js ufone.com collected 2026-10-02 13:55:28 UTC 9,373 bytes, 312 lines download raw bytes

1jQuery(document).ready(function($) {
2
3	jQuery('#splite_form_container').on('click' ,function() { splite_set_popup(); });
4
5	$animator = jQuery('.splite_popup_animator');
6	var cf7formid = $animator.attr('data-cf7formid'); 
7	
8	$inputs = jQuery("#splite_popup_box input,  #splite_popup_box textarea, #splite_popup_box select");
9	if($inputs.length) {
10		$inputs.each(function(e) {			
11			jQuery(this).focus(function(f){
12				jQuery(this).removeClass('wpcf7-not-valid').closest('.wpcf7-form-control-wrap').find('span.wpcf7-not-valid-tip').css({'display':'none'}); 
13			});
14		});
15		jQuery(document).on('click', 'span.wpcf7-not-valid-tip', function(e) { 
16			jQuery(this).css({'display':'none'}).prev('input').focus(); 
17		});
18	}
19	
20	var external_unloader = jQuery( '.splite-closepopup' );	
21	if( external_unloader.length ) {
22		//console.log("sa");
23		external_unloader.click( function(e) {
24			if( external_loader.tagName() == 'A' ) {
25				e.preventDefault(); 
26				splite_unloader();
27			}
28			else {
29				splite_unloader();
30			}
31		});
32	}
33	
34	/* var external_loader = jQuery( '.splite-showpopup' ); 
35	if( external_loader.length ) {
36		external_loader.click( function(e) {
37			if( external_loader.tagName() == 'A' ) {
38				e.preventDefault(); 
39				splite_loader();
40			}
41			else {
42				splite_loader();
43			}
44		});
45	} */
46
47	var external_selectors = {};
48	$animators = jQuery('.splite_popup_animator');
49	if($animators.length) {
50		i = 0; 
51		$animators.each(function() {
52			if (!! jQuery(this).attr('data-external_selectors')) {
53				$selectors_added = jQuery(this).attr('data-external_selectors');
54				var $selectors_added = $selectors_added.split(','); 
55				
56				var selector_parts = [];
57				jQuery.each($selectors_added, function(index, value) {
58					 selector_parts.push(jQuery.trim(value));
59				});
60				
61				external_selectors[i] = selector_parts.join(','); 
62				i++; 
63			}
64			
65		});
66	}
67	
68	//console.log(external_selectors);	
69	// Add a click function for all externa_selectors
70	jQuery.each(external_selectors, function(index, value) {
71		loaderButton = jQuery(value); 
72		loaderButton.click(function() {
73			splite_loader();			
74			return false; 
75		});
76	});
77	
78	document.addEventListener( 'wpcf7submit', function( event ) {
79		if ( jQuery.isNumeric(cf7formid) && cf7formid == event.detail.contactFormId ) {
80			splite_set_popup(id);
81		}
82	}, false );
83
84	document.addEventListener( 'wpcf7mailsent', function( event ) {
85		getSubmittedForm = jQuery('.splite_popup_animator[data-cf7-formID='+event.detail.contactFormId+']');
86		if(getSubmittedForm.length) {
87
88			autoclose = jQuery('.splite_popup_animator').attr('data-autoclose');
89			autoclose_time = jQuery('.splite_popup_animator').attr('data-autoclose_time'); 
90			redirect = jQuery('.splite_popup_animator').attr('data-redirect'); 
91			redirect_url = jQuery('.splite_popup_animator').attr('data-redirect_url');
92
93			if(redirect=="1" && redirect_url!='') {
94				location.replace(redirect_url); 
95			}
96			else if(autoclose=="1" && autoclose_time!='') {
97				setTimeout(function() {
98					splite_unloader(); 
99				}, parseInt(autoclose_time) * 1000);
100			}
101		}	 
102	}, false );
103
104
105	$popupBox = jQuery('#splite_popup_box');
106	if ($popupBox.length) {
107		var activationmode = jQuery(this).attr('data-activationmode');
108		if(activationmode=='onexit') {
109			//console.log(event.pageY==0 || event.pageY==1 || event.pageY < jQuery(document).scrollTop());
110			jQuery( "body" ).on( "mouseout", function( event ) {
111			  	if (event.pageY==0 || event.pageY==1 || event.pageY < jQuery(document).scrollTop() ) {
112			  		if(jQuery("#splite_popup_box").hasClass("manage")){
113			  			splite_loader();
114			  		}
115			  	}
116			});
117			//splite_loader();						
118		}
119	}
120
121	splite_set_popup();
122});
123
124
125/**
126* Function: tagName 
127* Returns the HTML tag of the element
128* Used for determining the tag of external anchor tag
129**/ 
130jQuery.fn.tagName = function() {
131	return this.prop("tagName");
132};
133
134
135/**
136* Function: splite_unloader 
137* Unloads the popup box
138**/ 
139function splite_unloader() {    
140
141	$animator = jQuery('.splite_popup_animator');
142	var ef = $animator.data('unloadeffect'); 
143	var speed = $animator.data('unloadspeed'); 
144
145	//console.log(ef,speed);
146	jQuery("#splite_popup_box").addClass(ef + ' animated').css({"-webkit-animation-duration": speed+"s","animation-duration": speed+"s"}).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){
147		jQuery(this).addClass('manage').removeClass(ef);
148	});
149
150	jQuery('#splite_curtain').fadeOut("slow");
151	jQuery(".splite_container").css({ 
152		"opacity": "1" 
153	});
154	//jQuery(this).addClass('manage');
155	
156	jQuery('body').enableScroll();
157	
158	return false;	
159}   
160
161
162/**
163* Function: splite_loader 
164* Loads the popup box
165**/ 
166function splite_loader() {  
167	
168	$animator = jQuery('.splite_popup_animator');
169	var ef = $animator.data('loadeffect'); 
170	var speed = $animator.data('loadspeed'); 
171	
172	// Load the Popup
173	var docHeight = jQuery(document).height();
174	jQuery('#splite_curtain').height(docHeight);	
175	jQuery('#splite_curtain').fadeIn("fast");			
176	//jQuery('#splite_popup_box').fadeIn("slow");
177	
178	splite_set_popup(		
179		jQuery("#splite_popup_box").removeClass('manage').addClass(ef + ' animated').
180		css({"-webkit-animation-duration": speed+"s","animation-duration": speed+"s"}).
181		one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){jQuery(this).removeClass(ef);})
182	);
183	
184	jQuery('body').disableScroll();
185	
186	return false;
187}
188
189
190/**
191* Function: window.resize 
192* Take action when window is resized
193* Used to splite_set_popup() on resize
194**/ 
195jQuery( window ).resize(function() {	
196	splite_set_popup();
197});
198
199
200/**
201* Function: splite_set_popup
202* Sets the popup position and layout
203* Important and need improvement 30072016
204**/ 
205function splite_set_popup() {
206	$popup = jQuery('#splite_popup_box');
207	$curtain = jQuery('#splite_curtain');
208	
209	$title = jQuery('#splite_popup_title');	
210	$description = jQuery('#splite_popup_description');	
211	$formArea = jQuery('#splite_form_container');
212	
213	$animator = jQuery('.splite_popup_animator');
214	var loadspeed = $animator.data('loadspeed'); 
215		
216	if ( $popup.length ) {
217		var popupHeight = $popup.outerHeight();
218		var titleHeight = $title.outerHeight();
219		var descriptionHeight = $description.outerHeight();		
220		$closeButton = jQuery('#splite_popupBoxClose');
221		
222		// Set Close Button Line Height to Title Height
223		$closeButton.css({ 'line-height':titleHeight + 'px', });	
224		descrptionHeight = 0; 
225		formHeight = popupHeight - titleHeight - 24;
226		$formArea.outerHeight(formHeight);
227		formAreaHeight = $formArea.outerHeight();
228		//alert( formAreaHeight + ' + ' +  formHeight ); 
229		if( formAreaHeight >= formHeight ) {
230			//formArea.css({'overflow-y':'scroll'});			
231			//setTimeout(function(){
232				$formArea.niceScroll({touchbehavior:false,cursorcolor:"#757575",cursoropacitymax:0,cursorwidth:0,cursorborder:"1px solid #2848BE",cursorborderradius:"0px",background:"#ccc",autohidemode:"scroll"});//.cursor.css({"background-image":"url(img/mac6scroll.png)"}); // MAC like scrollbar	
233			//},0);			
234			$formArea.getNiceScroll().resize()
235		}
236		
237		// Set Popup Left Position
238		curtainWidth = $curtain.width();
239		popupWidth = $popup.width();		
240		popLeft = (curtainWidth - popupWidth)/2;
241		//alert(popLeft);
242		
243		// Set Popup Top Position
244		windowHeight = jQuery(window).height();
245		popTop = (windowHeight - popupHeight)/2;
246		
247		$popup.css( 'left', popLeft+'px' );
248		$popup.css( 'top', popTop+'px' );
249	}
250	
251	splite_set_side_button();
252}
253
254jQuery('.nikhil').on('click' ,function() {
255	alert("Hello")
256	//splite_set_popup();
257});
258
259/**
260* Function: enableScroll
261* stackoverflow: /8701754/just-disable-scroll-not-hide-it
262**/ 
263jQuery.fn.enableScroll = function() {
264    jQuery(window).off('scroll.scrolldisabler');
265};
266
267/**
268* Function: disableScroll
269* stackoverflow: /8701754/just-disable-scroll-not-hide-it
270**/ 
271jQuery.fn.disableScroll = function() {
272    window.oldScrollPos = jQuery(window).scrollTop();
273
274    jQuery(window).on('scroll.scrolldisabler',function ( event ) {
275       jQuery(window).scrollTop( window.oldScrollPos );
276       event.preventDefault();
277    });
278};
279 
280/**
281* Function: set_side_button
282* Sets the side button position
283* Important and needs improvement 30072016
284**/ 
285function splite_set_side_button() {
286	
287	$side_button = jQuery('a.splite_sideEnquiry');
288	$curtain = jQuery('#splite_curtain');
289	
290	var button_width = $side_button.outerWidth();
291	var button_height = $side_button.outerHeight();
292	
293	if( button_width > button_height ) 
294		var button_pull = button_height/2 - button_width/2;
295	else 	
296		var button_pull = button_width/2 - button_height/2;
297	
298	//alert(button_width + ' - ' + button_height + ' = ' + button_pull);
299	
300	// Adjust if button right
301	var side_button_pos_right = jQuery('a.splite_sideEnquiry.pos_right');
302	if( side_button_pos_right.length ) 
303		side_button_pos_right.css( 'right', button_pull+ 'px' );
304	
305	// Adjust if button left
306	var side_button_pos_left = jQuery('a.splite_sideEnquiry.pos_left');
307	if( side_button_pos_left.length )
308		side_button_pos_left.css( 'left', button_pull+ 'px' );
309
310	
311	//side_button_on_mobile = jQuery('a.splite_sideEnquiry.on_mobile');
312}

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.