PageSourceSearch

https://earthjustice.org/wp-content/themes/earthjustice/js/ea-action-personalize.js?ver=7.1.2

js earthjustice.org collected 2026-09-24 08:27:22 UTC 1,384 bytes, 42 lines download raw bytes

1/*
2*
3*
4* For use on embedded EveryAction action forms
5* Customizes  EA's default personalization text (default: "Personalize your message") using value of ACF field action_personalization (in Action fields ACF field group)
6*
7*/
8
9// setup EA callback
10const labelPersonalize = () => {
11  const message = window.actionPersonalization ||
12    'Take a moment to personalize your letter. Sharing your experiences or expertise will have more impact.';
13
14  document
15    .querySelectorAll('div[id^="NVAdvocacyForm"] label.at-area')
16    .forEach(label => {
17      const hasMessageClass = [...label.classList]
18        .some(className => /^Message\d+$/.test(className));
19
20      if (!hasMessageClass) return;
21
22      const textNode = Array.from(label.childNodes)
23        .find(node => node.nodeType === Node.TEXT_NODE);
24
25      // if (textNode) {
26      //   textNode.textContent = message;
27      // }
28
29      // Wrap personalization text in CSS class
30      if (textNode && textNode.textContent.trim()) {
31        const span = document.createElement('span');
32        span.className = 'form-ea--message-label';
33        span.textContent = message;
34        label.insertBefore(span, textNode);
35        label.removeChild(textNode);
36      }
37    });
38};
39
40var nvtag_callbacks = nvtag_callbacks || {};
41nvtag_callbacks.postRender = nvtag_callbacks.postRender || [];
42nvtag_callbacks.postRender.push(labelPersonalize);

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.