PageSourceSearch

https://www.navymwr.org/_templates/components/googleanalytics/trac…?v=10974229842639258393099627237

js navymwr.org collected 2026-09-24 09:35:27 UTC 4,002 bytes, 76 lines download raw bytes

1; (function (jQuery, undefined) {
2    if (typeof jQuery != 'undefined') {
3        jQuery(function () {
4            if (typeof ga != 'undefined') {
5                var filetypes = /modules\/media\/\?do=download/i;
6                var baseHref = '';
7                if (jQuery('base').attr('href') != undefined)
8                    baseHref = jQuery('base').attr('href');
9
10                jQuery('a, a[rel="track-me"]').each(function () {
11                    var $anchor = jQuery(this);
12
13                    var href = jQuery(this).attr('href');
14                    if (href && $anchor.attr('rel') == 'track-me') {
15                        $anchor.click(function () {
16                        
17                            var eventCategory = $anchor.attr('data-track-category') || 'Link';
18                            var eventAction = $anchor.attr('data-track-action') || 'Click';
19                            var eventLabel = $anchor.attr('data-track-label') || $anchor.text();
20                            var eventValue = $anchor.attr('data-track-value') || '';
21                            if (!isNaN(eventValue)) {
22                                ga('send', 'event', {
23                                    eventCategory: eventCategory,
24                                    eventAction: eventAction,
25                                    eventLabel: eventLabel,
26                                    eventValue: eventValue
27                                });
28                            }
29                            else {
30                                ga('send', 'event', {
31                                    eventCategory: eventCategory,
32                                    eventAction: eventAction
33                                });
34                            }
35                            if (jQuery(this).attr('target') != undefined && jQuery(this).attr('target').toLowerCase() != '_blank') {
36                                setTimeout(function () { location.href = href; }, 200);
37                                return false;
38                            }
39                            setTimeout(function () { location.href = href; }, 200);
40                            return false;
41                        });
42                    }
43                    else if (href && (href.match(/^https?\:/i)) && (!href.match(document.domain))) {
44                        /*jQuery(this).click(function () {
45                            var extLink = href.replace(/^https?\:\/\//i, '');
46                            ga('send', 'event', 'External', 'Click', extLink);
47                            if (jQuery(this).attr('target') != undefined && jQuery(this).attr('target').toLowerCase() != '_blank') {
48                                setTimeout(function () { location.href = href; }, 200);
49                                return false;
50                            }
51                        });*/
52                        // NCS-2311 Moved this to CommonExternalLinks because of a conflict
53                    }
54                    else if (href && href.match(/^mailto\:/i)) {
55                        jQuery(this).click(function () {
56                            var mailLink = href.replace(/^mailto\:/i, '');
57                            ga('send', 'event', 'Email', 'Click', mailLink);
58                        });
59                    }
60                    else if (href && href.match(filetypes)) {
61                        jQuery(this).click(function () {
62
63                            var filePath = href;
64                            ga('send', 'event', 'Download', 'Click-File', $(this).text());
65                            if (jQuery(this).attr('target') != undefined && jQuery(this).attr('target').toLowerCase() != '_blank') {
66                                setTimeout(function () { location.href = baseHref + href; }, 200);
67                                return false;
68                            }
69                        });
70                    }
71
72                });
73            }
74        });
75    }
76})(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.