1(function($){ // Open closure and map jQuery to $. 2 3 // Adds :external for grabbing external links 4 $.expr[':'].external = function(obj) { 5 return !obj.href.match(/^mailto\:/) && !obj.href.match(/^javascript\:/) && (obj.hostname != location.hostname); 6 }; 7 8 // Document ready. 9 $( function() { 10 // Add 'external' class and _blank target to all external links 11 $('a:external').on( 'click.wp-google-analytics', function(e){ 12 try { 13 _gaq.push( [ '_trackEvent', 'Outbound Links', e.currentTarget.host, $(this).attr('href') ] ); 14 /** 15 * If this link is not opened in a new tab or window, we need to add 16 * a small delay so the event can fully fire. See: 17 * http://support.google.com/analytics/bin/answer.py?hl=en&answer=1136920 18 * 19 * We're actually checking for modifier keys or middle-click 20 */ 21 if ( ! ( e.metaKey || e.ctrlKey || 1 == e.button ) ) { 22 e.preventDefault(); 23 setTimeout('document.location = "' + $(this).attr('href') + '"', 100) 24 } 25 } catch(err) {} 26 }); 27 }); 28 29})( jQuery ); // Close closure.
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.