mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add dlna pause fix
This commit is contained in:
parent
a5f1fa7681
commit
e3e1ab2db3
6 changed files with 280 additions and 11 deletions
105
dashboard-ui/css/contextmenu.css
Normal file
105
dashboard-ui/css/contextmenu.css
Normal file
|
@ -0,0 +1,105 @@
|
||||||
|
.itemContextMenu {
|
||||||
|
position: absolute;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
color: #000;
|
||||||
|
font-size: 14px;
|
||||||
|
z-index: 10000;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.2);
|
||||||
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
font-size: 14px;
|
||||||
|
*border-right-width: 2px;
|
||||||
|
*border-bottom-width: 2px;
|
||||||
|
-webkit-border-radius: 6px;
|
||||||
|
-moz-border-radius: 6px;
|
||||||
|
border-radius: 6px;
|
||||||
|
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
|
||||||
|
-moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
|
||||||
|
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
|
||||||
|
-webkit-background-clip: padding-box;
|
||||||
|
-moz-background-clip: padding;
|
||||||
|
background-clip: padding-box;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contextMenuInner {
|
||||||
|
padding: .5em 0;
|
||||||
|
width: 160px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contextMenuOption {
|
||||||
|
display: block;
|
||||||
|
color: #000;
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: normal;
|
||||||
|
padding: .35em 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contextMenuOption:hover {
|
||||||
|
color: #ffffff;
|
||||||
|
text-decoration: none;
|
||||||
|
background-color: #0088cc;
|
||||||
|
background-color: #0081c2;
|
||||||
|
background-image: -moz-linear-gradient(top, #0088cc, #0077b3);
|
||||||
|
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
|
||||||
|
background-image: -webkit-linear-gradient(top, #0088cc, #0077b3);
|
||||||
|
background-image: -o-linear-gradient(top, #0088cc, #0077b3);
|
||||||
|
background-image: linear-gradient(to bottom, #0088cc, #0077b3);
|
||||||
|
background-repeat: repeat-x;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contextMenuHeader {
|
||||||
|
font-weight: bold;
|
||||||
|
margin: .5em 0;
|
||||||
|
padding: 0 1em;
|
||||||
|
color: #999;
|
||||||
|
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
.contextMenuDivider {
|
||||||
|
margin: .75em 0;
|
||||||
|
height: 1px;
|
||||||
|
background: #e5e5e5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.itemContextMenu:before, .dropdown-context-up:before {
|
||||||
|
position: absolute;
|
||||||
|
top: -7px;
|
||||||
|
left: 9px;
|
||||||
|
display: inline-block;
|
||||||
|
border-right: 7px solid transparent;
|
||||||
|
border-bottom: 7px solid #ccc;
|
||||||
|
border-left: 7px solid transparent;
|
||||||
|
border-bottom-color: rgba(0, 0, 0, 0.2);
|
||||||
|
content: '';
|
||||||
|
}
|
||||||
|
.dropdown-context:after, .dropdown-context-up:after {
|
||||||
|
position: absolute;
|
||||||
|
top: -6px;
|
||||||
|
left: 10px;
|
||||||
|
display: inline-block;
|
||||||
|
border-right: 6px solid transparent;
|
||||||
|
border-bottom: 6px solid #ffffff;
|
||||||
|
border-left: 6px solid transparent;
|
||||||
|
content: '';
|
||||||
|
}
|
||||||
|
.dropdown-context-up:before, .dropdown-context-up:after {
|
||||||
|
top: auto;
|
||||||
|
bottom: -7px;
|
||||||
|
z-index: 9999;
|
||||||
|
}
|
||||||
|
.dropdown-context-up:before {
|
||||||
|
border-right: 7px solid transparent;
|
||||||
|
border-top: 7px solid #ccc;
|
||||||
|
border-bottom: none;
|
||||||
|
border-left: 7px solid transparent;
|
||||||
|
}
|
||||||
|
.dropdown-context-up:after {
|
||||||
|
border-right: 6px solid transparent;
|
||||||
|
border-top: 6px solid #ffffff;
|
||||||
|
border-left: 6px solid transparent;
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
|
@ -1049,7 +1049,7 @@ a.itemTag:hover {
|
||||||
.alphabetPicker {
|
.alphabetPicker {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
right: 2px;
|
right: 2px;
|
||||||
bottom: 30px;
|
bottom: 10px;
|
||||||
width: 27px;
|
width: 27px;
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
|
@ -171,12 +171,12 @@
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
border: 1px solid #444;
|
border: 1px solid #444;
|
||||||
background-image: -webkit-gradient(linear,left top,left bottom,from(#444),to(#2d2d2d));
|
background-image: -webkit-gradient(linear,left top,left bottom,from(#333),to(#2d2d2d));
|
||||||
background-image: -webkit-linear-gradient(#444,#2d2d2d);
|
background-image: -webkit-linear-gradient(#333,#2d2d2d);
|
||||||
background-image: -moz-linear-gradient(#444,#2d2d2d);
|
background-image: -moz-linear-gradient(#333,#2d2d2d);
|
||||||
background-image: -ms-linear-gradient(#444,#2d2d2d);
|
background-image: -ms-linear-gradient(#333,#2d2d2d);
|
||||||
background-image: -o-linear-gradient(#444,#2d2d2d);
|
background-image: -o-linear-gradient(#333,#2d2d2d);
|
||||||
background-image: linear-gradient(#444,#2d2d2d);
|
background-image: linear-gradient(#333,#2d2d2d);
|
||||||
}
|
}
|
||||||
|
|
||||||
.imageEditorTile {
|
.imageEditorTile {
|
||||||
|
|
116
dashboard-ui/scripts/contextmenu.js
Normal file
116
dashboard-ui/scripts/contextmenu.js
Normal file
|
@ -0,0 +1,116 @@
|
||||||
|
(function () {
|
||||||
|
|
||||||
|
function onDocumentMouseDown(e) {
|
||||||
|
|
||||||
|
var $e = $(e.target);
|
||||||
|
|
||||||
|
var isContextMenuOption = $e.is('.contextMenuOption');
|
||||||
|
|
||||||
|
if (!isContextMenuOption || $e.is('.contextMenuCommandOption')) {
|
||||||
|
if ($e.is('.itemContextMenu') || $e.parents('.itemContextMenu').length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isContextMenuOption) {
|
||||||
|
|
||||||
|
setTimeout(closeContextMenus, 150);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
closeContextMenus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeContextMenus() {
|
||||||
|
$('.itemContextMenu').hide().remove();
|
||||||
|
$('.hasContextMenu').removeClass('hasContextMenu');
|
||||||
|
}
|
||||||
|
|
||||||
|
function getMenuOptionHtml(item) {
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
|
||||||
|
if (item.type == 'divider') {
|
||||||
|
|
||||||
|
html += '<p class="contextMenuDivider"></p>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.type == 'header') {
|
||||||
|
|
||||||
|
html += '<p class="contextMenuHeader">' + item.text + '</p>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.type == 'link') {
|
||||||
|
|
||||||
|
html += '<a class="contextMenuOption" href="' + item.url + '">' + item.text + '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.type == 'command') {
|
||||||
|
|
||||||
|
html += '<a class="contextMenuOption contextMenuCommandOption" data-command="' + item.name + '" href="#">' + item.text + '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getMenu(items) {
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
|
||||||
|
html += '<div class="itemContextMenu">';
|
||||||
|
html += '<div class="contextMenuInner">' + items.map(getMenuOptionHtml).join('') + '</div>';
|
||||||
|
html += '</div>';
|
||||||
|
|
||||||
|
return $(html).appendTo(document.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.createContextMenu = function (options) {
|
||||||
|
|
||||||
|
return this.on('contextmenu', options.selector, function (e) {
|
||||||
|
|
||||||
|
var elem = this;
|
||||||
|
var items = options.getOptions(elem);
|
||||||
|
|
||||||
|
if (!items.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var menu = getMenu(items);
|
||||||
|
|
||||||
|
var autoH = menu.height() + 12;
|
||||||
|
|
||||||
|
if ((e.pageY + autoH) > $('html').height()) {
|
||||||
|
|
||||||
|
menu.addClass('dropdown-context-up').css({
|
||||||
|
top: e.pageY - 20 - autoH,
|
||||||
|
left: e.pageX - 13
|
||||||
|
|
||||||
|
}).fadeIn();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
menu.css({
|
||||||
|
top: e.pageY + 10,
|
||||||
|
left: e.pageX - 13
|
||||||
|
|
||||||
|
}).fadeIn();
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this).addClass('hasContextMenu');
|
||||||
|
$(document).off('mousedown.closecontextmenu').on('mousedown.closecontextmenu', onDocumentMouseDown);
|
||||||
|
|
||||||
|
menu.on('click', '.contextMenuCommandOption', function() {
|
||||||
|
|
||||||
|
closeContextMenus();
|
||||||
|
|
||||||
|
options.command(this.getAttribute('data-command'), elem);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
|
@ -662,7 +662,7 @@
|
||||||
|
|
||||||
cssClass += ' ' + options.shape + 'PosterItem';
|
cssClass += ' ' + options.shape + 'PosterItem';
|
||||||
|
|
||||||
html += '<a data-itemid="' + item.Id + '" class="' + cssClass + '" href="' + LibraryBrowser.getHref(item, options.context) + '">';
|
html += '<a data-itemid="' + item.Id + '" class="' + cssClass + '" data-locationtype="' + item.LocationType + '" data-mediatype="' + (item.MediaType || '') + '" href="' + LibraryBrowser.getHref(item, options.context) + '">';
|
||||||
|
|
||||||
// Ribbon
|
// Ribbon
|
||||||
if (item.MediaType == "Video" && item.Video3DFormat) {
|
if (item.MediaType == "Video" && item.Video3DFormat) {
|
||||||
|
@ -2100,10 +2100,42 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onMenuCommand(command, elem) {
|
||||||
|
|
||||||
|
var id = elem.getAttribute('data-itemid');
|
||||||
|
}
|
||||||
|
|
||||||
|
function getMenuOptions(elem) {
|
||||||
|
|
||||||
|
var items = [];
|
||||||
|
|
||||||
|
var id = elem.getAttribute('data-itemid');
|
||||||
|
var mediatype = elem.getAttribute('data-mediatype');
|
||||||
|
|
||||||
|
items.push({ type: 'header', text: 'Edit' });
|
||||||
|
|
||||||
|
items.push({ type: 'link', text: 'Details', url: 'edititemmetadata.html?id=' + id });
|
||||||
|
|
||||||
|
items.push({ type: 'link', text: 'Images', url: 'edititemimages.html?id=' + id });
|
||||||
|
|
||||||
|
if (mediatype == 'Video' && elem.getAttribute('data-locationtype') == 'FileSystem') {
|
||||||
|
|
||||||
|
items.push({ type: 'divider' });
|
||||||
|
items.push({ type: 'header', text: 'Manage' });
|
||||||
|
items.push({ type: 'command', text: 'Alternate Editions', name: 'AlternateEditions' });
|
||||||
|
}
|
||||||
|
|
||||||
|
return items;
|
||||||
|
}
|
||||||
|
|
||||||
$.fn.createPosterItemHoverMenu = function () {
|
$.fn.createPosterItemHoverMenu = function () {
|
||||||
|
|
||||||
function onShowTimerExpired(elem) {
|
function onShowTimerExpired(elem) {
|
||||||
|
|
||||||
|
if ($(elem).hasClass('hasContextMenu')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var innerElem = $('.posterItemOverlayTarget', elem);
|
var innerElem = $('.posterItemOverlayTarget', elem);
|
||||||
var id = elem.getAttribute('data-itemid');
|
var id = elem.getAttribute('data-itemid');
|
||||||
|
|
||||||
|
@ -2152,7 +2184,23 @@
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.on('mouseenter', '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem', onHoverIn).on('mouseleave', '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem', onHoverOut);
|
var sequence = this;
|
||||||
|
|
||||||
|
Dashboard.getCurrentUser().done(function (user) {
|
||||||
|
|
||||||
|
if (user.Configuration.IsAdministrator) {
|
||||||
|
|
||||||
|
sequence.createContextMenu({
|
||||||
|
getOptions: getMenuOptions,
|
||||||
|
command: onMenuCommand,
|
||||||
|
selector: '.posterItem'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
return this.on('mouseenter', '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem', onHoverIn)
|
||||||
|
.on('mouseleave', '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem', onHoverOut);
|
||||||
};
|
};
|
||||||
|
|
||||||
})(jQuery, document, window);
|
})(jQuery, document, window);
|
Loading…
Add table
Add a link
Reference in a new issue