PageSourceSearch

https://babakfakhamzadeh.com/wordpress/wp-content/cache/autoptimiz…a2ebacda509400e3d62e2dc00.js?ver=1761180037

js babakfakhamzadeh.com collected 2026-10-02 11:45:33 UTC 4,890 bytes, 20 lines download raw bytes

1function loadMonthsGallery(year,album){var txt='<i class="fa-solid fa-circle-notch fa-spin fa-2x"></i>';var el=jQuery("#photos-year-block")
2var other_el=jQuery("#photos-year-block")
3var append=false;if(typeof(album)!="undefined"){el=jQuery("#photos-album-years-block .month-gallery");other_el=jQuery(".photos-album-year-block[data-year="+year+"]");txt='<i class="fa-solid fa-circle-notch fa-spin"></i> '+"loading "+year;append=true;}
4else{album='';}
5el.addClass("loading");var data={year:year,album:album,};console.log(data);other_el.html("<div style='text-align: center; padding: 2rem;'>"+txt+"</div>");wp.ajax.post("load_months_gallery",data).done(function(response){other_el.html('');other_el.removeClass("loading");other_el.removeClass("unloaded");other_el.addClass("loaded");if(response){if(append){el.append(response);}
6else{el.html(response);}}
7if(album!=''){if(jQuery(".photos-album-year-block.unloaded").length){loadMonthsGallery(jQuery(".photos-album-year-block.unloaded").first().attr("data-year"),album);}}}).fail(function(xhr){other_el.removeClass("loading");console.log("AJAX failed:",xhr);console.log(xhr.responseText);other_el.html("<div style='text-align: center; padding: 2rem;'><i class='fa-solid fa-circle-exclamation'></i> Problem</div>");try{const json=JSON.parse(xhr.responseText);console.log("Error response from server:",json.data);}catch(e){console.error("Failed to parse error response.");}});}
8function loadMonthGallery(index,month,album){const container=document.getElementById('month-gallery-'+index+'-'+album);container.classList.add("loading")
9container.classList.remove("loading-failed")
10var data={month:month,album:album,};console.log(data);wp.ajax.post("load_month_gallery",data).done(function(response){container.classList.remove("loading")
11const parser=new DOMParser();const doc=parser.parseFromString(response,'text/html');if(doc.querySelector('.fg-cell')){const modal=document.createElement("div");modal.innerHTML=response;document.body.appendChild(modal);const modalEl=document.getElementById("monthGalleryModal");modalEl.classList.add("active");}
12else{jQuery(container).find("a").html('<i class="fa-regular fa-face-frown"></i>');}}).fail(function(something){console.log(something);console.log("Error in AJAX call.");container.classList.remove("loading")
13container.classList.add("loading-failed")});}
14function closeMonthGallery(){const modal=document.getElementById("monthGalleryModal");if(modal){modal.remove();}}
15function openMonthImageModal(walker){var el=jQuery(".month-image-link[data-id='"+walker+"']");imageUrl=el.find("img").attr("data-full");caption=el.find("img").attr("title");const modal=document.getElementById("archive-imageModal");const img=document.getElementById("archives-modalImg");const text=jQuery("#archives-modalCaption");modal.style.display="block";img.src=imageUrl;text.html(caption);}
16function closeModalArchive(){const modal=document.getElementById("archive-imageModal");modal.style.display="none";}
17jQuery(function($){if($("#photos-year-block").length){loadMonthsGallery($("#photos-year-block").attr("data-year"));var mySelect=document.getElementById('photos-year-select');mySelect.onchange=(event)=>{var inputText=event.target.value;$("#photos-year-block").attr("data-year",inputText);loadMonthsGallery(inputText);}}
18if($("#countries-superwrap").length){const countries=JSON.parse($("#countries-lookup").html());const input=document.getElementById('countryInput');const suggestions=document.getElementById('countries-suggestions');const clearBtn=document.getElementById('countries-clearBtn');input.addEventListener('input',function(){const query=this.value.toLowerCase();suggestions.innerHTML='';clearBtn.style.display=query?'block':'none';if(!query){suggestions.style.display='none';return;}
19const matches=countries.filter(c=>c.country.toLowerCase().includes(query));if(matches.length){suggestions.style.display='block';matches.forEach(match=>{const div=document.createElement('div');div.textContent=match.country;div.addEventListener('click',()=>{input.value=match.country;suggestions.style.display='none';$("#photos-album-years-block .month-gallery").html("");$(".photos-album-year-block").html("");$(".photos-album-year-block").html("");$(".photos-album-year-block").removeClass("loaded");$(".photos-album-year-block").removeClass("loading");$(".photos-album-year-block").attr("data-album",match.id);for(var i=0;i<match.years.length;i++){if(match.years[i].found){$(".photos-album-year-block[data-year='"+match.years[i].year+"']").addClass("unloaded");}}
20console.log(match.country,match.id,match.years);loadMonthsGallery($(".photos-album-year-block.unloaded").first().attr("data-year"),match.id);});suggestions.appendChild(div);});}else{suggestions.style.display='none';}});clearBtn.addEventListener('click',function(){input.value='';suggestions.style.display='none';clearBtn.style.display='none';input.focus();});}});

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.