PageSourceSearch

https://shawntiffany.com/wp-content/plugins/amounts-main/assets/custom_theme.js?ver=1.0.5

js shawntiffany.com collected 2026-10-07 21:53:26 UTC 3,006 bytes, 87 lines download raw bytes

1document.addEventListener("DOMContentLoaded", function() {
2    let loanAmount;
3
4    let pageTitle = document.querySelector("h1");
5    if (pageTitle) {
6        let match = pageTitle.textContent.match(/\$?(\d{2,5})/);
7        if (match) {
8            loanAmount = match[1];
9        }
10    }
11
12    if (!loanAmount) {
13        let metaTag = document.querySelector('meta[name="loan_amount"]');
14        if (metaTag) {
15            loanAmount = metaTag.getAttribute("content");
16        }
17    }
18
19    if (loanAmount) {
20        let loanSelect = document.querySelector("#sidebar_form select, #lmF select, #omForm-root select#loanAmount");
21        if (loanSelect) {
22            let optionToSelect = loanSelect.querySelector(`option[value="${loanAmount}"]`);
23            if (optionToSelect) {
24                optionToSelect.selected = true;
25            }
26        }
27    }
28});
29
30(function($) {
31    'use strict';
32    
33    $(document).ready(function() {
34        // Add param to btn
35        $(document).on('click', 'a[href*="/apply/"]', function(e) {
36            e.preventDefault();
37            
38            var $link = $(this);
39            var href = $link.attr('href');
40            var currentDomain = window.location.hostname;
41            var clickId = window.location.pathname;
42            var separator = href.indexOf('?') !== -1 ? '&' : '?';
43            
44            var newHref = href + separator + 'clickid=' + encodeURIComponent(clickId) + '&source=' + encodeURIComponent(currentDomain);
45            
46            window.location.href = newHref;
47        });
48        
49        // Add param on form page
50        function getUrlParameter(name) {
51            name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
52            var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
53            var results = regex.exec(location.search);
54            return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
55        }
56
57        var urlSource = getUrlParameter('source');
58        var urlClickId = getUrlParameter('clickid');
59
60        // We are determining the source and clickid.
61        var trackingSource = urlSource ? urlSource : window.location.hostname;
62        var trackingClickId = urlClickId ? urlClickId : window.location.pathname;
63
64        var attempts = 0;
65        var maxAttempts = 50;
66        
67        function addTrackingParams() {
68            if (typeof window._omFormSetting !== 'undefined' && window._omFormSetting.visitor) {
69                window._omFormSetting.visitor.source = trackingSource;
70                window._omFormSetting.visitor.clickid = trackingClickId;
71                return true;
72            }
73            return false;
74        }
75        
76        var checkInterval = setInterval(function() {
77            attempts++;
78            
79            if (addTrackingParams()) {
80                clearInterval(checkInterval);
81            } else if (attempts >= maxAttempts) {
82                clearInterval(checkInterval);
83            }
84        }, 100);
85    });
86    
87})(jQuery);

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.