1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

added new indicators

This commit is contained in:
Luke Pulverenti 2013-04-10 00:38:04 -04:00
parent 0379c723e9
commit b9c29ad110
8 changed files with 55 additions and 13 deletions

View file

@ -1,13 +1,13 @@
var LibraryBrowser = {
getDetaultPageSize: function() {
getDetaultPageSize: function () {
if (window.location.toString().toLowerCase().indexOf('localhost') != -1) {
return 100;
}
return 25;
},
getPosterViewHtml: function (options) {
var items = options.items;
@ -35,7 +35,7 @@
height: 198,
width: 352,
tag: item.BackdropImageTags[0]
}) + "' />";
} else if (hasPrimaryImage) {
@ -47,7 +47,7 @@
height: height,
width: width,
tag: item.ImageTags.Primary
}) + "' />";
} else if (item.BackdropImageTags && item.BackdropImageTags.length) {
@ -56,7 +56,7 @@
height: 198,
width: 352,
tag: item.BackdropImageTags[0]
}) + "' />";
}
else if (item.MediaType == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicArtist") {
@ -78,6 +78,10 @@
html += "</div>";
}
if (options.showNewIndicator !== false) {
html += LibraryBrowser.getNewIndicatorHtml(item);
}
html += "</a></div>";
}
@ -153,6 +157,10 @@
html += "</div>";
}
if (options.showNewIndicator !== false) {
html += LibraryBrowser.getNewIndicatorHtml(item);
}
html += "</a></div>";
}
@ -220,12 +228,34 @@
html += "</div>";
}
if (options.showNewIndicator !== false) {
html += LibraryBrowser.getNewIndicatorHtml(item);
}
html += "</a></div>";
}
return html;
},
getNewIndicatorHtml: function (item) {
if (item.RecentlyAddedItemCount) {
return '<div class="posterRibbon">' + item.RecentlyAddedItemCount + ' New</div>';
}
if (!item.IsFolder) {
var date = item.DateCreated;
if (date && (new Date().getTime() - parseISO8601Date(date).getTime()) < 1209600000) {
return "<div class='posterRibbon'>New</div>";
}
}
return '';
},
getAveragePrimaryImageAspectRatio: function (items) {
var values = [];