LCMCISD: Little Cypress-Mauriceville High School (2024)

×Info! PRESS ENTER TO JUMP TO TOP OF '+ sameTypeWidgetRowNum + ' (FACEBOOK FEED), SHIFT+TAB TO CONTINUE INTO FB FEED, OR TAB TO CONTINUE

×Info! PRESS ENTER TO SKIP PAST '+ sameTypeWidgetRowNum + ' (TWITTER FEED), OR TAB TO CONTINUE

×Info! PRESS ENTER TO JUMP TO TOP OF '+ sameTypeWidgetRowNum + ' (TWITTER FEED), SHIFT+TAB TO CONTINUE INTO TWITTER FEED, OR TAB TO CONTINUE

'; var calendarLeftIcons = ''; //add print button calendarLeftIcons += ''; //add email button calendarLeftIcons += ''; //add subscribe button calendarLeftIcons += ''; //can't add custom classes, ids, glyphicons with fullcalendar customButtons //append button onto left button bar (fc-left) $('#fullpagelesson-calendar-content-19660 .fc-left').each(function(e) { $(this).append(calendarListToggle); }); $('#fullpagelesson-calendar-content-19660 .fc-right').each(function(e) { $(this).prepend(calendarLeftIcons); }); //Loop through each calendar and give sub elements ids so can access later $('.calendarDisplay').each(function(e) { var calendar_id = $(this).data('calendar'); var foo = $(this); if(calendar_id) { if(calendar_id && $.isNumeric(calendar_id)) { //loop through fc-view-container of current calendar, assign an id to toggle display //and append listView div to display list $(foo.children('.fc-view-container')).each(function(e) { if($(this).hasClass('fc-view-container')) { $(this).attr('id', 'fc-view-container_' + calendar_id); } }); foo.append('

'); $('#listView_' + calendar_id).hide(); } } }); //On click of icon, change active classes $(document).delegate('.listIcon', "click", function(event, state){ var calendar_id = $(this).data('calendar'); if(calendar_id) { $('#listIcon_' + calendar_id).addClass('fc-state-active'); if($('#calIcon_' + calendar_id).hasClass('fc-state-active')) { $('#calIcon_' + calendar_id).removeClass('fc-state-active'); } $('#fc-view-container_' + calendar_id).hide(); $('#listView_' + calendar_id).show(); //$('#listView_' + calendar_id).html('

LCMCISD: Little Cypress-Mauriceville High School (1)

'); //populate correct events based on current day var calGetDates = $('#fullpagelesson-calendar-content-19660').fullCalendar('getCalendar'); var startUnix = moment(calGetDates.view.start._d).unix() * 1000; var endUnix = moment(calGetDates.view.end._d).unix() * 1000; //first hour of next day 00:00:00 in GMT var listOutput = ''; var detailsEventCounter = 0; if(calendars) { $(calendars).each(function(i, val) { if(parseInt(val['id']) == parseInt('19660')) { //loop through every day from start->end, find every event that occurs on that day var days = date_diff_indays(startUnix, endUnix); //counter for loop var currentDay = new Date(startUnix); //incremented placeholder var today = moment().format('L'); //current day is one before start, increment once currentDay.setDate(currentDay.getDate() + 1); if(days && !isNaN(days)) { //store each days events in an array to sort by time before populating day var dayEvents = {}; var currentDayCounter = 0; for(var i = 0; i <= days; i++) { //loop through events to see if any occur on current day if(val['events']) { //new day, sort all events for previous day, clear array, if(i != currentDayCounter) { //if dayEvents has events, display non-timed events first, //sort the events that are timed, display timed events if(!jQuery.isEmptyObject(dayEvents)) { var nonTimedEvents = {}; var displayEventCounter = 0; Object.keys(dayEvents).forEach(function(i,val) { //add to display events if no time, remove from array if(!dayEvents[i]['start_time'] && !dayEvents[i]['end_time']) { nonTimedEvents[displayEventCounter] = dayEvents[i]['html_output']; delete dayEvents[i]; displayEventCounter++; } else if(dayEvents[i]['start_time']) { if(dayEvents[i]['start_time'] && dayEvents[i]['start_date']) { var startDateTime = dayEvents[i]['start_date'] + ' ' + dayEvents[i]['start_time']; dayEvents[i]['start_date_time'] = moment(startDateTime).unix() * 1000; } } }); //sort any remaining (timed) items in array if(!jQuery.isEmptyObject(dayEvents)) { var sortTimes = []; //compile simple array of id and timestamp for sorting Object.keys(dayEvents).forEach(function(i,val) { if(dayEvents[i]['start_date_time']) { sortTimes.push([dayEvents[i]['start_date_time'], dayEvents[i]['id']]); } }); sortTimes.sort(sortFunction); function sortFunction(a, b) { if (a[0] === b[0]) { return 0; } else { return (a[0] < b[0]) ? -1 : 1; } } } else { var sortTimes = []; } if(!jQuery.isEmptyObject(nonTimedEvents) || sortTimes && sortTimes.length > 0) { //due to currentDay being evaulated at the end of the loop and logic executes when //a new day occurs, must use the previous day var currentDayTmp = new Date(currentDay); var previousDay = new Date(currentDayTmp.setDate(currentDayTmp.getDate() - 1)); var monthName = moment(previousDay).format('MMM'); var dayName = moment(previousDay).format('ddd'); //if today, make box green if(today == moment(previousDay).format('L')) { var boxColor = 'successBox'; } else { var boxColor = 'lightGrayBox'; } listOutput += '

