1jQuery(function($) 2{ 3 var qvars = ph_utm_get_url_vars() 4 5 $.each([ 'utm_source','utm_medium','utm_term', 'utm_content', 'utm_campaign', 'gclid', 'fbclid' ], function( i,v ) { 6 7 var cookie_field = ph_utm_get_q_vars(v,qvars) 8 9 if ( cookie_field != '' ) 10 ph_utm_set_cookie(v, cookie_field, 30); 11 12 var curval = ph_utm_get_cookie(v) 13 14 if (curval != undefined) { 15 curval = decodeURIComponent(curval).replace(/[%]/g,' ') 16 if (v == 'username') { 17 //Maybe this should apply to all... We'll see... 18 curval = curval.replace(/\+/g, ' ') 19 } 20 21 jQuery('input[name=\"'+v+'\"]').val(curval) 22 jQuery('input#'+v).val(curval) 23 jQuery('input.'+v).val(curval) 24 } 25 }); 26}); 27 28function ph_utm_get_q_vars(v,qvars){ 29 if (qvars[v] != undefined) { 30 return qvars[v] 31 } 32 return '' 33} 34 35function ph_utm_get_url_vars() { 36 var vars = {}; 37 var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { 38 vars[key] = value; 39 }); 40 return vars; 41} 42 43function ph_utm_set_cookie(name, value, days) { 44 if (!value) return; 45 var expires = new Date(); 46 expires.setTime(expires.getTime() + (days * 24 * 60 * 60 * 1000)); 47 document.cookie = name + '=' + encodeURIComponent(value) + ';path=/;expires=' + expires.toUTCString(); 48} 49 50function ph_utm_get_cookie(name) { 51 var escaped = name.replace(/([.*+?^${}()|[\]\\])/g, '\\$1'); 52 var pattern = new RegExp('(?:^|; )' + escaped + '=([^;]*)'); 53 var matches = document.cookie.match(pattern); 54 return matches ? decodeURIComponent(matches[1]) : undefined; 55}
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.