diff --git a/dashboard-ui/plugincatalog.html b/dashboard-ui/plugincatalog.html index 7a3e9f1e3c..99fb17dfd0 100644 --- a/dashboard-ui/plugincatalog.html +++ b/dashboard-ui/plugincatalog.html @@ -15,16 +15,26 @@
-
- MB Server - MB Theatre - MB Classic -
+
- +
No available plugins
+ +
+

MB Server

+
+
+ +
+

MB Theatre

+
+
+ +
+

MB Classic

+
+
-
diff --git a/dashboard-ui/scripts/plugincatalogpage.js b/dashboard-ui/scripts/plugincatalogpage.js index 4f7d68491f..4db59e4007 100644 --- a/dashboard-ui/scripts/plugincatalogpage.js +++ b/dashboard-ui/scripts/plugincatalogpage.js @@ -2,7 +2,7 @@ // The base query options var query = { - TargetSystems: 'Server' + TargetSystems: 'Server,MBTheater,MBClassic' }; function reloadList(page) { @@ -21,24 +21,28 @@ function populateList(page, availablePlugins, installedPlugins) { + Dashboard.showLoadingMsg(); + availablePlugins = availablePlugins.filter(function (p) { return p.type == "UserInstalled"; }).sort(function (a, b) { return a.name > b.name ? 1 : -1; }); - var html = ""; + var serverhtml = ''; + var theatrehtml = ''; + var classichtml = ""; for (var i = 0, length = availablePlugins.length; i < length; i++) { - + var html = ''; var plugin = availablePlugins[i]; html += "
"; if (plugin.thumbImage) { - html += ""; + html += ""; } else { - html += ""; + html += ""; } if (plugin.isPremium) { @@ -69,31 +73,52 @@ html += "
"; + if (plugin.targetSystem == "Server") { + serverhtml += html; + }else if (plugin.targetSystem == "MBTheater") { + theatrehtml += html; + }else if (plugin.targetSystem == "MBClassic") { + classichtml += html; + } + } if (!availablePlugins.length) { - html = '
No available plugins
'; + $("#noPlugins", page).hide(); } - $('#pluginTiles', page).html(html); + $('#pluginServerTiles', page).html(serverhtml); + $('#pluginTheatreTiles', page).html(theatrehtml); + $('#pluginClassicTiles', page).html(classichtml); + + if (serverhtml) { + $('#pluginServerCollapsible', page).show(); + }else { + $('#pluginServerCollapsible', page).hide(); + } + + if (theatrehtml) { + $('#pluginTheatreCollapsible', page).show(); + }else { + $('#pluginTheatreCollapsible', page).hide(); + } + + if (classichtml) { + $('#pluginClassicCollapsible', page).show(); + }else { + $('#pluginClassicCollapsible', page).hide(); + } Dashboard.hideLoadingMsg(); } - function selectTab(elem, page) { - - $("#pluginTabs a").removeClass("ui-btn-active"); - $(elem).addClass("ui-btn-active"); - - query.TargetSystems = $(elem).attr("rel"); - - reloadList(page); - } $(document).on('pageinit', "#pluginCatalogPage", function () { var page = this; + reloadList(page); + $('.chkPremiumFilter', page).on('change', function () { if (this.checked) { @@ -104,18 +129,10 @@ reloadList(page); }); - $('#pluginTabs a', page).each(function () { - $(this).on('click', function () { - selectTab(this, page); - }); - }); - }).on('pageshow', "#pluginCatalogPage", function () { var page = this; - selectTab($("#pluginTabs a.ui-btn-active"), page); - // Reset form values using the last used query $('.chkPremiumFilter', page).each(function () {