META-INF.resources.message_boards.view_message.jsp 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
*/
--%>
<%@ include file="/message_boards/init.jsp" %>
<%
MBMessageDisplay messageDisplay = (MBMessageDisplay)request.getAttribute(WebKeys.MESSAGE_BOARDS_MESSAGE_DISPLAY);
MBMessage message = messageDisplay.getMessage();
MBThread thread = messageDisplay.getThread();
AssetEntry layoutAssetEntry = AssetEntryLocalServiceUtil.getEntry(MBMessage.class.getName(), message.getMessageId());
request.setAttribute(WebKeys.LAYOUT_ASSET_ENTRY, layoutAssetEntry);
LinkedAssetEntryIdsUtil.addLinkedAssetEntryId(request, layoutAssetEntry.getEntryId());
AssetEntryServiceUtil.incrementViewCounter(layoutAssetEntry);
boolean portletTitleBasedNavigation = GetterUtil.getBoolean(portletConfig.getInitParameter("portlet-title-based-navigation"));
MBBreadcrumbUtil.addPortletBreadcrumbEntries(message, request, renderResponse);
%>
>
<%
String mvcRenderCommandName = ParamUtil.getString(request, "mvcRenderCommandName", "/message_boards/view");
%>
<%@ include file="/message_boards/nav.jspf" %>
>
window[' addReplyToMessage'] = function (messageId, quote) {
var addQuickReplyContainer = document.querySelector(
'# addReplyToMessage' + messageId + ' .panel'
);
if (addQuickReplyContainer) {
var editorName = ' replyMessageBody' + messageId;
if (window[editorName]) {
addQuickReplyContainer.classList.remove('hide');
addQuickReplyContainer.scrollIntoView(true);
Liferay.Util.toggleDisabled(
'# replyMessageButton' + messageId,
true
);
return;
}
var editMessageQuickURL = Liferay.Util.addParams(
' messageId=' + messageId,
'<%= editMessageQuickURL.toString() %>'
);
if (quote) {
editMessageQuickURL = Liferay.Util.addParams(
' quote=true',
editMessageQuickURL
);
}
var addQuickReplyLoadingMask = document.querySelector(
'# addReplyToMessage' +
messageId +
' .loading-animation'
);
addQuickReplyContainer.classList.add('hide');
addQuickReplyLoadingMask.classList.remove('hide');
Liferay.Util.fetch(editMessageQuickURL)
.then((response) => {
return response.text();
})
.then((response) => {
addQuickReplyContainer.innerHTML = response;
Liferay.Util.runScriptsInElement(addQuickReplyContainer);
addQuickReplyContainer.classList.remove('hide');
addQuickReplyLoadingMask.classList.add('hide');
var parentMessageIdInput = addQuickReplyContainer.querySelector(
'# parentMessageId'
);
if (parentMessageIdInput) {
parentMessageIdInput.value = messageId;
}
Liferay.componentReady(editorName).then((editor) => {
editor.focus();
});
if (addQuickReplyContainer) {
addQuickReplyContainer.scrollIntoView(true);
}
Liferay.Util.toggleDisabled(
'# replyMessageButton' + messageId,
true
);
});
}
};
function hideReplyMessage(messageId) {
var addQuickReplyContainer = document.querySelector(
'# addReplyToMessage' + messageId + ' .panel'
);
if (addQuickReplyContainer) {
addQuickReplyContainer.classList.add('hide');
}
Liferay.Util.toggleDisabled(
'# replyMessageButton' + messageId,
false
);
}
var message = document.getElementById(
' message_' + <%= message.getMessageId() %>
);
if (message) {
message.scrollIntoView(true);
}
<%
MBThreadFlagLocalServiceUtil.addThreadFlag(themeDisplay.getUserId(), thread, new ServiceContext());
PortalUtil.setPageSubtitle(message.getSubject(), request);
PortalUtil.setPageDescription(message.getSubject(), request);
List assetTags = AssetTagLocalServiceUtil.getTags(MBMessage.class.getName(), message.getMessageId());
PortalUtil.setPageKeywords(ListUtil.toString(assetTags, AssetTag.NAME_ACCESSOR), request);
%>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy