1var utils={debug:!1} 2utils.array={inArray:function(needle,array){for(var i in array){if(array[i]===needle)return!0} 3return!1}} 4utils.cookies={isEnabled:function(){var cookiesEnabled=!!(navigator.cookieEnabled) 5if(typeof navigator.cookieEnabled==='undefined'&&!cookiesEnabled){document.cookie='testcookie' 6cookiesEnabled=($.inArray('testcookie',document.cookie)!==-1)} 7return cookiesEnabled},readCookie:function(name){var cookies=document.cookie.split(';') 8name=name+'=' 9for(var i=0;i<cookies.length;i++){var cookie=cookies[i] 10while(cookie.charAt(0)===' ')cookie=cookie.substring(1,cookie.length) 11if(cookie.indexOf(name)===0)return cookie.substring(name.length,cookie.length)} 12return null},setCookie:function(name,value,days,secure){if(typeof days==='undefined')days=7 13if(typeof secure==='undefined')secure=location.protocol==='https:' 14var expireDate=new Date() 15expireDate.setDate(expireDate.getDate()+days) 16document.cookie=name+'='+escape(value)+';expires='+expireDate.toUTCString()+';path=/'+(secure?';secure=true':'')}} 17utils.form={isChecked:function(element){return($('input[name="'+element.attr('name')+'"]:checked').length>=1)},isEmail:function(element){var regexp=/^[a-z0-9!#$%&'*+-/=?^_`{|}.~]+@([a-z0-9]+([-]+[a-z0-9]+)*\.)+[a-z]{2,7}$/i 18return regexp.test(element.val())},isFilled:function(element){return(utils.string.trim(element.val())!=='')},isNumber:function(element){return(!isNaN(element.val())&&element.val()!=='')},isURL:function(element){var regexp=/^((http|ftp|https):\/{2})?(([0-9a-zA-Z_-]+\.)+[0-9a-zA-Z]+)((:[0-9]+)?)((\/([~0-9a-zA-Z#%@./_-]+)?(\?[0-9a-zA-Z%@/&=_-]+)?)?)$/i 19return regexp.test(element.val())}} 20utils.string={div:!1,html5:function(html){var html5='abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video'.split(' ') 21var i=0 22if(utils.string.div===!1){utils.string.div=document.createElement('div') 23utils.string.div.innerHTML='<nav></nav>' 24if(utils.string.div.childNodes.length!==1){var fragment=document.createDocumentFragment() 25i=html5.length 26while(i--)fragment.createElement(html5[i]) 27fragment.appendChild(utils.string.div)}} 28html=html.replace(/^\s\s*/,'').replace(/\s\s*$/,'').replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,'') 29var inTable=html.match(/^<(tbody|tr|td|th|col|colgroup|thead|tfoot)[\s/>]/i) 30if(inTable){utils.string.div.innerHTML='<table>'+html+'</table>'}else{utils.string.div.innerHTML=html} 31var scope 32if(inTable){scope=utils.string.div.getElementsByTagName(inTable[1])[0].parentNode}else{scope=utils.string.div} 33var returnedFragment=document.createDocumentFragment() 34i=scope.childNodes.length 35while(i--)returnedFragment.appendChild(scope.firstChild) 36return returnedFragment},htmlEncode:function(value){return $('<div/>').text(value).html()},htmlDecode:function(value){return $('<div/>').html(value).text()},replaceAll:function(value,needle,replacement){if(typeof value==='undefined')return'' 37return value.replace(new RegExp(needle,'g'),replacement)},sprintf:function(value){if(arguments.length<2){return value}else{value=value.replace(/\$s/g,'Ss') 38for(var i=1;i<arguments.length;i++){value=utils.string.replaceAll(value,'%'+i+'Ss',arguments[i])}} 39return value},stripTags:function(value){return value.replace(/<[^>]*>/ig,'')},trim:function(value,charList){if(typeof value==='undefined')return'' 40if(typeof charList==='undefined')charList=' ' 41var pattern=new RegExp('^['+charList+']*|['+charList+']*$','g') 42return value.replace(pattern,'')},urlEncode:function(value){return encodeURIComponent(value).replace(/%20/g,'+').replace(/!/g,'%21').replace(/'/g,'%27').replace(/\(/g,'%28').replace(/\)/g,'%29').replace(/\*/g,'%2A').replace(/~/g,'%7E')},urlDecode:function(value){return decodeURIComponent(value.replace(/\+/g,'%20').replace(/%21/g,'!').replace(/%27/g,'\'').replace(/%28/g,'(').replace(/%29/g,')').replace(/%2A/g,'*').replace(/%7E/g,'~'))},urlise:function(value){var reservedCharacters=['/','?',':','@','#','[',']','!','$','&','\'','(',')','*','+',',',';','='] 43for(var i in reservedCharacters)value=value.replace(reservedCharacters[i],' ') 44value=utils.string.replaceAll(value,'"',' ') 45value=utils.string.replaceAll(value,' ','-') 46if(utils.string.urlDecode(value)===value){value=value.toLowerCase() 47value=utils.string.urlEncode(value)} 48value=value.replace(/-+/,'-') 49return utils.string.trim(value,'-')},ucfirst:function(value){return value.charAt(0).toUpperCase()+value.slice(1)},xhtml:function(value){value=value.replace(/<br>/g,'<br />') 50value=value.replace(/<br ?\/?>$/g,'') 51value=value.replace(/^<br ?\/?>/g,'') 52value=value.replace(/(<img [^>]+[^/])>/gi,'$1 />') 53value=value.replace(/(<input [^>]+[^/])>/gi,'$1 />') 54value=value.replace(/<b\b[^>]*>(.*?)<\/b[^>]*>/g,'<strong>$1</strong>') 55value=value.replace(/<i\b[^>]*>(.*?)<\/i[^>]*>/g,'<em>$1</em>') 56value=value.replace(/<u\b[^>]*>(.*?)<\/u[^>]*>/g,'<span style="text-decoration:underline">$1</span>') 57return value}} 58utils.url={extractParamFromUri:function(uri,paramName){if(!uri)return 59uri=uri.split('#')[0] 60var parts=uri.split('?') 61if(parts.length===1)return 62var query=decodeURI(parts[1]) 63paramName+='=' 64var params=query.split('&') 65for(var i=0;i<params.length;++i){var param=params[i] 66if(param.indexOf(paramName)===0)return decodeURIComponent(param.split('=')[1])}},getGetValue:function(name){var getValue='' 67var hashes=window.location.search.slice(window.location.search.indexOf('?')+1).split('&') 68$.each(hashes,function(index,value){var chunks=value.split('=') 69if(chunks[0]===name){getValue=chunks[1] 70return!1}}) 71return getValue}}
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.