";
+
+ html += '
';
+ html += '
";
+
+ // card
+ html += "
";
+
+ return html;
+ }
+
+ function populateList(page, plugins, pluginConfigurationPages) {
+
+ plugins = plugins.sort(function (plugin1, plugin2) {
+
+ return (plugin1.Name) > (plugin2.Name) ? 1 : -1;
+
+ });
+
+ var html = plugins.map(function (p) {
+ return getPluginCardHtml(p, pluginConfigurationPages);
+
+ }).join('');
+
+ if (!plugins.length) {
+
+ html += '
';
+
+ $('.installedPlugins', page).html(html).trigger('create');
+ } else {
+
+ var elem = $('.installedPlugins', page).html(html).trigger('create');
+
+ $('.btnNoConfig', elem).on('click', function () {
+ showNoConfigurationMessage();
+ });
+
+ $('.btnConnectPlugin', elem).on('click', function () {
+ showConnectMessage();
+ });
+
+ $('.btnCardMenu', elem).on('click', function () {
+ showPluginMenu(page, this);
+ });
+ }
+
+ Dashboard.hideLoadingMsg();
+ }
+
+ function showPluginMenu(page, elem) {
+
+ var card = $(elem).parents('.card');
+ var id = card.attr('data-id');
+ var name = card.attr('data-name');
+ var configHref = $('.cardContent', card).attr('href');
+
+ $('.cardMenu', page).popup("close").remove();
+
+ var html = '';
+
+ $(page).append(html);
+
+ var flyout = $('.cardMenu', page).popup({ positionTo: elem || "window" }).trigger('create').popup("open").on("popupafterclose", function () {
+
+ $(this).off("popupafterclose").remove();
+
+ });
+
+ $('.btnDeletePlugin', flyout).on('click', function () {
+
+ $('.cardMenu', page).popup('close');
+
+ // jqm won't show a popup while another is in the act of closing
+ setTimeout(function () {
+ deletePlugin(page, id, name);
+ }, 300);
+ });
+ }
+
+ function reloadList(page) {
+
+ Dashboard.showLoadingMsg();
+
+ var promise1 = ApiClient.getInstalledPlugins();
+
+ var promise2 = ApiClient.getJSON(ApiClient.getUrl("dashboard/configurationpages") + "?pageType=PluginConfiguration");
+
+ $.when(promise1, promise2).done(function (response1, response2) {
+
+ populateList(page, response1[0], response2[0]);
+
+ });
+ }
+
+ $(document).on('pageshow', "#pluginsPage", function () {
+
+ reloadList(this);
+ });
+
+})(jQuery, window);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/useredit.js b/dashboard-ui/scripts/useredit.js
index 21e016eb51..881a758d53 100644
--- a/dashboard-ui/scripts/useredit.js
+++ b/dashboard-ui/scripts/useredit.js
@@ -21,19 +21,19 @@
$('#txtUserName', page).val(user.Name);
$('#txtConnectUserName', page).val(currentUser.ConnectUserName);
- $('#chkIsAdmin', page).checked(user.Policy.IsAdministrator || false).checkboxradio("refresh");
+ $('#chkIsAdmin', page).checked(user.Policy.IsAdministrator).checkboxradio("refresh");
- $('#chkDisabled', page).checked(user.Policy.IsDisabled || false).checkboxradio("refresh");
- $('#chkIsHidden', page).checked(user.Policy.IsHidden || false).checkboxradio("refresh");
- $('#chkRemoteControlSharedDevices', page).checked(user.Policy.EnableSharedDeviceControl);
+ $('#chkDisabled', page).checked(user.Policy.IsDisabled).checkboxradio("refresh");
+ $('#chkIsHidden', page).checked(user.Policy.IsHidden).checkboxradio("refresh");
+ $('#chkRemoteControlSharedDevices', page).checked(user.Policy.EnableSharedDeviceControl).checkboxradio("refresh");
$('#chkEnableRemoteControlOtherUsers', page).checked(user.Policy.EnableRemoteControlOfOtherUsers).checkboxradio("refresh");
- $('#chkEnableMediaPlayback', page).checked(user.Policy.EnableMediaPlayback || false).checkboxradio("refresh");
+ $('#chkEnableMediaPlayback', page).checked(user.Policy.EnableMediaPlayback).checkboxradio("refresh");
- $('#chkManageLiveTv', page).checked(user.Policy.EnableLiveTvManagement || false).checkboxradio("refresh");
- $('#chkEnableLiveTvAccess', page).checked(user.Policy.EnableLiveTvAccess || false).checkboxradio("refresh");
- $('#chkEnableContentDeletion', page).checked(user.Policy.EnableContentDeletion || false).checkboxradio("refresh");
+ $('#chkManageLiveTv', page).checked(user.Policy.EnableLiveTvManagement).checkboxradio("refresh");
+ $('#chkEnableLiveTvAccess', page).checked(user.Policy.EnableLiveTvAccess).checkboxradio("refresh");
+ $('#chkEnableContentDeletion', page).checked(user.Policy.EnableContentDeletion).checkboxradio("refresh");
- $('#chkDisableUserPreferences', page).checked((!user.Policy.EnableUserPreferenceAccess) || false).checkboxradio("refresh");
+ $('#chkDisableUserPreferences', page).checked((!user.Policy.EnableUserPreferenceAccess)).checkboxradio("refresh");
$('#chkEnableSync', page).checked(user.Policy.EnableSync).checkboxradio("refresh");
diff --git a/dashboard-ui/scripts/wizardagreement.js b/dashboard-ui/scripts/wizardagreement.js
index 781581407b..0919b6c2cb 100644
--- a/dashboard-ui/scripts/wizardagreement.js
+++ b/dashboard-ui/scripts/wizardagreement.js
@@ -4,6 +4,12 @@
if ($('#chkAccept', page).checked()) {
Dashboard.navigate('wizardfinish.html');
+ } else {
+
+ Dashboard.alert({
+ message: Globalize.translate('MessagePleaseAcceptTermsOfServiceBeforeContinuing'),
+ title: ''
+ });
}
}