1
0
Fork 0
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:
Luke Pulverenti 2014-05-23 21:16:53 -04:00
parent 5677ce1011
commit 4962827f56
6 changed files with 51 additions and 27 deletions

View file

@ -68,11 +68,6 @@
text-decoration: none;
font-weight: 400!important;
font-size: 15px;
}
.libraryMenuButtonText {
display: inline-block;
vertical-align: middle;
margin-left: .5em;
@ -302,11 +297,15 @@
@media all and (max-width: 600px) {
.libraryMenuButtonText {
display: none;
}
.headerSettingsButton {
display: none;
}
}
@media all and (max-width: 500px) {
.libraryMenuButtonText {
display: none;
}
}

View file

@ -145,7 +145,7 @@
left: 0;
line-height: 36px;
text-align: left;
padding-left: 43px;
padding: 0 0 0 43px;
}
.moviesPosterItem .posterItemImage {

View file

@ -73,7 +73,8 @@
var imgUrl = ApiClient.getScaledImageUrl(item.id, {
type: "Backdrop",
tag: item.tag,
maxWidth: screenWidth
maxWidth: screenWidth,
quality: 80
});
getElement().css('backgroundImage', 'url(\'' + imgUrl + '\')');
@ -102,7 +103,7 @@
var val = LocalSettings.val('enableBackdrops', userId);
return val == '1';
return val != '0';
}
$(document).on('pagebeforeshow', ".backdropPage", function () {

View file

@ -70,11 +70,9 @@
html += '<div class="' + imageCssClass + '" style="' + style + '">';
html += '</div>';
if (options.showTitle) {
html += "<div class='posterItemDefaultText'>";
html += "<div class='posterItemDefaultText posterItemText'>";
html += item.Name;
html += "</div>";
}
html += "</a>";
}
@ -161,6 +159,8 @@
html += '</div>';
$(elem).html(html);
handleLibraryLinkNavigations(elem);
});
}
@ -228,6 +228,8 @@
$(elem).html(html).createPosterItemMenus();
handleLibraryLinkNavigations(elem);
});
}
@ -287,6 +289,7 @@
}
else if (section == 'librarybuttons') {
loadlibraryButtons(elem, userId, index);
} else {
elem.empty();
@ -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 () {
var page = this;

View file

@ -176,6 +176,12 @@
return panel;
}
function setLibraryMenuText(text) {
$('.libraryMenuButtonText').html('<span>' + text + '</span>');
}
function getTopParentId() {
return getParameterByName('topParentId') || sessionStorage.getItem('topParentId') || null;
@ -184,7 +190,9 @@
window.LibraryMenu = {
showLibraryMenu: showLibraryMenu,
getTopParentId: getTopParentId
getTopParentId: getTopParentId,
setText: setLibraryMenuText
};
function updateCastIcon() {

View file

@ -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;
}
normalizeImageOptions(options);
// Don't put these on the query string
delete options.type;
delete options.index;
normalizeImageOptions(options);
return self.getUrl(url, options);
};
@ -2154,12 +2155,12 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
url += "/" + options.index;
}
normalizeImageOptions(options);
// Don't put these on the query string
delete options.type;
delete options.index;
normalizeImageOptions(options);
return self.getUrl(url, options);
};
@ -2191,6 +2192,8 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
url += "/" + options.index;
}
options.quality = options.quality || (options.type.toLowerCase() == 'backdrop' ? 80 : 90);
// Don't put these on the query string
delete options.type;
delete options.index;
@ -2212,12 +2215,12 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
url += "/" + options.index;
}
normalizeImageOptions(options);
// Don't put these on the query string
delete options.type;
delete options.index;
normalizeImageOptions(options);
return self.getUrl(url, options);
};