Merge pull request #2138 from rgarmsen2295/plt-1672

PLT-1672 Added permalink feature to posts in the RHS
Этот коммит содержится в:
Joram Wilander
2016-02-14 08:22:47 -05:00
родитель 958b588448 081d5c22c7
Коммит 54cba38f3b
4 изменённых файлов: 48 добавлений и 1 удалений

Просмотреть файл

@@ -144,7 +144,8 @@ export default class PostInfo extends React.Component {
); );
} }
handlePermalink() { handlePermalink(e) {
e.preventDefault();
EventHelpers.showGetPostLinkModal(this.props.post); EventHelpers.showGetPostLinkModal(this.props.post);
} }

Просмотреть файл

@@ -31,6 +31,7 @@ class RhsComment extends React.Component {
this.retryComment = this.retryComment.bind(this); this.retryComment = this.retryComment.bind(this);
this.parseEmojis = this.parseEmojis.bind(this); this.parseEmojis = this.parseEmojis.bind(this);
this.handlePermalink = this.handlePermalink.bind(this);
this.state = {}; this.state = {};
} }
@@ -67,6 +68,10 @@ class RhsComment extends React.Component {
parseEmojis() { parseEmojis() {
twemoji.parse(ReactDOM.findDOMNode(this), {size: Constants.EMOJI_SIZE}); twemoji.parse(ReactDOM.findDOMNode(this), {size: Constants.EMOJI_SIZE});
} }
handlePermalink(e) {
e.preventDefault();
EventHelpers.showGetPostLinkModal(this.props.post);
}
componentDidMount() { componentDidMount() {
this.parseEmojis(); this.parseEmojis();
} }
@@ -92,6 +97,23 @@ class RhsComment extends React.Component {
var dropdownContents = []; var dropdownContents = [];
dropdownContents.push(
<li
key='rhs-root-permalink'
role='presentation'
>
<a
href='#'
onClick={this.handlePermalink}
>
<FormattedMessage
id='rhs_comment.permalink'
defaultMessage='Permalink'
/>
</a>
</li>
);
if (isOwner) { if (isOwner) {
dropdownContents.push( dropdownContents.push(
<li <li

Просмотреть файл

@@ -21,6 +21,7 @@ export default class RhsRootPost extends React.Component {
super(props); super(props);
this.parseEmojis = this.parseEmojis.bind(this); this.parseEmojis = this.parseEmojis.bind(this);
this.handlePermalink = this.handlePermalink.bind(this);
this.state = {}; this.state = {};
} }
@@ -31,6 +32,10 @@ export default class RhsRootPost extends React.Component {
folder: Emoji.getImagePathForEmoticon() folder: Emoji.getImagePathForEmoticon()
}); });
} }
handlePermalink(e) {
e.preventDefault();
EventHelpers.showGetPostLinkModal(this.props.post);
}
componentDidMount() { componentDidMount() {
this.parseEmojis(); this.parseEmojis();
} }
@@ -83,6 +88,23 @@ export default class RhsRootPost extends React.Component {
var dropdownContents = []; var dropdownContents = [];
dropdownContents.push(
<li
key='rhs-root-permalink'
role='presentation'
>
<a
href='#'
onClick={this.handlePermalink}
>
<FormattedMessage
id='rhs_root.permalink'
defaultMessage='Permalink'
/>
</a>
</li>
);
if (isOwner) { if (isOwner) {
dropdownContents.push( dropdownContents.push(
<li <li

Просмотреть файл

@@ -827,11 +827,13 @@
"rename_channel.cancel": "Cancel", "rename_channel.cancel": "Cancel",
"rename_channel.save": "Save", "rename_channel.save": "Save",
"rhs_comment.comment": "Comment", "rhs_comment.comment": "Comment",
"rhs_comment.permalink": "Permalink",
"rhs_comment.edit": "Edit", "rhs_comment.edit": "Edit",
"rhs_comment.del": "Delete", "rhs_comment.del": "Delete",
"rhs_comment.retry": "Retry", "rhs_comment.retry": "Retry",
"rhs_header.details": "Message Details", "rhs_header.details": "Message Details",
"rhs_root.direct": "Direct Message", "rhs_root.direct": "Direct Message",
"rhs_root.permalink": "Permalink",
"rhs_root.edit": "Edit", "rhs_root.edit": "Edit",
"rhs_root.del": "Delete", "rhs_root.del": "Delete",
"search_bar.search": "Search", "search_bar.search": "Search",