comments: add dtext shortlink option to comment menu.

Add a Shortlink menu option to the comment menu. Clicking this will copy
a DText comment shortlink (e.g. `comment #12345`) to the clipboard. You
can middle-click or right-click the menu option to get the full URL.

The menu option is called Shortlink instead of `comment #1234` because
show the full comment ID in the menu makes the menu look too unbalanced.

Note that the `navigator.clipboard` API can only be used in a https://
environment. It won't work in non-HTTPS development environments. ngrok
can help with this.
This commit is contained in:
evazion
2021-01-22 03:35:30 -06:00
parent 2beac62fc3
commit bed5fdafb8
4 changed files with 49 additions and 25 deletions

View File

@@ -135,4 +135,8 @@ module IconHelper
def flag_icon(**options)
icon_tag("fas fa-flag", **options)
end
def link_icon(**options)
icon_tag("fas fa-link", **options)
end
end