PageSourceSearch

https://vide-greniers.org/v2/compo_list_map.1788340435.js

js vide-greniers.org collected 2026-10-02 04:09:39 UTC 3,777 bytes, 16 lines download raw bytes

1(()=>{var n=class{constructor(){let e=null,i=[];document.addEventListener("alpine:init",()=>{Alpine.data("map",()=>({DateHelper:{},dialog:null,dateData:{},currentId:null,listDates:{},indexDates:[],currentDate:null,tomorrow:null,CANCEL:2,init(){window.alpineRender(this),this.dialog=document.querySelector("[x-ref='listMap']"),this.initDates()},initDates(){this.currentDate=new Date,this.tomorrow=new Date,this.tomorrow.setDate(this.currentDate.getDate()+1);let t=Intl.DateTimeFormat("fr-FR",{weekday:"long",day:"numeric",month:"long",year:"numeric"}),a=Object.keys(this.listDates),o=null;for(let s of a){this.indexDates.push(s);let h=s.toString().slice(0,4),c=s.toString().slice(4,6),d=s.toString().slice(6,8),l=new Date(h,c-1,d);this.dateData[s]={prev:o,mon:this.DateHelper.shortMonths[parseInt(c,10)],mday:parseInt(d,10),relative:this.getRelative(l)??this.DateHelper.days[l.getDay()],fullLabel:t.format(l),events:this.listDates[s].map(r=>({location:r.geo.location,title:r.title,city:r.geo.city.name,eventId:r.eventId,date:r.date,isCanceled:r.canceled}))},o&&(this.dateData[o].next=s),o=s}},getRelative(t){return this.currentDate.getFullYear()===t.getFullYear()&&this.currentDate.getMonth()===t.getMonth()&&this.currentDate.getDate()===t.getDate()?"Aujourd'hui":this.tomorrow.getFullYear()===t.getFullYear()&&this.tomorrow.getMonth()===t.getMonth()&&this.tomorrow.getDate()===t.getDate()?"Demain":null},openDialogMap(t){this.currentId=t,this.dialog.open||this.dialog.showModal(),this.render(t)},closeDialog(){this.dialog.open&&this.dialog.close(),e.remove(),e=null},render(t){e||(e=L.map("map-leaflet",{attributionControl:!1,zoomSnap:.1,maxBoundsViscosity:.9}),L.control.attribution().addTo(e).setPrefix('<a href="https://leafletjs.com/"  @click="closeDialog()">Leaflet</a>'),L.tileLayer("https://map.sopheos.com/{z}/{x}/{y}.png",{maxZoom:19,attribution:'&copy; <a href="http://www.openstreetmap.org/copyright" @click="closeDialog()">OpenStreetMap</a>'}).addTo(e)),this.deleteMarkers(),this.addMarkers(t),this.fitMarkers()},addMarkers(t){this.listDates[t]&&(L.Icon.Default.imagePath="/map/",this.dateData[t].events.forEach(a=>{let o=L.marker([a.location.lat,a.location.lon]);o.bindPopup(`
2                                 <div class="flex flex-col gap-xs min-w-[200px]">
3                                    <div class="flex flex-col gap-xs pr-md">
4                                        <span class="max-w-form font-semibold text-large wrap-anywhere line-clamp-1">${a.city}</span>
5                                        <span class="max-w-form wrap-anywhere line-clamp-1">${a.title}</span>
6                                    </div>
7                                    <div class="flex gap-xs ${a.isCanceled?"justify-between":"justify-end"}">
8                                        <template x-if="${a.isCanceled}">
9                                            <div class="rounded-xxs px-xs text-small self-start bg-red-600 font-semibold text-white">
10                                                <span>Annul\xE9</span>
11                                            </div>
12                                        </template>
13                                        <a href="/evenement/${a.eventId}/${a.date}" class="text-nowrap" @click="closeDialog()">Voir le d\xE9tail</a>
14                                    </div>
15                                </div>`,{autoPan:!1}),i.push(o),o.addTo(e)}))},deleteMarkers(){i.forEach(t=>{e.removeLayer(t)}),i.length=0},fitMarkers(){if(i.length===1){let t=i[0].getLatLng().toBounds(5e3);e.fitBounds(t,{maxZoom:17}),e.setMaxBounds(t)}else{let t=new L.featureGroup(i);e.fitBounds(t.getBounds().pad(.1),{maxZoom:17}),e.setMaxBounds(t.getBounds().pad(.1))}}}))},{once:!0})}};new n;})();
16//# sourceMappingURL=compo_list_map.1788340435.js.map

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.