mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
scale image sizes depending on pixel ratio
This commit is contained in:
parent
5677ce1011
commit
4962827f56
6 changed files with 51 additions and 27 deletions
|
@ -68,11 +68,6 @@
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-weight: 400!important;
|
font-weight: 400!important;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.libraryMenuButtonText {
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
margin-left: .5em;
|
margin-left: .5em;
|
||||||
|
@ -302,11 +297,15 @@
|
||||||
|
|
||||||
@media all and (max-width: 600px) {
|
@media all and (max-width: 600px) {
|
||||||
|
|
||||||
.libraryMenuButtonText {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.headerSettingsButton {
|
.headerSettingsButton {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@media all and (max-width: 500px) {
|
||||||
|
|
||||||
|
.libraryMenuButtonText {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -145,7 +145,7 @@
|
||||||
left: 0;
|
left: 0;
|
||||||
line-height: 36px;
|
line-height: 36px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding-left: 43px;
|
padding: 0 0 0 43px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.moviesPosterItem .posterItemImage {
|
.moviesPosterItem .posterItemImage {
|
||||||
|
|
|
@ -73,7 +73,8 @@
|
||||||
var imgUrl = ApiClient.getScaledImageUrl(item.id, {
|
var imgUrl = ApiClient.getScaledImageUrl(item.id, {
|
||||||
type: "Backdrop",
|
type: "Backdrop",
|
||||||
tag: item.tag,
|
tag: item.tag,
|
||||||
maxWidth: screenWidth
|
maxWidth: screenWidth,
|
||||||
|
quality: 80
|
||||||
});
|
});
|
||||||
|
|
||||||
getElement().css('backgroundImage', 'url(\'' + imgUrl + '\')');
|
getElement().css('backgroundImage', 'url(\'' + imgUrl + '\')');
|
||||||
|
@ -102,7 +103,7 @@
|
||||||
|
|
||||||
var val = LocalSettings.val('enableBackdrops', userId);
|
var val = LocalSettings.val('enableBackdrops', userId);
|
||||||
|
|
||||||
return val == '1';
|
return val != '0';
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on('pagebeforeshow', ".backdropPage", function () {
|
$(document).on('pagebeforeshow', ".backdropPage", function () {
|
||||||
|
|
|
@ -70,11 +70,9 @@
|
||||||
html += '<div class="' + imageCssClass + '" style="' + style + '">';
|
html += '<div class="' + imageCssClass + '" style="' + style + '">';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
if (options.showTitle) {
|
html += "<div class='posterItemDefaultText posterItemText'>";
|
||||||
html += "<div class='posterItemDefaultText'>";
|
html += item.Name;
|
||||||
html += item.Name;
|
html += "</div>";
|
||||||
html += "</div>";
|
|
||||||
}
|
|
||||||
|
|
||||||
html += "</a>";
|
html += "</a>";
|
||||||
}
|
}
|
||||||
|
@ -161,6 +159,8 @@
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
$(elem).html(html);
|
$(elem).html(html);
|
||||||
|
|
||||||
|
handleLibraryLinkNavigations(elem);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,6 +228,8 @@
|
||||||
|
|
||||||
|
|
||||||
$(elem).html(html).createPosterItemMenus();
|
$(elem).html(html).createPosterItemMenus();
|
||||||
|
|
||||||
|
handleLibraryLinkNavigations(elem);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,8 +289,9 @@
|
||||||
}
|
}
|
||||||
else if (section == 'librarybuttons') {
|
else if (section == 'librarybuttons') {
|
||||||
loadlibraryButtons(elem, userId, index);
|
loadlibraryButtons(elem, userId, index);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
elem.empty();
|
elem.empty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -299,7 +302,7 @@
|
||||||
var sectionCount = 3;
|
var sectionCount = 3;
|
||||||
|
|
||||||
var elem = $('.sections', page);
|
var elem = $('.sections', page);
|
||||||
|
|
||||||
if (!elem.html().length) {
|
if (!elem.html().length) {
|
||||||
var html = '';
|
var html = '';
|
||||||
for (i = 0, length = sectionCount; i < length; i++) {
|
for (i = 0, length = sectionCount; i < length; i++) {
|
||||||
|
@ -316,6 +319,16 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleLibraryLinkNavigations(elem) {
|
||||||
|
|
||||||
|
$('a', elem).on('click', function () {
|
||||||
|
|
||||||
|
var text = $('.posterItemText', this).html();
|
||||||
|
|
||||||
|
LibraryMenu.setText(text);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$(document).on('pagebeforeshow', "#indexPage", function () {
|
$(document).on('pagebeforeshow', "#indexPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
|
@ -175,6 +175,12 @@
|
||||||
|
|
||||||
return panel;
|
return panel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setLibraryMenuText(text) {
|
||||||
|
|
||||||
|
$('.libraryMenuButtonText').html('<span>' + text + '</span>');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function getTopParentId() {
|
function getTopParentId() {
|
||||||
|
|
||||||
|
@ -184,7 +190,9 @@
|
||||||
window.LibraryMenu = {
|
window.LibraryMenu = {
|
||||||
showLibraryMenu: showLibraryMenu,
|
showLibraryMenu: showLibraryMenu,
|
||||||
|
|
||||||
getTopParentId: getTopParentId
|
getTopParentId: getTopParentId,
|
||||||
|
|
||||||
|
setText: setLibraryMenuText
|
||||||
};
|
};
|
||||||
|
|
||||||
function updateCastIcon() {
|
function updateCastIcon() {
|
||||||
|
|
|
@ -2087,6 +2087,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
options.quality = options.quality || (options.type.toLowerCase() == 'backdrop' ? 80 : 90);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2117,12 +2118,12 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
|
||||||
url += "/" + options.index;
|
url += "/" + options.index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
normalizeImageOptions(options);
|
||||||
|
|
||||||
// Don't put these on the query string
|
// Don't put these on the query string
|
||||||
delete options.type;
|
delete options.type;
|
||||||
delete options.index;
|
delete options.index;
|
||||||
|
|
||||||
normalizeImageOptions(options);
|
|
||||||
|
|
||||||
return self.getUrl(url, options);
|
return self.getUrl(url, options);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2154,12 +2155,12 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
|
||||||
url += "/" + options.index;
|
url += "/" + options.index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
normalizeImageOptions(options);
|
||||||
|
|
||||||
// Don't put these on the query string
|
// Don't put these on the query string
|
||||||
delete options.type;
|
delete options.type;
|
||||||
delete options.index;
|
delete options.index;
|
||||||
|
|
||||||
normalizeImageOptions(options);
|
|
||||||
|
|
||||||
return self.getUrl(url, options);
|
return self.getUrl(url, options);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2191,13 +2192,15 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
|
||||||
url += "/" + options.index;
|
url += "/" + options.index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
options.quality = options.quality || (options.type.toLowerCase() == 'backdrop' ? 80 : 90);
|
||||||
|
|
||||||
// Don't put these on the query string
|
// Don't put these on the query string
|
||||||
delete options.type;
|
delete options.type;
|
||||||
delete options.index;
|
delete options.index;
|
||||||
|
|
||||||
return self.getUrl(url, options);
|
return self.getUrl(url, options);
|
||||||
};
|
};
|
||||||
|
|
||||||
self.getScaledImageUrl = function (itemId, options) {
|
self.getScaledImageUrl = function (itemId, options) {
|
||||||
|
|
||||||
if (!itemId) {
|
if (!itemId) {
|
||||||
|
@ -2212,12 +2215,12 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
|
||||||
url += "/" + options.index;
|
url += "/" + options.index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
normalizeImageOptions(options);
|
||||||
|
|
||||||
// Don't put these on the query string
|
// Don't put these on the query string
|
||||||
delete options.type;
|
delete options.type;
|
||||||
delete options.index;
|
delete options.index;
|
||||||
|
|
||||||
normalizeImageOptions(options);
|
|
||||||
|
|
||||||
return self.getUrl(url, options);
|
return self.getUrl(url, options);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue