PageSourceSearch

https://www.ifmk.fr/wp-content/plugins/pj-gravityforms/js/common.js?ver=0.7.7

js ifmk.fr collected 2026-10-07 21:52:34 UTC 4,488 bytes, 111 lines download raw bytes

1(function($){
2    var pjGravityCookies = {
3		init: function() {
4			this.handleAction();
5		},
6		handleAction: function() {
7			var self = this;
8			var pj_cookies_name = 'pj-cookie-captcha';
9			$('#pj-cookie-captcha').on('click', function(e) {
10				e.preventDefault();
11				self.setCookie(pj_cookies_name, true);
12				self.activateCaptcha(this, true);
13				self.hideGdprNotice();
14                __tcfapi("accept", 2, function(){},{force: true});
15
16
17				
18			});
19
20			// When user click agree and close
21			if(typeof __tcfapi === 'undefined') {
22                !function(){var e=function(){var e,t="__tcfapiLocator",a=[],n=window;for(;n;){try{if(n.frames[t]){e=n;break}}catch(e){}if(n===window.top)break;n=n.parent}e||(!function e(){var a=n.document,r=!!n.frames[t];if(!r)if(a.body){var s=a.createElement("iframe");s.style.cssText="display:none",s.name=t,a.body.appendChild(s)}else setTimeout(e,5);return!r}(),n.__tcfapi=function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return a;if("setGdprApplies"===n[0])n.length>3&&2===parseInt(n[1],10)&&"boolean"==typeof n[3]&&(e=n[3],"function"==typeof n[2]&&n[2]("set",!0));else if("ping"===n[0]){var s={gdprApplies:e,cmpLoaded:!1,cmpStatus:"stub"};"function"==typeof n[2]&&n[2](s)}else a.push(n)},n.addEventListener("message",(function(e){var t="string"==typeof e.data,a={};try{a=t?JSON.parse(e.data):e.data}catch(e){}var n=a.__tcfapiCall;n&&window.__tcfapi(n.command,n.version,(function(a,r){var s={__tcfapiReturn:{returnValue:a,success:r,callId:n.callId}};t&&(s=JSON.stringify(s)),e&&e.source&&e.source.postMessage&&e.source.postMessage(s,"*")}),n.parameter)}),!1))};"undefined"!=typeof module?module.exports=e:e()}();
23              }
24
25            __tcfapi('addEventListener', 2, (tcData, success) => {
26                if (
27                  success &&
28                  tcData.gdprApplies &&
29                  ('useractioncomplete' === tcData.eventStatus)
30                ) {
31                  // trigger a reload to apply the new consent and lock/unlock guardian
32                    
33                  if (Object.values(tcData.purpose.consents).length > 0 ) {
34                    // sfbxguardian.restart()
35                    self.setCookie('pj-cookie-captcha', true);
36					self.activateCaptcha('#pj-cookie-captcha', true);
37					self.hideGdprNotice();
38                    
39
40                 } 
41                  
42                }
43              })
44
45
46
47
48		
49
50            __tcfapi('addEventListener', 2, (tcData, success) => {
51                if (
52                  success &&
53                  tcData.gdprApplies &&
54                  ('useractioncomplete' === tcData.eventStatus)
55                ) {
56                  // trigger a reload to apply the new consent and lock/unlock guardian
57                    
58                  if (Object.values(tcData.purpose.consents).length === 0 ) {
59                    // sfbxguardian.restart()
60                    self.setCookie('pj-cookie-captcha', false);
61					self.activateCaptcha('#pj-cookie-captcha', false);
62					self.hideGdprNotice(true);
63                    
64
65                 } 
66                  
67                }
68              });
69
70			
71		},
72		setCookie: function(name, value) {
73			value = value || false;
74			var now = new Date(),
75			expires = now.getTime() + (1000*60*60*24*30*6);
76
77			now.setTime(expires);
78
79			var cookie_rest = ';expires=' + now.toGMTString() + ';path=/';
80			document.cookie = name + '=' + value + cookie_rest;
81		},
82		activateCaptcha: function(obj, state) {
83			state = state || false;
84			var elGform = $(obj).closest('.gform_body'),
85			elCaptcha = elGform.find('.ginput_recaptcha');
86			if (elCaptcha && elCaptcha.length) {
87				var cls = 'gfield_visibility_hidden';
88				if (state === true) {
89					cls = 'gfield_visibility_visible';
90				}
91				elCaptcha.closest('.gfield').removeClass('gfield_visibility_hidden').addClass(cls);
92			}
93		},
94		hideGdprNotice: function(show) {
95			show = show || false;
96			var elNotice = $('#pj-cookies-gdpr'),
97			elWrap = elNotice.closest('.gfield');
98			if (elWrap && elWrap.length) {
99				if (show === false) {
100					elWrap.removeClass('gfield_visibility_visible').addClass('gfield_visibility_hidden');
101				} else {
102					elWrap.removeClass('gfield_visibility_hidden').addClass('gfield_visibility_visible');
103				}
104			}
105		}
106	};
107	$(document).ready(function() {
108		pjGravityCookies.init();
109	});
110})(jQuery);
111

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.