mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update indexedDb
This commit is contained in:
parent
232f5dba67
commit
9e9ffda3e6
6 changed files with 56 additions and 37 deletions
|
@ -174,6 +174,10 @@
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fullCardFooter {
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.cardText {
|
.cardText {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
@ -185,7 +189,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.cardContent .cardFooter .cardText {
|
.cardContent .cardFooter .cardText {
|
||||||
font-size: 16px;
|
font-size: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cardOverlayInner {
|
.cardOverlayInner {
|
||||||
|
|
|
@ -1506,7 +1506,10 @@
|
||||||
var footerOverlayed = false;
|
var footerOverlayed = false;
|
||||||
|
|
||||||
if (options.overlayText || (forceName && !options.showTitle)) {
|
if (options.overlayText || (forceName && !options.showTitle)) {
|
||||||
html += LibraryBrowser.getCardFooterText(item, options, imgUrl, forceName, 'cardFooter', progressHtml);
|
|
||||||
|
var footerCssClass = progressHtml ? 'cardFooter fullCardFooter' : 'cardFooter';
|
||||||
|
|
||||||
|
html += LibraryBrowser.getCardFooterText(item, options, imgUrl, forceName, footerCssClass, progressHtml);
|
||||||
footerOverlayed = true;
|
footerOverlayed = true;
|
||||||
}
|
}
|
||||||
else if (progressHtml) {
|
else if (progressHtml) {
|
||||||
|
|
|
@ -1373,6 +1373,14 @@ var Dashboard = {
|
||||||
return quality;
|
return quality;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
normalizeImageOptions: function(options) {
|
||||||
|
|
||||||
|
if (AppInfo.hasLowImageBandwidth) {
|
||||||
|
|
||||||
|
options.enableImageEnhancers = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
getAppInfo: function () {
|
getAppInfo: function () {
|
||||||
|
|
||||||
function generateDeviceName() {
|
function generateDeviceName() {
|
||||||
|
@ -1588,6 +1596,7 @@ var AppInfo = {};
|
||||||
|
|
||||||
if (window.ApiClient) {
|
if (window.ApiClient) {
|
||||||
ApiClient.getDefaultImageQuality = Dashboard.getDefaultImageQuality;
|
ApiClient.getDefaultImageQuality = Dashboard.getDefaultImageQuality;
|
||||||
|
ApiClient.normalizeImageOptions = Dashboard.normalizeImageOptions;
|
||||||
|
|
||||||
if (!Dashboard.isRunningInCordova()) {
|
if (!Dashboard.isRunningInCordova()) {
|
||||||
Dashboard.importCss(ApiClient.getUrl('Branding/Css'));
|
Dashboard.importCss(ApiClient.getUrl('Branding/Css'));
|
||||||
|
|
|
@ -2372,6 +2372,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
options.quality = options.quality || self.getDefaultImageQuality(options.type);
|
options.quality = options.quality || self.getDefaultImageQuality(options.type);
|
||||||
|
|
||||||
|
if (self.normalizeImageOptions) {
|
||||||
|
self.normalizeImageOptions(options);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2439,6 +2443,10 @@
|
||||||
|
|
||||||
options.quality = options.quality || self.getDefaultImageQuality(options.type);
|
options.quality = options.quality || self.getDefaultImageQuality(options.type);
|
||||||
|
|
||||||
|
if (self.normalizeImageOptions) {
|
||||||
|
self.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;
|
||||||
|
|
7
dashboard-ui/thirdparty/browser.js
vendored
7
dashboard-ui/thirdparty/browser.js
vendored
|
@ -921,7 +921,12 @@
|
||||||
|
|
||||||
var browser = match[1] || "";
|
var browser = match[1] || "";
|
||||||
|
|
||||||
if (ua.indexOf("like gecko") != -1 && ua.indexOf('webkit') == -1 && ua.indexOf('opera') == -1 && ua.indexOf('chrome') == -1 && ua.indexOf('safari') == -1) {
|
if (ua.indexOf("windows phone") != -1 || ua.indexOf("iemobile") != -1) {
|
||||||
|
|
||||||
|
// http://www.neowin.net/news/ie11-fakes-user-agent-to-fool-gmail-in-windows-phone-81-gdr1-update
|
||||||
|
browser = "msie";
|
||||||
|
}
|
||||||
|
else if (ua.indexOf("like gecko") != -1 && ua.indexOf('webkit') == -1 && ua.indexOf('opera') == -1 && ua.indexOf('chrome') == -1 && ua.indexOf('safari') == -1) {
|
||||||
browser = "msie";
|
browser = "msie";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
58
dashboard-ui/thirdparty/jquery.unveil-custom.js
vendored
58
dashboard-ui/thirdparty/jquery.unveil-custom.js
vendored
|
@ -12,7 +12,10 @@
|
||||||
|
|
||||||
var unveilId = 0;
|
var unveilId = 0;
|
||||||
|
|
||||||
$.fn.unveil = function (threshold, callback) {
|
// Test search before setting to 0
|
||||||
|
var threshold = 100;
|
||||||
|
|
||||||
|
$.fn.unveil = function () {
|
||||||
|
|
||||||
var $w = $(window),
|
var $w = $(window),
|
||||||
th = threshold || 0,
|
th = threshold || 0,
|
||||||
|
@ -68,7 +71,7 @@
|
||||||
var lazyItems = $(".lazy", this);
|
var lazyItems = $(".lazy", this);
|
||||||
|
|
||||||
if (lazyItems.length) {
|
if (lazyItems.length) {
|
||||||
lazyItems.unveil(0);
|
lazyItems.unveil();
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
@ -76,7 +79,7 @@
|
||||||
|
|
||||||
$.fn.lazyImage = function (url) {
|
$.fn.lazyImage = function (url) {
|
||||||
|
|
||||||
return this.attr('data-src', url).unveil(0);
|
return this.attr('data-src', url).unveil();
|
||||||
};
|
};
|
||||||
|
|
||||||
})(window.jQuery || window.Zepto);
|
})(window.jQuery || window.Zepto);
|
||||||
|
@ -96,6 +99,17 @@
|
||||||
dataBase.createObjectStore(imagesStoreName);
|
dataBase.createObjectStore(imagesStoreName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setImageIntoElement(elem, url) {
|
||||||
|
|
||||||
|
if (elem.tagName === "DIV") {
|
||||||
|
|
||||||
|
elem.style.backgroundImage = "url('" + url + "')";
|
||||||
|
|
||||||
|
} else {
|
||||||
|
elem.setAttribute("src", url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function openDb() {
|
function openDb() {
|
||||||
|
|
||||||
var deferred = $.Deferred();
|
var deferred = $.Deferred();
|
||||||
|
@ -281,34 +295,19 @@
|
||||||
|
|
||||||
self.setImageInto = function (elem, url) {
|
self.setImageInto = function (elem, url) {
|
||||||
|
|
||||||
//if (!self.db()) {
|
function onFail() {
|
||||||
// if (elem.tagName === "DIV") {
|
setImageIntoElement(elem, url);
|
||||||
|
}
|
||||||
// elem.style.backgroundImage = "url('" + url + "')";
|
|
||||||
|
|
||||||
// } else {
|
|
||||||
// elem.setAttribute("src", url);
|
|
||||||
// }
|
|
||||||
// return;
|
|
||||||
//}
|
|
||||||
|
|
||||||
openPromise.done(function () {
|
openPromise.done(function () {
|
||||||
|
|
||||||
self.getImageUrl(url).done(function (localUrl) {
|
self.getImageUrl(url).done(function (localUrl) {
|
||||||
|
|
||||||
if (elem.tagName === "DIV") {
|
setImageIntoElement(elem, localUrl);
|
||||||
|
|
||||||
elem.style.backgroundImage = "url('" + localUrl + "')";
|
}).fail(onFail);
|
||||||
|
|
||||||
} else {
|
}).fail(onFail);
|
||||||
elem.setAttribute("src", localUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
}).fail(function() {
|
|
||||||
new simpleImageStore().setImageInto(elem, url);
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -317,16 +316,7 @@
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
self.setImageInto = function (elem, url) {
|
self.setImageInto = setImageIntoElement;
|
||||||
|
|
||||||
if (elem.tagName === "DIV") {
|
|
||||||
|
|
||||||
elem.style.backgroundImage = "url('" + url + "')";
|
|
||||||
|
|
||||||
} else {
|
|
||||||
elem.setAttribute("src", url);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($.browser.safari && indexedDB) {
|
if ($.browser.safari && indexedDB) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue