diff --git a/dashboard-ui/css/card.css b/dashboard-ui/css/card.css index 9afb8f44b6..345cd51a91 100644 --- a/dashboard-ui/css/card.css +++ b/dashboard-ui/css/card.css @@ -174,6 +174,10 @@ max-width: 100%; } +.fullCardFooter { + right: 0; +} + .cardText { text-overflow: ellipsis; overflow: hidden; @@ -185,7 +189,7 @@ } .cardContent .cardFooter .cardText { - font-size: 16px; + font-size: 15px; } .cardOverlayInner { diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 7ff797e18c..4d37f56c74 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -1506,7 +1506,10 @@ var footerOverlayed = false; 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; } else if (progressHtml) { diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index eeded894f2..c7ccf8cfb4 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1373,6 +1373,14 @@ var Dashboard = { return quality; }, + normalizeImageOptions: function(options) { + + if (AppInfo.hasLowImageBandwidth) { + + options.enableImageEnhancers = false; + } + }, + getAppInfo: function () { function generateDeviceName() { @@ -1588,6 +1596,7 @@ var AppInfo = {}; if (window.ApiClient) { ApiClient.getDefaultImageQuality = Dashboard.getDefaultImageQuality; + ApiClient.normalizeImageOptions = Dashboard.normalizeImageOptions; if (!Dashboard.isRunningInCordova()) { Dashboard.importCss(ApiClient.getUrl('Branding/Css')); diff --git a/dashboard-ui/thirdparty/apiclient/apiclient.js b/dashboard-ui/thirdparty/apiclient/apiclient.js index 7a256b6424..fb4ab61b1a 100644 --- a/dashboard-ui/thirdparty/apiclient/apiclient.js +++ b/dashboard-ui/thirdparty/apiclient/apiclient.js @@ -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; diff --git a/dashboard-ui/thirdparty/browser.js b/dashboard-ui/thirdparty/browser.js index 897738f7e5..a610804827 100644 --- a/dashboard-ui/thirdparty/browser.js +++ b/dashboard-ui/thirdparty/browser.js @@ -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"; } diff --git a/dashboard-ui/thirdparty/jquery.unveil-custom.js b/dashboard-ui/thirdparty/jquery.unveil-custom.js index cb845fa2fb..2631ccf7b7 100644 --- a/dashboard-ui/thirdparty/jquery.unveil-custom.js +++ b/dashboard-ui/thirdparty/jquery.unveil-custom.js @@ -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) {