diff --git a/assets/js/app.js b/assets/js/app.js
index 67d1a621..22778a7c 100644
--- a/assets/js/app.js
+++ b/assets/js/app.js
@@ -32,6 +32,14 @@ let liveSocket = new LiveSocket("/live", Socket, {
topbar.config({barColors: {0: "#FD4F00"}, shadowColor: "rgba(0, 0, 0, .3)"})
window.addEventListener("phx:page-loading-start", _info => topbar.show(300))
window.addEventListener("phx:page-loading-stop", _info => topbar.hide())
+window.addEventListener("music_library:clipcopy", (event) => {
+ if ("clipboard" in navigator) {
+ const text = event.target.textContent;
+ navigator.clipboard.writeText(text);
+ } else {
+ alert("Sorry, your browser does not support clipboard copy.");
+ }
+});
// connect if there are any LiveViews on the page
liveSocket.connect()
diff --git a/lib/music_library_web/live/record_live/show.html.heex b/lib/music_library_web/live/record_live/show.html.heex
index 2adac0c7..4d9aa3ad 100644
--- a/lib/music_library_web/live/record_live/show.html.heex
+++ b/lib/music_library_web/live/record_live/show.html.heex
@@ -56,10 +56,24 @@
+
- <%= @record.musicbrainz_id %>
+ <%= @record.musicbrainz_id %>
+
diff --git a/lib/music_library_web/live/wishlist_live/show.html.heex b/lib/music_library_web/live/wishlist_live/show.html.heex
index a7178985..8263fea8 100644
--- a/lib/music_library_web/live/wishlist_live/show.html.heex
+++ b/lib/music_library_web/live/wishlist_live/show.html.heex
@@ -56,10 +56,24 @@
<%= gettext("MusicBrainz ID") %>
-
+
- <%= @record.musicbrainz_id %>
+ <%= @record.musicbrainz_id %>
+
diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot
index 255d1e1c..24b4c517 100644
--- a/priv/gettext/default.pot
+++ b/priv/gettext/default.pot
@@ -29,12 +29,12 @@ msgstr ""
msgid "Attempting to reconnect"
msgstr ""
-#: lib/music_library_web/live/record_live/show.html.heex:95
+#: lib/music_library_web/live/record_live/show.html.heex:109
#, elixir-autogen, elixir-format
msgid "Back to records"
msgstr ""
-#: lib/music_library_web/live/wishlist_live/show.html.heex:87
+#: lib/music_library_web/live/wishlist_live/show.html.heex:101
#, elixir-autogen, elixir-format
msgid "Back to wishlist"
msgstr ""
@@ -125,8 +125,8 @@ msgstr ""
msgid "Import from MusicBrainz"
msgstr ""
-#: lib/music_library_web/live/record_live/show.html.heex:75
-#: lib/music_library_web/live/wishlist_live/show.html.heex:67
+#: lib/music_library_web/live/record_live/show.html.heex:89
+#: lib/music_library_web/live/wishlist_live/show.html.heex:81
#, elixir-autogen, elixir-format
msgid "Inserted at"
msgstr ""
@@ -201,7 +201,7 @@ msgstr ""
msgid "Purchased at"
msgstr ""
-#: lib/music_library_web/live/record_live/show.html.heex:67
+#: lib/music_library_web/live/record_live/show.html.heex:81
#, elixir-autogen, elixir-format
msgid "Purchased on"
msgstr ""
@@ -307,8 +307,8 @@ msgstr ""
msgid "Types"
msgstr ""
-#: lib/music_library_web/live/record_live/show.html.heex:83
-#: lib/music_library_web/live/wishlist_live/show.html.heex:75
+#: lib/music_library_web/live/record_live/show.html.heex:97
+#: lib/music_library_web/live/wishlist_live/show.html.heex:89
#, elixir-autogen, elixir-format
msgid "Updated at"
msgstr ""
@@ -345,3 +345,9 @@ msgstr ""
#, elixir-autogen, elixir-format
msgid "close"
msgstr ""
+
+#: lib/music_library_web/live/record_live/show.html.heex:69
+#: lib/music_library_web/live/wishlist_live/show.html.heex:69
+#, elixir-autogen, elixir-format
+msgid "Copy MusicBrainz ID to clipboard"
+msgstr ""