'; listOutput += '

'; listOutput += monthName; listOutput += '

' + previousDay.getDate() + '

'; listOutput += dayName; listOutput += '

'; listOutput += '

'; var eventPerDayCounter = 1; //list untimed events if(!jQuery.isEmptyObject(nonTimedEvents)) { var nonTimedLength = Object.keys(nonTimedEvents).length; Object.keys(nonTimedEvents).forEach(function(i,val) { listOutput += nonTimedEvents[i]; //If not last item, put divider if(eventPerDayCounter != nonTimedLength) { listOutput += '

'; } eventPerDayCounter++; }); } if(sortTimes && sortTimes.length > 0) { var sortedPerDay = 1; //add divider if there are any non-timed events before the timed events if(eventPerDayCounter != 1) { listOutput += '

'; } //loop through sorted times to display them in chronological order by start time $.each(sortTimes, function(i, val) { Object.keys(dayEvents).forEach(function(k,obj) { if(dayEvents[k]['id'] && dayEvents[k]['id'] == sortTimes[i][1]) { listOutput += dayEvents[k]['html_output']; //If not last item, put divider if(sortedPerDay != sortTimes.length) { listOutput += '

'; } sortedPerDay++; } }); }); } listOutput += '

'; listOutput += '

'; listOutput += '

'; } } dayEvents = {}; currentDayCounter = i; } var currentUnix = currentDay.getTime() / 1000; //convert to seconds which moment() uses var eventOutput = ''; $(val['events']).each(function(k, obj) { //have to get the start AND end of start day to correctly see if on that day var startOfDayStart = moment(obj['start_date']).startOf('day'); var eventStartUnixDayBegin = startOfDayStart.unix(); var endOfDayStart = moment(obj['start_date']).endOf('day'); var eventStartUnixDayEnd = endOfDayStart.unix(); //have to get the start AND end of end day to correctly see if on that day var startOfDayEnd = moment(obj['end_date']).startOf('day'); var eventEndUnixDayBegin = startOfDayEnd.unix(); var endOfDayEnd = moment(obj['end_date']).endOf('day'); var eventEndUnixDayEnd = endOfDayEnd.unix(); //if all day it spans into the next day time wise since timezone //isn't being calculated, fix for list view by taking off 12 hours so //it doesn't span into the next day if(obj['allDay'] == true) { eventEndUnixDayBegin -= 43200; eventEndUnixDayEnd -= 43200; } if((eventStartUnixDayBegin <= currentUnix && eventEndUnixDayEnd >= currentUnix) || //multi day event in middle (eventStartUnixDayBegin <= currentUnix && eventStartUnixDayEnd >= currentUnix) || //event starts this day (eventEndUnixDayBegin <= currentUnix && eventEndUnixDayEnd >= currentUnix)) { //event ends this day //Second event on this day, divide eventOutput = ''; eventOutput += '

'; eventOutput += ''; eventOutput += ''; eventOutput += ''; eventOutput += ''; eventOutput += ''; if(obj['attachment']) { var attachmentOutput = ''; //all attachments start with *_* if(obj['attachment'].indexOf('*_*') >= 0) { var attachmentsArr = obj['attachment'].split('*_*'); $(attachmentsArr).each(function(i,val) { if(val.indexOf('!_!') >= 0) { var attachmentInfo = val.split('!_!'); if(attachmentInfo && attachmentInfo[0] && attachmentInfo[1]) { if(attachmentOutput != '') { attachmentOutput += '
'; } attachmentOutput += ''; attachmentOutput += ''; //figure out if document link or url if(attachmentInfo[1].indexOf('/') != -1 & attachmentInfo[1].indexOf('/') != 0) { var attachmentURL = attachmentInfo[1].split('/'); var attachmentURLLength = attachmentURL.length; //if name after last '/' contains a '.' assume document if(attachmentURL[attachmentURLLength - 1] & decodeURI(attachmentURL[attachmentURLLength - 1]).indexOf('.') != -1) { attachmentOutput += decodeURI(attachmentURL[attachmentURLLength - 1]); } else { //link attachmentOutput += attachmentInfo[1]; } } else { attachmentOutput += attachmentInfo[0]; } attachmentOutput += ''; } } }); } if(attachmentOutput) { eventOutput += ''; eventOutput += ''; eventOutput += ''; } } if(obj['standard'] == 'true') { eventOutput += ''; eventOutput += ''; eventOutput += ''; } if(obj['description'] && obj['description'].trim()) { obj['description'] = obj['description'].trim(); eventOutput += ''; eventOutput += ''; eventOutput += ''; } eventOutput += ''; eventOutput += '
'; eventOutput += '

'; eventOutput += ''; eventOutput += obj['title']; eventOutput += ''; eventOutput += '

'; //don't show times if all day if(obj['all_day'] != true ) { eventOutput += '

'; eventOutput += '
'; //they did not set an end time, defaults to 11:59:59 if(obj['end'] == null || moment(obj['end']).format('h:mm:ss') == '11:59:59') { eventOutput += moment(obj['start']).format('h:mm a'); } else if(obj['end'] !== null) { eventOutput += moment(obj['start']).format('h:mm a') + ' to ' + moment(obj['end']).format('h:mm a'); } eventOutput += '

'; } eventOutput += '
'; if(obj['calendar_name']) { if(parseInt('19660') != obj['calendar_id']) { if(obj['calendar_name'].indexOf('Lesson Plan: ') >= 0) { var title = obj['calendar_name'].replace('Lesson Plan: ', ''); } else { var title = obj['calendar_name']; } eventOutput += '


'; eventOutput += '' + title + ''; eventOutput += '

'; } } else if(obj['url']) { eventOutput += '

'; eventOutput += '
'; eventOutput += ''; eventOutput += ''; if(obj['url'].length > 30) { eventOutput += obj['url'].substring(0, 29) + '...'; } else { eventOutput += obj['url']; } eventOutput += ''; eventOutput += '

'; } eventOutput += '
'; eventOutput += '
'; eventOutput += attachmentOutput; eventOutput += '
'; eventOutput += '
'; eventOutput += ''; eventOutput += '
'; //show full details in day view regardless of size if(dayView == true) { eventOutput += '
'; eventOutput += '

'; eventOutput += '

' + obj['description'] + '

'; eventOutput += '

'; eventOutput += '

'; eventOutput += '

' + obj['description'] + '

'; eventOutput += '

'; } else { if(obj['description'].indexOf('

'; //add event to day array for sorting if(i == currentDayCounter) { dayEvents[obj['id']] = { 'id' : obj['id'], 'html_output' : '

' + eventOutput + '

', 'start' : obj['start'], 'start_date' : obj['start_date'], 'start_time' : obj['start_time'], 'end' : obj['end'], 'end_date' : obj['end_date'], 'end_time' : obj['end_time'], 'all_day' : obj['all_day'] }; } detailsEventCounter++; //used to assign unique ids to "view more details" on a multi day event } }); } //increment to next day currentDay.setDate(currentDay.getDate() + 1); } } } }); } if(listOutput && listOutput.length > 0) { listOutput = '

    ' + listOutput + '

'; $('#listView_' + calendar_id).html(listOutput); } else { //no events var listOutput = '

    '; listOutput += '

    '; listOutput += '

    No events Occurred.

    '; listOutput += '

    '; listOutput += '

    '; listOutput += '

'; $('#listView_' + calendar_id).html(listOutput); } } }); //calculate days between two dates var date_diff_indays = function(date1, date2) { dt1 = new Date(date1); dt2 = new Date(date2); return Math.floor((Date.UTC(dt2.getFullYear(), dt2.getMonth(), dt2.getDate()) - Date.UTC(dt1.getFullYear(), dt1.getMonth(), dt1.getDate()) ) /(1000 * 60 * 60 * 24)); } //On click of icon, change active classes $(document).delegate('.calendarIcon', "click", function(event, state){ var calendar_id = $(this).data('calendar'); var id = $(this).attr('id'); if(calendar_id) { $('#calIcon_' + calendar_id).addClass('fc-state-active'); if($('#listIcon_' + calendar_id).hasClass('fc-state-active')) { $('#listIcon_' + calendar_id).removeClass('fc-state-active'); } //change view from list to calendar, show calendar, hide list $('#fc-view-container_' + calendar_id).show(); $('#listView_' + calendar_id).hide(); } }); $(document).delegate('.printIcon', 'click', function(event, state) { var startDate = $('#fullpagelesson-calendar-content-19660').fullCalendar('getView').intervalStart.unix(); var endDate = $('#fullpagelesson-calendar-content-19660').fullCalendar('getView').intervalEnd.unix(); var calendar_id = $(this).data('calendar'); if(startDate && endDate && calendar_id) { if($(this).hasClass('emailIcon')) { window.location.href = '/page/page_lesson_print?calendar_id=' + calendar_id + '&start_date=' + startDate + '&end_date=' + endDate + '&email=true'; } else { window.location.href = '/page/page_lesson_print?calendar_id=' + calendar_id + '&start_date=' + startDate + '&end_date=' + endDate; } } }); $(document).delegate('.subscribeIcon', "click", function(event, state){ var calendar_id = $(this).data('calendar'); window.location.href = '/page/subscribelp?calendar_id=' + calendar_id; }); //if linked from sidebar module change view and date to get vars &view=day &date=2016-08-11 if('' && '') { switch('') { case 'day': $('#fullpagelesson-calendar-content-19660').fullCalendar('changeView', 'agendaDay'); $('#fullpagelesson-calendar-content-19660').fullCalendar('gotoDate', ''); break; } } //On click of Show More Details, hide shortened details, show full details $(document).delegate('.showFullDetails', "click", function(event, state){ var event_id = $(this).data('event'); var counter = $(this).data('counter'); if(event_id) { $('#fullLessonDetails' + event_id + '_' + counter).removeClass('hidden'); $('#shortenedLessonDetails' + event_id + '_' + counter).addClass('hidden'); } }); //On click of Show Less Details, hide full details, show shortened details $(document).delegate('.showLessDetails', "click", function(event, state){ var event_id = $(this).data('event'); var counter = $(this).data('counter'); if(event_id) { $('#fullLessonDetails' + event_id + '_' + counter).addClass('hidden'); $('#shortenedLessonDetails' + event_id + '_' + counter).removeClass('hidden'); } }); });

LCMCISD: Little Cypress-Mauriceville High School (2024)

References

Top Articles
Latest Posts
Article information

Author: Wyatt Volkman LLD

Last Updated:

Views: 6042

Rating: 4.6 / 5 (46 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Wyatt Volkman LLD

Birthday: 1992-02-16

Address: Suite 851 78549 Lubowitz Well, Wardside, TX 98080-8615

Phone: +67618977178100

Job: Manufacturing Director

Hobby: Running, Mountaineering, Inline skating, Writing, Baton twirling, Computer programming, Stone skipping

Introduction: My name is Wyatt Volkman LLD, I am a handsome, rich, comfortable, lively, zealous, graceful, gifted person who loves writing and wants to share my knowledge and understanding with you.