From 4583cf5b524d880a45cdec804a326a03f631e3b8 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 5 Nov 2013 10:38:59 -0500 Subject: [PATCH] hide image buttons when there are no providers --- ApiClient.js | 17 ++++++++++ dashboard-ui/edititemimages.html | 9 ++++-- dashboard-ui/scripts/edititemimages.js | 43 +++++++++++++++++--------- packages.config | 2 +- 4 files changed, 53 insertions(+), 18 deletions(-) diff --git a/ApiClient.js b/ApiClient.js index a55879d2da..3254b84f36 100644 --- a/ApiClient.js +++ b/ApiClient.js @@ -342,6 +342,23 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi return urlPrefix; } + self.getRemoteImageProviders = function (options) { + + if (!options) { + throw new Error("null options"); + } + + var urlPrefix = getRemoteImagePrefix(options); + + var url = self.getUrl(urlPrefix + "/RemoteImages/Providers", options); + + return self.ajax({ + type: "GET", + url: url, + dataType: "json" + }); + }; + self.getAvailableRemoteImages = function (options) { if (!options) { diff --git a/dashboard-ui/edititemimages.html b/dashboard-ui/edititemimages.html index c081127305..0072555219 100644 --- a/dashboard-ui/edititemimages.html +++ b/dashboard-ui/edititemimages.html @@ -23,8 +23,13 @@
- Browse Online Images - Upload Image + +
+ Browse Online Images +
+
+ Upload Image +