mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 10:58:20 -07:00
Added option, if file is downloadable, copy the URL to clipboard
This commit is contained in:
parent
f72d26b9da
commit
437729d3f3
@ -134,6 +134,11 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
|
|||||||
name: globalize.translate('Download'),
|
name: globalize.translate('Download'),
|
||||||
id: 'download'
|
id: 'download'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
commands.push({
|
||||||
|
name: globalize.translate('CopyStreamURL'),
|
||||||
|
id: 'copy-stream'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var canEdit = itemHelper.canEdit(user, item);
|
var canEdit = itemHelper.canEdit(user, item);
|
||||||
@ -305,6 +310,22 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'appRouter',
|
|||||||
getResolveFunction(getResolveFunction(resolve, id), id)();
|
getResolveFunction(getResolveFunction(resolve, id), id)();
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case 'copy-stream':
|
||||||
|
var downloadHref = apiClient.getItemDownloadUrl(itemId);
|
||||||
|
var textArea = document.createElement("textarea");
|
||||||
|
textArea.value = downloadHref;
|
||||||
|
document.body.appendChild(textArea);
|
||||||
|
textArea.focus();
|
||||||
|
textArea.select();
|
||||||
|
try {
|
||||||
|
document.execCommand('copy');
|
||||||
|
} catch (err) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
document.body.removeChild(textArea);
|
||||||
|
getResolveFunction(resolve, id)();
|
||||||
|
break;
|
||||||
case 'editsubtitles':
|
case 'editsubtitles':
|
||||||
require(['subtitleEditor'], function (subtitleEditor) {
|
require(['subtitleEditor'], function (subtitleEditor) {
|
||||||
subtitleEditor.show(itemId, serverId).then(getResolveFunction(resolve, id, true), getResolveFunction(resolve, id));
|
subtitleEditor.show(itemId, serverId).then(getResolveFunction(resolve, id, true), getResolveFunction(resolve, id));
|
||||||
|
@ -452,5 +452,6 @@
|
|||||||
"HeaderPassword": "Password",
|
"HeaderPassword": "Password",
|
||||||
"HeaderPasswordReset": "Password Reset",
|
"HeaderPasswordReset": "Password Reset",
|
||||||
"HeaderPaths": "Paths",
|
"HeaderPaths": "Paths",
|
||||||
"HeaderPendingInvitations": "Pending Invitations"
|
"HeaderPendingInvitations": "Pending Invitations",
|
||||||
|
"CopyStreamURL": "Copy Stream URL"
|
||||||
}
|
}
|
||||||
|
@ -160,6 +160,7 @@
|
|||||||
"Connect": "Connect",
|
"Connect": "Connect",
|
||||||
"ContinueWatching": "Continue watching",
|
"ContinueWatching": "Continue watching",
|
||||||
"Continuing": "Continuing",
|
"Continuing": "Continuing",
|
||||||
|
"CopyStreamURL": "Copy Stream URL",
|
||||||
"CriticRating": "Critic rating",
|
"CriticRating": "Critic rating",
|
||||||
"CustomDlnaProfilesHelp": "Create a custom profile to target a new device or override a system profile.",
|
"CustomDlnaProfilesHelp": "Create a custom profile to target a new device or override a system profile.",
|
||||||
"DateAdded": "Date added",
|
"DateAdded": "Date added",
|
||||||
|
Loading…
Reference in New Issue
Block a user