1( function( $ ) { 2 3 "use strict"; 4 5 function isTouchEnabled() { 6 return (('ontouchstart' in window) 7 || (navigator.MaxTouchPoints > 0) 8 || (navigator.msMaxTouchPoints > 0)); 9 } 10 11 $(document).ready(function () { 12 $("path[id^=\"usmap_\"]").each(function (i, e) { 13 addEvent($(e).attr('id')); 14 }); 15 }); 16 17 function addEvent(id, relationId) { 18 var _obj = $('#' + id); 19 var _Textobj = $('#' + id + ',' + '#' + us_map_config[id]['title']); 20 var _abb = $('#' + us_map_config[id]['title']); 21 $('#usmapwrapper').css({'opacity': '1'}); 22 23 if(us_map_config['default']['usshowvisns'] === true) { 24 $('#usvisns').css({'fill': us_map_config['default']['usvisns']}); 25 $('#usvisns').css({'opacity': '1'}); 26 } else { 27 $('#usvisns').css({'opacity': '0'}); 28 } 29 30 if(us_map_config['default']['usshowlakes'] === true) { 31 $('#uslakes path').css({'stroke': us_map_config['default']['usbrdrclr']}); 32 $('#uslakes').css({'fill': us_map_config['default']['uslakesfill']}); 33 $('#uslakes').css({'visibility': 'visible'}); 34 } else { 35 $('#uslakes').css({'visibility': 'hidden'}); 36 } 37 38 if(us_map_config['default']['usshowalaska'] === true) { 39 $('#usmap_2' + ',' + '#usvn_2').css({'visibility': 'visible'}); 40 } else { 41 $('#usmap_2' + ',' + '#usvn_2').css({'visibility': 'hidden'}); 42 } 43 44 if(us_map_config['default']['usshowhawaii'] === true) { 45 $('#usmap_11' + ',' + '#usvn_11').css({'visibility': 'visible'}); 46 } else { 47 $('#usmap_11' + ',' + '#usvn_11').css({'visibility': 'hidden'}); 48 } 49 50 if(us_map_config['default']['usshowdc'] === true) { 51 $('#usmap_51' + ',' + '#usvn_51').css({'visibility': 'visible'}); 52 } else { 53 $('#usmap_51' + ',' + '#usvn_51').css({'visibility': 'hidden'}); 54 } 55 56 if(us_map_config['default']['uscallouts'] === true) { 57 $('#uscallouts').css({'visibility': 'hidden'}); 58 } else { 59 $('#uscallouts').css({'visibility': 'visible'}); 60 } 61 62 _obj.attr({'fill': us_map_config[id]['upclr'], 'stroke': us_map_config['default']['usbrdrclr']}); 63 64 _Textobj.attr({'cursor': 'default'}); 65 66 if (us_map_config[id]['enbl'] === true) { 67 if (isTouchEnabled()) { 68 var touchmoved; 69 _Textobj.on('touchend', function (e) { 70 if (touchmoved !== true) { 71 _Textobj.on('touchstart', function (e) { 72 let touch = e.originalEvent.touches[0]; 73 let x = touch.pageX - 10, y = touch.pageY + (-15); 74 75 let $usmtip = $('#tipusmap'); 76 let usmaptipw = $usmtip.outerWidth(), 77 usmaptiph = $usmtip.outerHeight(); 78 79 x = (x + usmaptipw > $(document).scrollLeft() + $(window).width()) ? x - usmaptipw - (20 * 2) : x 80 y = (y + usmaptiph > $(document).scrollTop() + $(window).height()) ? $(document).scrollTop() + $(window).height() - usmaptiph - 10 : y 81 82 if (us_map_config[id]['targt'] !== 'none') { 83 _obj.css({'fill': us_map_config[id]['dwnclr']}); 84 } 85 $usmtip.show().html(us_map_config[id]['hover']); 86 $usmtip.css({left: x, top: y}) 87 }) 88 _Textobj.on('touchend', function () { 89 _obj.css({'fill': us_map_config[id]['upclr']}); 90 if (us_map_config[id]['targt'] === '_blank') { 91 window.open(us_map_config[id]['url']); 92 } else if (us_map_config[id]['targt'] === '_self') { 93 window.parent.location.href = us_map_config[id]['url']; 94 }
95 $('#tipusmap').hide(); 96 }) 97 } 98 }).on('touchmove', function (e) { 99 touchmoved = true; 100 }).on('touchstart', function () { 101 touchmoved = false; 102 }); 103 } 104 _Textobj.attr({'cursor': 'pointer'}); 105 106 _Textobj.on('mouseenter', function () { 107 $('#tipusmap').show().html(us_map_config[id]['hover']); 108 _obj.css({'fill': us_map_config[id]['ovrclr']}); 109 _abb.css({'fill': us_map_config['default']['usvisnshover']}); 110 }).on('mouseleave', function () { 111 $('#tipusmap').hide(); 112 _obj.css({'fill': us_map_config[id]['upclr']}); 113 _abb.css({'fill': us_map_config['default']['usvisns']}); 114 }); 115 if (us_map_config[id]['targt'] !== 'none') { 116 _Textobj.on('mousedown', function () { 117 _obj.css({'fill': us_map_config[id]['dwnclr']}); 118 }); 119 } 120 _Textobj.on('mouseup', function () { 121 _obj.css({'fill': us_map_config[id]['ovrclr']}); 122 if (us_map_config[id]['targt'] === '_blank') { 123 window.open(us_map_config[id]['url']); 124 } else if (us_map_config[id]['targt'] === '_self') { 125 window.parent.location.href = us_map_config[id]['url']; 126 } 127 }); 128 _Textobj.on('mousemove', function (e) { 129 let x = e.pageX + 10, y = e.pageY + 15; 130 131 let $mus = $('#tipusmap'); 132 let usmaptipw = $mus.outerWidth(), usmaptiph = $mus.outerHeight(); 133 134 x = (x + usmaptipw > $(document).scrollLeft() + 135 $(window).width()) ? x - usmaptipw - (20 * 2) : x 136 y = (y + usmaptiph > $(document).scrollTop() + $(window).height()) ? 137 $(document).scrollTop() + $(window).height() - usmaptiph - 10 : y 138 139 $mus.css({left: x, top: y}) 140 }) 141 } 142 else { 143 _abb.css({'fill-opacity':'0.5'}); 144 } 145 } 146})(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.