var REQUEST_DEBOUNCE_TIME_MS=250 var debounce=function(func,delay){var inDebounce return function(){var context=this var args=arguments clearTimeout(inDebounce) inDebounce=setTimeout(function(){return func.apply(context,args)},delay)}} var request=debounce(function(method,url,success,data){if(!method)method='GET' if(!url)return var xhttp=new XMLHttpRequest() xhttp.onreadystatechange=function(){if(this.readyState==4&&this.status==200){success&&success(this.responseText)}} xhttp.open(method,url,true) if(method==='POST'){xhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded')} xhttp.send(serialize(data))},REQUEST_DEBOUNCE_TIME_MS) function serialize(obj){var str=[] for(var p in obj) if(obj.hasOwnProperty(p)){str.push(encodeURIComponent(p)+'='+encodeURIComponent(obj[p]))} return str.join('&')} function getCookie(cn){var name=cn+'=' var allCookie=decodeURIComponent(document.cookie).split(';') var cval=[] for(var i=0;i0?cval[1]:''};(function(){;(function(){var $searchbars=document.querySelectorAll('input.search-bar') var $searchbuttons=document.querySelectorAll('.search-button') var $autocompleteSuggestions=document.getElementById('autocomplete-suggestions') var $autocompleteSuggestionsDark=document.getElementById('autocomplete-suggestions-dark') var cache={} var $currentSearchbar=$searchbars[0] var currentSelection=-1 for(var i=0;i$1')}catch(e){} try{value=value.replace(/&/g,'&').replace(/,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/<(\/?span)>/g,'')}catch(e){} if((suggestion.value&&suggestion.value.toLowerCase())===(currentValue&¤tValue.toLowerCase())) selectPerson($searchbar,currentValue) return value} function selectPerson($currSearchbar,value){for(var i=0;i=len)currentSelection=len break;case "Enter":children[currentSelection].click() break;} if(children[currentSelection]){children[currentSelection].style.backgroundColor='#ddd'}},{passive:true})})();(function(){try{var $boost=document.getElementById('btn-boost') $boost.onclick=function(e){e.preventDefault() request('POST','/api/people/boost',function(r){$boost.onclick=function(){} $boost.classList.add('boosted') $boost.classList.add('disabled')},{url:$boost.dataset.url,from_web:1})}}catch(e){} try{document.getElementById('btn-edit').onclick=function(e){e.preventDefault() document.getElementById('edit-form').submit()}}catch(e){} try{var $groupBoosts=document.getElementsByClassName('btn-group-boost') for(var i=0;i