/
var
/
www
/
barefootlaw.org
/
wp-content
/
plugins
/
interactive-geo-maps
/
assets
/
public
/
map-actions
/
Upload File
HOME
function igm_display_below(e,t){iMapsActions.contentBelow(e,t,!1),window.dispatchEvent(new Event("resize"))}function igm_display_below_scroll(e,t){iMapsActions.contentBelow(e,t,!0),window.dispatchEvent(new Event("resize"))}function igm_display_above(e,t){iMapsActions.contentAbove(e,t,!1),window.dispatchEvent(new Event("resize"))}function igm_display_page_below(e,t){iMapsActions.pageBelow(e,t,!1)}function igm_display_page_below_and_scroll(e,t){iMapsActions.pageBelow(e,t,!0)}function igm_display_right_1_3(e,t){iMapsActions.contentRight(e,t,"igm_content_left_2_3","igm_content_right_1_3"),window.dispatchEvent(new Event("resize"))}function igm_lightbox(e,t){iMapsActions.lightboxAction(e,t,"inline"),window.dispatchEvent(new Event("resize"))}function igm_lightbox_image(e,t){iMapsActions.lightboxAction(e,t,"image")}function igm_lightbox_iframe(e,t){iMapsActions.lightboxAction(e,t,"external")}iMapsActions={},iMapsActions.init=function(){for(var e=document.querySelectorAll(".igm-live-filter"),t=0;t<e.length;t++)iMapsActions.buildFilter(e[t]);var i=document.querySelectorAll(".igm-live-filter-dropdown");for(t=0;t<i.length;t++)iMapsActions.buildDropdownFilter(i[t]);var n=document.querySelectorAll(".igm_select_choices");if(n.length>0)for(t=0;t<n.length;t++)iMapsActions.buildDropdown(n[t]);else{n=document.querySelectorAll(".igm_select");for(t=0;t<n.length;t++)n[t].addEventListener("change",function(e){var t=e.target,i=t.getAttribute("data-map-id");if(i=parseInt(i),"undefined"==typeof iMapsManager){if(t.getAttribute("data-url")){var n=t.getAttribute("data-url").split("#")[1];if(n){var o=t.getAttribute("data-url").replace("#"+n,"");window.open(o+"?mregion="+t.value+"#"+n,"_self")}else window.open(t.getAttribute("data-url")+"?mregion="+t.value,"_self")}}else iMapsManager.select(i,t.value,!0)})}var o=document.querySelectorAll(".igm_entries_list");for(t=0;t<o.length;t++)iMapsActions.buildLists(o[t])},iMapsActions.buildDropdown=function(e){var t=e.getAttribute("data-noresults"),i=e.getAttribute("data-select"),n={noResultsText:t,itemSelectText:i,resetScrollPosition:!1,searchResultLimit:1e3},o=new Choices(e,n);o.passedElement.element.addEventListener("change",function(){var t=e.getAttribute("data-map-id");if(t=parseInt(t),"undefined"!=typeof iMapsManager&&iMapsManager.select(t,this.value,!0),e.getAttribute("data-url")){var i=e.getAttribute("data-url").split("#")[1];if(i){var n=e.getAttribute("data-url").replace("#"+i,"");window.open(n+"?mregion="+e.value+"#"+i,"_self")}else window.open(e.getAttribute("data-url")+"?mregion="+e.value,"_self")}})},iMapsActions.buildLists=function(e){for(var t=e.getAttribute("data-map-id"),i=e.querySelectorAll("li"),n=0;n<i.length;n++){var o=i[n];o.addEventListener("click",function(e){if("undefined"==typeof iMapsManager)e.target.getAttribute("data-url")&&window.open(e.target.getAttribute("data-url")+"?mregion="+e.target.getAttribute("data-code"),"_self");else{var i=e.target.getAttribute("data-code");iMapsManager.select(t,i,!0)}}),o.addEventListener("mouseover",function(e){if("undefined"!=typeof iMapsManager){var i=e.target.getAttribute("data-code");iMapsManager.highlight(t,i)}}),o.addEventListener("mouseout",function(e){"undefined"!=typeof iMapsManager&&iMapsManager.clearHighlighted(t)})}},iMapsActions.buildDropdownFilter=function(e){var t=e.getAttribute("data-base-map-id"),i=e.getAttribute("data-keep-base-map");i=void 0!==i&&"1"===i,t=parseInt(t),e.addEventListener("change",function(e){var n=e.target.value;if(n=parseInt(n),iMapsManager.filteredMap=n,n===t)iMapsManager.activeMap=t,"undefined"!=typeof iMapsManager&&(iMapsManager.filteredMap=!1,iMapsManager.showAllSeries(n));else if("undefined"!=typeof iMapsManager){iMapsManager.hideAllSeries(t,i);var o=iMaps.maps[t].seriesById[n];if(o&&o.length>0)for(var a=0;a<o.length;a++){var s=o[a];s.show()}}void 0!==iMaps.maps[n]&&(iMaps.maps[n].map.goHome(),iMaps.maps[n].map.dispatchImmediately("zoomlevelchanged"))})},iMapsActions.buildFilter=function(e){var t=e.getAttribute("data-base-map-id"),i=e.getAttribute("data-keep-base-map");i=void 0!==i&&"1"===i,t=parseInt(t);for(var n=e.querySelectorAll("li"),o=0;o<n.length;o++){var a=n[o];a.addEventListener("click",function(e){for(var o=0;o<n.length;o++){var a=n[o];a.classList.remove("igm-live-filter-active")}e.target.classList.add("igm-live-filter-active");var s=e.target.getAttribute("data-map-id");if(s=parseInt(s),iMapsManager.filteredMap=s,s===t)"undefined"!=typeof iMapsManager&&(iMapsManager.filteredMap=!1,iMapsManager.showAllSeries(s));else if("undefined"!=typeof iMapsManager){iMapsManager.hideAllSeries(t,i);var r=iMaps.maps[t].seriesById[s];if(r&&r.length>0)for(var l=0;l<r.length;l++){var c=r[l];c.show()}}void 0!==iMaps.maps[t]&&(iMaps.maps[t].map.goHome(),iMaps.maps[t].map.dispatchImmediately("zoomlevelchanged"))})}},iMapsActions.lightbox=!1,iMapsActions.lightboxIsRunning=!1,iMapsActions.lightboxAction=function(e,t,i){var n=[],o=iMapsActionOptions.lightboxWidth,a=iMapsActionOptions.lightboxHeight,s={};if("inline"===i)t.content="#"+iMapsActions.getIDfromData(t),n.push({href:t.content,type:i,width:o,height:a});else if("external"===i)"auto"===a&&(a=parseInt(.8*window.innerHeight)),n.push({href:t.content,type:i,width:o,height:a});else if(""!==t.content&&t.content.includes(",")){let e=t.content.split(",");e.forEach(function(e,t){n.push({href:e,type:i,width:o,height:a})})}else n.push({href:t.content,type:i,width:o,height:a});s={touchNavigation:!1,draggable:!1,keyboardNavigation:!1,loopAtEnd:!1,loop:!1,zoomable:!1,elements:n,closeButton:!1,closeOnOutsideClick:!0},window.innerWidth>768&&iMapsActions.isTouchScreendevice()&&(s.closeOnOutsideClick=!1),iMapsActions.lighbox||(iMapsActions.lightbox=GLightbox(s)),iMapsActions.lightbox.on("open",function(){let e=document.querySelector(".ginner-container .gslide-media .igm_close");if(!e){e=document.createElement("span"),e.classList.add("igm_close"),e.innerHTML="╳";let t=document.querySelectorAll(".ginner-container .gslide-media");t.forEach(function(t){let i=e.cloneNode(!0);i.addEventListener("click",function(){iMapsActions.lightbox.close()}),t.prepend(i)})}}),""!==t.content&&iMapsActions.lightbox&&!iMapsActions.lightboxIsRunning?(iMapsActions.lightbox.open(),iMapsActions.lightboxIsRunning=!0):console.log("Empty Action Content or Incorrect Request - Lightbox not triggered"),iMapsActions.lightbox.on("close",function(){iMapsManager.clearSelected(e),iMapsActions.lightboxIsRunning=!1})},iMapsActions.contentBelow=function(e,t,i){var n,o,a,s=document.getElementById("map_"+e).parentNode.parentNode.parentNode,r=s.parentNode.querySelector(".igm_content_below"),l=document.getElementById("igm-hidden-footer-content");t.content="[id='"+iMapsActions.getIDfromData(t)+"']",null===r&&(r=document.createElement("div"),r.classList.add("igm_content_below"),s.parentNode.insertBefore(r,s.nextSibling)),a=r.firstChild,a&&(a.style&&(a.style.display="none"),l.appendChild(a)),o=document.querySelector(t.content),o&&(r.appendChild(o),o.style&&(o.style.display="block")),i&&(n=Math.floor(r.getBoundingClientRect().top-100),window.scrollBy({top:n,left:0,behavior:"smooth"}))},iMapsActions.contentAbove=function(e,t,i){var n,o,a=document.getElementById("map_"+e).parentNode.parentNode.parentNode,s=a.parentNode.querySelector(".igm_content_above"),r=document.getElementById("igm-hidden-footer-content");t.content="[id='"+iMapsActions.getIDfromData(t)+"']",null===s&&(s=document.createElement("div"),s.classList.add("igm_content_above"),a.parentNode.insertBefore(s,a.parentNode.childNodes[0])),o=s.firstChild,o&&(o.style.display="none",r.appendChild(o)),n=document.querySelector(t.content),n&&(s.appendChild(n),n.style.display="block"),i&&(originalTop=Math.floor(s.getBoundingClientRect().top-100),window.scrollBy({top:originalTop,left:0,behavior:"smooth"}))},iMapsActions.contentRight=function(e,t,i,n){var o,a,s=document.getElementById("map_"+e).parentNode.parentNode.parentNode,r=s.parentNode.querySelector("."+n),l=s.parentNode.querySelector("."+i),c=document.getElementById("igm-hidden-footer-content");t.content="[id='"+iMapsActions.getIDfromData(t)+"']",null===l&&(l=s.parentNode.querySelector(".map_box"),l.classList.add(i)),null===r&&(r=document.createElement("div"),r.classList.add(n),s.parentNode.insertBefore(r,s.nextSibling)),a=r.firstChild,a&&(a.style.display="none",c.appendChild(a)),o=document.querySelector(t.content),o&&(r.appendChild(o),o.style.display="block")},iMapsActions.pageBelow=function(e,t,i){if(""!==t.content){var n,o=parseInt(t.content),a=iMapsActionOptions.restURL+"pages/"+o,s=document.getElementById("map_"+e).parentNode.parentNode.parentNode,r=s.parentNode.querySelector(".igm_content_below"),l=new XMLHttpRequest;l.open("GET",a),l.onload=function(){if(l.status>=200&&l.status<400){var e=JSON.parse(l.response);r.innerHTML=e.content.rendered,i&&(n=Math.floor(r.getBoundingClientRect().top-100),window.scrollBy({top:n,left:0,behavior:"smooth"}))}else console.log("We connected to the server, but it returned an error.")},l.onerror=function(){console.log("Connection error")},l.send()}},iMapsActions.getIDfromData=function(e){var t;return void 0!==e.originalID?(t=e.originalID.replace(/\s/g,""),t=t.replace(/,/g,"_"),t=iMapsActions.wpFeSanitizeTitle(t),e.content=t+"_"+e.mapID):(Number.isInteger(e.id)&&(e.id=e.id.toString()),t=e.id.replace(/\s/g,""),t=t.replace(/,/g,"_"),t=iMapsActions.wpFeSanitizeTitle(t),e.content=t+"_"+e.mapID),e.content.toLowerCase()},iMapsActions.wpFeSanitizeTitle=function(e){return e=e.replace(/\ /g,"").replace(/\,/g,"_"),e=encodeURIComponent(e).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%/g,"").toLowerCase(),e},iMapsActions.resetContainer=function(e,t){var i,n,o=document.getElementById("map_wrapper_"+e),a=document.getElementById("igm-hidden-footer-content");null!==o&&(i=o.querySelector(t),null!==i&&(n=i.firstChild,n&&a&&(n.style.display="none",a.appendChild(n)),what2display=document.getElementById("default_"+e),what2display&&(i.appendChild(what2display),what2display.style.display="block")))},iMapsActions.resetActions=function(e){iMapsActions.resetContainer(e,".igm_content_below"),iMapsActions.resetContainer(e,".igm_content_above"),iMapsActions.resetContainer(e,".igm_content_right_1_3")},iMapsActions.isTouchScreendevice=function(){return"ontouchstart"in window||navigator.maxTouchPoints},iMapsActions.loadScript=function(e,t){var i=document.createElement("script");i.type="text/javascript",i.src=e,i.onreadystatechange=t,i.onload=t,document.head.appendChild(i)},iMapsActions.loadScripts=function(e,t){var i=0,n=function(){i++,i>=e.length&&t.call(this,arguments)};e.forEach(function(e,t){iMapsActions.loadScript(e,n)})},void 0!==iMapsActionOptions.async&&Array.isArray(iMapsActionOptions.urls)&&iMapsActionOptions.urls.length>0?iMapsActions.loadScripts(iMapsActionOptions.urls,function(){iMapsActions.init()}):iMapsActions.init();