PageSourceSearch

https://elpinto.com/js/calendar.js

js elpinto.com collected 2026-09-25 18:39:01 UTC 4,426 bytes, 1 lines download raw bytes

1import{determineProto}from"./protoDeterminer.js";var proto=determineProto();function generateICS(t){if(!t||"object"!=typeof t)return;const e=moment(t.start).utc().format("YYYYMMDDTHHmmss")+"Z",n=moment(t.end).utc().format("YYYYMMDDTHHmmss")+"Z",a=t.title||"No Title",r=t.description?$("<div>").html(t.description).text().replace(/\n/g,"\\n"):"",c=t.location_name||"No Location",i=t.rrule?t.rrule.split("\n").filter((t=>!t.startsWith("DTSTART"))).join(";"):"",o=moment().utc().format("YYYYMMDDTHHmmss")+"Z",l=new URL(window.location.href).hostname.replace(/^www\./,""),d=["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//Spillover//EN","BEGIN:VEVENT",`UID:${`${(new Date).getTime()}@${l}`}`,`DTSTAMP:${o}`,`URL:${window.location.href}`,t.allDay?`DTSTART:${moment(t.start).utc().format("YYYYMMDD")}`:`DTSTART:${e}`,t.allDay?`DTEND:${moment(t.end).utc().format("YYYYMMDD")}`:`DTEND:${n}`,`SUMMARY:${a}`,`DESCRIPTION:${r}`,`LOCATION:${c}`,i?`${i}`:"","END:VEVENT","END:VCALENDAR"].filter((t=>t)).join("\r\n"),s=new Blob([d],{type:"text/calendar;charset=utf-8"}),m=URL.createObjectURL(s),f=document.createElement("a");f.href=m,f.download=`${a.replace(/[^a-zA-Z0-9]/g,"_")}.ics`,document.body.appendChild(f),f.click(),document.body.removeChild(f),URL.revokeObjectURL(m)}$((function(){function t(t){const e=String(t.getDate()).padStart(2,"0"),n=String(t.getMonth()+1).padStart(2,"0");return`${t.getFullYear()}-${n}-${e}`}function e(){const e=new Date;return e.setDate(e.getDate()+30),t(e)}let n=0;$("#calendar-events").length&&$((function(){$.ajax({url:`https://rails-admin.spillover.com/esites-api/v1/${proto}/calendar_events?start=${t(new Date)}T00:00:00Z&end=${e()}T00:00:00-01Z&include_recurrences=true`,success:function(t){$.each(t,(function(t,e){function a(t,n,a=e.allDay){const r=e.timezone_IANA||"UTC";let c=moment.tz(t,r);switch(n){case"leftDate":return`<h3>${c.format("MMM")}</h3><h2>${c.format("D")}</h2><h3>${c.format("YYYY")}</h3>`;case"dayOfWeek":return c.format("dddd");case"time":return a?"All Day":c.format("h:mm A");default:return c.format()}}function r(t){return a(e[t],"time")}n++;const c=a(e.start,"leftDate",e.allDay),i=a(e.start,"dayOfWeek",e.allDay),o=r("start"),l=r("end"),d={Central:"(CST)",Eastern:"(EST)",Mountain:"(MST)",Pacific:"(PST)",Alaska:"(AKST)",Yukon:"(YST)","Alaska-Hawaii":"(AHST)"}[e.timezone_name.split(" ")[0]]||"";let s=$(e.description).find("img").length>0;const m=s?"col-md-6":"col-md-10",f=s?'<div class="col-md-4 text-md-right text-center p-0"><div class="h-100"><span id="card-i"></span></div></div>':"",u=$("#calendar-events"),D=`\n\t\t\t\t\t\t\t<div class="col-md-12 mb-4">\n\t\t\t\t\t\t\t\t<div class="card h-100 p-0" id="${e.id+"-"+n}">\n\t\t\t\t\t\t\t\t<i class="fa-regular fa-calendar-plus generate-ics" data-calendar='${JSON.stringify(e).replace(/'/g,"&apos;").replace(/"/g,"&quot;")}'></i>\n\t\t\t\t\t\t\t\t<div class="row h-100 m-0">\n\t\t\t\t\t\t\t\t\t\t<div class="col-md-2 p-0 m-0 text-center date-bg" style="background-color:${e.color} !important;">\n\t\t\t\t\t\t\t\t\t\t\t<div class="d-flex align-items-center justify-content-center h-100">\n\t\t\t\t\t\t\t\t\t\t\t\t<div>${c}</div>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div class="${m} text-center d-flex align-items-center justify-content-center">\n\t\t\t\t\t\t\t\t\t\t\t<div class="card-body">\n\t\t\t\t\t\t\t\t\t\t\t\t<h2 class="card-title h3 text-center">${e.title}</h2>\n\t\t\t\t\t\t\t\t\t\t\t\t<h5 class="card-subtitle d-block mb-3 text-center">${i}${e.allDay?" @ All Day":" @ "+o}${e.end&&!e.allDay?" - "+l:""} ${e.allDay?"":d}</h5>\n\t\t\t\t\t\t\t\t\t\t\t\t<hr>\n\t\t\t\t\t\t\t\t\t\t\t\t${e.title===e.description?"":'<div class="card-text">'+e.description+"</div>"}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t${f}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t${e.url?`<div class="card-footer"><a class="cta-button btn btn-template" target="_blank" href="${e.url}">Learn More</a></div>`:""}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t`;u.append(D),u.find(".card").each((function(){const t=$(this),e=t.find(".card-text img").detach();if(e.length>0){const n=t.find("#card-i");e.appendTo(n),e.addClass("card-img-top h-100").attr("no-modal","true")}}))}))}})}))})),$("#calendar-events").length&&$(document).ready((function(){$("#calendar-events").on("click",".generate-ics",(function(){generateICS($(this).data("calendar"))}))}));

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.