1046 lines
36 KiB
JavaScript
1046 lines
36 KiB
JavaScript
var perfEntries = performance.getEntriesByType("navigation");
|
|
if (perfEntries[0].type === "back_forward") {
|
|
location.reload(true);
|
|
}
|
|
|
|
var numCheckable = 0, numChecked = 0, idcounter = '';
|
|
var commonLocalisation = null;
|
|
|
|
function showCalendar() {
|
|
var calendarSelectorStyle = document.getElementById('calendarSelectors').style;
|
|
if (calendarSelectorStyle.display == 'inline-block' || calendarSelectorStyle.display == 'block') {
|
|
calendarSelectorStyle.display = 'none';
|
|
document.getElementById('subheader').style.bottom = '';
|
|
document.getElementById('a_calendar').className = 'button';
|
|
}
|
|
else {
|
|
if (isie7 || isie6 || (document.documentMode < 8))
|
|
calendarSelectorStyle.display = 'inline-block';
|
|
else
|
|
calendarSelectorStyle.display = 'block';
|
|
var height = document.getElementById('calendarSelectors').clientHeight - 5;
|
|
document.getElementById('subheader').style.bottom = -height + 'px';
|
|
document.getElementById('a_calendar').className = 'button active';
|
|
}
|
|
}
|
|
|
|
function inviteFriends(eventId) {
|
|
document.cookie = "emailpageUrlReferrer=" + location.href;
|
|
window.location.href = "/EmailPage";
|
|
}
|
|
|
|
function eventDetails(id, thisDay, thisMonth, thisYear, calType, modal) {
|
|
if (modal)
|
|
closeModalDialog('editItemBehavior');
|
|
if (event.currentTarget.href && window.FeatureToggles.isActive("CMS.Calendar.LinkToWebAddressAdjustmentsAndNotifications")) {
|
|
if (event.currentTarget.target == '_blank')
|
|
window.open(event.currentTarget.href, '_blank');
|
|
else
|
|
window.location.href = event.currentTarget.href;
|
|
}
|
|
else {
|
|
document.aspnetForm.action = '/Calendar.aspx?EID=' + id + '&month=' + thisMonth + '&year=' + thisYear + '&day=' + thisDay + '&calType=' + calType;
|
|
document.aspnetForm.submit();
|
|
}
|
|
}
|
|
|
|
function expandCollapseEventMoreDetails(eventID, detailsText) {
|
|
if (document.getElementById(eventID).style.display == 'none') {
|
|
document.getElementById('evnt' + eventID).setAttribute('title', 'Collapse ' + detailsText);
|
|
document.getElementById(eventID).style.display = 'block';
|
|
document.getElementById('a_' + eventID).innerHTML = '▼ ' + detailsText;
|
|
}
|
|
else {
|
|
document.getElementById('evnt' + eventID).setAttribute('title', 'Expand ' + detailsText);
|
|
document.getElementById(eventID).style.display = 'none';
|
|
document.getElementById('a_' + eventID).innerHTML = '► ' + detailsText;
|
|
}
|
|
}
|
|
|
|
function findPos(obj) {
|
|
var curleft = curtop = 0;
|
|
if (obj.offsetParent) {
|
|
do {
|
|
curleft += obj.offsetLeft;
|
|
curtop += obj.offsetTop;
|
|
} while (obj = obj.offsetParent);
|
|
}
|
|
return curleft;
|
|
}
|
|
|
|
function showDetailsBox(id, counter, isIcalEvent) {
|
|
|
|
// logic for shifting the Detail box to left if there isn't space on the right side.
|
|
var showDetailsText = 'showDetails';
|
|
var parentdivText = 'parentdiv';
|
|
var icalEventText = 'ICalEvent_';
|
|
|
|
if (isIcalEvent) {
|
|
showDetailsText = icalEventText + showDetailsText;
|
|
parentdivText = icalEventText + parentdivText
|
|
}
|
|
var moreActionsDiv = document.getElementById(showDetailsText + id + '_' + counter);
|
|
//get the element distance from right
|
|
var leftpos = findPos(moreActionsDiv.parentNode);
|
|
if (document.body.scrollWidth - leftpos < 327) {
|
|
moreActionsDiv.className = moreActionsDiv.className.replace(/detailsTooltip/, 'detailsTooltip flip');
|
|
moreActionsDiv.style.left = moreActionsDiv.style.width - 270 + 'px';
|
|
}
|
|
else {
|
|
moreActionsDiv.className = moreActionsDiv.className.replace(/detailsTooltip flip/, 'detailsTooltip');
|
|
moreActionsDiv.style.left = '0px';
|
|
}
|
|
// logic for shifting the Detail box to left if there isn't space on the right side ends.
|
|
|
|
if (document.getElementById(showDetailsText + idcounter)) {
|
|
document.getElementById(showDetailsText + idcounter).style.display = 'none';
|
|
document.getElementById(parentdivText + idcounter).style.zIndex = '1';
|
|
document.getElementById(parentdivText + idcounter).style.position = '';
|
|
}
|
|
|
|
moreActionsDiv.style.display = 'block';
|
|
var height = document.getElementById(parentdivText + id + '_' + counter).clientHeight + 2;
|
|
moreActionsDiv.style.bottom = height + 'px';
|
|
document.getElementById(parentdivText + id + '_' + counter).style.zIndex = '5';
|
|
document.getElementById(parentdivText + id + '_' + counter).style.position = 'relative';
|
|
idcounter = id + '_' + counter;
|
|
|
|
if ($('#CalendarContent').hasClass('maxWidth650px')) {
|
|
document.location.hash = "";
|
|
document.location.hash = "#eventDetail";
|
|
}
|
|
|
|
//Check if anchor link is already added. If not then add it.
|
|
if (isIcalEvent) {
|
|
var anchorLinkAdded = $('p#p_' + id).children('a').length > 0;
|
|
if (!anchorLinkAdded)
|
|
$('p#p_' + id).urlToLink({ target: '_blank' });
|
|
}
|
|
|
|
}
|
|
|
|
function hideDetailsBox(id, counter, isIcalEvent) {
|
|
var showDetailsText = 'showDetails';
|
|
var parentdivText = 'parentdiv';
|
|
var icalEventText = 'ICalEvent_';
|
|
|
|
if (isIcalEvent) {
|
|
showDetailsText = icalEventText + showDetailsText;
|
|
parentdivText = icalEventText + parentdivText
|
|
}
|
|
|
|
if (document.getElementById(showDetailsText + id + '_' + counter)) {
|
|
document.getElementById(showDetailsText + id + '_' + counter).style.display = 'none';
|
|
document.getElementById(parentdivText + id + '_' + counter).style.zIndex = '1';
|
|
document.getElementById(parentdivText + id + '_' + counter).style.position = '';
|
|
}
|
|
}
|
|
|
|
function removeDefaultStartEndDate(elem) {
|
|
|
|
if (elem.value == 'dd/mm/yyyy')
|
|
elem.value = '';
|
|
else if (elem.value == '')
|
|
elem.value = 'dd/mm/yyyy';
|
|
}
|
|
|
|
function removeDefaultStartDate(elem) {
|
|
if (elem.value == 'Start Date')
|
|
elem.value = '';
|
|
else if (elem.value == '')
|
|
elem.value = 'Start Date';
|
|
}
|
|
|
|
function removeDefaultEndDate(elem) {
|
|
if (elem.value == 'End Date')
|
|
elem.value = '';
|
|
else if (elem.value == '')
|
|
elem.value = 'End Date';
|
|
}
|
|
|
|
function removeDefaultSearchTerm(elem) {
|
|
if (elem.value == 'Search')
|
|
elem.value = '';
|
|
else if (elem.value == '')
|
|
elem.value = 'Search';
|
|
}
|
|
|
|
function changeView(view, thisDay, thisMonth, thisYear, CID, keywords, startDate, endDate) {
|
|
//optional params
|
|
keywords = typeof keywords !== 'undefined' ? keywords : '';
|
|
startDate = typeof startDate !== 'undefined' ? startDate : '';
|
|
endDate = typeof endDate !== 'undefined' ? endDate : '';
|
|
document.aspnetForm.calendarView.value = view;
|
|
document.aspnetForm.action = '/calendar.aspx?' + (thisMonth ? 'month=' + thisMonth + '&' : '') + (thisYear ? 'year=' + thisYear + '&' : '') + (thisDay && view == 'week' ? 'day=' + thisDay + '&' : '') + (CID ? 'CID=' + CID + '&' : '') + 'Keywords=' + keywords + '&startDate=' + startDate + '&enddate=' + endDate + '&';
|
|
document.aspnetForm.submit();
|
|
}
|
|
|
|
function printView(view) {
|
|
var action = document.aspnetForm.action;
|
|
var mode = window.getPrintPreviewType();
|
|
var printStr = 'PREVIEW=YES';
|
|
if (mode == 1)
|
|
printStr = 'PRINT=YES';
|
|
if ((action.indexOf('?view=') == -1) && (action.indexOf('&view=') == -1))
|
|
action = action + (action.indexOf("?") == -1 ? '?' : '&') + "view=" + view;
|
|
if (action.indexOf(printStr) == -1)
|
|
action = action + (action.indexOf("?") == -1 ? '?' : '&') + printStr;
|
|
window.open(action, "");
|
|
}
|
|
|
|
function checkAllCalendars(value) {
|
|
var arrCheckboxes = document.getElementsByName("chkCalendarID");
|
|
for (var cv = 0; cv < arrCheckboxes.length; cv++)
|
|
arrCheckboxes[cv].checked = value;
|
|
|
|
numChecked = (value ? arrCheckboxes.length : 0);
|
|
}
|
|
|
|
function boxChanged(wasChecked) {
|
|
if (wasChecked)
|
|
++numChecked;
|
|
else
|
|
--numChecked;
|
|
document.getElementById('allCalendars').checked = (numChecked == numCheckable);
|
|
}
|
|
|
|
function searchTextHook(ev) {
|
|
ev = (window.event ? window.event : ev);
|
|
if (ev.keyCode == 10 || ev.keyCode == 13)
|
|
calendarSearch();
|
|
}
|
|
|
|
function calendarSearch() {
|
|
var frm = document.aspnetForm;
|
|
var startDate = window.FeatureToggles.isActive("CMS.JqueryUpgrade.UpgradeTo224") ? frm.startDateFromAmsul.value : frm.startDate.value;
|
|
var enddate = window.FeatureToggles.isActive("CMS.JqueryUpgrade.UpgradeTo224") ? frm.endDateFromAmsul.value : frm.enddate.value;
|
|
var searchTerm = frm.searchTerm.value;
|
|
var CID = '';
|
|
|
|
var objDate = new dateValidator();
|
|
if (startDate == 'Start Date')
|
|
startDate = '';
|
|
if (enddate == 'End Date')
|
|
enddate = '';
|
|
if (searchTerm == 'Search')
|
|
searchTerm = '';
|
|
if (startDate != '' || enddate != '') {
|
|
objDate.setStartDate(startDate);
|
|
objDate.setEndDate(enddate);
|
|
if (!objDate.dateOrderValidateNew()) {
|
|
if (objDate.error) alert(objDate.error);
|
|
else alert("Error in date format");
|
|
return false;
|
|
}
|
|
}
|
|
var arrCheckboxes = document.getElementsByName("chkCalendarID");
|
|
for (var cv = 0; cv < arrCheckboxes.length; cv++) {
|
|
if (arrCheckboxes[cv].checked)
|
|
CID = CID + arrCheckboxes[cv].value + ",";
|
|
}
|
|
|
|
if (startDate + enddate + searchTerm == "") {
|
|
frm.action = '/calendar.aspx?CID=' + CID;
|
|
}
|
|
else {
|
|
frm.calendarView.value = 'list';
|
|
frm.action = '/calendar.aspx?Keywords=' + encodeURIComponent(searchTerm) + '&startDate=' + startDate + '&enddate=' + enddate + '&CID=' + CID;
|
|
}
|
|
|
|
var pastEventsCheckbox = document.getElementById("showPastEvents");
|
|
if (pastEventsCheckbox) {
|
|
frm.action = frm.action.substr(0, frm.action.length-1);
|
|
frm.action += '&showPastEvents=' + pastEventsCheckbox.checked;
|
|
}
|
|
|
|
frm.submit();
|
|
}
|
|
|
|
function checkShowPastEvents(value) {
|
|
var pastEventsCheckbox = document.getElementById("showPastEvents");
|
|
if (pastEventsCheckbox && pastEventsCheckbox.length > 0)
|
|
pastEventsCheckbox.checked = value;
|
|
}
|
|
|
|
function eventDetail(id, thisDay, thisMonth, thisYear, calType) {
|
|
var $divWeekEventDetails = $('div.weekEventDetails');
|
|
if ($divWeekEventDetails.length == 1 && !$divWeekEventDetails.is(':visible') && thisDay && thisMonth && thisYear) {
|
|
eventDetails(id, thisDay, thisMonth, thisYear, calType);
|
|
} else {
|
|
document.aspnetForm.calendarView.value = 'week';
|
|
document.aspnetForm.eventID.value = id;
|
|
redrawContentCalendar();
|
|
}
|
|
}
|
|
|
|
function facilityDetail(id) {
|
|
document.aspnetForm.action = '/facilities.aspx?Page=resvdetail&FRID=' + id;
|
|
document.aspnetForm.submit();
|
|
}
|
|
|
|
function facility2012Detail(id) {
|
|
window.location.href = '/Facilities/Facility/Details/' + id;
|
|
}
|
|
|
|
function showMore(id, showMoreId, day) {
|
|
var elemStyle = document.getElementById(id).style;
|
|
if (elemStyle.display == 'none') {
|
|
elemStyle.display = 'block';
|
|
document.aspnetForm.showMoreDay.value = day;
|
|
document.getElementById(showMoreId).innerHTML = '<span class="label">Show Less </span><svg class="icon"><use href="#iconChevronUp"></use></svg>';
|
|
}
|
|
else {
|
|
elemStyle.display = 'none';
|
|
document.aspnetForm.showMoreDay.value = '';
|
|
document.getElementById(showMoreId).innerHTML = '<span class="label">Show More </span><svg class="icon"><use href="#iconChevronDown"></use></svg>';
|
|
}
|
|
}
|
|
|
|
function switchWeek(action) {
|
|
document.aspnetForm.calendarView.value = 'week';
|
|
document.aspnetForm.eventID.value = 0;
|
|
document.aspnetForm.action = action;
|
|
redrawContentCalendar();
|
|
}
|
|
|
|
function changeDate(year, month, view, CID) {
|
|
var frm = document.aspnetForm;
|
|
frm.calendarView.value = view;
|
|
|
|
var nid = GetQueryStringParameter('NID');
|
|
var fid = GetQueryStringParameter('FID');
|
|
|
|
frm.action = '/calendar.aspx?month=' + month + '&year=' + year + (CID ? '&CID=' + CID : '') + (nid != '' ? '&NID=' + nid : '') + (fid != '' ? '&FID=' + fid : '');
|
|
redrawContentCalendar();
|
|
}
|
|
|
|
function displayPopUp(id) {
|
|
var elemStyle = document.getElementById(id).style;
|
|
if (elemStyle.display == 'none') {
|
|
elemStyle.display = 'block';
|
|
}
|
|
else {
|
|
elemStyle.display = 'none';
|
|
}
|
|
}
|
|
|
|
function changeDay(date, CID) {
|
|
var month = date.substring(0, date.indexOf('/'));
|
|
date = date.substring(date.indexOf('/') + 1);
|
|
var day = date.substring(0, date.indexOf('/'));
|
|
var year = date.substring(date.indexOf('/') + 1);
|
|
var url = '/common/modules/Calendar/ShowAllEvents.aspx?day=' + day + '&year=' + year + '&month=' + month + (CID ? '&CID=' + CID + '&' : '');
|
|
openCpModal({
|
|
title: 'More Events',
|
|
className: "modalContainer modalContainerCP showMoreEvents",
|
|
isFrontEnd: true,
|
|
useIframe: false,
|
|
showLoading: true,
|
|
async: false,
|
|
verticalCenter: true,
|
|
url: url
|
|
});
|
|
|
|
$('p.icalDescription').urlToLink({ target: '_blank' });
|
|
}
|
|
|
|
function showAllEvents(day, month, year, state, CID) {
|
|
openCpModal({
|
|
title: 'More Events',
|
|
className: "modalContainer modalContainerCP showMoreEvents",
|
|
isFrontEnd: true,
|
|
useIframe: false,
|
|
showLoading: true,
|
|
async: false,
|
|
verticalCenter: true,
|
|
url: '/common/modules/Calendar/ShowAllEvents.aspx?day=' + day + '&year=' + year + '&month=' + month + '&state=' + state + (CID ? '&CID=' + CID + '&' : '')
|
|
});
|
|
|
|
$('p.icalDescription').urlToLink({ target: '_blank' });
|
|
}
|
|
|
|
function expandAll(month, year, action, CID) {
|
|
if (action === 'expand') {
|
|
document.aspnetForm.action = '/calendar.aspx?month=' + month + '&year=' + year + '&mode=expandAll' + (CID ? '&CID=' + CID + '&' : '');
|
|
} else {
|
|
document.aspnetForm.action = '/calendar.aspx?month=' + month + '&year=' + year + '&mode=collapseAll' + (CID ? '&CID=' + CID + '&' : '');
|
|
}
|
|
document.aspnetForm.calendarView.value = 'month';
|
|
redrawContentCalendar();
|
|
return false;
|
|
}
|
|
|
|
function refreshPage(date, state) {
|
|
var frm = document.aspnetForm;
|
|
var datecopy = date;
|
|
var month = datecopy.substring(0, datecopy.indexOf('/'));
|
|
datecopy = datecopy.substring(datecopy.indexOf('/') + 1);
|
|
var day = datecopy.substring(0, datecopy.indexOf('/'));
|
|
datecopy = datecopy.substring(datecopy.indexOf('/') + 1);
|
|
var year = datecopy.substring(datecopy.indexOf('/'));
|
|
if (state === 'expanded')
|
|
frm.action = '/calendar.aspx?day=' + day + '&month=' + month + '&year=' + year;
|
|
else
|
|
frm.action = '/calendar.aspx?day=' + day + '&month=' + month + '&year=' + year + '&mode=collapseAll';
|
|
frm.calendarView.value = 'month';
|
|
frm.submit();
|
|
}
|
|
|
|
// LIVE EDIT STUFF:
|
|
try {
|
|
Sys.Application.add_load(loadOrAjaxUpdate);
|
|
}
|
|
catch (ex) { }
|
|
|
|
if (!window.CalendarKAMMenu) {
|
|
CalendarKAMMenu = function() { };
|
|
window.CalendarKAMMenu = CalendarKAMMenu;
|
|
}
|
|
|
|
function raiseAsyncPostbackCalendar(updatePanelID, closePopUp, actionTaken) {
|
|
if (closePopUp) {
|
|
closeModalDialog('editItemBehavior');
|
|
closeModalDialog();
|
|
}
|
|
|
|
if (actionTaken != undefined)
|
|
blockMenuSpawn = true;
|
|
if (CalendarKAMMenu.dayCounter)
|
|
CalendarItemHideMenu(CalendarKAMMenu.dayCounter);
|
|
else
|
|
CalendarItemHideMenu(1);
|
|
CalendarCategoryHideMenu();
|
|
if (actionTaken)
|
|
__doPostBack(updatePanelID, actionTaken);
|
|
else
|
|
__doPostBack(updatePanelID, "calendar");
|
|
}
|
|
|
|
function CalendarEventModifyDelete(calendarID, action, updatePanelID, eventID) {
|
|
var ysnArchShowForce = -1, doSubmit = true;
|
|
var frmCalendar = document.aspnetForm;
|
|
|
|
switch (action) {
|
|
case "Link":
|
|
{
|
|
doSubmit = false;
|
|
showCopyLinkWindowUsingRelatedLink('/calendar.aspx?EID=' + eventID);
|
|
break;
|
|
}
|
|
case "Publish":
|
|
case "Unpublish":
|
|
case "Reject":
|
|
case "Submit":
|
|
frmCalendar.strActionFE.value = "CalendarItem" + action;
|
|
break;
|
|
case "Delete":
|
|
{
|
|
if (confirm("Are you sure you want to delete this item?")) {
|
|
frmCalendar.strActionFE.value = "CalendarItemDelete";
|
|
}
|
|
else
|
|
doSubmit = false;
|
|
break;
|
|
}
|
|
case 'archivePublic':
|
|
ysnArchShowForce = 1;
|
|
case 'archiveHidden':
|
|
if (ysnArchShowForce < 0) ysnArchShowForce = 0;
|
|
if (!(confirm('Are you sure you want to archive this item?'))) {
|
|
ysnArchShowForce = -1;
|
|
return;
|
|
}
|
|
frmCalendar.strActionFE.value = 'CalendarItemArchive';
|
|
frmCalendar.ysnArchShowForceFE.value = ysnArchShowForce;
|
|
break;
|
|
default:
|
|
{
|
|
doSubmit = false;
|
|
break;
|
|
}
|
|
}
|
|
if (doSubmit) {
|
|
frmCalendar.ysnSaveFE.value = 1;
|
|
frmCalendar.lngCalendarEventID.value = eventID;
|
|
raiseAsyncPostbackCalendar(updatePanelID, 0);
|
|
}
|
|
}
|
|
|
|
function openEditWindowCalendar(calendarID, eventID, isCopy, order, updatePanelID, isSubmit) {
|
|
|
|
if (isSubmit) {
|
|
openCpModal({
|
|
title: 'Event Submission',
|
|
className: 'submitEvent',
|
|
isFrontEnd: true,
|
|
useIframe: true,
|
|
draggable: true,
|
|
url: '/common/modules/Calendar/calendarLiveEdit.aspx?calendarID=' + calendarID + '&eventID=' + eventID + '&order=' + order + '&updatePanelID=' + updatePanelID + '&submit=1'
|
|
});
|
|
$('#iframeModal').focus();
|
|
} else {
|
|
behavior = $find('editItemBehavior');
|
|
if (behavior) {
|
|
var ifr = document.getElementById('liveEditDialog');
|
|
setModalClass('liveEdit calendar', behavior);
|
|
|
|
var url = '/common/modules/Calendar/calendarLiveEdit.aspx?calendarID=' + calendarID + '&eventID=' + eventID + '&order=' + order + '&updatePanelID=' + updatePanelID;
|
|
|
|
if (isCopy)
|
|
ifr.src = url + '&strPage=itemCopy';
|
|
else
|
|
ifr.src = url + '&strPage=itemForm';
|
|
|
|
ifr.style.display = 'block';
|
|
behavior.show();
|
|
}
|
|
}
|
|
}
|
|
|
|
function CalendarItemMouseOver(sender, event, itemID, dayCounter) {
|
|
if (blockMenuSpawn)
|
|
return;
|
|
|
|
var controlID;
|
|
CalendarKAMMenu.eventID = itemID;
|
|
////58 is moduleId Please follow the format LiveEditControlModuleID_ItemId
|
|
controlID = 'LiveEditControl58_' + itemID + '_' + dayCounter;
|
|
var liveEditControl = $get(controlID);
|
|
var showLiveEditControls = getCookieValue('showLiveEditControls') == "true";
|
|
// Make sure previous KAMs are hidden if they need to be.
|
|
if (!showLiveEditControls) {
|
|
if (previousKAMControl)
|
|
previousKAMControl.style.display = 'none';
|
|
previousKAMControl = liveEditControl;
|
|
}
|
|
|
|
// Change z-index, for proper display.
|
|
var parentContainer = resolveLiveEditContainer(liveEditControl);
|
|
parentContainer.style.zIndex = 2;
|
|
if (document.getElementById('parentdiv' + itemID + '_' + dayCounter))
|
|
document.getElementById('parentdiv' + itemID + '_' + dayCounter).style.zIndex = 5;
|
|
|
|
// Move action category menu to container for category.
|
|
liveEditControl.appendChild(CalendarKAMMenu.elemItemMenu);
|
|
|
|
// Show tool-tip (if they are not disabled).
|
|
CalendarShowTooltip(controlID);
|
|
|
|
// Show KAM.
|
|
liveEditControl.style.display = 'block';
|
|
}
|
|
|
|
function CalendarShowTooltip(controlID) {
|
|
var liveEditControl = $get(controlID);
|
|
liveEditControl.appendChild(CalendarKAMMenu.elemTooltip);
|
|
|
|
if (CalendarKAMMenu.elemTooltip) {
|
|
if (showToolTip)
|
|
CalendarKAMMenu.elemTooltip.style.display = 'block';
|
|
else
|
|
CalendarKAMMenu.elemTooltip.style.display = 'none';
|
|
}
|
|
}
|
|
|
|
function CalendarItemMouseOut(sender, event, itemID, dayCounter) {
|
|
// Ignore when mouse leaves child controls within the live edit control.
|
|
event = (window.event ? window.event : event);
|
|
var toElement = (event.toElement ? event.toElement : event.relatedTarget);
|
|
|
|
if (!elemInsideOrEq(sender, toElement)) {
|
|
CalendarItemHideMenu(dayCounter);
|
|
}
|
|
}
|
|
|
|
|
|
function CalendarCategoryMouseOver(sender, event, categoryID, fromCalendarScreen) {
|
|
if (blockMenuSpawn)
|
|
return;
|
|
|
|
CalendarKAMMenu.calendarID = categoryID;
|
|
var controlID;
|
|
if (!fromCalendarScreen)
|
|
controlID = 'LiveEditControl_' + categoryID;
|
|
else
|
|
controlID = 'LiveEditControlCalendar_' + categoryID;
|
|
var liveEditControl = $get(controlID);
|
|
|
|
var showLiveEditControls = getCookieValue('showLiveEditControls') == "true";
|
|
// Make sure previous KAMs are hidden if they need to be.
|
|
if (!showLiveEditControls) {
|
|
if (previousKAMControl)
|
|
previousKAMControl.style.display = 'none';
|
|
previousKAMControl = liveEditControl;
|
|
}
|
|
|
|
// Move action category menu to container for category.
|
|
liveEditControl.appendChild(CalendarKAMMenu.elemCatMenu);
|
|
|
|
// Change z-index, for proper display.
|
|
var parentContainer = resolveLiveEditContainer(liveEditControl);
|
|
parentContainer.style.zIndex = 1;
|
|
|
|
// Show tool-tip (if they are not disabled).
|
|
CalendarShowTooltip(controlID);
|
|
|
|
// Show KAM.
|
|
liveEditControl.style.display = 'block';
|
|
}
|
|
|
|
// Summons action menu for a category.
|
|
function CalendarActionsCategory(calendarID, catElemID, updatePanelID, status, rights, fromCalendarScreen) {
|
|
CalendarKAMMenu.updatePanelID = updatePanelID;
|
|
CalendarKAMMenu.eventID = 0;
|
|
CalendarKAMMenu.calendarID = calendarID;
|
|
CalendarKAMMenu.counter = 0;
|
|
CalendarKAMMenu.status = status;
|
|
CalendarKAMMenu.rights = rights;
|
|
if (!fromCalendarScreen)
|
|
liveEditCommonCategory(
|
|
$get(catElemID),
|
|
CalendarKAMMenu.elemTooltip,
|
|
CalendarKAMMenu.elemCatMenu,
|
|
$get('LiveEditControl_' + calendarID), 'CalendarCategoryLiveEditMoreActions');
|
|
else
|
|
liveEditCommonCategory(
|
|
$get(catElemID),
|
|
CalendarKAMMenu.elemTooltip,
|
|
CalendarKAMMenu.elemCatMenu,
|
|
$get('LiveEditControlAlbum_' + calendarID), 'CalendarCategoryLiveEditMoreActions');
|
|
}
|
|
|
|
function CalendarCategoryMouseOut(sender, event) {
|
|
// Ignore when mouse leaves child controls within the live edit control.
|
|
event = (window.event ? window.event : event);
|
|
var toElement = (event.toElement ? event.toElement : event.relatedTarget);
|
|
var showLiveEditControls = getCookieValue('showLiveEditControls') == "true";
|
|
|
|
if (!elemInsideOrEq(sender, toElement))
|
|
CalendarCategoryHideMenu();
|
|
if (showLiveEditControls)
|
|
{
|
|
var categoryID = CalendarKAMMenu.calendarID;
|
|
var controlID = 'LiveEditControl_' + categoryID;
|
|
$get(controlID).style.display = 'block';
|
|
}
|
|
}
|
|
|
|
function CalendarCategoryHideMenu() {
|
|
var categoryID = CalendarKAMMenu.calendarID;
|
|
var controlID = 'LiveEditControl_' + categoryID;
|
|
var controlIDAlbum = 'LiveEditControlAlbum_' + categoryID;
|
|
|
|
var liveEditControl = $get(controlID);
|
|
var liveEditControlAlbum = $get(controlIDAlbum);
|
|
|
|
if (!liveEditControl && !liveEditControlAlbum)
|
|
return;
|
|
|
|
// Change z-index, for proper display.
|
|
var parentContainer;
|
|
if (liveEditControl)
|
|
parentContainer = resolveLiveEditContainer(liveEditControl);
|
|
else
|
|
parentContainer = resolveLiveEditContainer(liveEditControlAlbum);
|
|
parentContainer.style.zIndex = 0;
|
|
|
|
// Hide action menu for category.
|
|
CalendarKAMMenu.elemCatMenu.style.display = 'none';
|
|
|
|
if (CalendarKAMMenu.elemCatMenu.parentNode) {
|
|
CalendarKAMMenu.elemCatMenu.parentNode.removeChild(CalendarKAMMenu.elemCatMenu);
|
|
CalendarKAMMenu.elemLiveEditBullpen.appendChild(CalendarKAMMenu.elemCatMenu);
|
|
}
|
|
|
|
// Hide any possibly visible tool-tip.
|
|
CalendarHideTooltip();
|
|
|
|
// Hide KAM unless KAMs are set to always show.
|
|
if (!showLiveEditControls) {
|
|
if (liveEditControlAlbum)
|
|
liveEditControlAlbum.style.display = 'none';
|
|
if (liveEditControl)
|
|
liveEditControl.style.display = 'none';
|
|
}
|
|
}
|
|
|
|
function CalendarItemHideMenu(dayCounter) {
|
|
var itemID = CalendarKAMMenu.eventID;
|
|
//58 is moduleId Please follow the format LiveEditControlModuleID_ItemId
|
|
var controlID = 'LiveEditControl58_' + itemID + '_' + dayCounter;
|
|
var liveEditControl = $get(controlID);
|
|
var showLiveEditControls = getCookieValue('showLiveEditControls') == "true";
|
|
|
|
if (!liveEditControl)
|
|
return;
|
|
|
|
// Change z-index, for proper display.
|
|
var parentContainer = resolveLiveEditContainer(liveEditControl);
|
|
parentContainer.style.zIndex = 0;
|
|
if (document.getElementById('parentdiv' + itemID + '_' + dayCounter))
|
|
document.getElementById('parentdiv' + itemID + '_' + dayCounter).style.zIndex = 1;
|
|
|
|
// Hide action menu for item.
|
|
CalendarKAMMenu.elemItemMenu.style.display = 'none';
|
|
|
|
if (CalendarKAMMenu.elemItemMenu.parentNode) {
|
|
CalendarKAMMenu.elemItemMenu.parentNode.removeChild(CalendarKAMMenu.elemItemMenu);
|
|
CalendarKAMMenu.elemLiveEditBullpen.appendChild(CalendarKAMMenu.elemItemMenu);
|
|
}
|
|
|
|
// Hide any possibly visible tool-tip.
|
|
CalendarHideTooltip();
|
|
|
|
// Hide KAM unless KAMs are set to always show.
|
|
if (!showLiveEditControls) {
|
|
liveEditControl.style.display = 'none';
|
|
}
|
|
}
|
|
|
|
// Hides tool-tip text for a category.
|
|
function CalendarHideTooltip() {
|
|
if (CalendarKAMMenu.elemTooltip.parentNode)
|
|
CalendarKAMMenu.elemTooltip.parentNode.removeChild(CalendarKAMMenu.elemTooltip);
|
|
CalendarKAMMenu.elemTooltip.style.display = 'none';
|
|
}
|
|
|
|
function openSeriesModal(action, callback) {
|
|
openCpModal({
|
|
type: 'GET',
|
|
cache: true,
|
|
useIframe: false,
|
|
isFrontEnd: false,
|
|
draggable: true,
|
|
title: action + ' Recurring Event',
|
|
className: 'relatedDocuments',
|
|
url: '/Admin/Calendar/Modals/LiveEditAction?selectedAction=' + action,
|
|
onLoadComplete: function (data) {
|
|
$('a.button[data-action="cancel"]')
|
|
.click(function (e) {
|
|
e.preventDefault();
|
|
closeCpModal();
|
|
});
|
|
$('a.button[data-action="single"]')
|
|
.click(function (e) {
|
|
e.preventDefault();
|
|
callback();
|
|
closeCpModal();
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
function CalendarActionsInit() {
|
|
// Set up state variables (they change per item).
|
|
CalendarKAMMenu.updatePanelID = '';
|
|
CalendarKAMMenu.eventID = 0;
|
|
CalendarKAMMenu.calendarID = 0;
|
|
CalendarKAMMenu.counter = 0;
|
|
CalendarKAMMenu.order = 0;
|
|
CalendarKAMMenu.status = 0;
|
|
CalendarKAMMenu.rights = 0;
|
|
CalendarKAMMenu.dayCounter = 0;
|
|
CalendarKAMMenu.isRecurring = false;
|
|
|
|
// Get invisible bullpen (where hidden stuff is stored).
|
|
CalendarKAMMenu.elemLiveEditBullpen = $get('CalendarLiveEditBullpen');
|
|
|
|
// Set up KAM tooltip.
|
|
CalendarKAMMenu.elemTooltip = $get('CalendarLiveEditToolTip');
|
|
if (!showToolTip)
|
|
CalendarKAMMenu.elemTooltip.style.display = 'none';
|
|
|
|
// Set up category action menu.
|
|
CalendarKAMMenu.elemCatMenu = $get('CalendarCategoryLiveEditMoreActions');
|
|
|
|
CalendarKAMMenu.elemCatActionNew = $get('CalendarCategoryNewItem');
|
|
hookAnchorClick(CalendarKAMMenu.elemCatActionNew,
|
|
function(sender, eventArgs) {
|
|
CalendarCategoryHideMenu();
|
|
var updatePanel = (CalendarKAMMenu.updatePanelID + '').trim();
|
|
|
|
if (updatePanel == 'feature' || updatePanel == '')
|
|
openEditWindowCalendar(0, 0, 1, 0, 'feature');
|
|
else
|
|
openEditWindowCalendar(CalendarKAMMenu.calendarID, 0, 0, 0, CalendarKAMMenu.updatePanelID);
|
|
});
|
|
|
|
// Set up item action menu.
|
|
CalendarKAMMenu.elemItemMenu = $get('CalendarItemLiveEditMoreActions');
|
|
CalendarKAMMenu.elemItemActionModify = $get('CalendarItemModify');
|
|
CalendarKAMMenu.elemItemActionCommands = $get('CalendarItemCommands');
|
|
hookAnchorClick(CalendarKAMMenu.elemItemActionModify,
|
|
function (sender, eventArgs) {
|
|
document.forms.aspnetForm.strActionFE.value = "";
|
|
if (!CalendarKAMMenu.elemItemActionModify.inactive) {
|
|
if (CalendarKAMMenu.isRecurring) {
|
|
openSeriesModal('Modify', function () {
|
|
CalendarItemHideMenu(CalendarKAMMenu.dayCounter);
|
|
openEditWindowCalendar(CalendarKAMMenu.calendarID, CalendarKAMMenu.eventID, 0, -1, CalendarKAMMenu.updatePanelID);
|
|
});
|
|
}
|
|
else {
|
|
CalendarItemHideMenu(CalendarKAMMenu.dayCounter);
|
|
openEditWindowCalendar(CalendarKAMMenu.calendarID, CalendarKAMMenu.eventID, 0, -1, CalendarKAMMenu.updatePanelID);
|
|
}
|
|
}
|
|
});
|
|
|
|
CalendarKAMMenu.elemItemActionCopyLink = $get('CalendarItemCopyLink');
|
|
hookAnchorClick(CalendarKAMMenu.elemItemActionCopyLink,
|
|
function(sender, eventArgs) {
|
|
CalendarEventModifyDelete(CalendarKAMMenu.calendarID, 'Link', CalendarKAMMenu.updatePanelID, CalendarKAMMenu.eventID);
|
|
});
|
|
|
|
CalendarKAMMenu.elemItemActionUnpublish = $get('CalendarItemUnpublish');
|
|
hookAnchorClick(CalendarKAMMenu.elemItemActionUnpublish,
|
|
function (sender, eventArgs) {
|
|
if (CalendarKAMMenu.isRecurring) {
|
|
openSeriesModal('Unpublish', function () {
|
|
CalendarItemHideMenu(CalendarKAMMenu.dayCounter);
|
|
CalendarEventModifyDelete(CalendarKAMMenu.calendarID, 'Unpublish', CalendarKAMMenu.updatePanelID, CalendarKAMMenu.eventID);
|
|
});
|
|
}
|
|
else {
|
|
CalendarItemHideMenu(CalendarKAMMenu.dayCounter);
|
|
CalendarEventModifyDelete(CalendarKAMMenu.calendarID, 'Unpublish', CalendarKAMMenu.updatePanelID, CalendarKAMMenu.eventID);
|
|
}
|
|
});
|
|
|
|
CalendarKAMMenu.elemItemActionPublish = $get('CalendarItemPublish');
|
|
hookAnchorClick(CalendarKAMMenu.elemItemActionPublish,
|
|
function (sender, eventArgs) {
|
|
if (CalendarKAMMenu.isRecurring) {
|
|
openSeriesModal('Publish', function () {
|
|
CalendarItemHideMenu(CalendarKAMMenu.dayCounter);
|
|
var title = $('#eventTitle_' + CalendarKAMMenu.eventID).text();
|
|
title = title.replace(/^\[[A-Z]*\] /g, ''); //get rid of status at the beginning of title.
|
|
SetFieldForRssBehavior({ add: true, categoryId: CalendarKAMMenu.calendarID });
|
|
saveAndSendBE(CalendarKAMMenu.calendarID, CalendarKAMMenu.updatePanelID, CalendarKAMMenu.eventID, title);
|
|
});
|
|
}
|
|
else {
|
|
CalendarItemHideMenu(CalendarKAMMenu.dayCounter);
|
|
var title = $('#eventTitle_' + CalendarKAMMenu.eventID).text();
|
|
title = title.replace(/^\[[A-Z]*\] /g, ''); //get rid of status at the beginning of title.
|
|
SetFieldForRssBehavior({ add: true, categoryId: CalendarKAMMenu.calendarID });
|
|
saveAndSendBE(CalendarKAMMenu.calendarID, CalendarKAMMenu.updatePanelID, CalendarKAMMenu.eventID, title);
|
|
}
|
|
});
|
|
|
|
CalendarKAMMenu.elemItemActionSubmit = $get('CalendarItemSubmit');
|
|
hookAnchorClick(CalendarKAMMenu.elemItemActionSubmit,
|
|
function (sender, eventArgs) {
|
|
if (CalendarKAMMenu.isRecurring) {
|
|
openSeriesModal('Submit', function () {
|
|
CalendarItemHideMenu(CalendarKAMMenu.dayCounter);
|
|
CalendarEventModifyDelete(CalendarKAMMenu.calendarID, 'Submit', CalendarKAMMenu.updatePanelID, CalendarKAMMenu.eventID);
|
|
});
|
|
}
|
|
else {
|
|
CalendarItemHideMenu(CalendarKAMMenu.dayCounter);
|
|
CalendarEventModifyDelete(CalendarKAMMenu.calendarID, 'Submit', CalendarKAMMenu.updatePanelID, CalendarKAMMenu.eventID);
|
|
}
|
|
});
|
|
|
|
CalendarKAMMenu.elemItemActionCopy = $get('CalendarItemCopy');
|
|
hookAnchorClick(CalendarKAMMenu.elemItemActionCopy,
|
|
function(sender, eventArgs) {
|
|
CalendarItemHideMenu(CalendarKAMMenu.dayCounter);
|
|
|
|
if (CalendarKAMMenu.counter > 0)
|
|
openEditWindowCalendar(CalendarKAMMenu.calendarID, CalendarKAMMenu.eventID, 1, -1, CalendarKAMMenu.updatePanelID);
|
|
else
|
|
openEditWindowCalendar(CalendarKAMMenu.calendarID, CalendarKAMMenu.eventID, 1, -1, 'search');
|
|
});
|
|
|
|
CalendarKAMMenu.elemItemActionArchive = $get('CalendarItemArchive');
|
|
hookAnchorClick(CalendarKAMMenu.elemItemActionArchive,
|
|
function(sender, eventArgs) {
|
|
if (CalendarKAMMenu.isRecurring) {
|
|
openSeriesModal('Archive', function () {
|
|
CalendarItemHideMenu(CalendarKAMMenu.dayCounter);
|
|
CalendarEventModifyDelete(CalendarKAMMenu.calendarID, 'archiveHidden', CalendarKAMMenu.updatePanelID, CalendarKAMMenu.eventID);
|
|
});
|
|
}
|
|
else {
|
|
CalendarItemHideMenu(CalendarKAMMenu.dayCounter);
|
|
CalendarEventModifyDelete(CalendarKAMMenu.calendarID, 'archiveHidden', CalendarKAMMenu.updatePanelID, CalendarKAMMenu.eventID);
|
|
}
|
|
});
|
|
|
|
CalendarKAMMenu.elemItemActionDelete = $get('CalendarItemDelete');
|
|
hookAnchorClick(CalendarKAMMenu.elemItemActionDelete,
|
|
function(sender, eventArgs) {
|
|
if (CalendarKAMMenu.isRecurring) {
|
|
openSeriesModal('Delete', function () {
|
|
CalendarItemHideMenu(CalendarKAMMenu.dayCounter);
|
|
CalendarEventModifyDelete(CalendarKAMMenu.calendarID, 'Delete', CalendarKAMMenu.updatePanelID, CalendarKAMMenu.eventID);
|
|
});
|
|
}
|
|
else {
|
|
CalendarItemHideMenu(CalendarKAMMenu.dayCounter);
|
|
CalendarEventModifyDelete(CalendarKAMMenu.calendarID, 'Delete', CalendarKAMMenu.updatePanelID, CalendarKAMMenu.eventID);
|
|
}
|
|
});
|
|
|
|
CalendarKAMMenu.elemItemActionNewAnchor = $get('CalendarItemNewItemAnchor');
|
|
CalendarKAMMenu.elemItemActionNew = $get('CalendarItemNewItem');
|
|
hookAnchorClick(CalendarKAMMenu.elemItemActionNew,
|
|
function(sender, eventArgs) {
|
|
if (!CalendarKAMMenu.elemItemActionNew.inactive) {
|
|
CalendarItemHideMenu(CalendarKAMMenu.dayCounter);
|
|
openEditWindowCalendar(CalendarKAMMenu.calendarID, 0, 0, CalendarKAMMenu.order, CalendarKAMMenu.updatePanelID);
|
|
}
|
|
});
|
|
|
|
CalendarKAMMenu.elemItemActionReject = $get('CalendarItemReject');
|
|
hookAnchorClick(CalendarKAMMenu.elemItemActionReject,
|
|
function (sender, eventArgs) {
|
|
if (CalendarKAMMenu.isRecurring) {
|
|
openSeriesModal('Decline', function () {
|
|
CalendarItemHideMenu(CalendarKAMMenu.dayCounter);
|
|
CalendarEventModifyDelete(CalendarKAMMenu.calendarID, 'Reject', CalendarKAMMenu.updatePanelID, CalendarKAMMenu.eventID);
|
|
});
|
|
}
|
|
else {
|
|
CalendarItemHideMenu(CalendarKAMMenu.dayCounter);
|
|
CalendarEventModifyDelete(CalendarKAMMenu.calendarID, 'Reject', CalendarKAMMenu.updatePanelID, CalendarKAMMenu.eventID);
|
|
}
|
|
});
|
|
}
|
|
|
|
// Called when Notify Me pop-up is closed on the Front End.
|
|
function notifyMePopUpCallBack(frmMain, argument) {
|
|
var array = argument.split('_');
|
|
var comingFrom = array[0];
|
|
switch (comingFrom) {
|
|
case "LiveEdit":
|
|
CalendarEventModifyDelete(array[1], 'Publish', array[2], array[3]);
|
|
break;
|
|
default:
|
|
alert('Not callback provided to handle notifyme');
|
|
}
|
|
closeModalDialog('editItemBehavior');
|
|
}
|
|
|
|
function saveAndSendBE(catId, updatePanelID, eventID, title) {
|
|
var ifrID = document.getElementById('liveEditDialog');
|
|
var behaviorID = $find('editItemBehavior');
|
|
var argument = "LiveEdit_" + catId + "_" + updatePanelID + "_" + eventID;
|
|
if (behaviorID) {
|
|
setModalClass('notifyMe', behaviorID);
|
|
ifrID.src = '/common/admin/sendEmailBE.aspx?formName=aspnetForm&catId=' + catId + '&title=' + title + '&from=calendar&moduleName=calendar&comingFrom=' + argument + '&status=calendar';
|
|
ifrID.style.display = 'block';
|
|
behaviorID.show();
|
|
}
|
|
}
|
|
|
|
// Summons action menu for an item.
|
|
function CalendarActionItems(eventID, updatePanelID, calendarID, order, counter, status, rights, lastItem, dayCounter, isRecurring) {
|
|
|
|
CalendarKAMMenu.updatePanelID = updatePanelID;
|
|
CalendarKAMMenu.calendarID = calendarID;
|
|
CalendarKAMMenu.eventID = eventID;
|
|
CalendarKAMMenu.counter = counter;
|
|
CalendarKAMMenu.order = order;
|
|
CalendarKAMMenu.status = status;
|
|
CalendarKAMMenu.rights = rights;
|
|
CalendarKAMMenu.lastItem = lastItem;
|
|
CalendarKAMMenu.dayCounter = dayCounter;
|
|
CalendarKAMMenu.isRecurring = isRecurring;
|
|
|
|
// Determine if modify is available.
|
|
if (rights >= PUBLISHER || rights == AUTHOR && status < MIN_PUBLISHED) {
|
|
CalendarKAMMenu.elemItemActionModify.className = 'big modify';
|
|
CalendarKAMMenu.elemItemActionModify.title = '';
|
|
CalendarKAMMenu.elemItemActionModify.inactive = false;
|
|
}
|
|
else {
|
|
CalendarKAMMenu.elemItemActionModify.className = 'big modify inactive';
|
|
CalendarKAMMenu.elemItemActionModify.title = 'You do not have rights to modify this item.'
|
|
CalendarKAMMenu.elemItemActionModify.inactive = true;
|
|
}
|
|
|
|
// Determine visiblity of submit/reject/publish/unpublish.
|
|
CalendarKAMMenu.elemItemActionSubmit.style.display = 'none';
|
|
CalendarKAMMenu.elemItemActionReject.style.display = 'none';
|
|
CalendarKAMMenu.elemItemActionPublish.style.display = 'none';
|
|
CalendarKAMMenu.elemItemActionUnpublish.style.display = 'none';
|
|
|
|
if (rights > AUTHOR) {
|
|
if (status > MAX_DRAFT)
|
|
CalendarKAMMenu.elemItemActionUnpublish.style.display = '';
|
|
else
|
|
CalendarKAMMenu.elemItemActionPublish.style.display = '';
|
|
|
|
if (status == SUBMITTED)
|
|
CalendarKAMMenu.elemItemActionReject.style.display = '';
|
|
}
|
|
else if (status != SUBMITTED && status <= MAX_DRAFT)
|
|
CalendarKAMMenu.elemItemActionSubmit.style.display = '';
|
|
|
|
// Determine visiblity of delete/archive.
|
|
CalendarKAMMenu.elemItemActionArchive.style.display = 'none';
|
|
CalendarKAMMenu.elemItemActionDelete.style.display = 'none';
|
|
|
|
if (rights > AUTHOR) {
|
|
// Only publisher or higher can delete.
|
|
if (status > MAX_DRAFT)
|
|
CalendarKAMMenu.elemItemActionArchive.style.display = '';
|
|
else
|
|
CalendarKAMMenu.elemItemActionDelete.style.display = '';
|
|
}
|
|
else if (status <= MAX_DRAFT)
|
|
CalendarKAMMenu.elemItemActionDelete.style.display = '';
|
|
|
|
// Determine visiblity/behavior of new.
|
|
if (counter > 0) {
|
|
if (rights >= AUTHOR) {
|
|
CalendarKAMMenu.elemItemActionNew.style.display = '';
|
|
CalendarKAMMenu.elemItemActionNewAnchor.title = '';
|
|
CalendarKAMMenu.elemItemActionNewAnchor.className = 'addItem';
|
|
CalendarKAMMenu.elemItemActionNew.inactive = false;
|
|
}
|
|
else
|
|
CalendarKAMMenu.elemItemActionNew.style.display = 'none';
|
|
}
|
|
else if (counter > -2) {
|
|
CalendarKAMMenu.elemItemActionNew.style.display = '';
|
|
CalendarKAMMenu.elemItemActionNewAnchor.title = 'You cannot add item on search screen.';
|
|
CalendarKAMMenu.elemItemActionNewAnchor.className = 'addItem inactive';
|
|
CalendarKAMMenu.elemItemActionNew.inactive = true;
|
|
}
|
|
else
|
|
CalendarKAMMenu.elemItemActionNew.style.display = 'none';
|
|
|
|
// Apply even/odd classes.
|
|
var listItems = CalendarKAMMenu.elemItemActionCommands.firstChild;
|
|
var lc = 0;
|
|
|
|
while (listItems != null) {
|
|
if (listItems.nodeType == 1 && listItems.style.display != 'none')
|
|
listItems.className = (((++lc) % 2) == 0 ? 'even' : '');
|
|
listItems = listItems.nextSibling;
|
|
}
|
|
|
|
if ($get('item' + eventID) != null && $get('item' + eventID).style.zIndex == 4) {
|
|
$get('LiveEditControl58_' + eventID + '_' + CalendarKAMMenu.dayCounter).style.zIndex = 0;
|
|
var list = $('.CalendarItem');
|
|
for (var i = 0; i < list.length; i++) {
|
|
list[i].style.zIndex = 0;
|
|
}
|
|
}
|
|
else {
|
|
$get('LiveEditControl58_' + eventID + '_' + CalendarKAMMenu.dayCounter).style.zIndex = 4;
|
|
if($get('item' + eventID) != null)
|
|
$get('item' + eventID).style.zIndex = 4;
|
|
}
|
|
|
|
// Show menu.
|
|
liveEditCommonItem(
|
|
CalendarKAMMenu.elemTooltip,
|
|
CalendarKAMMenu.elemItemMenu,
|
|
$get('LiveEditControl58_' + eventID + '_' + CalendarKAMMenu.dayCounter), 'CalendarItemLiveEditMoreActions', false); ////58 is moduleId Please follow the format LiveEditControlModuleID_ItemId
|
|
|
|
} |