From ce1763c192e80e52900e623560f990f23ea71476 Mon Sep 17 00:00:00 2001
From: Luke Pulverenti
Date: Sat, 7 Jun 2014 17:06:01 -0400
Subject: [PATCH] add adult content filter to catalog
---
dashboard-ui/plugincatalog.html | 7 ++++++-
dashboard-ui/scripts/channelitems.js | 1 +
dashboard-ui/scripts/dashboardpage.js | 17 +++++++++++------
dashboard-ui/scripts/librarymenu.js | 2 +-
dashboard-ui/scripts/plugincatalogpage.js | 15 +++++++++++----
5 files changed, 30 insertions(+), 12 deletions(-)
diff --git a/dashboard-ui/plugincatalog.html b/dashboard-ui/plugincatalog.html
index 0904160def..a9ff01b023 100644
--- a/dashboard-ui/plugincatalog.html
+++ b/dashboard-ui/plugincatalog.html
@@ -11,7 +11,7 @@
${TabMyPlugins}
${TabCatalog}
-
+
+
+
+
+
+
${MessageNoAvailablePlugins}
diff --git a/dashboard-ui/scripts/channelitems.js b/dashboard-ui/scripts/channelitems.js
index 3a83d4194b..956f4e0125 100644
--- a/dashboard-ui/scripts/channelitems.js
+++ b/dashboard-ui/scripts/channelitems.js
@@ -7,6 +7,7 @@
SortBy: "",
SortOrder: "Ascending",
+ Fields: "PrimaryImageAspectRatio",
StartIndex: 0
};
diff --git a/dashboard-ui/scripts/dashboardpage.js b/dashboard-ui/scripts/dashboardpage.js
index 5640170bfb..d171ecbfc5 100644
--- a/dashboard-ui/scripts/dashboardpage.js
+++ b/dashboard-ui/scripts/dashboardpage.js
@@ -176,6 +176,11 @@
DashboardPage.renderRunningTasks(page, tasks);
}
+ else if (msg.MessageType == "PackageInstalling" || msg.MessageType == "PackageInstallationCompleted") {
+
+ DashboardPage.pollForInfo(page, true);
+ DashboardPage.reloadSystemInfo(page);
+ }
},
onWebSocketOpen: function () {
@@ -183,11 +188,11 @@
DashboardPage.startInterval();
},
- pollForInfo: function (page) {
+ pollForInfo: function (page, forceUpdate) {
ApiClient.getSessions().done(function (sessions) {
- DashboardPage.renderInfo(page, sessions);
+ DashboardPage.renderInfo(page, sessions, forceUpdate);
});
ApiClient.getScheduledTasks().done(function (tasks) {
@@ -195,10 +200,10 @@
});
},
- renderInfo: function (page, sessions) {
+ renderInfo: function (page, sessions, forceUpdate) {
DashboardPage.renderActiveConnections(page, sessions);
- DashboardPage.renderPluginUpdateInfo(page);
+ DashboardPage.renderPluginUpdateInfo(page, forceUpdate);
Dashboard.hideLoadingMsg();
},
@@ -812,10 +817,10 @@
$('#pendingInstallations', page).html(html);
},
- renderPluginUpdateInfo: function (page) {
+ renderPluginUpdateInfo: function (page, forceUpdate) {
// Only check once every 30 mins
- if (DashboardPage.lastPluginUpdateCheck && (new Date().getTime() - DashboardPage.lastPluginUpdateCheck) < 1800000) {
+ if (!forceUpdate && DashboardPage.lastPluginUpdateCheck && (new Date().getTime() - DashboardPage.lastPluginUpdateCheck) < 1800000) {
return;
}
diff --git a/dashboard-ui/scripts/librarymenu.js b/dashboard-ui/scripts/librarymenu.js
index 864a9ce924..8ab01704b9 100644
--- a/dashboard-ui/scripts/librarymenu.js
+++ b/dashboard-ui/scripts/librarymenu.js
@@ -342,7 +342,7 @@ $.fn.createHoverTouch = function () {
timerId = setTimeout(function () {
$(elem).trigger('hovertouch');
- }, 250);
+ }, 300);
}
function stopTimer(elem) {
diff --git a/dashboard-ui/scripts/plugincatalogpage.js b/dashboard-ui/scripts/plugincatalogpage.js
index d3cf5f90d2..56db3126da 100644
--- a/dashboard-ui/scripts/plugincatalogpage.js
+++ b/dashboard-ui/scripts/plugincatalogpage.js
@@ -2,7 +2,8 @@
// The base query options
var query = {
- TargetSystems: 'Server'
+ TargetSystems: 'Server',
+ IsAdult: false
};
function getApps() {
@@ -79,7 +80,7 @@
}
html += '' + category + '
';
-
+
currentCategory = category;
}
@@ -126,7 +127,7 @@
})[0];
html += "";
-
+
if (installedPlugin) {
html += Globalize.translate('LabelVersionInstalled').replace("{0}", installedPlugin.Version);
} else {
@@ -173,11 +174,17 @@
reloadList(page);
});
+ $('#chkAdult', page).on('change', function () {
+
+ query.IsAdult = this.checked ? null : false;
+ reloadList(page);
+ });
+
}).on('pageshow', "#pluginCatalogPage", function () {
var page = this;
- $(".radioPackageTypes", page).each(function() {
+ $(".radioPackageTypes", page).each(function () {
this.checked = this.value == query.TargetSystems;