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

update indexedDb

This commit is contained in:
Luke Pulverenti 2015-05-11 12:32:15 -04:00
parent 232f5dba67
commit 9e9ffda3e6
6 changed files with 56 additions and 37 deletions

View file

@ -2372,6 +2372,10 @@
}
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);
if (self.normalizeImageOptions) {
self.normalizeImageOptions(options);
}
// Don't put these on the query string
delete options.type;
delete options.index;

View file

@ -921,7 +921,12 @@
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";
}

View file

@ -12,7 +12,10 @@
var unveilId = 0;
$.fn.unveil = function (threshold, callback) {
// Test search before setting to 0
var threshold = 100;
$.fn.unveil = function () {
var $w = $(window),
th = threshold || 0,
@ -68,7 +71,7 @@
var lazyItems = $(".lazy", this);
if (lazyItems.length) {
lazyItems.unveil(0);
lazyItems.unveil();
}
return this;
@ -76,7 +79,7 @@
$.fn.lazyImage = function (url) {
return this.attr('data-src', url).unveil(0);
return this.attr('data-src', url).unveil();
};
})(window.jQuery || window.Zepto);
@ -96,6 +99,17 @@
dataBase.createObjectStore(imagesStoreName);
}
function setImageIntoElement(elem, url) {
if (elem.tagName === "DIV") {
elem.style.backgroundImage = "url('" + url + "')";
} else {
elem.setAttribute("src", url);
}
}
function openDb() {
var deferred = $.Deferred();
@ -281,34 +295,19 @@
self.setImageInto = function (elem, url) {
//if (!self.db()) {
// if (elem.tagName === "DIV") {
// elem.style.backgroundImage = "url('" + url + "')";
// } else {
// elem.setAttribute("src", url);
// }
// return;
//}
function onFail() {
setImageIntoElement(elem, url);
}
openPromise.done(function () {
self.getImageUrl(url).done(function (localUrl) {
if (elem.tagName === "DIV") {
setImageIntoElement(elem, localUrl);
elem.style.backgroundImage = "url('" + localUrl + "')";
}).fail(onFail);
} else {
elem.setAttribute("src", localUrl);
}
}).fail(function() {
new simpleImageStore().setImageInto(elem, url);
});
});
}).fail(onFail);
};
}
@ -317,16 +316,7 @@
var self = this;
self.setImageInto = function (elem, url) {
if (elem.tagName === "DIV") {
elem.style.backgroundImage = "url('" + url + "')";
} else {
elem.setAttribute("src", url);
}
};
self.setImageInto = setImageIntoElement;
}
if ($.browser.safari && indexedDB) {