1function isTouchEnabled() { 2 return (('ontouchstart' in window) 3 || (navigator.MaxTouchPoints > 0) 4 || (navigator.msMaxTouchPoints > 0)); 5} 6jQuery(function(){ 7 jQuery("path[id^=\"us_\"]").each(function (i, e) { 8 // alert(jQuery(e).attr('id')); 9 addEvent( jQuery(e).attr('id') ); 10 }); 11}) 12function addEvent(id,relationId){ 13 var _obj = jQuery('#'+id); 14 var _Textobj = jQuery('#'+id+','+'#'+us_config[id]['visnames']); 15 var _h = jQuery('#map').height(); 16 17 jQuery('#'+['visnames']).attr({'fill':us_config['default']['visnames']}); 18 jQuery('#lakes').css({'fill':us_config['default']['lakesfill']}); 19 jQuery('#lakes path').css({'stroke':us_config['default']['lakesoutline']}); 20 21 _obj.attr({'fill':us_config[id]['upclr'],'stroke':us_config['default']['borderclr']}); 22 _Textobj.attr({'cursor':'default'}); 23 if(us_config[id]['enbl'] == true){ 24 if (isTouchEnabled()) { 25 _Textobj.on('touchstart', function(e){ 26 var touch = e.originalEvent.touches[0]; 27 var x=touch.pageX-10, y=touch.pageY+(-15); 28 var maptipw=jQuery('#tipus').outerWidth(), maptiph=jQuery('#tipus').outerHeight(), 29 x=(x+maptipw>jQuery(document).scrollLeft()+jQuery(window).width())? x-maptipw-(20*2) : x 30 y=(y+maptiph>jQuery(document).scrollTop()+jQuery(window).height())? jQuery(document).scrollTop()+jQuery(window).height()-maptiph-10 : y 31 if(us_config[id]['targt'] != 'none'){ 32 jQuery('#'+id).css({'fill':us_config[id]['dwnclr']}); 33 } 34 jQuery('#tipus').show().html(us_config[id]['hover']); 35 jQuery('#tipus').css({left:x, top:y}) 36 }) 37 _Textobj.on('touchend', function(){ 38 jQuery('#'+id).css({'fill':us_config[id]['upclr']}); 39 if(us_config[id]['targt'] == '_blank'){ 40 window.open(us_config[id]['url']); 41 }else if(us_config[id]['targt'] == '_self'){ 42 window.parent.location.href=us_config[id]['url']; 43 } 44 jQuery('#tipus').hide(); 45 }) 46 } 47 _Textobj.attr({'cursor':'pointer'}); 48 _Textobj.hover(function(){ 49 //moving in/out effect 50 jQuery('#tipus').show().html(us_config[id]['hover']); 51 _obj.css({'fill':us_config[id]['ovrclr']}) 52 },function(){ 53 jQuery('#tipus').hide(); 54 jQuery('#'+id).css({'fill':us_config[id]['upclr']}); 55 }) 56 if(us_config[id]['targt'] != 'none'){ 57 //clicking effect 58 _Textobj.mousedown(function(){ 59 jQuery('#'+id).css({'fill':us_config[id]['dwnclr']}); 60 }) 61 } 62 _Textobj.mouseup(function(){ 63 jQuery('#'+id).css({'fill':us_config[id]['ovrclr']}); 64 if(us_config[id]['targt'] == '_blank'){ 65 window.open(us_config[id]['url']); 66 }else if(us_config[id]['targt'] == '_self'){ 67 window.parent.location.href=us_config[id]['url']; 68 } 69 }) 70 _Textobj.mousemove(function(e){ 71 var x=e.pageX+10, y=e.pageY+15; 72 var maptipw=jQuery('#tipus').outerWidth(), maptiph=jQuery('#tipus').outerHeight(), 73 x=(x+maptipw>jQuery(document).scrollLeft()+jQuery(window).width())? x-maptipw-(20*2) : x 74 y=(y+maptiph>jQuery(document).scrollTop()+jQuery(window).height())? jQuery(document).scrollTop()+jQuery(window).height()-maptiph-10 : y 75 jQuery('#tipus').css({left:x, top:y}) 76 }) 77 } 78}
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.