var rei_searchResult = false; document.addEventListener('DOMContentLoaded', (event) => { console.log("loaded");rei_showFoundProperties(); rei_prepareSearchForm(); }); function rei_showFoundProperties() { let propertyLists = document.querySelectorAll(".rei-properties-box"); for (listNo = 0; listNo < propertyLists.length; listNo++) { jsonVarName = propertyLists[listNo].getAttribute("rei-properties-holder"); showPagination = parseInt(propertyLists[listNo].getAttribute("rei-show-pagination")); // console.log("Rei show found properties: ", this[jsonVarName]) ; rei_showPropertiesList(this[jsonVarName], showPagination, propertyLists[listNo]); } } function rei_showPropertiesList(rei_searchResultJson, showPagination, targetDiv) { rei_searchResult = JSON.parse(rei_searchResultJson); if (!rei_searchResult) return; if (rei_searchResult.properties_order == undefined) { console.log("No properties order - properties not found?"); return;} if (rei_searchResult.error != undefined) { targetDiv.innerHTML = "
"+l("Found")+" "+rei_searchResult.nof_found+" "+l("Properties")+"