');
$(document).on('click', function() {
$('#calendar-event-overlay').remove();
});
$('#calendar-event-overlay').css({
'left': ($this.offset().left - ($('#calendar-event-overlay').outerWidth() / 2) +
($this.outerWidth() / 2)) + 'px',
'top': ($this.offset().top - $('#calendar-event-overlay').outerHeight() - 18) + 'px'
}).bind('mouseleave', function() {
$(this).remove();
});
}
function EditMyEventRegistration(eventDateID, userRegID) {
//LoadEventRegistrationEdit(userRegID);
LoadEventDetail(eventDateID, userRegID, true)
}
function RemoveMyEventRegistration(userRegID,EventDateID) {
//var data = "{userRegID:" + userRegID + ", EventDateID:" + EventDateID + "}";
swalert('Are you sure you want to remove this registration?','Remove Registration','critical','yesno',YesRemoveMyEventRegistration,'','',{userRegID:userRegID,EventDateID:EventDateID});
}
function YesRemoveMyEventRegistration(userData) {
var data = "{UserRegistrationID: " + userData.userRegID + ", EventDateID: " + userData.EventDateID + "}";
var StartDate;
var EndDate;
if ($('#myeventslist-txt-startdate').val() == '') {
StartDate = '1/1/1900';
} else {
StartDate = $('#myeventslist-txt-startdate').val();
}
if ($('#myeventslist-txt-enddate').val() == '') {
EndDate = '1/1/1900';
} else {
EndDate = $('#myeventslist-txt-enddate').val();
}
if (StartDate != '1/1/1900') {
StartDate += ' 0:00:00';
}
if (EndDate != '1/1/1900') {
EndDate += ' 23:59:59';
}
var success = 'GetContent("https://www.houstonisd.org//site/UserControls/Calendar/MyEventsListWrapper.aspx?ModuleInstanceID=246674&StartDate=' + StartDate + '&EndDate=' + EndDate + '", "myeventslist-pnl-detail", 2, ""); ShowNotification("Success! You have deleted your registration for this event.");';
var failure = 'CallControllerFailure(result[0].errormessage);';
CallController("https://www.houstonisd.org//site/UserControls/Calendar/CalendarController.aspx/DeleteRegistration", data, success, failure);
}
function LoadEventListView(ModuleInstanceID, Month, Year) {
$('#calendarview-toggle a').removeClass('active');
$('#calendarview-toggle a.list').addClass('active');
var itemid = $('#calendarlist-month').val();
var gotoDate = new Date($('#calendarlist-year').val(), (itemid - 1), 1);
$('#calendar-pnl-title h1').text(gotoDate.toLocaleString("en-us", { month: "long" }) + ' ' + $('#calendarlist-year').val());
$('#calendarlist-pnl-specialview').removeClass('ui-helper-hidden');
$('#calendar').addClass('ui-helper-hidden');
Month = $('#calendarlist-month').val();
Year = $('#calendarlist-year').val();
GetContent("https://www.houstonisd.org//site/UserControls/Calendar/EventListViewWrapper.aspx?ModuleInstanceID=" + ModuleInstanceID + "&Month=" + Month + "&Year=" + Year, "calendarlist-pnl-specialview", 2, '');
}
function ChangeMonth() {
var itemid = $('#calendarlist-month').val();
$('#calendar').find('td.fc-active-day').removeClass('fc-active-day');
var gotoDate = new Date($('#calendarlist-year').val(), (itemid - 1), 1);
$('#calendar').fullCalendar('gotoDate', gotoDate);
if (!$('#calendarlist-pnl-specialview').hasClass('ui-helper-hidden')) {
LoadEventListView(246674, $('#calendar').fullCalendar('getmonth'), $('#calendar').fullCalendar('getyear'));
}
if ($('#calendar-pnl-smcalendar').is(':visible')) {
$('#small-calendar-1').datepicker('setDate', new Date($('#calendarlist-year').val(), parseInt($('#calendarlist-month').val()-1)));
}
ChangeYearDropDown($('#calendarlist-year').val());
// remove table header for ADA compliance
// add tabindex for table cells
fixADA();
}
function ChangeYear(itemid) {
var itemid = $('#calendarlist-year').val();
$('#calendar').find('td.fc-active-day').removeClass('fc-active-day');
var gotoDate = new Date(itemid, ($('#calendarlist-month').val() - 1), 1);
$('#calendar').fullCalendar('gotoDate', gotoDate);
if (!$('#calendarlist-pnl-specialview').hasClass('ui-helper-hidden')) {
LoadEventListView(246674, $('#calendar').fullCalendar('getmonth'), $('#calendar').fullCalendar('getyear'));
}
if ($('#calendar-pnl-smcalendar').is(':visible')) {
$('#small-calendar-1').datepicker('setDate', new Date($('#calendarlist-year').val(), parseInt($('#calendarlist-month').val()-1)));
}
ChangeYearDropDown($('#calendarlist-year').val());
// remove table header for ADA compliance
// add tabindex for table cells
fixADA();
}
function GoToNext() {
$('#calendar').find('td.fc-active-day').removeClass('fc-active-day');
$('#calendar').fullCalendar('next');
if (!$('#calendarlist-pnl-specialview').hasClass('ui-helper-hidden')) {
var month = parseInt($('#calendarlist-month').val()) + 1;
var year = parseInt($('#calendarlist-year').val());
if (month > 12) {
month = 1;
year = year + 1;
}
$('#calendarlist-month').val(month).change();
ChangeYearDropDown(year);
$('#calendarlist-year').val(year).change();
if (!$('#calendarlist-pnl-specialview').hasClass('ui-helper-hidden')) {
LoadEventListView(246674, $('#calendar').fullCalendar('getmonth'), $('#calendar').fullCalendar('getyear'));
}
if ($('#calendar-pnl-smcalendar').is(':visible')) {
$('#small-calendar-1').datepicker('setDate', new Date($('#calendarlist-year').val(), parseInt($('#calendarlist-month').val())-1));
}
}
// remove table header for ADA compliance
// add tabindex for table cells
fixADA();
}
function GoToPrevious() {
$('#calendar').find('td.fc-active-day').removeClass('fc-active-day');
$('#calendar').fullCalendar('prev');
if (!$('#calendarlist-pnl-specialview').hasClass('ui-helper-hidden')) {
var month = $('#calendarlist-month').val() - 1;
var year = $('#calendarlist-year').val();
if (month new Date(EndDate)) {
swalert('The start date must come before the end date.', 'Attention', 'warning', 'ok', '', '', '');
return false;
}
} else if ((EndDate != '1/1/1900') && (StartDate == '1/1/1900')) {
var CurrentDate = new Date();
StartDate = (parseInt(CurrentDate.getMonth()) + 1) + "/" + CurrentDate.getDate() + "/" + CurrentDate.getFullYear();
if (new Date(StartDate) > new Date(EndDate)) {
swalert('The end date must come after the current date.', 'Attention', 'warning', 'ok', '', '', '');
return false;
}
}
if (StartDate != '1/1/1900') {
StartDate += ' 0:00:00';
}
if (EndDate != '1/1/1900') {
EndDate += ' 23:59:59';
}
GetContent("https://www.houstonisd.org//site/UserControls/Calendar/MyEventsListWrapper.aspx?ModuleInstanceID=246674&StartDate=" + StartDate + "&EndDate=" + EndDate, "myeventslist-pnl-detail", 2, '');
}
function RefreshCalendarFilter() {
if ($('#calendar-pnl-calendarfilter-closed').is(':visible')) {
GetContent("https://www.houstonisd.org//site/UserControls/Calendar/CalendarFilterListWrapper.aspx?ModuleInstanceID=" + "246674" + "&Expanded=" + false, "calendar-pnl-calendarfilter-closed", 2);
} else {
GetContent("https://www.houstonisd.org//site/UserControls/Calendar/CalendarFilterListWrapper.aspx?ModuleInstanceID=" + "246674" + "&Expanded=" + true, "calendar-pnl-calendarfilter-open", 2);
}
}
function ToggleCalendarFilter(expanded) {
if (expanded === undefined) {
expanded = $('#calendar-pnl-calendarfilter-closed').is(':visible');
}
if (expanded === true) {
var callback = "$('#calendar-pnl-calendarfilter-closed').fadeOut('fast',function() { $('#calendar-pnl-calendarfilter-open').fadeIn('fast');});";
GetContent("https://www.houstonisd.org//site/UserControls/Calendar/CalendarFilterListWrapper.aspx?ModuleInstanceID=" + "246674" + "&Expanded=" + true, "calendar-pnl-calendarfilter-open", 3, callback);
} else {
var callback = "$('#calendar-pnl-calendarfilter-open').fadeOut('fast',function() { $('#calendar-pnl-calendarfilter-closed').fadeIn('fast');});";
GetContent("https://www.houstonisd.org//site/UserControls/Calendar/CalendarFilterListWrapper.aspx?ModuleInstanceID=" + "246674" + "&Expanded=" + false, "calendar-pnl-calendarfilter-closed", 3, callback);
}
}
function OpenCalendarFilter() {
OpenDialogOverlay("WindowLargeModal", { LoadType: "U", LoadURL: "https://www.houstonisd.org//site/UserControls/Calendar/CalendarFilterNewWrapper.aspx?DomainID=22720&ModuleInstanceID=246674" });
}
function RefreshCategoryFilter() {
if ($('#calendar-pnl-categoryfilter-closed').is(':visible')) {
GetContent("https://www.houstonisd.org//site/UserControls/Calendar/CategoryFilterListWrapper.aspx?ModuleInstanceID=" + "246674" + "&Expanded=" + false, "calendar-pnl-categoryfilter-closed", 2);
} else {
GetContent("https://www.houstonisd.org//site/UserControls/Calendar/CategoryFilterListWrapper.aspx?ModuleInstanceID=" + "246674" + "&Expanded=" + true, "calendar-pnl-categoryfilter-open", 2);
}
}
function ToggleCategoryFilter(expanded) {
if (expanded === undefined) {
expanded = $('#calendar-pnl-categoryfilter-closed').is(':visible');
}
if (expanded === true) {
var callback = "$('#calendar-pnl-categoryfilter-closed').fadeOut('fast',function() { $('#calendar-pnl-categoryfilter-open').fadeIn('fast');});";
GetContent("https://www.houstonisd.org//site/UserControls/Calendar/CategoryFilterListWrapper.aspx?ModuleInstanceID=" + "246674" + "&Expanded=" + true, "calendar-pnl-categoryfilter-open", 3, callback);
} else {
var callback = "$('#calendar-pnl-categoryfilter-open').fadeOut('fast',function() { $('#calendar-pnl-categoryfilter-closed').fadeIn('fast');});";
GetContent("https://www.houstonisd.org//site/UserControls/Calendar/CategoryFilterListWrapper.aspx?ModuleInstanceID=" + "246674" + "&Expanded=" + false, "calendar-pnl-categoryfilter-closed", 3, callback);
}
}
function OpenCategoryFilter() {
OpenDialogOverlay("WindowLargeModal", { LoadType: "U", LoadURL: "https://www.houstonisd.org//site/UserControls/Calendar/CategoryFilterNewWrapper.aspx?DomainID=22720&ModuleInstanceID=246674" });
}
function RemoveCalendarFilter(ModuleInstanceID) {
$('#calendarfilter-ul-list li[itemid=' + ModuleInstanceID + ']').remove();
var strCalendarFilter = GetCookie('CalendarFilter');
strCalendarFilter = strCalendarFilter.replace(ModuleInstanceID + '-', '');
SetCookie('CalendarFilter', strCalendarFilter, 365);
if (!$('#calendarlist-pnl-specialview').hasClass('ui-helper-hidden')) {
LoadEventListView(246674, $('#calendar').fullCalendar('getmonth'), $('#calendar').fullCalendar('getyear'));
} else {
$('#calendar').fullCalendar('refetchEvents');
}
}
function AddCategoryFilter(EventCategoryMasterID) {
$('#categoryfilter-ul-list li[itemid=' + EventCategoryMasterID + ']').remove();
var strCategoryFilter = GetCookie('CategoryFilter');
strCategoryFilter = strCategoryFilter + EventCategoryMasterID + '-';
SetCookie('CategoryFilter', strCategoryFilter, 365);
if (!$('#calendarlist-pnl-specialview').hasClass('ui-helper-hidden')) {
LoadEventListView(246674, $('#calendar').fullCalendar('getmonth'), $('#calendar').fullCalendar('getyear'));
} else {
$('#calendar').fullCalendar('refetchEvents');
}
}
function UpdateCalendarFilter(id) {
var strCalendarFilter = GetCookie('CalendarFilter');
if ($('#calendarfilter-chk-calendar' + id).is(':checked')) {
strCalendarFilter = strCalendarFilter + id + '-';
} else {
strCalendarFilter = strCalendarFilter.replace(id + '-', '');
}
SetCookie('CalendarFilter', strCalendarFilter, 365);
}
function LoadCalendarChannelList() {
GetContent("https://www.houstonisd.org//site/UserControls/Calendar/CalendarChannelListWrapper.aspx?DomainID=" + $('#calendarfilter-hid-siteid').val(), "calendarfilter-pnl-channellist", 2);
LoadCalendarSearchList();
}
function SelectFilteredCalendars() {
var arrValues = GetCookie('CalendarFilter').split('-');
$.each(arrValues, function() {
$('#calendarfilter-chk-calendar' + this).attr('checked', true);
});
}
function LoadCalendarSearchList() {
var DomainID = $('#calendarfilter-hid-channelid').val();
if (DomainID == 0) {
DomainID = $('#calendarfilter-hid-siteid').val();
}
GetContent("https://www.houstonisd.org//site/UserControls/Calendar/CalendarSearchListWrapper.aspx?DomainID=" + DomainID + "&ModuleInstanceID=" + "246674" + "&SearchFor=" + $('#calendarfilternew-txt-search').val(), "calendarfilter-pnl-results", 2, '');
}
function CloseCalendarFilter() {
CloseDialogOverlay('WindowLargeModal');
if (!$('#calendarlist-pnl-specialview').hasClass('ui-helper-hidden')) {
LoadEventListView(246674, $('#calendar').fullCalendar('getmonth'), $('#calendar').fullCalendar('getyear'));
} else {
$('#calendar').fullCalendar('refetchEvents');
}
RefreshCalendarFilter();
}
function CloseCategoryFilter() {
CloseDialogOverlay('WindowLargeModal');
if (!$('#calendarlist-pnl-specialview').hasClass('ui-helper-hidden')) {
LoadEventListView(246674, $('#calendar').fullCalendar('getmonth'), $('#calendar').fullCalendar('getyear'));
} else {
$('#calendar').fullCalendar('refetchEvents');
}
RefreshCategoryFilter();
}
function SelectFilteredCategories() {
var arrValues = GetCookie('CategoryFilter').split('-');
$.each(arrValues, function() {
$('#categoryfilter-chk-category' + this).attr('checked', false);
});
}
function UpdateCategoryFilter(id) {
var strCategoryFilter = GetCookie('CategoryFilter');
if ($('#categoryfilter-chk-category' + id).is(':checked')) {
strCategoryFilter = strCategoryFilter.replace(id + '-', '');
} else {
strCategoryFilter = strCategoryFilter + id + '-';
}
SetCookie('CategoryFilter', strCategoryFilter, 365);
}
function toggleFilters() {
if ($("#calendar-filter-wrapper").hasClass("open")) {
$("#calendar-filter-wrapper").removeClass("open").addClass("closed");
SlideUpControl('calendar-filter-wrapper');
$("#calendar-pnl-filter-toggle-chevron").attr("src", "https://www.houstonisd.org/Static//GlobalAssets/Images/Icons/16/toggle-closed.png");
$("#calendar-pnl-filter-toggle-chevron").attr("alt","Open Customized Calendar View");
$("#calendar-pnl-filter-toggle-chevron").attr("aria-expanded", "false");
} else {
$("#calendar-filter-wrapper").removeClass("closed").addClass("open");
SlideDownControl('calendar-filter-wrapper');
$("#calendar-pnl-filter-toggle-chevron").attr("src", "https://www.houstonisd.org/Static//GlobalAssets/Images/Icons/16/toggle-open.png");
$("#calendar-pnl-filter-toggle-chevron").attr("alt", "Close Customized Calendar View");
$("#calendar-pnl-filter-toggle-chevron").attr("aria-expanded", "true");
}
}
function UpdateCalendarFollow() {
var data = "{ModuleInstanceID: 246674}";
var success = 'ShowNotification("Success! You are now following this calendar in MyView.");';
//var failure = 'CallControllerFailure(result[0].errormessage);';
var failure = 'ShowNotification(result[0].errormessage);';
CallController("https://www.houstonisd.org//site/UserControls/Calendar/CalendarController.aspx/UpdateCalendarFollow", data, success, failure);
}
} else {
function showHideComments(view) {
$("#calendar-pnl-calendarcontainer-246674 .app-level-social-commenting")[view === 'event' ? 'hide' : 'show']();
$("#calendar-pnl-calendarcontainer-246674 .app-level-social-rating")[view === 'event' ? 'hide' : 'show']();
}
$("#calendar-pnl-calendarcontainer-246674 .app-level-social-commenting, #calendar-pnl-calendarcontainer-246674 .app-level-social-rating").hide();
Bb.WCM.UI.Calendar('246674', { attachTo: document.getElementById('calendar-newplaceholder-246674'),
name: '', customized: true, pageID: '166894', domainID: '42773', isUserLogged: false, showRssBtn: false, GoogleApiKey: 'AIzaSyD0SvOivJCsw4_mxiWCnj7RBd0Kwfh4Wmc'})
.then (
function (cal) {
showHideComments(cal.view);
cal.on("viewChange", function (view) {
showHideComments(view);
});
cal.on("interaction", function (category, action, label) {
if (!window.AddAnalyticsEvent) {
var loadAttempts = 0;
var checker = setInterval( function () {
loadAttempts++;
if (window.AddAnalyticsEvent) {
AddAnalyticsEvent(category, action, label);
clearInterval(checker);
}
if (loadAttempts >= 10) {
clearInterval(checker);
}
}, 300);
} else {
AddAnalyticsEvent(category, action, label);
}
});
}
);
}