mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update subtitle interface
This commit is contained in:
parent
76d39e1345
commit
a5ab0b50c6
5 changed files with 3 additions and 138 deletions
|
@ -17,7 +17,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.backdropPage {
|
.backdropPage {
|
||||||
background-color: rgba(0, 0, 0, .86);
|
background-color: rgba(0, 0, 0, .85);
|
||||||
}
|
}
|
||||||
|
|
||||||
.backdropContainer {
|
.backdropContainer {
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
var deferred = $.Deferred();
|
var deferred = $.Deferred();
|
||||||
|
|
||||||
var data = localStorage.getItem(key);
|
var data = sessionStorage.getItem(key);
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
localStorage.setItem(key, JSON.stringify(images));
|
sessionStorage.setItem(key, JSON.stringify(images));
|
||||||
deferred.resolveWith(null, [images]);
|
deferred.resolveWith(null, [images]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,116 +0,0 @@
|
||||||
(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;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
})();
|
|
||||||
|
|
|
@ -262,23 +262,6 @@
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
var sequence = this;
|
|
||||||
|
|
||||||
if (options.contextMenu !== false) {
|
|
||||||
Dashboard.getCurrentUser().done(function (user) {
|
|
||||||
|
|
||||||
if (user.Configuration.IsAdministrator) {
|
|
||||||
|
|
||||||
sequence.createContextMenu({
|
|
||||||
getOptions: getContextMenuOptions,
|
|
||||||
command: onMenuCommand,
|
|
||||||
selector: '.posterItem'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.off('.posterItemHoverMenu').on('mouseenter.posterItemHoverMenu', '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem', onHoverIn)
|
return this.off('.posterItemHoverMenu').on('mouseenter.posterItemHoverMenu', '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem', onHoverIn)
|
||||||
.on('mouseleave.posterItemHoverMenu', '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem', onHoverOut);
|
.on('mouseleave.posterItemHoverMenu', '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem', onHoverOut);
|
||||||
};
|
};
|
||||||
|
|
|
@ -61,8 +61,6 @@
|
||||||
|
|
||||||
$page.prepend(html);
|
$page.prepend(html);
|
||||||
|
|
||||||
$('.viewMenuBar', page).trigger('create');
|
|
||||||
|
|
||||||
$page.trigger('headercreated');
|
$page.trigger('headercreated');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue