Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
META-INF.resources.view_calendar_menus.jspf Maven / Gradle / Ivy
<%--
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
--%>
var calendarContainer = Liferay.component(
' calendarContainer'
);
var remoteServices = Liferay.component(' remoteServices');
window. calendarListsMenu = new Liferay.SimpleMenu({
align: {
points: [A.WidgetPositionAlign.TL, A.WidgetPositionAlign.BL],
},
constrain: true,
items: [
{
caption: ' ',
fn: function (event) {
var instance = this;
var calendarResourceId = instance.calendarResourceId;
if (calendarResourceId) {
Liferay.Util.openWindow({
dialog: {
after: {
destroy: function (event) {
remoteServices.getResourceCalendars(
calendarResourceId,
(calendars) => {
var calendarList =
window
. calendarLists[
calendarResourceId
];
calendarList.set(
'calendars',
calendars
);
syncCalendarsMap();
scheduler.load();
}
);
},
},
destroyOnHide: true,
modal: true,
},
refreshWindow: window,
title: ' ',
uri: Liferay.CalendarUtil.fillURLParameters(
decodeURIComponent('<%= editCalendarURL %>'),
{
calendarResourceId: calendarResourceId,
}
),
});
}
},
id: 'add',
},
{
caption: ' ',
fn: function (event) {
var instance = this;
var calendarResourceId = instance.calendarResourceId;
if (calendarResourceId) {
window.location.href =
Liferay.CalendarUtil.fillURLParameters(
decodeURIComponent('<%= calendarsURL %>'),
{
calendarResourceId: calendarResourceId,
}
);
}
},
id: 'manage',
},
{
caption: ' ',
fn: function (event) {
var instance = this;
Liferay.Util.openWindow({
dialog: {
destroyOnHide: true,
modal: true,
},
dialogIframe: {
bodyCssClass: 'dialog-with-footer',
},
refreshWindow: window,
title: ' ',
uri: decodeURIComponent('<%= permissionsURL %>'),
});
},
id: 'permissions',
},
],
on: {
visibleChange: function (event) {
var instance = this;
var hiddenItems = [];
if (
!(
instance.calendarResourceId ===
'<%= groupCalendarResource.getCalendarResourceId() %>'
) ||
!<%= CalendarPortletPermission.contains(permissionChecker, scopeGroupId, ActionKeys.PERMISSIONS) %>
) {
hiddenItems.push('permissions');
}
instance.set('hiddenItems', hiddenItems);
},
},
visible: false,
width: 290,
zIndex: 500,
}).render();
window. calendarsMenu = {
id: ' calendarsMenu',
items: [
{
caption: ' ',
fn: function (event) {
var instance = this;
var calendarList = instance.get('host');
var activeCalendar = calendarList.activeItem;
Liferay.Util.openWindow({
dialog: {
after: {
destroy: function (event) {
scheduler.load();
},
},
destroyOnHide: true,
modal: true,
},
refreshWindow: window,
title: ' ',
uri: Liferay.CalendarUtil.fillURLParameters(
decodeURIComponent('<%= addCalendarBookingURL %>'),
{
calendarId: activeCalendar.get('calendarId'),
}
),
});
},
id: 'addEvent',
},
{
caption: ' ',
fn: function (event) {
var instance = this;
var calendarList = instance.get('host');
calendarList.remove(calendarList.activeItem);
refreshVisibleCalendarRenderingRules();
instance.set('visible', false);
},
id: 'hide',
},
{
caption: ' ',
fn: function (event) {
var instance = this;
var calendarList = instance.get('host');
var activeCalendar = calendarList.activeItem;
Liferay.Util.openWindow({
dialog: {
after: {
destroy: function (event) {
remoteServices.getCalendar(
activeCalendar.get('calendarId'),
(calendar) => {
var activeCalendarId =
activeCalendar.get('calendarId');
var calendars = calendarList
.get('calendars')
.map((item) => {
if (
activeCalendarId ===
item.get('calendarId')
) {
item = calendar;
}
return item;
});
calendarList.set(
'calendars',
calendars
);
syncCalendarsMap();
scheduler.load();
}
);
},
},
destroyOnHide: true,
modal: true,
},
refreshWindow: window,
title: ' ',
uri: Liferay.CalendarUtil.fillURLParameters(
decodeURIComponent('<%= editCalendarURL %>'),
{
calendarId: activeCalendar.get('calendarId'),
calendarResourceId:
activeCalendar.get('calendarResourceId'),
}
),
});
},
id: 'settings',
},
{
caption: ' ',
fn: function (event) {
var instance = this;
var calendarList = instance.get('host');
var activeCalendar = calendarList.activeItem;
Liferay.Util.openWindow({
dialog: {
after: {
destroy: function (event) {
scheduler.load();
},
},
destroyOnHide: true,
modal: true,
},
dialogIframe: {
bodyCssClass: 'dialog-with-footer',
},
refreshWindow: window,
title: ' ',
uri: Liferay.CalendarUtil.fillURLParameters(
decodeURIComponent('<%= permissionsURL %>'),
{
modelResourceDescription:
activeCalendar.get('name'),
resourceGroupId: activeCalendar.get('groupId'),
resourcePrimKey: activeCalendar.get('calendarId'),
}
),
});
},
id: 'permissions',
},
{
caption: ' ',
fn: function (event) {
var instance = this;
var calendarList = instance.get('host');
var activeCalendar = calendarList.activeItem;
Liferay.Util.openConfirmModal({
message:
' ',
onConfirm: (isConfirmed) => {
if (isConfirmed) {
var remoteServices = Liferay.component(
' remoteServices'
);
remoteServices.deleteCalendar(
activeCalendar.get('calendarId'),
() => {
remoteServices.getResourceCalendars(
activeCalendar.get(
'calendarResourceId'
),
(calendars) => {
calendarList.set(
'calendars',
calendars
);
syncCalendarsMap();
scheduler.load();
Liferay.CalendarMessageUtil.showAlert(
' alert',
' '
);
}
);
}
);
}
},
});
},
id: 'delete',
},
{
caption: ' ',
fn: function (event) {
var instance = this;
var calendarList = instance.get('host');
var activeCalendar = calendarList.activeItem;
var url = Liferay.CalendarUtil.fillURLParameters(
decodeURIComponent('<%= calendarRSSURL %>'),
{
calendarId: activeCalendar.get('calendarId'),
}
);
window.open(url, '_blank');
instance.set('visible', false);
},
id: 'subscribe',
},
{
caption: '-',
id: 'separator1',
},
{
caption:
'
" class="calendar-portlet-color-picker">
',
id: 'colorPicker',
onKeyDown: (event) => {
if (
event.keyCode === A.Event.KeyMap.SPACE ||
event.keyCode === A.Event.KeyMap.ENTER
) {
event.preventDefault();
window.