mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
display critic reviews on detail page
This commit is contained in:
parent
5437824c3f
commit
ec50d3613f
8 changed files with 299 additions and 86 deletions
26
ApiClient.js
26
ApiClient.js
|
@ -838,6 +838,32 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
self.getCriticReviews = function (itemId, options) {
|
||||||
|
|
||||||
|
if (!itemId) {
|
||||||
|
throw new Error("null itemId");
|
||||||
|
}
|
||||||
|
|
||||||
|
var url = self.getUrl("Items/" + itemId + "/CriticReviews", options);
|
||||||
|
|
||||||
|
return self.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: url,
|
||||||
|
dataType: "json"
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
self.getSessions = function (options) {
|
||||||
|
|
||||||
|
var url = self.getUrl("Sessions", options);
|
||||||
|
|
||||||
|
return self.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: url,
|
||||||
|
dataType: "json"
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Uploads a user image
|
* Uploads a user image
|
||||||
* @param {String} userId
|
* @param {String} userId
|
||||||
|
|
|
@ -150,6 +150,42 @@
|
||||||
margin: 0 5px 5px 0;
|
margin: 0 5px 5px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.criticReview {
|
||||||
|
font-size: 14px;
|
||||||
|
margin: 1.5em 0;
|
||||||
|
background: #222;
|
||||||
|
padding: .8em .8em .8em 55px;
|
||||||
|
border-radius: 5px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.criticReview:first-child {
|
||||||
|
margin-top: .5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.criticReview img {
|
||||||
|
width: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.reviewerName {
|
||||||
|
color: #ccc;
|
||||||
|
font-size: 13px;
|
||||||
|
margin-top: .5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.reviewLink {
|
||||||
|
margin-top: .5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.reviewDate {
|
||||||
|
margin-left: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.reviewScore {
|
||||||
|
position: absolute;
|
||||||
|
left: .8em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@media all and (min-width: 750px) {
|
@media all and (min-width: 750px) {
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,14 @@ body {
|
||||||
overflow-y: scroll!important;
|
overflow-y: scroll!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.textlink {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.textlink:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-family: 'Segoe UI Light', 'Open Sans', Arial, Helvetica, sans-serif;
|
font-family: 'Segoe UI Light', 'Open Sans', Arial, Helvetica, sans-serif;
|
||||||
font-weight: 200;
|
font-weight: 200;
|
||||||
|
@ -640,7 +648,8 @@ progress {
|
||||||
/* Firefox */
|
/* Firefox */
|
||||||
progress::-moz-progress-bar {
|
progress::-moz-progress-bar {
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
background-image: -moz-linear-gradient( center bottom, rgb(43,194,83) 37%, rgb(84,240,84) 69% );s
|
background-image: -moz-linear-gradient( center bottom, rgb(43,194,83) 37%, rgb(84,240,84) 69% );
|
||||||
|
s;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Chrome */
|
/* Chrome */
|
||||||
|
@ -923,9 +932,9 @@ progress {
|
||||||
margin: .2em 0px;
|
margin: .2em 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#videoWindow.tubecss .vjs-menu-button.vjs-subtitle-button div:hover {
|
#videoWindow.tubecss .vjs-menu-button.vjs-subtitle-button div:hover {
|
||||||
opacity: 1.0;
|
opacity: 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vjs-language-button.vjs-menu-button ul {
|
.vjs-language-button.vjs-menu-button ul {
|
||||||
width: auto;
|
width: auto;
|
||||||
|
@ -978,7 +987,7 @@ progress {
|
||||||
|
|
||||||
#videoWindow.tubecss .vjs-duration {
|
#videoWindow.tubecss .vjs-duration {
|
||||||
right: .1em;
|
right: .1em;
|
||||||
text-align:right;
|
text-align: right;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,6 +101,9 @@
|
||||||
<span id="playButtonContainer" style="display: none;">
|
<span id="playButtonContainer" style="display: none;">
|
||||||
<button id="btnPlay" type="button" data-icon="play" data-inline="true" data-mini="true" data-theme="a">Play</button>
|
<button id="btnPlay" type="button" data-icon="play" data-inline="true" data-mini="true" data-theme="a">Play</button>
|
||||||
</span>
|
</span>
|
||||||
|
<span>
|
||||||
|
<button id="btnRemote" type="button" data-icon="hand-up" data-inline="true" data-mini="true" data-theme="a">Remote</button>
|
||||||
|
</span>
|
||||||
<span id="editButtonContainer" style="display: none;">
|
<span id="editButtonContainer" style="display: none;">
|
||||||
<button id="btnEdit" type="button" data-icon="pencil" data-inline="true" data-mini="true" data-theme="a">Edit</button>
|
<button id="btnEdit" type="button" data-icon="pencil" data-inline="true" data-mini="true" data-theme="a">Edit</button>
|
||||||
</span>
|
</span>
|
||||||
|
@ -177,6 +180,12 @@
|
||||||
<div id="castContent"></div>
|
<div id="castContent"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<div data-role="collapsible" id="criticReviewsCollapsible" style="display: none;" data-mini="true" data-collapsed="false" data-corners="false">
|
||||||
|
<h3>Critic Reviews</h3>
|
||||||
|
<div id="criticReviewsContent"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div data-role="collapsible" id="scenesCollapsible" style="display: none;" data-mini="true" data-collapsed="false" data-corners="false">
|
<div data-role="collapsible" id="scenesCollapsible" style="display: none;" data-mini="true" data-collapsed="false" data-corners="false">
|
||||||
<h3>Scenes</h3>
|
<h3>Scenes</h3>
|
||||||
|
|
|
@ -164,7 +164,7 @@
|
||||||
$('#scenesCollapsible', page).hide();
|
$('#scenesCollapsible', page).hide();
|
||||||
} else {
|
} else {
|
||||||
$('#scenesCollapsible', page).show();
|
$('#scenesCollapsible', page).show();
|
||||||
renderScenes(page, item);
|
renderScenes(page, item, 6);
|
||||||
}
|
}
|
||||||
if (!item.LocalTrailerCount || item.LocalTrailerCount == 0) {
|
if (!item.LocalTrailerCount || item.LocalTrailerCount == 0) {
|
||||||
$('#trailersCollapsible', page).hide();
|
$('#trailersCollapsible', page).hide();
|
||||||
|
@ -176,13 +176,13 @@
|
||||||
$('#specialsCollapsible', page).hide();
|
$('#specialsCollapsible', page).hide();
|
||||||
} else {
|
} else {
|
||||||
$('#specialsCollapsible', page).show();
|
$('#specialsCollapsible', page).show();
|
||||||
renderSpecials(page, item);
|
renderSpecials(page, item, 6);
|
||||||
}
|
}
|
||||||
if (!item.People || !item.People.length) {
|
if (!item.People || !item.People.length) {
|
||||||
$('#castCollapsible', page).hide();
|
$('#castCollapsible', page).hide();
|
||||||
} else {
|
} else {
|
||||||
$('#castCollapsible', page).show();
|
$('#castCollapsible', page).show();
|
||||||
renderCast(page, item, context);
|
renderCast(page, item, context, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#themeSongsCollapsible', page).hide();
|
$('#themeSongsCollapsible', page).hide();
|
||||||
|
@ -195,6 +195,8 @@
|
||||||
ApiClient.getThemeVideos(Dashboard.getCurrentUserId(), item.Id).done(function (result) {
|
ApiClient.getThemeVideos(Dashboard.getCurrentUserId(), item.Id).done(function (result) {
|
||||||
renderThemeVideos(page, item, result);
|
renderThemeVideos(page, item, result);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
renderCriticReviews(page, item, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderDetails(page, item, context) {
|
function renderDetails(page, item, context) {
|
||||||
|
@ -316,6 +318,97 @@
|
||||||
$('#itemRatings', page).html(LibraryBrowser.getUserDataIconsHtml(item));
|
$('#itemRatings', page).html(LibraryBrowser.getUserDataIconsHtml(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function renderCriticReviews(page, item, limit) {
|
||||||
|
|
||||||
|
var options = {};
|
||||||
|
|
||||||
|
if (limit) {
|
||||||
|
options.limit = limit;
|
||||||
|
}
|
||||||
|
|
||||||
|
ApiClient.getCriticReviews(item.Id, options).done(function (result) {
|
||||||
|
|
||||||
|
if (result.TotalRecordCount) {
|
||||||
|
$('#criticReviewsCollapsible', page).show();
|
||||||
|
renderCriticReviewsContent(page, result, limit);
|
||||||
|
} else {
|
||||||
|
$('#criticReviewsCollapsible', page).hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderCriticReviewsContent(page, result, limit) {
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
|
||||||
|
var reviews = result.ItemReviews;
|
||||||
|
|
||||||
|
for (var i = 0, length = reviews.length; i < length; i++) {
|
||||||
|
|
||||||
|
var review = reviews[i];
|
||||||
|
|
||||||
|
html += '<div class="criticReview">';
|
||||||
|
|
||||||
|
html += '<div class="reviewScore">';
|
||||||
|
|
||||||
|
|
||||||
|
if (review.Score != null) {
|
||||||
|
html += review.Score;
|
||||||
|
}
|
||||||
|
else if (review.Likes != null) {
|
||||||
|
|
||||||
|
if (review.Likes) {
|
||||||
|
html += '<img src="css/images/fresh.png" />';
|
||||||
|
} else {
|
||||||
|
html += '<img src="css/images/rotten.png" />';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '</div>';
|
||||||
|
|
||||||
|
html += '<div class="reviewCaption">' + review.Caption + '</div>';
|
||||||
|
|
||||||
|
var vals = [];
|
||||||
|
|
||||||
|
if (review.ReviewerName) {
|
||||||
|
vals.push(review.ReviewerName);
|
||||||
|
}
|
||||||
|
if (review.Publisher) {
|
||||||
|
vals.push(review.Publisher);
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '<div class="reviewerName">' + vals.join(', ') + '.';
|
||||||
|
|
||||||
|
if (review.Date) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
var date = parseISO8601Date(review.Date, true).toLocaleDateString();
|
||||||
|
|
||||||
|
html += '<span class="reviewDate">' + date + '</span>';
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '</div>';
|
||||||
|
|
||||||
|
if (review.Url) {
|
||||||
|
html += '<div class="reviewLink"><a class="textlink" href="' + review.Url + '" target="_blank">Full review</a></div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (limit && result.TotalRecordCount > limit) {
|
||||||
|
html += '<p style="margin: .5em 0 0;padding-left: .5em;"><button class="moreCriticReviews" data-inline="true" data-mini="true">More ...</button></p>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#criticReviewsContent', page).html(html).trigger('create');
|
||||||
|
}
|
||||||
|
|
||||||
function renderThemeSongs(page, item, result) {
|
function renderThemeSongs(page, item, result) {
|
||||||
|
|
||||||
if (result.Items.length) {
|
if (result.Items.length) {
|
||||||
|
@ -336,13 +429,17 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderScenes(page, item) {
|
function renderScenes(page, item, limit) {
|
||||||
var html = '';
|
var html = '';
|
||||||
|
|
||||||
var chapters = item.Chapters || {};
|
var chapters = item.Chapters || [];
|
||||||
|
|
||||||
for (var i = 0, length = chapters.length; i < length; i++) {
|
for (var i = 0, length = chapters.length; i < length; i++) {
|
||||||
|
|
||||||
|
if (limit && i >= limit) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
var chapter = chapters[i];
|
var chapter = chapters[i];
|
||||||
var chapterName = chapter.Name || "Chapter " + i;
|
var chapterName = chapter.Name || "Chapter " + i;
|
||||||
|
|
||||||
|
@ -374,7 +471,11 @@
|
||||||
html += '</a>';
|
html += '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#scenesContent', page).html(html);
|
if (limit && chapters.length > limit) {
|
||||||
|
html += '<p style="margin: .5em 0 0;padding-left: .5em;"><button class="moreScenes" data-inline="true" data-mini="true">More ...</button></p>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#scenesContent', page).html(html).trigger('create');
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderGallery(page, item) {
|
function renderGallery(page, item) {
|
||||||
|
@ -479,15 +580,21 @@
|
||||||
$('#mediaInfoContent', page).html(html).trigger('create');
|
$('#mediaInfoContent', page).html(html).trigger('create');
|
||||||
}
|
}
|
||||||
|
|
||||||
function getVideosHtml(items) {
|
function getVideosHtml(items, limit, moreButtonClass) {
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
|
|
||||||
for (var i = 0, length = items.length; i < length; i++) {
|
for (var i = 0, length = items.length; i < length; i++) {
|
||||||
|
|
||||||
|
if (limit && i >= limit) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
var item = items[i];
|
var item = items[i];
|
||||||
|
|
||||||
html += '<a class="posterItem smallBackdropPosterItem" href="#" onclick="MediaPlayer.playById(\'' + item.Id + '\');">';
|
var cssClass = "posterItem smallBackdropPosterItem";
|
||||||
|
|
||||||
|
html += '<a class="' + cssClass + '" href="#" onclick="MediaPlayer.playById(\'' + item.Id + '\');">';
|
||||||
|
|
||||||
var imageTags = item.ImageTags || {};
|
var imageTags = item.ImageTags || {};
|
||||||
|
|
||||||
|
@ -522,14 +629,18 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (limit && items.length > limit) {
|
||||||
|
html += '<p style="margin: .5em 0 0;padding-left: .5em;"><button class="' + moreButtonClass + '" data-inline="true" data-mini="true">More ...</button></p>';
|
||||||
|
}
|
||||||
|
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderSpecials(page, item) {
|
function renderSpecials(page, item, limit) {
|
||||||
|
|
||||||
ApiClient.getSpecialFeatures(Dashboard.getCurrentUserId(), item.Id).done(function (specials) {
|
ApiClient.getSpecialFeatures(Dashboard.getCurrentUserId(), item.Id).done(function (specials) {
|
||||||
|
|
||||||
$('#specialsContent', page).html(getVideosHtml(specials));
|
$('#specialsContent', page).html(getVideosHtml(specials, limit, "moreSpecials")).trigger('create');
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -543,19 +654,59 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderCast(page, item, context) {
|
function renderCast(page, item, context, limit) {
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
|
|
||||||
var casts = item.People || [];
|
var casts = item.People || [];
|
||||||
|
|
||||||
for (var i = 0, length = casts.length; i < length; i++) {
|
for (var i = 0, length = casts.length; i < length; i++) {
|
||||||
|
|
||||||
var cast = casts[i];
|
if (limit && i >= limit) {
|
||||||
|
break;
|
||||||
html += LibraryBrowser.createCastImage(cast, context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#castContent', page).html(html);
|
var cast = casts[i];
|
||||||
|
|
||||||
|
html += '<a class="tileItem smallPosterTileItem" href="itembynamedetails.html?context=' + context + '&person=' + ApiClient.encodeName(cast.Name) + '">';
|
||||||
|
|
||||||
|
var imgUrl;
|
||||||
|
|
||||||
|
if (cast.PrimaryImageTag) {
|
||||||
|
|
||||||
|
imgUrl = ApiClient.getPersonImageUrl(cast.Name, {
|
||||||
|
width: 130,
|
||||||
|
tag: cast.PrimaryImageTag,
|
||||||
|
type: "primary"
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
imgUrl = "css/images/items/list/person.png";
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '<div class="tileImage" style="background-image:url(\'' + imgUrl + '\');"></div>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
html += '<div class="tileContent">';
|
||||||
|
|
||||||
|
html += '<p>' + cast.Name + '</p>';
|
||||||
|
|
||||||
|
var role = cast.Role ? "as " + cast.Role : cast.Type;
|
||||||
|
|
||||||
|
html += '<p>' + (role || "") + '</p>';
|
||||||
|
|
||||||
|
html += '</div>';
|
||||||
|
|
||||||
|
html += '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (limit && casts.length > limit) {
|
||||||
|
html += '<p style="margin: .5em 0 0;padding-left: .5em;"><button class="morePeople" data-inline="true" data-mini="true">More ...</button></p>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#castContent', page).html(html).trigger('create');
|
||||||
}
|
}
|
||||||
|
|
||||||
function play(startPosition) {
|
function play(startPosition) {
|
||||||
|
@ -581,11 +732,33 @@
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
$(page).on("click.moreScenes", ".moreScenes", function () {
|
||||||
|
|
||||||
|
renderScenes(page, currentItem);
|
||||||
|
|
||||||
|
}).on("click.morePeople", ".morePeople", function () {
|
||||||
|
|
||||||
|
renderCast(page, currentItem, getContext(currentItem));
|
||||||
|
|
||||||
|
}).on("click.moreSpecials", ".moreSpecials", function () {
|
||||||
|
|
||||||
|
renderSpecials(page, currentItem);
|
||||||
|
|
||||||
|
}).on("click.moreCriticReviews", ".moreCriticReviews", function () {
|
||||||
|
|
||||||
|
renderCriticReviews(page, currentItem);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
reload(page);
|
reload(page);
|
||||||
|
|
||||||
}).on('pagehide', "#itemDetailPage", function () {
|
}).on('pagehide', "#itemDetailPage", function () {
|
||||||
|
|
||||||
currentItem = null;
|
currentItem = null;
|
||||||
|
|
||||||
|
var page = this;
|
||||||
|
|
||||||
|
$(page).off("click.moreScenes").off("click.morePeople").off("click.moreSpecials").off("click.moreCriticReviews");
|
||||||
});
|
});
|
||||||
|
|
||||||
function itemDetailPage() {
|
function itemDetailPage() {
|
||||||
|
|
|
@ -166,7 +166,7 @@
|
||||||
$('#pViewWebsite', page).hide();
|
$('#pViewWebsite', page).hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pkg.previewImage) {
|
if (pkg.previewImage || pkg.thumbImage) {
|
||||||
|
|
||||||
var color = pkg.tileColor || "#2572EB";
|
var color = pkg.tileColor || "#2572EB";
|
||||||
var img = pkg.previewImage ? pkg.previewImage : pkg.thumbImage;
|
var img = pkg.previewImage ? pkg.previewImage : pkg.thumbImage;
|
||||||
|
|
|
@ -700,51 +700,51 @@
|
||||||
var links = [];
|
var links = [];
|
||||||
|
|
||||||
if (item.HomePageUrl) {
|
if (item.HomePageUrl) {
|
||||||
links.push('<a class="ui-link" href="' + item.HomePageUrl + '" target="_blank">Website</a>');
|
links.push('<a class="textlink" href="' + item.HomePageUrl + '" target="_blank">Website</a>');
|
||||||
}
|
}
|
||||||
|
|
||||||
var providerIds = item.ProviderIds || {};
|
var providerIds = item.ProviderIds || {};
|
||||||
|
|
||||||
if (providerIds.Imdb) {
|
if (providerIds.Imdb) {
|
||||||
if (item.Type == "Movie" || item.Type == "Episode" || item.Type == "Trailer")
|
if (item.Type == "Movie" || item.Type == "Episode" || item.Type == "Trailer")
|
||||||
links.push('<a class="ui-link" href="http://www.imdb.com/title/' + providerIds.Imdb + '" target="_blank">IMDb</a>');
|
links.push('<a class="textlink" href="http://www.imdb.com/title/' + providerIds.Imdb + '" target="_blank">IMDb</a>');
|
||||||
else if (item.Type == "Person")
|
else if (item.Type == "Person")
|
||||||
links.push('<a class="ui-link" href="http://www.imdb.com/name/' + providerIds.Imdb + '" target="_blank">IMDb</a>');
|
links.push('<a class="textlink" href="http://www.imdb.com/name/' + providerIds.Imdb + '" target="_blank">IMDb</a>');
|
||||||
}
|
}
|
||||||
if (providerIds.Tmdb) {
|
if (providerIds.Tmdb) {
|
||||||
if (item.Type == "Movie" || item.Type == "Trailer")
|
if (item.Type == "Movie" || item.Type == "Trailer")
|
||||||
links.push('<a class="ui-link" href="http://www.themoviedb.org/movie/' + providerIds.Tmdb + '" target="_blank">TMDB</a>');
|
links.push('<a class="textlink" href="http://www.themoviedb.org/movie/' + providerIds.Tmdb + '" target="_blank">TMDB</a>');
|
||||||
else if (item.Type == "BoxSet")
|
else if (item.Type == "BoxSet")
|
||||||
links.push('<a class="ui-link" href="http://www.themoviedb.org/collection/' + providerIds.Tmdb + '" target="_blank">TMDB</a>');
|
links.push('<a class="textlink" href="http://www.themoviedb.org/collection/' + providerIds.Tmdb + '" target="_blank">TMDB</a>');
|
||||||
else if (item.Type == "Person")
|
else if (item.Type == "Person")
|
||||||
links.push('<a class="ui-link" href="http://www.themoviedb.org/person/' + providerIds.Tmdb + '" target="_blank">TMDB</a>');
|
links.push('<a class="textlink" href="http://www.themoviedb.org/person/' + providerIds.Tmdb + '" target="_blank">TMDB</a>');
|
||||||
}
|
}
|
||||||
if (providerIds.Tvdb)
|
if (providerIds.Tvdb)
|
||||||
links.push('<a class="ui-link" href="http://thetvdb.com/index.php?tab=series&id=' + providerIds.Tvdb + '" target="_blank">TVDB</a>');
|
links.push('<a class="textlink" href="http://thetvdb.com/index.php?tab=series&id=' + providerIds.Tvdb + '" target="_blank">TVDB</a>');
|
||||||
if (providerIds.Tvcom) {
|
if (providerIds.Tvcom) {
|
||||||
if (item.Type == "Episode")
|
if (item.Type == "Episode")
|
||||||
links.push('<a class="ui-link" href="http://www.tv.com/shows/' + providerIds.Tvcom + '" target="_blank">TV.com</a>');
|
links.push('<a class="textlink" href="http://www.tv.com/shows/' + providerIds.Tvcom + '" target="_blank">TV.com</a>');
|
||||||
else if (item.Type == "Person")
|
else if (item.Type == "Person")
|
||||||
links.push('<a class="ui-link" href="http://www.tv.com/people/' + providerIds.Tvcom + '" target="_blank">TV.com</a>');
|
links.push('<a class="textlink" href="http://www.tv.com/people/' + providerIds.Tvcom + '" target="_blank">TV.com</a>');
|
||||||
}
|
}
|
||||||
if (providerIds.Musicbrainz) {
|
if (providerIds.Musicbrainz) {
|
||||||
|
|
||||||
if (item.Type == "MusicArtist" || item.Type == "Artist") {
|
if (item.Type == "MusicArtist" || item.Type == "Artist") {
|
||||||
links.push('<a class="ui-link" href="http://musicbrainz.org/artist/' + providerIds.Musicbrainz + '" target="_blank">MusicBrainz</a>');
|
links.push('<a class="textlink" href="http://musicbrainz.org/artist/' + providerIds.Musicbrainz + '" target="_blank">MusicBrainz</a>');
|
||||||
} else {
|
} else {
|
||||||
links.push('<a class="ui-link" href="http://musicbrainz.org/release/' + providerIds.Musicbrainz + '" target="_blank">MusicBrainz</a>');
|
links.push('<a class="textlink" href="http://musicbrainz.org/release/' + providerIds.Musicbrainz + '" target="_blank">MusicBrainz</a>');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (providerIds.Gamesdb)
|
if (providerIds.Gamesdb)
|
||||||
links.push('<a class="ui-link" href="http://www.games-db.com/Game/' + providerIds.Gamesdb + '" target="_blank">GamesDB</a>');
|
links.push('<a class="textlink" href="http://www.games-db.com/Game/' + providerIds.Gamesdb + '" target="_blank">GamesDB</a>');
|
||||||
|
|
||||||
|
|
||||||
if (links.length) {
|
if (links.length) {
|
||||||
|
|
||||||
var html = 'Links: ' + links.join(' / ');
|
var html = 'Links: ' + links.join(' / ');
|
||||||
|
|
||||||
$(linksElem).html(html);
|
$(linksElem).html(html).trigger('create');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$(linksElem).hide();
|
$(linksElem).hide();
|
||||||
|
@ -1272,7 +1272,7 @@
|
||||||
try {
|
try {
|
||||||
var date = parseISO8601Date(item.PremiereDate, { toLocal: true });
|
var date = parseISO8601Date(item.PremiereDate, { toLocal: true });
|
||||||
|
|
||||||
text = (date.getMonth() + 1) + "/" + (date.getDate()) + "/" + date.getFullYear();
|
text = date.toLocaleDateString();
|
||||||
miscInfo.push(text);
|
miscInfo.push(text);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
@ -1379,7 +1379,7 @@
|
||||||
html += ' / ';
|
html += ' / ';
|
||||||
}
|
}
|
||||||
|
|
||||||
html += '<a href="itembynamedetails.html?context=' + context + '&studio=' + ApiClient.encodeName(item.Studios[i].Name) + '">' + item.Studios[i].Name + '</a>';
|
html += '<a class="textlink" href="itembynamedetails.html?context=' + context + '&studio=' + ApiClient.encodeName(item.Studios[i].Name) + '">' + item.Studios[i].Name + '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
elem.show().html(html).trigger('create');
|
elem.show().html(html).trigger('create');
|
||||||
|
@ -1401,7 +1401,7 @@
|
||||||
html += ' / ';
|
html += ' / ';
|
||||||
}
|
}
|
||||||
|
|
||||||
html += '<a href="itembynamedetails.html?context=' + context + '&genre=' + ApiClient.encodeName(item.Genres[i]) + '">' + item.Genres[i] + '</a>';
|
html += '<a class="textlink" href="itembynamedetails.html?context=' + context + '&genre=' + ApiClient.encodeName(item.Genres[i]) + '">' + item.Genres[i] + '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
elem.show().html(html).trigger('create');
|
elem.show().html(html).trigger('create');
|
||||||
|
@ -1583,46 +1583,6 @@
|
||||||
}) + '" />';
|
}) + '" />';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
return html;
|
|
||||||
},
|
|
||||||
|
|
||||||
createCastImage: function (cast, context) {
|
|
||||||
|
|
||||||
var html = '';
|
|
||||||
|
|
||||||
html += '<a class="tileItem smallPosterTileItem" href="itembynamedetails.html?context=' + context + '&person=' + ApiClient.encodeName(cast.Name) + '">';
|
|
||||||
|
|
||||||
var imgUrl;
|
|
||||||
|
|
||||||
if (cast.PrimaryImageTag) {
|
|
||||||
|
|
||||||
imgUrl = ApiClient.getPersonImageUrl(cast.Name, {
|
|
||||||
width: 130,
|
|
||||||
tag: cast.PrimaryImageTag,
|
|
||||||
type: "primary"
|
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
imgUrl = "css/images/items/list/person.png";
|
|
||||||
}
|
|
||||||
|
|
||||||
html += '<div class="tileImage" style="background-image:url(\'' + imgUrl + '\');"></div>';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
html += '<div class="tileContent">';
|
|
||||||
|
|
||||||
html += '<p>' + cast.Name + '</p>';
|
|
||||||
|
|
||||||
var role = cast.Role ? "as " + cast.Role : cast.Type;
|
|
||||||
|
|
||||||
html += '<p>' + (role || "") + '</p>';
|
|
||||||
|
|
||||||
html += '</div>';
|
|
||||||
|
|
||||||
html += '</a>';
|
|
||||||
|
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.104" targetFramework="net45" />
|
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.105" targetFramework="net45" />
|
||||||
<package id="ServiceStack.Common" version="3.9.44" targetFramework="net45" />
|
<package id="ServiceStack.Common" version="3.9.44" targetFramework="net45" />
|
||||||
<package id="ServiceStack.Text" version="3.9.44" targetFramework="net45" />
|
<package id="ServiceStack.Text" version="3.9.44" targetFramework="net45" />
|
||||||
</packages>
|
</packages>
|
Loading…
Add table
Add a link
Reference in a new issue