summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-02-14 08:22:47 -0500
committerJoram Wilander <jwawilander@gmail.com>2016-02-14 08:22:47 -0500
commit54cba38f3b7c1941dd5e63ac0152819a34aefa86 (patch)
tree114974d88a91ee513eac214ba7bf5735b6dc665b /web
parent958b588448a0bc405068345f267aa623c5014d67 (diff)
parent081d5c22c795939a2b555fabf9daf42933e6ae99 (diff)
downloadchat-54cba38f3b7c1941dd5e63ac0152819a34aefa86.tar.gz
chat-54cba38f3b7c1941dd5e63ac0152819a34aefa86.tar.bz2
chat-54cba38f3b7c1941dd5e63ac0152819a34aefa86.zip
Merge pull request #2138 from rgarmsen2295/plt-1672
PLT-1672 Added permalink feature to posts in the RHS
Diffstat (limited to 'web')
-rw-r--r--web/react/components/post_info.jsx3
-rw-r--r--web/react/components/rhs_comment.jsx22
-rw-r--r--web/react/components/rhs_root_post.jsx22
-rw-r--r--web/static/i18n/en.json2
4 files changed, 48 insertions, 1 deletions
diff --git a/web/react/components/post_info.jsx b/web/react/components/post_info.jsx
index 6d82423d5..c44223b1f 100644
--- a/web/react/components/post_info.jsx
+++ b/web/react/components/post_info.jsx
@@ -144,7 +144,8 @@ export default class PostInfo extends React.Component {
);
}
- handlePermalink() {
+ handlePermalink(e) {
+ e.preventDefault();
EventHelpers.showGetPostLinkModal(this.props.post);
}
diff --git a/web/react/components/rhs_comment.jsx b/web/react/components/rhs_comment.jsx
index 9c85e9940..0d15c8599 100644
--- a/web/react/components/rhs_comment.jsx
+++ b/web/react/components/rhs_comment.jsx
@@ -31,6 +31,7 @@ class RhsComment extends React.Component {
this.retryComment = this.retryComment.bind(this);
this.parseEmojis = this.parseEmojis.bind(this);
+ this.handlePermalink = this.handlePermalink.bind(this);
this.state = {};
}
@@ -67,6 +68,10 @@ class RhsComment extends React.Component {
parseEmojis() {
twemoji.parse(ReactDOM.findDOMNode(this), {size: Constants.EMOJI_SIZE});
}
+ handlePermalink(e) {
+ e.preventDefault();
+ EventHelpers.showGetPostLinkModal(this.props.post);
+ }
componentDidMount() {
this.parseEmojis();
}
@@ -92,6 +97,23 @@ class RhsComment extends React.Component {
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) {
dropdownContents.push(
<li
diff --git a/web/react/components/rhs_root_post.jsx b/web/react/components/rhs_root_post.jsx
index f9f7f8f81..54f2e8262 100644
--- a/web/react/components/rhs_root_post.jsx
+++ b/web/react/components/rhs_root_post.jsx
@@ -21,6 +21,7 @@ export default class RhsRootPost extends React.Component {
super(props);
this.parseEmojis = this.parseEmojis.bind(this);
+ this.handlePermalink = this.handlePermalink.bind(this);
this.state = {};
}
@@ -31,6 +32,10 @@ export default class RhsRootPost extends React.Component {
folder: Emoji.getImagePathForEmoticon()
});
}
+ handlePermalink(e) {
+ e.preventDefault();
+ EventHelpers.showGetPostLinkModal(this.props.post);
+ }
componentDidMount() {
this.parseEmojis();
}
@@ -83,6 +88,23 @@ export default class RhsRootPost extends React.Component {
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) {
dropdownContents.push(
<li
diff --git a/web/static/i18n/en.json b/web/static/i18n/en.json
index 2c091ca7d..9fbd5c343 100644
--- a/web/static/i18n/en.json
+++ b/web/static/i18n/en.json
@@ -827,11 +827,13 @@
"rename_channel.cancel": "Cancel",
"rename_channel.save": "Save",
"rhs_comment.comment": "Comment",
+ "rhs_comment.permalink": "Permalink",
"rhs_comment.edit": "Edit",
"rhs_comment.del": "Delete",
"rhs_comment.retry": "Retry",
"rhs_header.details": "Message Details",
"rhs_root.direct": "Direct Message",
+ "rhs_root.permalink": "Permalink",
"rhs_root.edit": "Edit",
"rhs_root.del": "Delete",
"search_bar.search": "Search",