PageSourceSearch

https://perinton.gov/wp-content/themes/perinton/js/external.js?ver=1790904230

js perinton.gov collected 2026-10-02 22:52:11 UTC 2,586 bytes, 85 lines download raw bytes

1var filetypes = /\.(zip|exe|dmg|pdf|doc.*|xls.*|ppt.*|mp3|txt|rar|wma|mov|avi|wmv|flv|wav)$/i;
2	var baseHref = '';
3	if (jQuery('base').attr('href') != undefined) baseHref = jQuery('base').attr('href');
4	var hrefRedirect = '';
5	
6	jQuery(document).ready(function(){
7	jQuery('body').on('click', 'a', function(event) {
8		var el = jQuery(this);
9		var track = true;
10		var href = (typeof(el.attr('href')) != 'undefined' ) ? el.attr('href') : '';
11		var isThisDomain = href.match(document.domain.split('.').reverse()[1] + '.' + document.domain.split('.').reverse()[0]);
12		if (!href.match(/^javascript:/i)) {
13			var elEv = []; elEv.value=0, elEv.non_i=false;
14			if (href.match(/^mailto\:/i)) {
15				elEv.category = 'email';
16				elEv.action = 'click';
17				elEv.label = href.replace(/^mailto\:/i, '');
18				elEv.loc = href;
19			}
20			else if (href.match(filetypes)) {
21				var extension = (/[.]/.exec(href)) ? /[^.]+$/.exec(href) : undefined;
22				elEv.category = 'download';
23				elEv.action = 'click-' + extension[0];
24				elEv.label = href.replace(/ /g,'-');
25				elEv.loc = baseHref + href;
26			}
27			else if (href.match(/^https?\:/i) && !isThisDomain) {
28				elEv.category = 'external';
29				elEv.action = 'click';
30				elEv.label = href.replace(/^https?\:\/\//i, '');
31				elEv.non_i = true;
32				elEv.loc = href;
33			}
34			else if (href.match(/^tel\:/i)) {
35				elEv.category = 'telephone';
36				elEv.action = 'click';
37				elEv.label = href.replace(/^tel\:/i, '');
38				elEv.loc = href;
39			}
40			else track = false;
41 
42			if (track) {
43				var ret = true;
44 
45				if((elEv.category == 'external' || elEv.category == 'download') && (el.attr('target') == undefined || el.attr('target').toLowerCase() != '_blank') ) {
46					hrefRedirect = elEv.loc;
47 
48/*
49					ga('send','event', elEv.category.toLowerCase(),elEv.action.toLowerCase(),elEv.label.toLowerCase(),elEv.value,{
50						'nonInteraction': elEv.non_i ,
51						'hitCallback':gaHitCallbackHandler
52					});
53*/
54
55					gtag('event', elEv.action.toLowerCase(), {
56					  'event_category': elEv.category.toLowerCase(),
57					  'event_label': elEv.label.toLowerCase()
58					});
59
60 
61					ret = false;
62				}
63				else {
64/*
65					ga('send','event', elEv.category.toLowerCase(),elEv.action.toLowerCase(),elEv.label.toLowerCase(),elEv.value,{
66						'nonInteraction': elEv.non_i
67					});
68*/
69					gtag('event', elEv.action.toLowerCase(), {
70					  'event_category': elEv.category.toLowerCase(),
71					  'event_label': elEv.label.toLowerCase()
72					});
73				}
74 
75				return true;
76			}
77		}
78	});
79	});
80	
81   
82 
83	gaHitCallbackHandler = function() {
84		//jQuery(location).attr('href', hrefRedirect);
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.