mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add options to identify function
This commit is contained in:
parent
e2384f3087
commit
127f342be1
12 changed files with 177 additions and 93 deletions
|
@ -16,12 +16,12 @@
|
||||||
<a href="supporterkey.html" data-role="button">${TabSupporterKey}</a>
|
<a href="supporterkey.html" data-role="button">${TabSupporterKey}</a>
|
||||||
<a href="about.html" data-role="button" class="ui-btn-active">${TabAbout}</a>
|
<a href="about.html" data-role="button" class="ui-btn-active">${TabAbout}</a>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
<div style="font-size:24px;">
|
||||||
<img class="imgLogoIcon" src="css/images/mblogoicon.png" /><img class="imgLogoText" src="css/images/mblogotextblack.png" />
|
<img class="imgLogoIcon" src="css/images/mblogoicon.png" /><span class="logoLibraryMenuButtonText">MEDIA</span><span class="logoLibraryMenuButtonText mediaBrowserAccent">BROWSER</span>
|
||||||
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<span id="appVersionNumber">${VersionNumber}</span>
|
<div id="appVersionNumber">${VersionNumber}</div>
|
||||||
</p>
|
|
||||||
<br />
|
<br />
|
||||||
<div class="ui-bar-a" style="padding: 1em;">${HeaderCredits}</div>
|
<div class="ui-bar-a" style="padding: 1em;">${HeaderCredits}</div>
|
||||||
<div style="padding: 0 .5em;">
|
<div style="padding: 0 .5em;">
|
||||||
|
|
|
@ -82,7 +82,7 @@
|
||||||
background: #fff;
|
background: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.visualCardBox-b {
|
.ui-page-theme-b .visualCardBox {
|
||||||
background: rgb(51, 51, 51);
|
background: rgb(51, 51, 51);
|
||||||
border: 1px solid rgb(31, 31, 31);
|
border: 1px solid rgb(31, 31, 31);
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
|
@ -148,9 +148,6 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
.cardFooter {
|
|
||||||
}
|
|
||||||
|
|
||||||
.cardContent .cardFooter {
|
.cardContent .cardFooter {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 20 KiB |
Binary file not shown.
Before Width: | Height: | Size: 20 KiB |
|
@ -102,6 +102,11 @@
|
||||||
.logoLibraryMenuButtonText {
|
.logoLibraryMenuButtonText {
|
||||||
font-family: MBLogo;
|
font-family: MBLogo;
|
||||||
font-weight: 200;
|
font-weight: 200;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ui-page-theme-b .logoLibraryMenuButtonText, .ui-bar-b .logoLibraryMenuButtonText {
|
||||||
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.viewMenuBar {
|
.viewMenuBar {
|
||||||
|
|
|
@ -203,12 +203,12 @@ pre, textarea.pre {
|
||||||
|
|
||||||
.imgLogoIcon {
|
.imgLogoIcon {
|
||||||
height: 45px;
|
height: 45px;
|
||||||
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
.imgLogoText {
|
.imgLogoIcon + span {
|
||||||
height: 45px;
|
margin-left: 10px;
|
||||||
margin-left: 5px;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.ui-popup-container {
|
.ui-popup-container {
|
||||||
z-index: 99999;
|
z-index: 99999;
|
||||||
|
@ -446,10 +446,6 @@ h1 .imageLink {
|
||||||
max-width: 600px;
|
max-width: 600px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.imgLogoText {
|
|
||||||
height: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
padding-top: 15px;
|
padding-top: 15px;
|
||||||
padding-bottom: 15px;
|
padding-bottom: 15px;
|
||||||
|
@ -782,17 +778,17 @@ progress {
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btnUserItemRatingOff {
|
.btnUserItemRatingOff {
|
||||||
color: #aaa !important;
|
color: #aaa !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btnUserItemRating:last-child {
|
.btnUserItemRating:last-child {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btnUserItemRating:hover {
|
.btnUserItemRating:hover {
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.imgUserItemRating {
|
.imgUserItemRating {
|
||||||
height: 16px;
|
height: 16px;
|
||||||
|
|
|
@ -389,11 +389,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div data-role="popup" class="popupIdentify popup" data-theme="a">
|
<div data-role="popup" class="popupIdentify popup" data-theme="a">
|
||||||
<a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-b ui-icon-delete ui-btn-icon-notext ui-btn-right">${ButtonClose}</a>
|
|
||||||
|
|
||||||
<div class="ui-bar-a" style="text-align: center; padding: 0 20px; position: relative;">
|
<div class="ui-bar-a" style="text-align: center; padding: 0 20px; position: relative;">
|
||||||
|
|
||||||
<button type="button" data-icon="search" data-mini="true" data-inline="true" data-iconpos="notext" style="position: absolute; top: 8px; left: 10px; margin: 0;" class="btnSearchAgain">${ButtonSearch}</button>
|
<button type="button" data-icon="back" data-mini="true" data-inline="true" data-iconpos="notext" style="position: absolute; top: 8px; left: 10px; margin: 0;" class="btnIdentifyBack">${ButtonSearch}</button>
|
||||||
|
|
||||||
<h3 class="identificationHeader">${HeaderIdentifyItem}</h3>
|
<h3 class="identificationHeader">${HeaderIdentifyItem}</h3>
|
||||||
</div>
|
</div>
|
||||||
|
@ -430,6 +429,24 @@
|
||||||
|
|
||||||
<div class="identificationSearchResultList"></div>
|
<div class="identificationSearchResultList"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<form class="identifyOptionsForm" style="max-width:initial;">
|
||||||
|
|
||||||
|
<h1 style="margin-top:.25em;">${HeaderIdentificationResult}</h1>
|
||||||
|
<div class="selectedSearchResult"></div>
|
||||||
|
<h1>${HeaderOptions}</h1>
|
||||||
|
<div>
|
||||||
|
<label for="chkIdentifyReplaceImages">${OptionReplaceExistingImages}</label>
|
||||||
|
<input id="chkIdentifyReplaceImages" type="checkbox" checked="checked" data-mini="true" />
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<button type="submit" data-theme="b" data-icon="check" data-mini="true">
|
||||||
|
${ButtonSubmit}
|
||||||
|
</button>
|
||||||
|
<button type="button" data-icon="delete" data-mini="true" onclick="$(this).parents('.popup').popup('close');">
|
||||||
|
${ButtonCancel}
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -528,6 +545,7 @@
|
||||||
$('.popupIdentifyForm').off('submit', EditItemMetadataPage.onIdentificationFormSubmitted).on('submit', EditItemMetadataPage.onIdentificationFormSubmitted);
|
$('.popupIdentifyForm').off('submit', EditItemMetadataPage.onIdentificationFormSubmitted).on('submit', EditItemMetadataPage.onIdentificationFormSubmitted);
|
||||||
$('.popupEditPersonForm').off('submit', EditItemMetadataPage.onPersonInfoFormSubmit).on('submit', EditItemMetadataPage.onPersonInfoFormSubmit);
|
$('.popupEditPersonForm').off('submit', EditItemMetadataPage.onPersonInfoFormSubmit).on('submit', EditItemMetadataPage.onPersonInfoFormSubmit);
|
||||||
$('.popupAdvancedRefreshForm').off('submit', EditItemMetadataPage.onRefreshFormSubmit).on('submit', EditItemMetadataPage.onRefreshFormSubmit);
|
$('.popupAdvancedRefreshForm').off('submit', EditItemMetadataPage.onRefreshFormSubmit).on('submit', EditItemMetadataPage.onRefreshFormSubmit);
|
||||||
|
$('.identifyOptionsForm').off('submit', EditItemMetadataPage.onIdentificationOptionsSubmit).on('submit', EditItemMetadataPage.onIdentificationOptionsSubmit);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
(function ($, document, window) {
|
(function ($, document, window) {
|
||||||
|
|
||||||
var currentItem;
|
var currentItem;
|
||||||
|
var currentSearchResult;
|
||||||
var metadataEditorInfo;
|
var metadataEditorInfo;
|
||||||
|
|
||||||
function updateTabs(page, item) {
|
function updateTabs(page, item) {
|
||||||
|
@ -148,7 +149,7 @@
|
||||||
var buttonId = "btnOpen1" + idInfo.Key;
|
var buttonId = "btnOpen1" + idInfo.Key;
|
||||||
var formatString = idInfo.UrlFormatString || '';
|
var formatString = idInfo.UrlFormatString || '';
|
||||||
|
|
||||||
html += '<div>';
|
html += '<div data-role="fieldcontain">';
|
||||||
var idLabel = Globalize.translate('LabelDynamicExternalId').replace('{0}', idInfo.Name);
|
var idLabel = Globalize.translate('LabelDynamicExternalId').replace('{0}', idInfo.Name);
|
||||||
html += '<label for="' + id + '">' + idLabel + '</label>';
|
html += '<label for="' + id + '">' + idLabel + '</label>';
|
||||||
|
|
||||||
|
@ -1008,6 +1009,14 @@
|
||||||
savePersonInfo(page);
|
savePersonInfo(page);
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
self.onIdentificationOptionsSubmit = function () {
|
||||||
|
|
||||||
|
var page = $(this).parents('.page');
|
||||||
|
|
||||||
|
submitIdentficationResult(page);
|
||||||
|
return false;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
window.EditItemMetadataPage = new editItemMetadataPage();
|
window.EditItemMetadataPage = new editItemMetadataPage();
|
||||||
|
@ -1058,7 +1067,8 @@
|
||||||
|
|
||||||
$('.popupIdentifyForm', page).show();
|
$('.popupIdentifyForm', page).show();
|
||||||
$('.identificationSearchResults', page).hide();
|
$('.identificationSearchResults', page).hide();
|
||||||
$('.btnSearchAgain', page).hide();
|
$('.identifyOptionsForm', page).hide();
|
||||||
|
$('.btnIdentifyBack', page).hide();
|
||||||
|
|
||||||
$('.popupIdentify', page).popup('open');
|
$('.popupIdentify', page).popup('open');
|
||||||
});
|
});
|
||||||
|
@ -1131,18 +1141,9 @@
|
||||||
return ApiClient.getUrl("Items/RemoteSearch/Image", { imageUrl: url, ProviderName: provider });
|
return ApiClient.getUrl("Items/RemoteSearch/Image", { imageUrl: url, ProviderName: provider });
|
||||||
}
|
}
|
||||||
|
|
||||||
function showIdentificationSearchResults(page, results) {
|
function getSearchResultHtml(result, index) {
|
||||||
|
|
||||||
$('.popupIdentifyForm', page).hide();
|
|
||||||
$('.identificationSearchResults', page).show();
|
|
||||||
$('.btnSearchAgain', page).show();
|
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
|
|
||||||
for (var i = 0, length = results.length; i < length; i++) {
|
|
||||||
|
|
||||||
var result = results[i];
|
|
||||||
|
|
||||||
var cssClass = "searchImageContainer remoteImageContainer";
|
var cssClass = "searchImageContainer remoteImageContainer";
|
||||||
|
|
||||||
if (currentItem.Type == "Episode") {
|
if (currentItem.Type == "Episode") {
|
||||||
|
@ -1160,10 +1161,10 @@
|
||||||
if (result.ImageUrl) {
|
if (result.ImageUrl) {
|
||||||
var displayUrl = getSearchImageDisplayUrl(result.ImageUrl, result.SearchProviderName);
|
var displayUrl = getSearchImageDisplayUrl(result.ImageUrl, result.SearchProviderName);
|
||||||
|
|
||||||
html += '<a href="#" class="searchImage" data-index="' + i + '" style="background-image:url(\'' + displayUrl + '\');">';
|
html += '<a href="#" class="searchImage" data-index="' + index + '" style="background-image:url(\'' + displayUrl + '\');">';
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
html += '<a href="#" class="searchImage" data-index="' + i + '" style="background-image:url(\'css/images/items/list/remotesearch.png\');background-position: center center;">';
|
html += '<a href="#" class="searchImage" data-index="' + index + '" style="background-image:url(\'css/images/items/list/remotesearch.png\');background-position: center center;">';
|
||||||
}
|
}
|
||||||
html += '</a>';
|
html += '</a>';
|
||||||
|
|
||||||
|
@ -1182,22 +1183,81 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
|
||||||
|
function showIdentificationSearchResults(page, results) {
|
||||||
|
|
||||||
|
$('.popupIdentifyForm', page).hide();
|
||||||
|
$('.identificationSearchResults', page).show();
|
||||||
|
$('.identifyOptionsForm', page).hide();
|
||||||
|
$('.btnIdentifyBack', page).show();
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
|
||||||
|
for (var i = 0, length = results.length; i < length; i++) {
|
||||||
|
|
||||||
|
var result = results[i];
|
||||||
|
|
||||||
|
html += getSearchResultHtml(result, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
var elem = $('.identificationSearchResultList', page).html(html).trigger('create');
|
var elem = $('.identificationSearchResultList', page).html(html).trigger('create');
|
||||||
|
|
||||||
$('.searchImage', elem).on('click', function () {
|
$('.searchImage', elem).on('click', function () {
|
||||||
|
|
||||||
Dashboard.showLoadingMsg();
|
|
||||||
|
|
||||||
var index = parseInt(this.getAttribute('data-index'));
|
var index = parseInt(this.getAttribute('data-index'));
|
||||||
|
|
||||||
var currentResult = results[index];
|
var currentResult = results[index];
|
||||||
|
|
||||||
|
showIdentifyOptions(page, currentResult);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function showIdentifyOptions(page, identifyResult) {
|
||||||
|
|
||||||
|
$('.popupIdentifyForm', page).hide();
|
||||||
|
$('.identificationSearchResults', page).hide();
|
||||||
|
$('.identifyOptionsForm', page).show();
|
||||||
|
$('.btnIdentifyBack', page).show();
|
||||||
|
$('#chkIdentifyReplaceImages', page).checked(true).checkboxradio('refresh');
|
||||||
|
|
||||||
|
currentSearchResult = identifyResult;
|
||||||
|
|
||||||
|
var lines = [];
|
||||||
|
lines.push(identifyResult.Name);
|
||||||
|
|
||||||
|
if (identifyResult.ProductionYear) {
|
||||||
|
lines.push(identifyResult.ProductionYear);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (identifyResult.GameSystem) {
|
||||||
|
lines.push(identifyResult.GameSystem);
|
||||||
|
}
|
||||||
|
|
||||||
|
var resultHtml = lines.join('<br/>');
|
||||||
|
|
||||||
|
if (identifyResult.ImageUrl) {
|
||||||
|
var displayUrl = getSearchImageDisplayUrl(identifyResult.ImageUrl, identifyResult.SearchProviderName);
|
||||||
|
|
||||||
|
resultHtml = '<img src="' + displayUrl + '" style="max-height:160px;" /><br/>' + resultHtml;
|
||||||
|
}
|
||||||
|
|
||||||
|
$('.selectedSearchResult', page).html(resultHtml);
|
||||||
|
}
|
||||||
|
|
||||||
|
function submitIdentficationResult(page) {
|
||||||
|
|
||||||
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
|
var options = {
|
||||||
|
ReplaceAllImages: $('#chkIdentifyReplaceImages', page).checked()
|
||||||
|
};
|
||||||
|
|
||||||
ApiClient.ajax({
|
ApiClient.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: ApiClient.getUrl("Items/RemoteSearch/Apply/" + currentItem.Id),
|
url: ApiClient.getUrl("Items/RemoteSearch/Apply/" + currentItem.Id, options),
|
||||||
data: JSON.stringify(currentResult),
|
data: JSON.stringify(currentSearchResult),
|
||||||
contentType: "application/json"
|
contentType: "application/json"
|
||||||
|
|
||||||
}).done(function () {
|
}).done(function () {
|
||||||
|
@ -1208,7 +1268,6 @@
|
||||||
|
|
||||||
reload(page);
|
reload(page);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function performAdvancedRefresh(page) {
|
function performAdvancedRefresh(page) {
|
||||||
|
@ -1279,11 +1338,20 @@
|
||||||
showIdentificationForm(page);
|
showIdentificationForm(page);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.btnSearchAgain', page).on('click', function () {
|
$('.btnIdentifyBack', page).on('click', function () {
|
||||||
|
|
||||||
|
if ($('.identifyOptionsForm', page).is(':visible')) {
|
||||||
|
|
||||||
|
$('.identifyOptionsForm', page).hide();
|
||||||
|
|
||||||
|
$('.identificationSearchResults', page).show();
|
||||||
|
$('.popupIdentifyForm', page).hide();
|
||||||
|
} else {
|
||||||
|
|
||||||
$('.popupIdentifyForm', page).show();
|
|
||||||
$('.identificationSearchResults', page).hide();
|
$('.identificationSearchResults', page).hide();
|
||||||
$('.btnSearchAgain', page).hide();
|
$('.popupIdentifyForm', page).show();
|
||||||
|
$(this).hide();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#btnDelete', this).on('click', function () {
|
$('#btnDelete', this).on('click', function () {
|
||||||
|
|
|
@ -1250,7 +1250,7 @@
|
||||||
var cardboxCssClass = 'cardBox';
|
var cardboxCssClass = 'cardBox';
|
||||||
|
|
||||||
if (options.cardLayout) {
|
if (options.cardLayout) {
|
||||||
cardboxCssClass += ' visualCardBox visualCardBox-b';
|
cardboxCssClass += ' visualCardBox';
|
||||||
}
|
}
|
||||||
html += '<div class="' + cardboxCssClass + '">';
|
html += '<div class="' + cardboxCssClass + '">';
|
||||||
html += '<div class="cardScalable">';
|
html += '<div class="cardScalable">';
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
|
|
||||||
html += "<div data-id='" + server.Id + "' data-connectserverid='" + (server.ConnectServerId || '') + "' class='" + cssClass + "'>";
|
html += "<div data-id='" + server.Id + "' data-connectserverid='" + (server.ConnectServerId || '') + "' class='" + cssClass + "'>";
|
||||||
|
|
||||||
html += '<div class="cardBox visualCardBox visualCardBox-b">';
|
html += '<div class="cardBox visualCardBox">';
|
||||||
html += '<div class="cardScalable">';
|
html += '<div class="cardScalable">';
|
||||||
|
|
||||||
html += '<div class="cardPadder"></div>';
|
html += '<div class="cardPadder"></div>';
|
||||||
|
@ -264,7 +264,7 @@
|
||||||
|
|
||||||
html += "<div data-id='" + invite.Id + "' class='" + cssClass + "'>";
|
html += "<div data-id='" + invite.Id + "' class='" + cssClass + "'>";
|
||||||
|
|
||||||
html += '<div class="cardBox visualCardBox visualCardBox-b">';
|
html += '<div class="cardBox visualCardBox">';
|
||||||
html += '<div class="cardScalable">';
|
html += '<div class="cardScalable">';
|
||||||
|
|
||||||
html += '<div class="cardPadder"></div>';
|
html += '<div class="cardPadder"></div>';
|
||||||
|
|
|
@ -640,11 +640,12 @@ var Dashboard = {
|
||||||
|
|
||||||
headerHtml += '<div class="header">';
|
headerHtml += '<div class="header">';
|
||||||
|
|
||||||
headerHtml += '<a class="logo" href="index.html">';
|
headerHtml += '<a class="logo" href="index.html" style="text-decoration:none;font-size: 22px;">';
|
||||||
|
|
||||||
if (page.hasClass('standalonePage')) {
|
if (page.hasClass('standalonePage')) {
|
||||||
|
|
||||||
headerHtml += '<img class="imgLogoIcon" src="css/images/mblogoicon.png" /><img class="imgLogoText" src="css/images/mblogotextblack.png" />';
|
headerHtml += '<img class="imgLogoIcon" src="css/images/mblogoicon.png" />';
|
||||||
|
headerHtml += '<span class="logoLibraryMenuButtonText">MEDIA</span><span class="logoLibraryMenuButtonText mediaBrowserAccent">BROWSER</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
headerHtml += '</a>';
|
headerHtml += '</a>';
|
||||||
|
|
|
@ -144,7 +144,6 @@
|
||||||
var barCssClass = 'ui-bar-a';
|
var barCssClass = 'ui-bar-a';
|
||||||
|
|
||||||
if ($(page).hasClass('libraryPage')) {
|
if ($(page).hasClass('libraryPage')) {
|
||||||
cardBoxCssClass += ' visualCardBox-b';
|
|
||||||
barCssClass = 'detailSectionHeader';
|
barCssClass = 'detailSectionHeader';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue