mirror of
https://github.com/mediacms-io/mediacms.git
synced 2024-11-22 00:03:28 +01:00
parent
c866fdd6ba
commit
102414b514
@ -80,7 +80,7 @@ function CommentForm(props) {
|
|||||||
|
|
||||||
function onChangeWithMention(event, newValue, newPlainTextValue, mentions) {
|
function onChangeWithMention(event, newValue, newPlainTextValue, mentions) {
|
||||||
textareaRef.current.style.height = '';
|
textareaRef.current.style.height = '';
|
||||||
|
|
||||||
setValue(newValue);
|
setValue(newValue);
|
||||||
setMadeChanges(true);
|
setMadeChanges(true);
|
||||||
|
|
||||||
@ -144,8 +144,8 @@ function CommentForm(props) {
|
|||||||
<UserThumbnail />
|
<UserThumbnail />
|
||||||
<div className="form">
|
<div className="form">
|
||||||
<div className={'form-textarea-wrap' + (textareaFocused ? ' focused' : '')}>
|
<div className={'form-textarea-wrap' + (textareaFocused ? ' focused' : '')}>
|
||||||
{ MediaCMS.features.media.actions.comment_mention ?
|
{ MediaCMS.features.media.actions.comment_mention ?
|
||||||
<MentionsInput
|
<MentionsInput
|
||||||
inputRef={textareaRef}
|
inputRef={textareaRef}
|
||||||
className="form-textarea"
|
className="form-textarea"
|
||||||
rows="1"
|
rows="1"
|
||||||
@ -430,31 +430,37 @@ export default function CommentsList(props) {
|
|||||||
|
|
||||||
function onCommentsLoad() {
|
function onCommentsLoad() {
|
||||||
const retrievedComments = [...MediaPageStore.get('media-comments')];
|
const retrievedComments = [...MediaPageStore.get('media-comments')];
|
||||||
const video = videojs('vjs_video_3');
|
|
||||||
|
|
||||||
if (MediaCMS.features.media.actions.timestampTimebar)
|
|
||||||
{
|
|
||||||
enableMarkers(video);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (MediaCMS.features.media.actions.comment_mention === true)
|
|
||||||
{
|
|
||||||
retrievedComments.forEach(comment => {
|
|
||||||
comment.text = setMentions(comment.text);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
video.one('loadedmetadata', () => {
|
|
||||||
retrievedComments.forEach(comment => {
|
|
||||||
comment.text = setTimestampAnchorsAndMarkers(comment.text, video);
|
|
||||||
});
|
|
||||||
|
|
||||||
displayCommentsRelatedAlert();
|
|
||||||
setComments([...retrievedComments]);
|
|
||||||
});
|
|
||||||
setComments([...retrievedComments]);
|
setComments([...retrievedComments]);
|
||||||
|
|
||||||
|
// TODO: this code is breaking, beed ti debug, until then removing the extra
|
||||||
|
// functionality related with video/timestamp/user mentions
|
||||||
|
// const video = videojs('vjs_video_3');
|
||||||
|
|
||||||
|
// if (MediaCMS.features.media.actions.timestampTimebar)
|
||||||
|
//{
|
||||||
|
// enableMarkers(video);
|
||||||
|
//}
|
||||||
|
|
||||||
|
//if (MediaCMS.features.media.actions.comment_mention === true)
|
||||||
|
//{
|
||||||
|
// retrievedComments.forEach(comment => {
|
||||||
|
// comment.text = setMentions(comment.text);
|
||||||
|
// });
|
||||||
|
//}
|
||||||
|
|
||||||
|
// TODO: this code is breaking
|
||||||
|
// video.one('loadedmetadata', () => {
|
||||||
|
// retrievedComments.forEach(comment => {
|
||||||
|
// comment.text = setTimestampAnchorsAndMarkers(comment.text, video);
|
||||||
|
// });
|
||||||
|
|
||||||
|
// displayCommentsRelatedAlert();
|
||||||
|
// setComments([...retrievedComments]);
|
||||||
|
//});
|
||||||
|
//setComments([...retrievedComments]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function setMentions(text)
|
function setMentions(text)
|
||||||
{
|
{
|
||||||
let sanitizedComment = text.split('@(_').join("<a href=\"/user/");
|
let sanitizedComment = text.split('@(_').join("<a href=\"/user/");
|
||||||
@ -464,7 +470,7 @@ export default function CommentsList(props) {
|
|||||||
|
|
||||||
function setTimestampAnchorsAndMarkers(text, videoPlayer)
|
function setTimestampAnchorsAndMarkers(text, videoPlayer)
|
||||||
{
|
{
|
||||||
function wrapTimestampWithAnchor(match, string)
|
function wrapTimestampWithAnchor(match, string)
|
||||||
{
|
{
|
||||||
let split = match.split(':'), s = 0, m = 1;
|
let split = match.split(':'), s = 0, m = 1;
|
||||||
let searchParameters = new URLSearchParams(window.location.search);
|
let searchParameters = new URLSearchParams(window.location.search);
|
||||||
|
@ -194,7 +194,9 @@ class MediaPageStore extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.loadPlaylists();
|
this.loadPlaylists();
|
||||||
this.loadUsers();
|
if (MediaCMS.features.media.actions.comment_mention === true) {
|
||||||
|
this.loadUsers();
|
||||||
|
}
|
||||||
|
|
||||||
if (this.mediacms_config.member.can.readComment) {
|
if (this.mediacms_config.member.can.readComment) {
|
||||||
this.loadComments();
|
this.loadComments();
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user