PageSourceSearch

https://premieredate.news/plugins/system/cleantalkantispam/js/ct-functions.js?1790935204

js premieredate.news collected 2026-10-02 11:33:44 UTC 4,936 bytes, 153 lines download raw bytes

1function ctSetCookie(c_name, value) {
2	if (typeof ct_setcookie !== "undefined" && ct_setcookie) {
3		document.cookie = c_name + "=" + encodeURIComponent(value) + "; path=/";
4	}	
5}
6
7ct_attach_event_handler(window, "DOMContentLoaded", ct_ready);
8
9//Stop observing function
10function ctMouseStopData(){
11	if(typeof window.addEventListener == "function")
12		window.removeEventListener("mousemove", ctFunctionMouseMove);
13	else
14		window.detachEvent("onmousemove", ctFunctionMouseMove);
15	clearInterval(ctMouseReadInterval);
16	clearInterval(ctMouseWriteDataInterval);				
17}
18
19//Stop key listening function
20function ctKeyStopStopListening(){
21	if(typeof window.addEventListener == "function"){
22		window.removeEventListener("mousedown", ctFunctionFirstKey);
23		window.removeEventListener("keydown", ctFunctionFirstKey);
24	}else{
25		window.detachEvent("mousedown", ctFunctionFirstKey);
26		window.detachEvent("keydown", ctFunctionFirstKey);
27	}			
28}
29
30var d = new Date(), 
31	ctTimeMs = new Date().getTime(),
32	ctMouseEventTimerFlag = true, //Reading interval flag
33	ctMouseData = "[",
34	ctMouseDataCounter = 0;
35	
36//Reading interval
37var ctMouseReadInterval = setInterval(function(){
38		ctMouseEventTimerFlag = true;
39	}, 150);
40	
41//Writting interval
42var ctMouseWriteDataInterval = setInterval(function(){ 
43		var ctMouseDataToSend = ctMouseData.slice(0,-1).concat("]");
44		ctSetCookie("ct_pointer_data", ctMouseDataToSend);
45	}, 1200);
46
47//Logging mouse position each 300 ms
48var ctFunctionMouseMove = function output(event){
49	if(ctMouseEventTimerFlag == true){
50		var mouseDate = new Date();
51		ctMouseData += "[" + event.pageY + "," + event.pageX + "," + (mouseDate.getTime() - ctTimeMs) + "],";
52		ctMouseDataCounter++;
53		ctMouseEventTimerFlag = false;
54		if(ctMouseDataCounter >= 100)
55			ctMouseStopData();
56	}
57}
58//Writing first key press timestamp
59var ctFunctionFirstKey = function output(event){
60	var KeyTimestamp = Math.floor(new Date().getTime()/1000);
61	ctSetCookie("ct_fkp_timestamp", KeyTimestamp);
62	ctKeyStopStopListening();
63}
64
65if(typeof window.addEventListener == "function"){
66	window.addEventListener("mousemove", ctFunctionMouseMove);
67	window.addEventListener("mousedown", ctFunctionFirstKey);
68	window.addEventListener("keydown", ctFunctionFirstKey);
69}else{
70	window.attachEvent("onmousemove", ctFunctionMouseMove);
71	window.attachEvent("mousedown", ctFunctionFirstKey);
72	window.attachEvent("keydown", ctFunctionFirstKey);
73}
74// Ready function
75function ct_ready(){
76	ctSetCookie("ct_ps_timestamp", Math.floor(new Date().getTime()/1000));
77	ctSetCookie("ct_fkp_timestamp", "0");
78	ctSetCookie("ct_pointer_data", "0");
79	ctSetCookie("ct_timezone", new Date().getTimezoneOffset()/60*(-1));
80	ctSetCookie("ct_visible_fields", 0);
81	ctSetCookie("ct_visible_fields_count", 0);
82	setTimeout(function(){
83		for(var i = 0; i < document.forms.length; i++){
84			var form = document.forms[i];
85
86			if (!form.name && !form.id) {
87				continue;
88			}
89
90			form.addEventListener('submit', function () {
91				// Get only fields
92				var elements = [];
93				for(var key in this.elements){
94					if(!isNaN(+key))
95						elements[key] = this.elements[key];
96				}
97
98				// Filter fields
99				elements = elements.filter(function(elem){
100
101					var pass = true;
102
103					// Filter fields
104					if( getComputedStyle(elem).display    === "none" ||   // hidden
105						getComputedStyle(elem).visibility === "hidden" || // hidden
106						getComputedStyle(elem).opacity    === "0" ||      // hidden
107						elem.getAttribute("type")         === "hidden" || // type == hidden
108						elem.getAttribute("type")         === "submit" || // type == submit
109						elem.value                        === ""       || // empty value
110						elem.getAttribute('name')         === null
111					){
112						return false;
113					}
114
115					// Filter elements with same names for type == radio
116					if(elem.getAttribute("type") === "radio"){
117						elements.forEach(function(el, j, els){
118							if(elem.getAttribute('name') === el.getAttribute('name')){
119								pass = false;
120								return;
121							}
122						});
123					}
124
125					return true;
126				});
127
128				// Visible fields count
129				var visible_fields_count = elements.length;
130
131				// Visible fields
132				var visible_fields = '';
133				elements.forEach(function(elem, i, elements){
134					visible_fields += " " + elem.getAttribute("name");
135				});
136				visible_fields = visible_fields.trim();
137
138				ctSetCookie("ct_visible_fields", visible_fields);
139				ctSetCookie("ct_visible_fields_count", visible_fields_count);
140			});
141		}
142	}, 1000);
143}
144
145function ct_attach_event_handler(elem, event, callback){
146	if(typeof window.addEventListener === "function") elem.addEventListener(event, callback);
147	else                                              elem.attachEvent(event, callback);
148}
149
150function ct_remove_event_handler(elem, event, callback){
151	if(typeof window.removeEventListener === "function") elem.removeEventListener(event, callback);
152	else                                                 elem.detachEvent(event, callback);
153}

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.