PageSourceSearch

https://www.postawnaswoim.pl/wp-content/plugins/anti-spam/js/anti-spam-5.2.js

js postawnaswoim.pl collected 2026-10-09 16:49:18 UTC 2,540 bytes, 73 lines download raw bytes

1/*
2Anti-spam plugin
3No spam in comments. No captcha.
4wordpress.org/plugins/anti-spam/
5*/
6
7"use strict";
8(function() {
9	function anti_spam_init() {
10
11		var i,
12			len,
13			elements,
14			answer = '',
15			current_year = new Date().getFullYear(),
16			dynamic_control;
17
18		elements = document.querySelectorAll('.antispam-group');
19		len = elements.length;
20		for (i = 0; i < len; i++) { // hide inputs from users
21			elements[i].style.display = 'none';
22		}
23
24		elements = document.querySelectorAll('.antispam-control-a');
25		if ((elements) && (elements.length > 0)) { // get the answer
26			answer = elements[0].value;
27		}
28
29		elements = document.querySelectorAll('.antispam-control-q');
30		len = elements.length;
31		for (i = 0; i < len; i++) { // set answer into other input instead of user
32			elements[i].value = answer;
33		}
34		
35		// clear value of the empty input because some themes are adding some value for all inputs
36		elements = document.querySelectorAll('.antispam-control-e');
37		len = elements.length;
38		for (i = 0; i < len; i++) {
39			elements[i].value = '';
40		}
41
42		//dynamic_control = '<input type="text" name="antspm-d" class="antispam-control antispam-control-d" value="' + current_year + '" />';
43		dynamic_control = document.createElement('input');
44		dynamic_control.setAttribute('type', 'hidden');
45		dynamic_control.setAttribute('name', 'antspm-d');
46		dynamic_control.setAttribute('class', 'antispam-control antispam-control-d');
47		dynamic_control.setAttribute('value', current_year);
48
49		// add input for every comment form if there are more than 1 form with IDs: comments, respond or commentform
50		elements = document.querySelectorAll('form');
51		len = elements.length;
52		for (i = 0; i < len; i++) {
53			if ( (elements[i].id === 'comments') || (elements[i].id === 'respond') || (elements[i].id === 'commentform') ) {
54				var class_index = elements[i].className.indexOf('anti-spam-form-processed');
55				if ( class_index == -1 ) { // form is not yet js processed
56					//elements[i].innerHTML += dynamic_control; // not working
57					elements[i].appendChild(dynamic_control);
58					elements[i].className = elements[i].className + ' anti-spam-form-processed';
59				}
60			}
61		}
62	}
63
64	if (document.addEventListener) {
65		document.addEventListener('DOMContentLoaded', anti_spam_init, false);
66	}
67
68	// set 1 second timeout for having form loaded and adding support for browsers which does not support 'DOMContentLoaded' listener
69	setTimeout(function () {
70		anti_spam_init();
71	}, 1000);
72
73})();

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.