PageSourceSearch

https://photohuman.space/wp-content/themes/photohuman/source/js/modules/feedback.js?v=1.6.370

js photohuman.space collected 2026-09-28 08:54:26 UTC 1,471 bytes, 61 lines download raw bytes

1import {
2  block,
3  cleanFields,
4  closeParentModal,
5  openModal,
6  serverReq,
7  unblock,
8  validateRequiredForm,
9} from "./helpers.js?v=1.6.769";
10
11export const feedback = (form) => {
12  const body = new FormData(form);
13  const blockContainer = form.closest('._to_block') || form;
14
15  const hiddenFieldValue = body.get('name');
16
17  if (hiddenFieldValue) {
18    return;
19  }
20
21  if (!validateRequiredForm(form)) {
22    return;
23  }
24
25  // Invisible JS marker — bots that POST without theme script are rejected server-side.
26  body.set('ph_js', '1');
27
28  block(blockContainer);
29
30  serverReq(body, form.getAttribute('action'))
31    .then((res) => {
32      if (res.result === "success") {
33        closeParentModal(form);
34        openModal('popup-success', res.popup_title, res.popup_message);
35
36        const keepFields = [
37          'inp-agreement',
38          'inp-policy',
39          'form_type',
40          'max-to-upload',
41          'max-file-size',
42          'url_refer',
43          'ya_target',
44          'ph_js',
45          'name',
46        ];
47
48        cleanFields(form, keepFields);
49        const jsField = form.querySelector('input[name="ph_js"]');
50        if (jsField) {
51          jsField.value = '';
52        }
53      } else {
54        console.error('Ошибка:', res.status);
55        alert('Произошла ошибка: ' + res.status);
56      }
57    })
58    .finally(() => {
59      unblock(blockContainer);
60    });
61};

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.