PageSourceSearch

https://ecembroid.com/wp-content/cache/min/1/wp-content/plugins/wo…/js/woo-notification.js?ver=1786068908

js ecembroid.com collected 2026-09-28 06:11:48 UTC 11,144 bytes, 148 lines download raw bytes

1jQuery(document).ready(function($){'use strict'
2if(jQuery('#message-purchased').length>0){var notify=woo_notification
3if(_woocommerce_notification_params.billing==0&&_woocommerce_notification_params.detect==0){notify.detect_address()}
4var el=document.getElementById('message-purchased')
5viSwipeDetect(el,function(swipedir){if(swipedir!=='none'){if(parseInt(woo_notification.time_close)>0){$('#message-purchased').unbind()
6woo_notification.setCookie('woo_notification_close',1,3600*parseInt(woo_notification.time_close))}
7woo_notification.message_hide(!1,swipedir)}})}})
8function vi_wn_b64DecodeUnicode(str){var decodedStr=''
9if(str){try{decodedStr=decodeURIComponent(atob(str).split('').map(function(c){return'%'+('00'+c.charCodeAt(0).toString(16)).slice(-2)}).join(''))}catch(e){return str}}
10return decodedStr}
11function viSwipeDetect(el,callback){var touchsurface=el,swipedir,startX,startY,distX,distY,threshold=150,restraint=100,allowedTime=300,elapsedTime,startTime,handleswipe=callback||function(swipedir){}
12touchsurface.addEventListener('touchstart',function(e){var touchobj=e.changedTouches[0]
13swipedir='none'
14startX=touchobj.pageX
15startY=touchobj.pageY
16startTime=new Date().getTime()},{passive:!0})
17touchsurface.addEventListener('touchmove',function(e){e.preventDefault()},{passive:!0})
18touchsurface.addEventListener('touchend',function(e){var touchobj=e.changedTouches[0]
19distX=touchobj.pageX-startX
20distY=touchobj.pageY-startY
21elapsedTime=new Date().getTime()-startTime
22if(elapsedTime<=allowedTime){if(Math.abs(distX)>=threshold&&Math.abs(distY)<=restraint){swipedir=distX<0?'left':'right'}else if(Math.abs(distY)>=threshold&&Math.abs(distX)<=restraint){swipedir=distY<0?'up':'down'}}
23handleswipe(swipedir)},{passive:!0})}
24jQuery(window).on('load',function(){'use strict'
25var notify=woo_notification
26notify.ajax_url=_woocommerce_notification_params.ajax_url
27notify.products=_woocommerce_notification_params.products
28notify.messages=_woocommerce_notification_params.messages
29notify.image=_woocommerce_notification_params.image
30notify.redirect_target=_woocommerce_notification_params.redirect_target
31notify.time=_woocommerce_notification_params.time
32notify.display_effect=_woocommerce_notification_params.display_effect
33notify.hidden_effect=_woocommerce_notification_params.hidden_effect
34notify.messages=_woocommerce_notification_params.messages
35notify.names=_woocommerce_notification_params.names
36notify.detect=_woocommerce_notification_params.detect
37notify.billing=_woocommerce_notification_params.billing
38notify.message_custom=_woocommerce_notification_params.message_custom
39notify.message_number_min=_woocommerce_notification_params.message_number_min
40notify.message_number_max=_woocommerce_notification_params.message_number_max
41notify.time_close=_woocommerce_notification_params.time_close
42notify.show_close=_woocommerce_notification_params.show_close
43notify.nonce=_woocommerce_notification_params.nonce
44if(_woocommerce_notification_params.billing==0&&_woocommerce_notification_params.detect==0){notify.cities=[notify.getCookie('wn_city')]
45notify.country=[notify.getCookie('wn_country')]
46var check_ip=notify.getCookie('wn_ip')
47if(check_ip&&check_ip!='undefined'){notify.init()}}else{notify.cities=_woocommerce_notification_params.cities
48notify.country=_woocommerce_notification_params.country
49notify.init()}})
50var woo_notification={billing:0,in_the_same_cate:0,loop:0,init_delay:5,total:30,display_time:10,next_time:60,count:0,intel:0,wn_popup:0,id:0,nonce:'',messages:'',products:'',ajax_url:'',display_effect:'',hidden_effect:'',time:'',names:'',cities:'',country:'',message_custom:'',message_number_min:'',message_number_max:'',detect:0,time_close:0,show_close:0,shortcodes:['{first_name}','{city}','{state}','{country}','{product}','{product_with_link}','{time_ago}','{custom}'],init:function(){if(this.ajax_url){this.ajax_get_data()}else{setTimeout(function(){woo_notification.get_product()},this.init_delay*1000)}
51jQuery('#message-purchased').on('mouseenter',function(){window.clearInterval(woo_notification.wn_popup)}).on('mouseleave',function(){woo_notification.message_show()})},detect_address:function(){var ip_address=this.getCookie('wn_ip')
52if(!ip_address){jQuery.getJSON('https://extreme-ip-lookup.com/json/',function(data){if(data.query){woo_notification.setCookie('wn_ip',data.query,86400)}
53if(data.city){woo_notification.setCookie('wn_city',data.city,86400)}
54if(data.country){woo_notification.setCookie('wn_country',data.country,86400)}})}},ajax_get_data:function(){if(this.ajax_url){var str_data
55if(this.id){str_data='&id='+this.id}else{str_data=''}
56jQuery.ajax({type:'POST',data:'action=woonotification_get_product'+str_data+'&nonce='+woo_notification.nonce,url:this.ajax_url,success:function(data){var products=JSON.parse(data)
57if(products&&products!='undefined'&&products.length>0){woo_notification.products=products
58woo_notification.message_show()
59setTimeout(function(){woo_notification.get_product()},woo_notification.init_delay*1000)}},error:function(html){},})}},message_show:function(){var count=this.count++
60if(this.total<=count){return}
61window.clearInterval(this.intel)
62var message_id=jQuery('#message-purchased')
63if(message_id.hasClass(this.hidden_effect)){message_id.removeClass(this.hidden_effect)}
64message_id.addClass(this.display_effect).css('display','inline-grid')
65this.wn_popup=setTimeout(function(){woo_notification.message_hide()},this.display_time*1000)},message_hide:function(close=!1,swipe=''){var message_id=jQuery('#message-purchased')
66if(message_id.hasClass(this.display_effect)){message_id.removeClass(this.display_effect)}
67switch(swipe){case 'left':message_id.addClass('bounceOutLeft')
68break
69case 'right':message_id.addClass('bounceOutRight')
70break
71case 'up':message_id.addClass('bounceOutUp')
72break
73case 'down':message_id.addClass('bounceOutDown')
74break
75default:message_id.addClass(this.hidden_effect)}
76message_id.fadeOut(1000)
77if(close||this.getCookie('woo_notification_close')){return}
78var count=this.count
79if(this.loop==1){if(this.total>count){window.clearTimeout(this.wn_popup)
80this.intel=setInterval(function(){woo_notification.get_product()},this.next_time*1000)}}else{window.clearTimeout(this.wn_popup)
81window.clearInterval(this.intel)}},get_time_string:function(){var time_cal=this.random(0,this.time*3600)
82var check_time=parseFloat(time_cal/86400)
83if(check_time>1){check_time=parseInt(check_time)
84if(check_time==1){return check_time+' '+_woocommerce_notification_params.str_day}else{return check_time+' '+_woocommerce_notification_params.str_days}}
85check_time=parseFloat(time_cal/3600)
86if(check_time>1){check_time=parseInt(check_time)
87if(check_time==1){return check_time+' '+_woocommerce_notification_params.str_hour}else{return check_time+' '+_woocommerce_notification_params.str_hours}}
88check_time=parseFloat(time_cal/60)
89if(check_time>1){check_time=parseInt(check_time)
90if(check_time==1){return check_time+' '+_woocommerce_notification_params.str_min}else{return check_time+' '+_woocommerce_notification_params.str_mins}}else if(check_time<10){return _woocommerce_notification_params.str_few_sec}else{check_time=parseInt(check_time)
91return check_time+' '+_woocommerce_notification_params.str_secs}},get_product:function(){var products=this.products
92var messages=this.messages
93var image_redirect=this.image
94var redirect_target=this.redirect_target
95var data_first_name,data_state,data_country,data_city,time_str,index
96if(products=='undefined'||!products||!messages){return}
97if(products.length>0&&messages.length>0){index=woo_notification.random(0,messages.length-1)
98var string=messages[index]
99index=woo_notification.random(0,products.length-1)
100var product=products[index]
101if(parseInt(this.billing)>0&&parseInt(this.in_the_same_cate)<1){data_first_name=vi_wn_b64DecodeUnicode(product.first_name)
102data_city=vi_wn_b64DecodeUnicode(product.city)
103data_state=vi_wn_b64DecodeUnicode(product.state)
104data_country=vi_wn_b64DecodeUnicode(product.country)
105time_str=product.time}else{if(this.names&&this.names!='undefined'){index=woo_notification.random(0,this.names.length-1)
106data_first_name=vi_wn_b64DecodeUnicode(this.names[index])}else{data_first_name=''}
107if(this.cities&&this.cities!='undefined'){index=woo_notification.random(0,this.cities.length-1)
108data_city=vi_wn_b64DecodeUnicode(this.cities[index])}else{data_city=''}
109data_state=''
110data_country=this.country
111time_str=this.get_time_string()}
112var data_product='<span class="wn-popup-product-title">'+product.title+'</span>'
113var data_product_link='<a class="wn-popup-product-title-with-link" '
114if(redirect_target==='1'){data_product_link+='target="_blank"'}
115data_product_link+=' href="'+product.url+'">'+product.title+'</a>'
116var data_time='<small>'+_woocommerce_notification_params.str_about+' '+time_str+' '+_woocommerce_notification_params.str_ago+' </small>'
117var data_custom=this.message_custom
118var image_html=''
119if(product.thumb){jQuery('#message-purchased').addClass('wn-product-with-image').removeClass('wn-product-without-image')
120if(image_redirect==='1'){image_html='<a class="wn-notification-image-wrapper" '
121if(redirect_target==='1'){image_html+='target="_blank"'}
122image_html+=' href="'+product.url+'"><img class="wn-notification-image" src="'+product.thumb+'" alt="'+product.thumb_alt+'"></a>'}else{image_html='<span class="wn-notification-image-wrapper"><img class="wn-notification-image" src="'+product.thumb+'" alt="'+product.thumb_alt+'"></span>'}}else{jQuery('#message-purchased').addClass('wn-product-without-image').removeClass('wn-product-with-image')}
123data_custom=data_custom.replace('{number}',this.random(this.message_number_min,this.message_number_max))
124var replaceArray=this.shortcodes
125var replaceArrayValue=[data_first_name,data_city,data_state,data_country,data_product,data_product_link,data_time,data_custom]
126var finalAns=string
127for(var i=replaceArray.length-1;i>=0;i--){finalAns=finalAns.replace(replaceArray[i],replaceArrayValue[i])}
128var close_html=''
129if(parseInt(this.show_close)>0){close_html='<div id="notify-close"></div>'}
130var html=image_html+'<p class="wn-notification-message-container">'+finalAns+'</p>'
131jQuery('#message-purchased').html('<div class="message-purchase-main">'+html+'</div>'+close_html)
132this.close_notify()
133woo_notification.message_show()}},close_notify:function(){jQuery('#notify-close').unbind()
134jQuery('#notify-close').bind('click',function(){woo_notification.message_hide()
135jQuery('#message-purchased').unbind()
136if(parseInt(woo_notification.time_close)>0){woo_notification.setCookie('woo_notification_close',1,3600*parseInt(woo_notification.time_close))}})},random:function(min,max){min=parseInt(min)
137max=parseInt(max)
138var rand_number=Math.random()*(max-min)
139return Math.round(rand_number)+min},setCookie:function(cname,cvalue,expire){var d=new Date()
140d.setTime(d.getTime()+(expire*1000))
141var expires='expires='+d.toUTCString()
142document.cookie=cname+'='+cvalue+';'+expires+';path=/'},getCookie:function(cname){var name=cname+'='
143var decodedCookie=decodeURIComponent(document.cookie)
144var ca=decodedCookie.split(';')
145for(var i=0;i<ca.length;i++){var c=ca[i]
146while(c.charAt(0)==' '){c=c.substring(1)}
147if(c.indexOf(name)==0){return c.substring(name.length,c.length)}}
148return''},}

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.