mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 10:58:20 -07:00
Merge pull request #751 from ThibaultNocchi/copy_url_firefox_fix
Checks if stream URL is successfully copied and displays an appropriate toast
This commit is contained in:
commit
9f105c477e
@ -351,14 +351,15 @@ define(["apphost", "globalize", "connectionManager", "itemHelper", "appRouter",
|
||||
document.body.appendChild(textArea);
|
||||
textArea.focus();
|
||||
textArea.select();
|
||||
try {
|
||||
document.execCommand("copy");
|
||||
|
||||
if (document.execCommand("copy")) {
|
||||
require(["toast"], function (toast) {
|
||||
toast(globalize.translate("CopyStreamURLSuccess"));
|
||||
});
|
||||
} catch (err) {
|
||||
} else {
|
||||
console.error("Failed to copy to clipboard");
|
||||
require(["toast"], function (toast) {
|
||||
toast(globalize.translate("CopyStreamURLError"));
|
||||
});
|
||||
}
|
||||
|
||||
document.body.removeChild(textArea);
|
||||
|
@ -161,6 +161,7 @@
|
||||
"Continuing": "Continuing",
|
||||
"CopyStreamURL": "Copy Stream URL",
|
||||
"CopyStreamURLSuccess": "URL copied successfully.",
|
||||
"CopyStreamURLError": "There was an error copying the URL.",
|
||||
"CriticRating": "Critic rating",
|
||||
"CustomDlnaProfilesHelp": "Create a custom profile to target a new device or override a system profile.",
|
||||
"DateAdded": "Date added",
|
||||
|
Loading…
Reference in New Issue
Block a user