PageSourceSearch

https://www.hurrcollective.com/assets/controllers/application_cont…c5e9d594c5ec2a3f9c8f1d3bdfe23d20dc0c1da4.js

js hurrcollective.com collected 2026-09-24 20:37:44 UTC 1,298 bytes, 34 lines download raw bytes

1import { Controller } from '@hotwired/stimulus';
2import 'core-js-features-array-at';
3
4export default class extends Controller {
5  addError(targets, message, options = { outline: true }) {
6    const targetElement = Array.from(targets).at(-1);
7    const parentElement = targetElement.parentElement;
8    const parentElelmentNextSibling = parentElement.nextElementSibling;
9
10    if (options.outline)
11      Array.from(targets).forEach((target) => {
12        target.classList.add('field-error');
13      });
14
15    if (parentElement && parentElelmentNextSibling && parentElelmentNextSibling.classList.contains('error')) {
16      targetElement.parentElement.nextElementSibling.innerHTML = message;
17    } else if (parentElement) {
18      targetElement.parentElement.insertAdjacentHTML('afterEnd', `<div class="error">${message}</div>`);
19    }
20  }
21
22  removeError(targets) {
23    const targetElement = Array.from(targets).at(-1);
24
25    Array.from(targets).forEach((target) => {
26      if (target.classList.contains('field-error')) target.classList.remove('field-error');
27    });
28
29    if (targetElement && targetElement.parentElement) {
30      const parentSibling = targetElement.parentElement.nextElementSibling;
31      if (parentSibling && parentSibling.classList.contains('error')) parentSibling.remove();
32    }
33  }
34};

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.