PageSourceSearch

https://wpfrank.com/wp-content/plugins/lead-generation-form/includes/assets/js/wlgf-shortcode-form.js

js wpfrank.com collected 2026-10-02 05:34:41 UTC 3,028 bytes, 85 lines download raw bytes

1jQuery(document).ready(function($) {
2     
3     //console.log(WLGFShortcode.FormId);
4     //console.log(WLGFShortcode.SiteKey);
5     
6     // Disable all buttons on load
7     jQuery('button').prop('disabled', true);
8     // Enable buttons when the page finishes loading
9     jQuery(window).on('load', function() {
10          jQuery(function() {
11               // it will wait for 1.5 sec.
12               setTimeout(function() {
13                    jQuery('button').prop('disabled', false);
14               }, 1000);
15          });
16     });
17     
18 
19     // prevent resubmit the form
20     var isSubmitting = false; // Flag to prevent resubmission
21
22     $('#'+ WLGFShortcode.FormId).on('submit', function(event) {
23          if (isSubmitting) {
24               event.preventDefault(); // Prevent resubmission
25               return false; // Stop execution
26          }
27
28          // Set the flag to true and disable the submit button
29          isSubmitting = true;
30          $('#submit-1').attr('disabled', true);
31     });
32     
33     // Focus on message after form submit
34     setTimeout(function() {
35          // Change the display to 'none' to make the div disappear
36          jQuery('div#wlgf-msg').focus();
37          //jQuery('#wlgf-msg').css('display', 'none');
38          jQuery('#wlgf-msg').fadeOut('slow');
39     }, 3000);
40     
41     // bootstrap tooltip
42     //const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]');
43     //const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
44    
45});
46
47// JavaScript
48document.addEventListener('DOMContentLoaded', function() {
49     const rangeInputs = document.querySelectorAll('input[type="range"]');
50
51     rangeInputs.forEach(function(rangeInput) {
52          const display = document.getElementById('range-value-display-' + rangeInput.id);
53
54          // Set initial display value
55          if (display) {
56               display.textContent = rangeInput.value; // Initial value display
57          }
58
59          // Update display value on input change
60          rangeInput.addEventListener('input', function() {
61               display.textContent = this.value; // Update the displayed value
62          });
63     });
64});
65
66
67// back button does not take the user back to the form submission.
68if ( window.history.replaceState ) {
69     window.history.replaceState( null, null, window.location.href );
70}
71
72// add script if Recaptcha is enabled
73if(WLGFShortcode.Recaptcha == 1) {
74     function runRecaptcha() {
75          if (typeof grecaptcha === "undefined") {
76               setTimeout(runRecaptcha, 100);
77          } else {
78               grecaptcha.ready(function() {
79                    grecaptcha.execute(WLGFShortcode.SiteKey, {action: "submit"}).then(function(token) {
80                         document.getElementById("recaptchaResponse").value = token;
81                    });
82               });
83          }
84     }runRecaptcha();
85}

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.