mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fix report script
This commit is contained in:
parent
af129fb92d
commit
284e61038d
8 changed files with 38 additions and 309 deletions
|
@ -81,7 +81,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.largeCardMargin .visualCardBox {
|
.largeCardMargin .visualCardBox {
|
||||||
|
margin: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media all and (min-width: 600px) {
|
||||||
|
|
||||||
|
.largeCardMargin .visualCardBox {
|
||||||
margin: 18px;
|
margin: 18px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui-page-theme-b .visualCardBox {
|
.ui-page-theme-b .visualCardBox {
|
||||||
|
|
|
@ -55,10 +55,6 @@
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
.headerSearchButton img {
|
|
||||||
height: 18px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.headerButtonLeft {
|
.headerButtonLeft {
|
||||||
padding: 0 15px;
|
padding: 0 15px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -252,7 +252,7 @@
|
||||||
#videoPlayer .nowPlayingImage img {
|
#videoPlayer .nowPlayingImage img {
|
||||||
height: auto !important;
|
height: auto !important;
|
||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
max-height: 280px;
|
max-height: 300px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -146,36 +146,37 @@
|
||||||
color: #ddd;
|
color: #ddd;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
padding: 4px 7px 3px 50px;
|
padding: 4px 7px 3px 50px;
|
||||||
font-size: 14px;
|
font-size: 16px;
|
||||||
font-family: Roboto;
|
font-family: Roboto;
|
||||||
outline: none;
|
outline: none;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
width: 180px;
|
width: 85%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.searchInputIcon {
|
.searchInputIcon {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 20px;
|
left: 20px;
|
||||||
top: 6px;
|
top: 15px;
|
||||||
font-size: 14px !important;
|
font-size: 16px !important;
|
||||||
color: #ddd !important;
|
color: #ddd !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.viewMenuSearch {
|
.viewMenuSearch {
|
||||||
position: relative;
|
position: fixed;
|
||||||
display: none;
|
top: 0;
|
||||||
margin-left: 2em;
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
background: #000000;
|
||||||
|
z-index: 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all and (min-width: 1200px) {
|
.viewMenuSearch:not(.hide) {
|
||||||
|
|
||||||
.viewMenuSearch {
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.headerSearchButton {
|
.viewMenuSearchForm {
|
||||||
display: none;
|
max-width: initial;
|
||||||
}
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.searchResultsOverlay {
|
.searchResultsOverlay {
|
||||||
|
|
|
@ -964,7 +964,7 @@
|
||||||
var div = $('<div class="card ' + shape + 'Card"><div class="cardBox"><div class="cardImage"></div></div></div>').appendTo(document.body);
|
var div = $('<div class="card ' + shape + 'Card"><div class="cardBox"><div class="cardImage"></div></div></div>').appendTo(document.body);
|
||||||
var width = screenWidth / $('.cardImage', div).innerWidth();
|
var width = screenWidth / $('.cardImage', div).innerWidth();
|
||||||
div.remove();
|
div.remove();
|
||||||
return width;
|
return Math.floor(width);
|
||||||
}
|
}
|
||||||
|
|
||||||
var info = {};
|
var info = {};
|
||||||
|
|
|
@ -20,15 +20,6 @@
|
||||||
|
|
||||||
html += '<div class="libraryMenuButtonText headerButton"><span>EMBY</span></div>';
|
html += '<div class="libraryMenuButtonText headerButton"><span>EMBY</span></div>';
|
||||||
|
|
||||||
if (user.localUser) {
|
|
||||||
|
|
||||||
html += '<div class="viewMenuSearch"><form class="viewMenuSearchForm">';
|
|
||||||
html += '<input type="text" data-role="none" data-type="search" class="headerSearchInput" autocomplete="off" spellcheck="off" />';
|
|
||||||
html += '<div class="searchInputIcon fa fa-search"></div>';
|
|
||||||
html += '<button data-role="none" type="button" data-iconpos="notext" class="imageButton btnCloseSearch" style="display:none;"><i class="fa fa-close"></i></button>';
|
|
||||||
html += '</form></div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
html += '<div class="viewMenuSecondary">';
|
html += '<div class="viewMenuSecondary">';
|
||||||
|
|
||||||
var btnCastVisible = user.localUser ? '' : 'visibility:hidden;';
|
var btnCastVisible = user.localUser ? '' : 'visibility:hidden;';
|
||||||
|
@ -43,6 +34,12 @@
|
||||||
|
|
||||||
if (user.localUser) {
|
if (user.localUser) {
|
||||||
html += '<button onclick="Search.showSearchPanel($.mobile.activePage);" type="button" data-role="none" class="headerButton headerButtonRight headerSearchButton"><div class="fa fa-search" style="font-size:21px;"></div></button>';
|
html += '<button onclick="Search.showSearchPanel($.mobile.activePage);" type="button" data-role="none" class="headerButton headerButtonRight headerSearchButton"><div class="fa fa-search" style="font-size:21px;"></div></button>';
|
||||||
|
|
||||||
|
html += '<div class="viewMenuSearch hide"><form class="viewMenuSearchForm">';
|
||||||
|
html += '<input type="text" data-role="none" data-type="search" class="headerSearchInput" autocomplete="off" spellcheck="off" />';
|
||||||
|
html += '<div class="searchInputIcon fa fa-search"></div>';
|
||||||
|
html += '<button data-role="none" type="button" data-iconpos="notext" class="imageButton btnCloseSearch"><i class="fa fa-close"></i></button>';
|
||||||
|
html += '</form></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.name) {
|
if (user.name) {
|
||||||
|
|
|
@ -90,9 +90,8 @@
|
||||||
function onPopupOpen(elem) {
|
function onPopupOpen(elem) {
|
||||||
elem.popup("open").parents(".ui-popup-container").css("margin-top", 30);
|
elem.popup("open").parents(".ui-popup-container").css("margin-top", 30);
|
||||||
|
|
||||||
// TODO: With iOS 8 this might not be required anymore
|
|
||||||
if ($.browser.safari) {
|
if ($.browser.safari) {
|
||||||
//$('.itemVideo').css('visibility', 'hidden');
|
$('.itemVideo').css('visibility', 'hidden');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,7 +290,7 @@
|
||||||
|
|
||||||
var url = "";
|
var url = "";
|
||||||
var imageWidth = 400;
|
var imageWidth = 400;
|
||||||
var imageHeight = 280;
|
var imageHeight = 300;
|
||||||
|
|
||||||
if (state.NowPlayingItem.PrimaryImageTag) {
|
if (state.NowPlayingItem.PrimaryImageTag) {
|
||||||
|
|
||||||
|
@ -355,7 +354,7 @@
|
||||||
$('.selectedNowPlayingTabButton').removeClass('selectedNowPlayingTabButton');
|
$('.selectedNowPlayingTabButton').removeClass('selectedNowPlayingTabButton');
|
||||||
$(this).addClass('selectedNowPlayingTabButton');
|
$(this).addClass('selectedNowPlayingTabButton');
|
||||||
$('.nowPlayingTab').hide();
|
$('.nowPlayingTab').hide();
|
||||||
$('.' + this.getAttribute('data-tab')).show('slide').trigger('scroll');
|
$('.' + this.getAttribute('data-tab')).show().trigger('scroll');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -11,61 +11,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSearchHints(page, searchTerm) {
|
|
||||||
|
|
||||||
if (!searchTerm) {
|
|
||||||
|
|
||||||
$('#searchHints', page).empty();
|
|
||||||
clearSearchHintTimeout();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
clearSearchHintTimeout();
|
|
||||||
|
|
||||||
searchHintTimeout = setTimeout(function () {
|
|
||||||
|
|
||||||
requestSearchHints(page, searchTerm);
|
|
||||||
|
|
||||||
}, 100);
|
|
||||||
}
|
|
||||||
|
|
||||||
function requestSearchHints(page, searchTerm) {
|
|
||||||
|
|
||||||
var currentTimeout = searchHintTimeout;
|
|
||||||
|
|
||||||
ApiClient.getSearchHints({ userId: Dashboard.getCurrentUserId(), searchTerm: searchTerm, limit: 10 }).done(function (result) {
|
|
||||||
|
|
||||||
if (currentTimeout != searchHintTimeout) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
renderSearchHintResult(page, result.SearchHints);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function preg_quote(str, delimiter) {
|
|
||||||
// http://kevin.vanzonneveld.net
|
|
||||||
// + original by: booeyOH
|
|
||||||
// + improved by: Ates Goral (http://magnetiq.com)
|
|
||||||
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
|
|
||||||
// + bugfixed by: Onno Marsman
|
|
||||||
// + improved by: Brett Zamir (http://brett-zamir.me)
|
|
||||||
// * example 1: preg_quote("$40");
|
|
||||||
// * returns 1: '\$40'
|
|
||||||
// * example 2: preg_quote("*RRRING* Hello?");
|
|
||||||
// * returns 2: '\*RRRING\* Hello\?'
|
|
||||||
// * example 3: preg_quote("\\.+*?[^]$(){}=!<>|:");
|
|
||||||
// * returns 3: '\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:'
|
|
||||||
return (str + '').replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\' + (delimiter || '') + '-]', 'g'), '\\$&');
|
|
||||||
}
|
|
||||||
|
|
||||||
function getHintDisplayName(data, term) {
|
|
||||||
|
|
||||||
var regexp = new RegExp("(" + preg_quote(term) + ")", 'gi');
|
|
||||||
|
|
||||||
return data.replace(regexp, "<b>$1</b>");
|
|
||||||
}
|
|
||||||
|
|
||||||
function getAdditionalTextLines(hint) {
|
function getAdditionalTextLines(hint) {
|
||||||
|
|
||||||
if (hint.Type == "Audio") {
|
if (hint.Type == "Audio") {
|
||||||
|
@ -109,229 +54,14 @@
|
||||||
return [hint.Type];
|
return [hint.Type];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSearchHintHtml(hint) {
|
|
||||||
|
|
||||||
var html = '';
|
|
||||||
|
|
||||||
html += '<a class="searchHint" href="' + LibraryBrowser.getHref(hint, null, '') + '">';
|
|
||||||
|
|
||||||
var imgUrl;
|
|
||||||
|
|
||||||
if (hint.PrimaryImageTag) {
|
|
||||||
|
|
||||||
hint.ImageTags = { Primary: hint.PrimaryImageTag };
|
|
||||||
|
|
||||||
imgUrl = ApiClient.getImageUrl(hint.ItemId, {
|
|
||||||
type: "Primary",
|
|
||||||
maxWidth: 150,
|
|
||||||
maxHeight: 150,
|
|
||||||
tag: hint.PrimaryImageTag
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (hint.MediaType == "Game") {
|
|
||||||
|
|
||||||
imgUrl = "css/images/items/searchhintsv2/game.png";
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (hint.Type == "Episode" || hint.Type == "Season" || hint.Type == "Series") {
|
|
||||||
|
|
||||||
imgUrl = "css/images/items/searchhintsv2/tv.png";
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (hint.Type == "Audio" || hint.Type == "MusicAlbum" || hint.Type == "MusicArtist") {
|
|
||||||
|
|
||||||
imgUrl = "css/images/items/searchhintsv2/music.png";
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (hint.Type == "Person") {
|
|
||||||
|
|
||||||
imgUrl = "css/images/items/searchhintsv2/person.png";
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
imgUrl = "css/images/items/searchhintsv2/film.png";
|
|
||||||
}
|
|
||||||
|
|
||||||
html += '<img class="searchHintImage" src="' + imgUrl + '" />';
|
|
||||||
|
|
||||||
html += '<div class="searchHintContent"><div class="searchHintContentInner">';
|
|
||||||
|
|
||||||
html += '<div class="searchHintName">' + getHintDisplayName(hint.Name, hint.MatchedTerm) + '</div>';
|
|
||||||
|
|
||||||
if (hint.Type == "Audio") {
|
|
||||||
|
|
||||||
html += '<div class="searchHintSecondaryText">' + [hint.AlbumArtist, hint.Album].join(" - ") + '</div>';
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (hint.Type == "MusicAlbum") {
|
|
||||||
|
|
||||||
html += '<div class="searchHintSecondaryText">' + hint.AlbumArtist + '</div>';
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (hint.Type == "MusicArtist") {
|
|
||||||
|
|
||||||
html += '<div class="searchHintSecondaryText">' + Globalize.translate('LabelArtist') + '</div>';
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (hint.Type == "Movie") {
|
|
||||||
|
|
||||||
html += '<div class="searchHintSecondaryText">' + Globalize.translate('LabelMovie') + '</div>';
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (hint.Type == "MusicVideo") {
|
|
||||||
|
|
||||||
html += '<div class="searchHintSecondaryText">' + Globalize.translate('LabelMusicVideo') + '</div>';
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (hint.Type == "Episode") {
|
|
||||||
|
|
||||||
html += '<div class="searchHintSecondaryText">' + Globalize.translate('LabelEpisode') + '</div>';
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (hint.Type == "Series") {
|
|
||||||
|
|
||||||
html += '<div class="searchHintSecondaryText">' + Globalize.translate('LabelSeries') + '</div>';
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
html += '<div class="searchHintSecondaryText">' + (hint.Type) + '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
var text;
|
|
||||||
|
|
||||||
if (hint.EpisodeCount) {
|
|
||||||
|
|
||||||
text = hint.EpisodeCount == 1 ? "1 Episode" : hint.EpisodeCount + " Episodes";
|
|
||||||
|
|
||||||
html += '<div class="searchHintSecondaryText">' + text + '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (hint.SongCount) {
|
|
||||||
|
|
||||||
text = hint.SongCount == 1 ? "1 Song" : hint.SongCount + " Songs";
|
|
||||||
|
|
||||||
html += '<div class="searchHintSecondaryText">' + text + '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (hint.ProductionYear && hint.MediaType != "Audio" && hint.Type != "Episode") {
|
|
||||||
html += '<div class="searchHintSecondaryText">' + hint.ProductionYear + '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (hint.RunTimeTicks) {
|
|
||||||
html += '<div class="searchHintSecondaryText">' + Dashboard.getDisplayTime(hint.RunTimeTicks) + '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
html += '</div></div>';
|
|
||||||
|
|
||||||
|
|
||||||
html += '</a>';
|
|
||||||
|
|
||||||
return html;
|
|
||||||
}
|
|
||||||
|
|
||||||
function renderSearchHintResult(page, hints) {
|
|
||||||
|
|
||||||
var html = '';
|
|
||||||
|
|
||||||
for (var i = 0, length = hints.length; i < length; i++) {
|
|
||||||
html += getSearchHintHtml(hints[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#searchHints', page).html(html);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSearchPanel(page) {
|
|
||||||
|
|
||||||
var panel = $('#searchPanel', page);
|
|
||||||
|
|
||||||
if (!panel.length) {
|
|
||||||
|
|
||||||
var html = '';
|
|
||||||
|
|
||||||
html += '<div data-role="panel" id="searchPanel" class="searchPanel" data-position="right" data-display="overlay" data-position-fixed="true" data-theme="b">';
|
|
||||||
|
|
||||||
html += '<h3>';
|
|
||||||
html += Globalize.translate('HeaderSearch');
|
|
||||||
html += '</h3>';
|
|
||||||
|
|
||||||
html += '<input id="txtSearch" class="txtSearch" type="search" data-theme="a" />';
|
|
||||||
|
|
||||||
html += '<div id="searchHints" class="searchHints"></div>';
|
|
||||||
|
|
||||||
html += '</div>';
|
|
||||||
|
|
||||||
$(page).append(html);
|
|
||||||
|
|
||||||
panel = $('#searchPanel', page).panel({}).trigger('create');
|
|
||||||
|
|
||||||
$('#txtSearch', panel).on("keyup", function (e) {
|
|
||||||
|
|
||||||
// Down
|
|
||||||
if (e.keyCode == 40) {
|
|
||||||
|
|
||||||
var first = $('.searchHint', panel)[0];
|
|
||||||
|
|
||||||
if (first) {
|
|
||||||
first.focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}).on("keyup", function (e) {
|
|
||||||
|
|
||||||
if (e.keyCode != 40) {
|
|
||||||
var value = this.value;
|
|
||||||
|
|
||||||
updateSearchHints(panel, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#searchHints', page).on("keydown", '.searchHint', function (e) {
|
|
||||||
|
|
||||||
// Down
|
|
||||||
if (e.keyCode == 40) {
|
|
||||||
|
|
||||||
var next = $(this).next()[0];
|
|
||||||
|
|
||||||
if (next) {
|
|
||||||
next.focus();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Up
|
|
||||||
if (e.keyCode == 38) {
|
|
||||||
|
|
||||||
var prev = $(this).prev()[0];
|
|
||||||
|
|
||||||
if (prev) {
|
|
||||||
prev.focus();
|
|
||||||
} else {
|
|
||||||
$('#txtSearch', page)[0].focus();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return panel;
|
|
||||||
}
|
|
||||||
|
|
||||||
function search() {
|
function search() {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
self.showSearchPanel = function (page) {
|
self.showSearchPanel = function (page) {
|
||||||
|
|
||||||
var panel = getSearchPanel(page);
|
$('.viewMenuSearch').removeClass('hide').animate({ "left": "0px" }, "fast");
|
||||||
|
$('.headerSearchInput').focus();
|
||||||
$(panel).panel('toggle');
|
|
||||||
|
|
||||||
$('#txtSearch').focus();
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
window.Search = new search();
|
window.Search = new search();
|
||||||
|
@ -417,13 +147,11 @@
|
||||||
function onHeaderSearchChange(val) {
|
function onHeaderSearchChange(val) {
|
||||||
|
|
||||||
if (val) {
|
if (val) {
|
||||||
$('.btnCloseSearch').show();
|
|
||||||
updateSearchOverlay(getSearchOverlay(true).fadeIn('fast'), val);
|
updateSearchOverlay(getSearchOverlay(true).fadeIn('fast'), val);
|
||||||
$(document.body).addClass('bodyWithPopupOpen');
|
$(document.body).addClass('bodyWithPopupOpen');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$('.btnCloseSearch').hide();
|
|
||||||
updateSearchOverlay(getSearchOverlay(false).fadeOut('fast'), val);
|
updateSearchOverlay(getSearchOverlay(false).fadeOut('fast'), val);
|
||||||
$(document.body).removeClass('bodyWithPopupOpen');
|
$(document.body).removeClass('bodyWithPopupOpen');
|
||||||
}
|
}
|
||||||
|
@ -469,6 +197,7 @@
|
||||||
function closeSearchOverlay() {
|
function closeSearchOverlay() {
|
||||||
$('.headerSearchInput').val('');
|
$('.headerSearchInput').val('');
|
||||||
onHeaderSearchChange('');
|
onHeaderSearchChange('');
|
||||||
|
$('.viewMenuSearch').addClass('hide');
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on('pagehide', ".libraryPage", function () {
|
$(document).on('pagehide', ".libraryPage", function () {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue