Sorting by

×

Fayette County Public Schools


‘ + year + ”).insertBefore(“#sel-calendarlist-year li:first”); addedYear = true; } else if (year > parseInt($(‘#sel-calendarlist-year li:last’).attr(‘itemid’))) { $(“#sel-calendarlist-year”).append(‘

  • ‘ + year + ”); addedYear = true; } $(‘#calendarlist-year’).val(year); Month = $(‘#calendarlist-month’).val(); Year = $(‘#calendarlist-year’).val(); if($(‘#sel-calendarlist-month li.selected’).attr(‘itemid’) != Month) { $(‘#sel-calendarlist-month li.selected’).attr(‘class’, ”); $(‘#sel-calendarlist-month li[itemid=”‘+Month+'”]’).addClass(‘selected’); $(‘#selectedsel-calendarlist-month’).children(‘span’).text($(‘#sel-calendarlist-month li.selected’).text()); } if($(‘#sel-calendarlist-month li.selected’).text() != $(‘#selectedsel-calendarlist-month’).children(‘span’).text()) { $(‘#selectedsel-calendarlist-month’).children(‘span’).text($(‘#sel-calendarlist-month li.selected’).text()); } if(addedYear) { attachClickEvents(‘sel-calendarlist-year’, $(‘#sel-calendarlist-year’).find(‘li’), $(‘#calendarlist-year’), $(‘#selectedsel-calendarlist-year’)); $(‘#sel-calendarlist-year li[itemid=”‘+Year+'”]’).not(‘.noselect’).click(function(e) { ChangeYear(); $(‘#selectedsel-calendarlist-year’).children(‘span’).text(Year); }); } if($(‘#sel-calendarlist-year li.selected’).attr(‘itemid’) != Year) { $(‘#sel-calendarlist-year li.selected’).attr(‘class’, ”); $(‘#sel-calendarlist-year li[itemid=”‘+Year+'”]’).addClass(‘selected’); $(‘#selectedsel-calendarlist-year’).children(‘span’).text($(‘#sel-calendarlist-year li.selected’).text()); } } function ChangeView(type, eDate) { if (!$(‘#calendarlist-pnl-specialview’).hasClass(‘ui-helper-hidden’)) { $(‘#calendarlist-pnl-specialview’).addClass(‘ui-helper-hidden’); $(‘#calendar’).removeClass(‘ui-helper-hidden’); setTimeout(“$(‘#calendar’).fullCalendar(‘refetchEvents’);”, 500); } if (eDate !== undefined) { // clicked ‘more’ link var gotoDate = new Date(eDate.getFullYear(), eDate.getMonth(), eDate.getDate()); $(‘#calendar’).fullCalendar(‘gotoDate’, gotoDate); $(‘#calendar’).fullCalendar(‘changeView’, type); } else if ($(‘#calendar’).find(‘.fc-active-day’).length > 0) { // active day var activeDay = $(‘td.fc-active-day’); var gotoDate = new Date(activeDay.attr(‘y’), activeDay.attr(‘m’), activeDay.attr(‘d’)); $(‘#calendar’).fullCalendar(‘gotoDate’, gotoDate); $(‘#calendar’).fullCalendar(‘changeView’, type); } else { // go to view w/o changing var gotoDate = new Date($(‘#calendarlist-year’).val(), ($(‘#calendarlist-month’).val() – 1), 1); $(‘#calendar’).fullCalendar(‘gotoDate’, gotoDate); $(‘#calendar’).fullCalendar(‘changeView’, type); } // remove table header for ADA compliance // add tabindex for table cells fixADA(); } function LoadEventDetail(eventDateID, userRegID, isEdit) { (userRegID === undefined ? userRegID = 0 : ”); (isEdit === undefined ? isEdit = false : ”); var isListView = !$(‘#calendarlist-pnl-specialview’).hasClass(‘ui-helper-hidden’) var currentView = $(‘#calendar’).fullCalendar(‘getView’); if (!$(‘#calendarlist-pnl-specialview’).hasClass(‘ui-helper-hidden’)) { currentView = ‘list’; } else { currentView = currentView.name; } /*var currentDate = $(‘#calendar’).fullCalendar(‘getdate’); var currentMonth = $(‘#calendar’).fullCalendar(‘getmonth’); var currentYear = $(‘#calendar’).fullCalendar(‘getyear’);*/ var currentDate = $(‘#calendar’).fullCalendar(‘getDate’); var currentMonth = $.fullCalendar.formatDate(currentDate, ‘M’); var currentYear = $.fullCalendar.formatDate(currentDate, ‘yyyy’); currentMonth = currentMonth – 1; parent.location.href = “https://www.fcps.net//site/Default.aspx?PageID=2&PageType=17&DomainID=4&ModuleInstanceID=1&EventDateID=” + eventDateID + “&CurrentView=” + currentView; //”&UserRegID=” + userRegID + “&IsEdit=” + isEdit; } function ShowEventOverlay(obj, eventDateID, eventID, recurring, title, start, end, noEndTime) { $this = $(obj); $(‘#calendar-event-overlay’).remove(); // get date for display var startDate = (start.getMonth() + 1) + ‘/’ + start.getDate() + ‘/’ + start.getFullYear(); var endDate = “”; //if (end !== null) { endDate = (end.getMonth() + 1) + ‘/’ + end.getDate() + ‘/’ + end.getFullYear(); //} else endDate = startDate; var strDate = “”; var allDay = false; //var noEndTime = false; // get times var startHour = start.getHours().toString(); var startMinute = start.getMinutes().toString(); var startTime = (startHour < 12 ? (startHour.length == 2 ? startHour : (startHour == "0" ? "12" : "0" + startHour)) + ":" + (startMinute.length == 2 ? startMinute : "0" + startMinute) + " AM" : ((startHour - 12).toString().length == 2 ? startHour - 12 : (startHour - 12 == 0 ? "12" : "0" + (startHour - 12))) + ":" + (startMinute.length == 2 ? startMinute : "0" + startMinute) + " PM"); var endHour = ""; var endMinute = ""; if (end !== null) { endHour = end.getHours().toString(); endMinute = end.getMinutes().toString(); } else { endHour = "00"; endMinute = "00"; } var endTime = (endHour 70) { title = title.substring(0, 69) + '...'; } $('body').append('' + title.replace(/&/g, '&amp').replace(/"/g, '"').replace(/, '<').replace(/>/g, ‘>’) + “

    ” + strDate + ‘]]>

  • ‘);

    $(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.fcps.net//site/UserControls/Calendar/MyEventsListWrapper.aspx?ModuleInstanceID=1&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.fcps.net//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.fcps.net//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(1, $(‘#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(1, $(‘#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(1, $(‘#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.fcps.net//site/UserControls/Calendar/MyEventsListWrapper.aspx?ModuleInstanceID=1&StartDate=” + StartDate + “&EndDate=” + EndDate, “myeventslist-pnl-detail”, 2, ”);
    }

    function RefreshCalendarFilter() {
    if ($(‘#calendar-pnl-calendarfilter-closed’).is(‘:visible’)) {
    GetContent(“https://www.fcps.net//site/UserControls/Calendar/CalendarFilterListWrapper.aspx?ModuleInstanceID=” + “1” + “&Expanded=” + false, “calendar-pnl-calendarfilter-closed”, 2);
    } else {
    GetContent(“https://www.fcps.net//site/UserControls/Calendar/CalendarFilterListWrapper.aspx?ModuleInstanceID=” + “1” + “&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.fcps.net//site/UserControls/Calendar/CalendarFilterListWrapper.aspx?ModuleInstanceID=” + “1” + “&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.fcps.net//site/UserControls/Calendar/CalendarFilterListWrapper.aspx?ModuleInstanceID=” + “1” + “&Expanded=” + false, “calendar-pnl-calendarfilter-closed”, 3, callback);
    }
    }

    function OpenCalendarFilter() {
    OpenDialogOverlay(“WindowLargeModal”, { LoadType: “U”, LoadURL: “https://www.fcps.net//site/UserControls/Calendar/CalendarFilterNewWrapper.aspx?DomainID=4&ModuleInstanceID=1” });
    }

    function RefreshCategoryFilter() {
    if ($(‘#calendar-pnl-categoryfilter-closed’).is(‘:visible’)) {
    GetContent(“https://www.fcps.net//site/UserControls/Calendar/CategoryFilterListWrapper.aspx?ModuleInstanceID=” + “1” + “&Expanded=” + false, “calendar-pnl-categoryfilter-closed”, 2);
    } else {
    GetContent(“https://www.fcps.net//site/UserControls/Calendar/CategoryFilterListWrapper.aspx?ModuleInstanceID=” + “1” + “&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.fcps.net//site/UserControls/Calendar/CategoryFilterListWrapper.aspx?ModuleInstanceID=” + “1” + “&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.fcps.net//site/UserControls/Calendar/CategoryFilterListWrapper.aspx?ModuleInstanceID=” + “1” + “&Expanded=” + false, “calendar-pnl-categoryfilter-closed”, 3, callback);
    }
    }

    function OpenCategoryFilter() {
    OpenDialogOverlay(“WindowLargeModal”, { LoadType: “U”, LoadURL: “https://www.fcps.net//site/UserControls/Calendar/CategoryFilterNewWrapper.aspx?DomainID=4&ModuleInstanceID=1″ });
    }

    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(1, $(‘#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(1, $(‘#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.fcps.net//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.fcps.net//site/UserControls/Calendar/CalendarSearchListWrapper.aspx?DomainID=” + DomainID + “&ModuleInstanceID=” + “1” + “&SearchFor=” + $(‘#calendarfilternew-txt-search’).val(), “calendarfilter-pnl-results”, 2, ”);
    }

    function CloseCalendarFilter() {
    CloseDialogOverlay(‘WindowLargeModal’);

    if (!$(‘#calendarlist-pnl-specialview’).hasClass(‘ui-helper-hidden’)) {
    LoadEventListView(1, $(‘#calendar’).fullCalendar(‘getmonth’), $(‘#calendar’).fullCalendar(‘getyear’));
    } else {
    $(‘#calendar’).fullCalendar(‘refetchEvents’);
    }

    RefreshCalendarFilter();
    }

    function CloseCategoryFilter() {
    CloseDialogOverlay(‘WindowLargeModal’);

    if (!$(‘#calendarlist-pnl-specialview’).hasClass(‘ui-helper-hidden’)) {
    LoadEventListView(1, $(‘#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.fcps.net/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.fcps.net/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: 1}”;
    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.fcps.net//site/UserControls/Calendar/CalendarController.aspx/UpdateCalendarFollow”, data, success, failure);
    }
    } else {
    function showHideComments(view) {
    $(“#calendar-pnl-calendarcontainer-1 .app-level-social-commenting”)[view === ‘event’ ? ‘hide’ : ‘show’]();
    $(“#calendar-pnl-calendarcontainer-1 .app-level-social-rating”)[view === ‘event’ ? ‘hide’ : ‘show’]();
    }

    $(“#calendar-pnl-calendarcontainer-1 .app-level-social-commenting, #calendar-pnl-calendarcontainer-1 .app-level-social-rating”).hide();

    Bb.WCM.UI.Calendar(‘1’, { attachTo: document.getElementById(‘calendar-newplaceholder-1’),
    name: ”, customized: true, pageID: ‘2’, domainID: ‘4’, isUserLogged: false, showRssBtn: false})
    .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);
    }
    });
    }
    );
    }

    Source