Skip to content

Add menu option for external_url if present - #2560

Merged
dbkr merged 2 commits into
element-hq:developfrom
Half-Shot:msg-external-url
Nov 8, 2016
Merged

Add menu option for external_url if present#2560
dbkr merged 2 commits into
element-hq:developfrom
Half-Shot:msg-external-url

Conversation

@Half-Shot

Copy link
Copy Markdown
Member

No description provided.

@matrixbot

Copy link
Copy Markdown

Can one of the admins verify this patch?

@dbkr dbkr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise look good

},

onPermalinkClick: function() {
onLinkClick: function() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're re-using this, I'd call it 'closeMenu'

externalURLButton = (
<div className="mx_MessageContextMenu_field">
<a target="_blank" href={ this.props.mxEvent.event.content.external_url }
onClick={ this.onLinkClick }>Source URL</a>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add it to both, just because it makes me feel better.

<div className="mx_MessageContextMenu_field">
<a href={ "https://matrix.to/#/" + this.props.mxEvent.getRoomId() +"/"+ this.props.mxEvent.getId() }
target="_blank" onClick={ this.onPermalinkClick }>Permalink</a>
target="_blank" onClick={ this.onLinkClick }>Permalink</a>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also add rel="noopener" here, which we seem to have forgotten (although presumably we sort of trust matrix.to)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't realise that was a thing. Neat.

@dbkr
dbkr merged commit e66e8b1 into element-hq:develop Nov 8, 2016
t3chguy pushed a commit that referenced this pull request Mar 25, 2026
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants