PageSourceSearch

https://www.cleverreach.com/wp-content/plugins/cr-wiredminds/js/cr-wiredminds.js?ver=1768233090

js cleverreach.com collected 2026-09-24 06:04:14 UTC 3,522 bytes, 100 lines download raw bytes

1!function() {
2	'use strict';
3
4	document.addEventListener("DOMContentLoaded", (e => {
5		var branchKnown = false;
6		var branchid = localStorage.getItem('cr_wm_branchid');
7		if(branchid) {
8			branchid = JSON.parse(branchid);
9			if(branchid) {
10				if(branchid.validUntil == -1 || branchid.validUntil > Date.now()) {
11					branchKnown = true;
12				}
13			}
14		}
15		var postData = new FormData();
16		var urlParams = new URLSearchParams(window.location.search);
17		if(!branchKnown || urlParams.get('debug_ip') || urlParams.get('debug_branch')) {
18			if (urlParams.get('debug_ip')) {
19				postData.append('cr_getCompanyFromIP', urlParams.get('debug_ip'));
20			} else {
21				postData.append('cr_getCompanyFromIP', 'true');
22			}
23			if (urlParams.get('debug_branch')) {
24				postData.append('branch_code', urlParams.get('debug_branch'));
25			}
26			window.fetch(window.location, {
27				method: 'POST',
28				headers: {
29					'X-Requested-With': 'XMLHttpRequest'
30				},
31				body: postData
32			})
33			.then(response => response.json())
34			.then(decoded => {
35				if (decoded.branch_code) {
36					localStorage.setItem('cr_wm_branchid', JSON.stringify({
37						value: decoded.branch_code,
38						validUntil: Date.now() + (86400 * 1000)
39					}));
40				}
41			});
42		}
43
44		if(document.querySelector('#wiredminds-industry')) {
45			var modal = new bootstrap.Modal(document.querySelector('#wiredminds-industry'));
46			var postData = new FormData();
47			var urlParams = new URLSearchParams(window.location.search);
48			if(urlParams.get('debug_ip')) {
49				postData.append('cr_getCompanyFromIP', urlParams.get('debug_ip'));
50			} else {
51				postData.append('cr_getCompanyFromIP', 'true');
52			}
53			if(urlParams.get('debug_branch')) {
54				postData.append('branch_code', urlParams.get('debug_branch'));
55			}
56			window.fetch(window.location, {
57				method: 'POST',
58				headers: {
59					'X-Requested-With': 'XMLHttpRequest'
60				},
61				body: postData
62			})
63			.then(response => response.json())
64			.then(decoded => {
65				console.log('wiredminds response', decoded);
66				if(decoded.branch_code) {
67					localStorage.setItem('cr_wm_branchid', JSON.stringify({value: decoded.branch_code, validUntil: Date.now() + (86400 * 1000)}));
68				}
69				if(!decoded.error) {
70					document.querySelector('#wiredminds-industry .industry-image img').src = decoded.img;
71					document.querySelector('#wiredminds-industry .title').innerHTML = decoded.title;
72					document.querySelector('#wiredminds-industry .description').innerHTML = decoded.description;
73					document.querySelector('#wiredminds-industry .offer').innerHTML = decoded.offer;
74					document.querySelector('#wiredminds-industry .button').innerHTML = decoded.button;
75					document.querySelector('#wiredminds-industry .button').href = decoded.url;
76					modal.show();
77				}
78				// Ensure decoded.img is available and not empty
79				if (decoded && decoded.img) {
80					// Select the img element within .industry-image
81					const imgElement = document.querySelector('.industry-image img');
82					
83					// Check if the img element exists
84					if (imgElement) {
85						// Log the old src and new src for debugging purposes
86						console.log('Old Image Source:', imgElement.src);
87						console.log('New Image Source:', decoded.img);
88						
89						// Replace the src of the img element with the new image from decoded.img
90						imgElement.src = decoded.img;
91					} else {
92						console.error('Image element not found in .industry-image');
93					}
94				} else {
95					console.error('Decoded image source is not available or empty');
96				}				
97			});
98		}
99	}));
100}();

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.