From 0ccced6797810b7d77b3ad219e4a0bf265590bc8 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 4 Apr 2013 00:24:52 -0400 Subject: [PATCH 1/7] added IsPremium filter to GetPackages api method --- dashboard-ui/plugincatalog.html | 52 ++++++++++++++++----------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/dashboard-ui/plugincatalog.html b/dashboard-ui/plugincatalog.html index 6801d0ce40..92be6b2ad9 100644 --- a/dashboard-ui/plugincatalog.html +++ b/dashboard-ui/plugincatalog.html @@ -8,44 +8,44 @@
-
+
Installed Plugins Plugin Catalog Automatic Updates
-
- -
+
+ +
-
-
-
- -

Application:

-
- - +
+ +
+ +

Application:

+
+ + - - + + - - -
+ + +
-
- -

-
- - -
-
-
+
+ +

+
+ + +
+ +
From d2dab357703f8823851d2ea4062c7f3591c2cd6a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 4 Apr 2013 00:36:02 -0400 Subject: [PATCH 2/7] pass page instead of using $.mobile.activePage --- dashboard-ui/scripts/plugincatalogpage.js | 178 +++++++++++----------- 1 file changed, 87 insertions(+), 91 deletions(-) diff --git a/dashboard-ui/scripts/plugincatalogpage.js b/dashboard-ui/scripts/plugincatalogpage.js index c328607178..45414b6bf1 100644 --- a/dashboard-ui/scripts/plugincatalogpage.js +++ b/dashboard-ui/scripts/plugincatalogpage.js @@ -1,139 +1,135 @@ (function ($, document) { - // The base query options - var query = { - IsPremium: false, - TargetSystems: "" - }; + // The base query options + var query = { + IsPremium: false, + TargetSystems: "" + }; - function reloadList() { + function reloadList(page) { - Dashboard.showLoadingMsg(); + Dashboard.showLoadingMsg(); - var promise1 = ApiClient.getAvailablePlugins(query); - var promise2 = ApiClient.getInstalledPlugins(); + var promise1 = ApiClient.getAvailablePlugins(query); + var promise2 = ApiClient.getInstalledPlugins(); - $.when(promise1, promise2).done(function (response1, response2) { - populateList(response1[0], response2[0]); - }); + $.when(promise1, promise2).done(function (response1, response2) { + populateList(page, response1[0], response2[0]); + }); - Dashboard.hideLoadingMsg(); - } + Dashboard.hideLoadingMsg(); + } - function populateList(availablePlugins, installedPlugins) { + function populateList(page, availablePlugins, installedPlugins) { - var page = $($.mobile.activePage); - availablePlugins = availablePlugins.filter(function (p) { - return p.type == "UserInstalled"; - }).sort(function (a, b) { - return a.name > b.name ? 1 : -1; - }); + availablePlugins = availablePlugins.filter(function (p) { + return p.type == "UserInstalled"; + }).sort(function (a, b) { + return a.name > b.name ? 1 : -1; + }); - var html = ""; + var html = ""; - for (var i = 0, length = availablePlugins.length; i < length; i++) { + for (var i = 0, length = availablePlugins.length; i < length; i++) { - var plugin = availablePlugins[i]; + var plugin = availablePlugins[i]; - html += ""; - } + } - $('#pluginTiles', page).html(html); + $('#pluginTiles', page).html(html); - Dashboard.hideLoadingMsg(); - } + Dashboard.hideLoadingMsg(); + } - $(document).on('pageinit', "#pluginCatalogPage", function () { + $(document).on('pageinit', "#pluginCatalogPage", function () { - var page = this; + var page = this; + $('.chkStandardFilter', this).on('change', function () { - $('.chkStandardFilter', this).on('change', function () { + var filterName = this.getAttribute('data-filter'); + var filters = query.TargetSystems || ""; - var filterName = this.getAttribute('data-filter'); - var filters = query.TargetSystems || ""; + filters = (',' + filters).replace(',' + filterName, '').substring(1); - filters = (',' + filters).replace(',' + filterName, '').substring(1); + if (this.checked) { + filters = filters ? (filters + ',' + filterName) : filterName; + } - if (this.checked) { - filters = filters ? (filters + ',' + filterName) : filterName; - } + query.TargetSystems = filters; - query.TargetSystems = filters; + reloadList(page); + }); - reloadList(); - }); + $('.chkPremiumFilter', this).on('change', function () { - $('.chkPremiumFilter', this).on('change', function () { + if (this.checked) { + query.IsPremium = true; + } else { + query.IsPremium = false; + } - var filterName = this.getAttribute('data-filter'); + reloadList(page); + }); - if (this.checked) { - query.IsPremium = true; - }else { - query.IsPremium = false; - } + }).on('pageshow', "#pluginCatalogPage", function () { - reloadList(); - }); + reloadList(this); - }).on('pageshow', "#pluginCatalogPage", function () { + // Reset form values using the last used query - reloadList(); + $('.chkStandardFilter', this).each(function () { - // Reset form values using the last used query + var filters = "," + (query.TargetSystems || ""); + var filterName = this.getAttribute('data-filter'); - $('.chkStandardFilter', this).each(function () { + this.checked = filters.indexOf(',' + filterName) != -1; - var filters = "," + (query.TargetSystems || ""); - var filterName = this.getAttribute('data-filter'); + }).checkboxradio('refresh'); - this.checked = filters.indexOf(',' + filterName) != -1; + $('.chkPremiumFilter', this).each(function () { - }).checkboxradio('refresh'); + var filters = query.IsPremium || false; - $('.chkPremiumFilter', this).each(function () { + this.checked = filters; - var filters = query.IsPremium || false; - - this.checked = filters; - - }).checkboxradio('refresh'); - }); + }).checkboxradio('refresh'); + }); })(jQuery, document); \ No newline at end of file From c83eb94a90cc48ae1a45e046cb10900ff1fe9c95 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 4 Apr 2013 00:40:28 -0400 Subject: [PATCH 3/7] fixed MBTheater typo --- ApiClient.js | 7 +++++-- dashboard-ui/plugincatalog.html | 2 +- packages.config | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ApiClient.js b/ApiClient.js index 8380dc8e57..5ac4ecd8f0 100644 --- a/ApiClient.js +++ b/ApiClient.js @@ -572,9 +572,12 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { /** * Gets a list of plugins that are available to be installed */ - self.getAvailablePlugins = function () { + self.getAvailablePlugins = function (options) { - var url = self.getUrl("Packages", { PackageType: "UserInstalled" }); + options = $.extend({}, options || {}); + options.PackageType = "UserInstalled"; + + var url = self.getUrl("Packages", options); return self.ajax({ type: "GET", diff --git a/dashboard-ui/plugincatalog.html b/dashboard-ui/plugincatalog.html index 92be6b2ad9..97df6766ca 100644 --- a/dashboard-ui/plugincatalog.html +++ b/dashboard-ui/plugincatalog.html @@ -30,7 +30,7 @@ - + diff --git a/packages.config b/packages.config index 42d7b089c5..e8181f609f 100644 --- a/packages.config +++ b/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file From 2fab9770a78e8203030a18ac97d666fa51ed8202 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 4 Apr 2013 00:46:14 -0400 Subject: [PATCH 4/7] added pricing header --- dashboard-ui/plugincatalog.html | 2 +- dashboard-ui/scripts/plugincatalogpage.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dashboard-ui/plugincatalog.html b/dashboard-ui/plugincatalog.html index 97df6766ca..1694c8c6f0 100644 --- a/dashboard-ui/plugincatalog.html +++ b/dashboard-ui/plugincatalog.html @@ -39,7 +39,7 @@
-

+

Pricing:

diff --git a/dashboard-ui/scripts/plugincatalogpage.js b/dashboard-ui/scripts/plugincatalogpage.js index 45414b6bf1..e86da18522 100644 --- a/dashboard-ui/scripts/plugincatalogpage.js +++ b/dashboard-ui/scripts/plugincatalogpage.js @@ -2,8 +2,6 @@ // The base query options var query = { - IsPremium: false, - TargetSystems: "" }; function reloadList(page) { @@ -102,7 +100,7 @@ if (this.checked) { query.IsPremium = true; } else { - query.IsPremium = false; + query.IsPremium = null; } reloadList(page); From 76e1a14dac8fb7a82d11e485674b6d275ff7cf8c Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 4 Apr 2013 00:50:06 -0400 Subject: [PATCH 5/7] remove library copying when setting up a custom library. we'll add a separate button to do it later. --- dashboard-ui/boxsets.html | 122 +++++++++++++++++++------------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/dashboard-ui/boxsets.html b/dashboard-ui/boxsets.html index 839c44f796..e19a65ce2d 100644 --- a/dashboard-ui/boxsets.html +++ b/dashboard-ui/boxsets.html @@ -1,77 +1,77 @@  - Media Browser + Media Browser -
-

- Box Sets

-
- -
- - -
-
-
-
+
+

+ Movies

+
+ +
+ + +
+
+
+
-
-
-
- -

Sort By:

-
+ +
+
+ +

Sort By:

+
- - + + - - + + - - -
+ + +
-
- -

Sort Order:

-
+
+ +

Sort Order:

+
- - + + - - -
-
-
-
-
-
-
- -

Filters:

-
- - + + +
+
+ +
+
+
+
+ +

Filters:

+
+ + - - + + - - -
-
-
-
+ + +
+ + + From 0e3f6ba00d0e874311c16e45aeb323042b8a29b2 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 4 Apr 2013 01:02:18 -0400 Subject: [PATCH 6/7] image failure check --- dashboard-ui/scripts/site.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index b3b6793d4f..46f37556d5 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1009,7 +1009,7 @@ var Dashboard = { type: "Primary" }); - if (!item.Id || !data.icon) { + if (!item.Id || !data.icon || data.icon == "undefined") { alert("bad image url: " + JSON.stringify(item)); console.log("bad image url: " + JSON.stringify(item)); From 527eed1b6ba85875be7c5cf0aa49955a876ed86c Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 4 Apr 2013 01:06:46 -0400 Subject: [PATCH 7/7] update to servicestack 3.9.43 --- packages.config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages.config b/packages.config index e8181f609f..30a541990f 100644 --- a/packages.config +++ b/packages.config @@ -1,6 +1,6 @@  - - + + \ No newline at end of file