PageSourceSearch

https://www.newberryhousing.org/libs/js/utility.js?v=0.04

js newberryhousing.org collected 2026-09-30 13:46:28 UTC 7,227 bytes, 9 lines download raw bytes

1function ajax(e,t,n,r){var o=new XMLHttpRequest;o.onreadystatechange=function(){4===o.readyState&&r(o.status,o.responseText)};var a=[];for(var l in n)"object"==typeof n[l]&&(n[l]=JSON.stringify(n[l])),a.push(encodeURIComponent(l)+"="+encodeURIComponent(n[l]));if("GET"==(t=t.toUpperCase()))e=e+(-1===e.indexOf("?")?"?":"&")+a.join("&"),o.open("GET",e),o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.send(null);else if("POST"==t){var c=a.join("&");o.open("POST",e),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.send(c)}}function onlyUnique(e,t,n){return n.indexOf(e)===t}function uuidv4(e=9999){let t=((Date.now()+122192928e5)*1e4).toString(16);return`${t.slice(-8)}-${t.slice(-12,-8)}-1${t.slice(0,3)}-${e}-${crypto.getRandomValues(new Uint8Array(6)).reduce((e,t,n)=>e+(0===n?1|t:t).toString(16).padStart(2,"0"),"")}`}function isSelected(e,t){return e==t?"selected":""}function isChecked(e,t){return e==t?"checked":""}function isNotDisplayed(e,t){return e==t?"":"display:none"}function updateTimestamps(){let e=document.querySelectorAll(".timeago");0!=e.length&&timeago.render(e,"en_US",{minInterval:3})}function createClickableAlert(e,t,n){var r={info:"primary",success:"success",danger:"danger",warning:"warning"},o=`<div class="alert alert-${r[e]} d-flex align-items-center alert-dismissible" role="alert">
2					  <svg class="bi flex-shrink-0 me-2" width="24" height="24" role="img" aria-label="${r[e]}:">
3						<use xlink:href="#${{info:"info",success:"success",danger:"warning",warning:"warning"}[e]}-fill"/>
4					  </svg>
5						<p class="mb-0">
6						${t} <br><span class='clickable' onClick="copyClick(event)">${n}</span>
7						</p>
8						<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
9					</div>`,a=document.createElement("div");a.className="p-2",a.innerHTML=o,document.querySelector("#master-alert-container").appendChild(a),new bootstrap.Alert(a)}function copyClick(e){var t=document.querySelector("#copyArea");t.value=e.target.innerText,t.select(),t.setSelectionRange(0,99999),document.execCommand("copy")}function getRandomInt(e,t){return e=Math.ceil(e),Math.floor(Math.random()*((t=Math.floor(t))-e))+e}function generatePassword(e){for(var t=["123456789","abcdefghjkmnpqrstuvwxyz","ABCDEFGHJKLMNPQRSTUVWXYZ","!#$%&*=?@"],n="",r=0;r<e;r++){var o=getRandomInt(0,4);n+=t[o][getRandomInt(0,t[o].length-1)]}return n}function testPasswordStrength(e){var t=0;let n=document.querySelector(e).value;if(n.length<10)return{score:t,color:"red",passwordStrength:"shortPass"};let r=function(e,t){let n="";for(var r=0;r<t.length;r++){let o=!0;for(var a=0;a<e&&a+r+e<t.length;a++)o=o&&t.charAt(a+r)==t.charAt(a+r+e);a<e&&(o=!1),o?(r+=e-1,o=!1):n+=t.charAt(r)}return n};return(t+=1*n.length,t+=(r(1,n).length-n.length)*1,t+=(r(2,n).length-n.length)*1,t+=(r(3,n).length-n.length)*1,t+=(r(4,n).length-n.length)*1,n.match(/(.*[0-9].*[0-9].*[0-9])/)&&(t+=5),n.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)&&(t+=5),n.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)&&(t+=10),n.match(/([a-zA-Z])/)&&n.match(/([0-9])/)&&(t+=15),n.match(/([!,@,#,$,%,^,&,*,?,_,~])/)&&n.match(/([0-9])/)&&(t+=15),n.match(/([!,@,#,$,%,^,&,*,?,_,~])/)&&n.match(/([a-zA-Z])/)&&(t+=15),(n.match(/^\w+$/)||n.match(/^\d+$/))&&(t-=10),t<0&&(t=0),t>100&&(t=100),t<34)?{score:t,color:"red",passwordStrength:"badPass"}:t<58?{score:t,color:"yellow",passwordStrength:"goodPass"}:{score:t,color:"green",passwordStrength:"strongPass"}}function humanFileSize(e){var t=Math.floor(Math.log(e)/Math.log(1024));return 1*(e/Math.pow(1024,t)).toFixed(2)+" "+["B","kB","MB","GB","TB"][t]}function makeAssocArray(e,t){var n={};return e.forEach(function(e){n[e[t]]=e}),n}function dragElement(e){var t=0,n=0,r=0,o=0;function a(e){(e=e||window.event).preventDefault(),r=e.clientX,o=e.clientY,document.onmouseup=c,document.onmousemove=l}function l(a){(a=a||window.event).preventDefault(),t=r-a.clientX,n=o-a.clientY,r=a.clientX,o=a.clientY,e.style.top=e.offsetTop-n+"px",e.style.left=e.offsetLeft-t+"px"}function c(){document.onmouseup=null,document.onmousemove=null}document.getElementById(e.id+"-header")?document.getElementById(e.id+"-header").onmousedown=a:e.onmousedown=a}
9function string_to_slug(e,t){return(e=(e=e.trim()).toLowerCase()).replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+/,"").replace(/-+$/,"").replace(/-/g,t)}function str_ireplace(e,t,n,r){var o=0,a=0,l="",c="",s=0,i=0,u="",p="",d="",f="",g="",h="",m="",_=n,y="[object Array]"===Object.prototype.toString.call(_);if("object"==typeof e)for(o=0,l=e,e=[];o<l.length;o+=1)e[o]=l[o].toLowerCase();else e=e.toLowerCase();if("object"==typeof n)for(o=0,l=n,n=[];o<l.length;o+=1)n[o]=l[o].toLowerCase();else n=n.toLowerCase();if("object"==typeof e&&"string"==typeof t)for(o=0,l=t,t=[];o<e.length;o+=1)t[o]=l;for(l="",u=[].concat(e),p=[].concat(t),f="[object Array]"===Object.prototype.toString.call(p),d=[].concat(d=n),_=[].concat(_),r&&(r.value=0),o=0,s=d.length;o<s;o++)if(""!==d[o])for(a=0,i=u.length;a<i;a++)l=d[o]+"",c=f?void 0!==p[a]?p[a]:"":p[0],d[o]=l.split(u[a]).join(c),g=_[o]+"",h=l.indexOf(u[a]),m=u[a].length,h>=0&&(_[o]=g.split(g.substr(h,m)).join(c)),r&&(r.value+=l.split(u[a]).length-1);return y?_:_[0]}function capitalize(e){return e?e[0].toUpperCase()+e.slice(1).toLowerCase():e}function toDataURL(e,t){var n=new XMLHttpRequest;n.onload=function(){var e=new FileReader;e.onloadend=function(){t(e.result)},e.readAsDataURL(n.response)},n.open("GET",e),n.responseType="blob",n.send()}function base64ToBlob(e,t){t=t||"";for(var n=window.atob(e),r=[],o=0,a=n.length;o<a;o+=1024){for(var l=n.slice(o,o+1024),c=Array(l.length),s=0;s<l.length;s++)c[s]=l.charCodeAt(s);var i=new Uint8Array(c);r.push(i)}return new Blob(r,{type:t})}function CleanWordHTML(e){return e=(e=(e=(e=e.replace(/[\u2018|\u2019|\u201A]/g,"'")).replace(/[\u201C|\u201D|\u201E]/g,'"')).replace(/[\u2026]/g,"...")).replace(/[\u2013|\u2014]/g,"-")}function mockCForm(){let e=new Date,t=e.getFullYear()+"-"+("0"+(e.getMonth()+1)).slice(-2)+"-"+("0"+e.getDate()).slice(-2);$("#rendered-content input[type=tel]").val("000-000-0000"),$("#rendered-content input[type=text],textarea").val("BJM Test"),$("#rendered-content input[type=date]").val(t),$("#rendered-content input[type=radio]").attr("checked",!0),$("#rendered-content input[type=checkbox]").attr("checked",!0),console.log("Form Filled")}Date.createFromMysql=function(e){var t,n=null;return"string"==typeof e&&(t=e.split(/[- :]/),n=new Date(t[0],t[1]-1,t[2],t[3]||0,t[4]||0,t[5]||0)),n},Array.prototype.diff=function(e){return this.filter(t=>!e.includes(t))},Date.createFromUnixTimestamp=function(e){return new Date(1e3*e).toLocaleString("en-US",{timeZoneName:"short"})},String.prototype.ucwords=function(){return(str=this.toLowerCase()).replace(/(^([a-zA-Z\p{M}]))|([ -][a-zA-Z\p{M}])/g,function(e){return e.toUpperCase()})},String.prototype.toTitleCase=function(){return(str=this.replace("_"," ",this)).replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})},String.prototype.isNumeric=function(){return"string"==typeof this&&!isNaN(this)&&!isNaN(parseFloat(this))};

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.