diff --git a/dashboard-ui/css/site.css b/dashboard-ui/css/site.css
index 180b8e646a..87000da27c 100644
--- a/dashboard-ui/css/site.css
+++ b/dashboard-ui/css/site.css
@@ -1031,7 +1031,7 @@ h1 + .accentButton {
}
.dashboardFooter {
- margin-top: 70px;
+ margin-top: 50px;
text-align: center;
}
diff --git a/dashboard-ui/dashboardgeneral.html b/dashboard-ui/dashboardgeneral.html
index d9b50eab5b..683fbd4bb3 100644
--- a/dashboard-ui/dashboardgeneral.html
+++ b/dashboard-ui/dashboardgeneral.html
@@ -64,6 +64,11 @@
${LabelLoginDisclaimerHelp}
+
+
+
+ ${LabelCustomCssHelp}
+
diff --git a/dashboard-ui/scripts/dashboardgeneral.js b/dashboard-ui/scripts/dashboardgeneral.js
index ebecb094f1..01b7670036 100644
--- a/dashboard-ui/scripts/dashboardgeneral.js
+++ b/dashboard-ui/scripts/dashboardgeneral.js
@@ -1,6 +1,7 @@
(function ($, document, window) {
var brandingConfigKey = "branding";
+ var currentBrandingOptions;
function loadPage(page, config, languageOptions) {
@@ -49,7 +50,10 @@
ApiClient.getNamedConfiguration(brandingConfigKey).done(function (config) {
+ currentBrandingOptions = config;
+
$('#txtLoginDisclaimer', page).val(config.LoginDisclaimer || '');
+ $('#txtCustomCss', page).val(config.CustomCss || '');
});
}).on('pageinit', "#dashboardGeneralPage", function () {
@@ -99,8 +103,15 @@
ApiClient.getNamedConfiguration(brandingConfigKey).done(function (brandingConfig) {
brandingConfig.LoginDisclaimer = $('#txtLoginDisclaimer', form).val();
+ brandingConfig.CustomCss = $('#txtCustomCss', form).val();
+
+ var cssChanged = currentBrandingOptions && brandingConfig.CustomCss != currentBrandingOptions.CustomCss;
ApiClient.updateNamedConfiguration(brandingConfigKey, brandingConfig).done(Dashboard.processServerConfigurationUpdateResult);
+
+ if (cssChanged) {
+ Dashboard.showDashboardRefreshNotification();
+ }
});
});
diff --git a/dashboard-ui/scripts/dashboardpage.js b/dashboard-ui/scripts/dashboardpage.js
index 19f6ca3942..8726a75d32 100644
--- a/dashboard-ui/scripts/dashboardpage.js
+++ b/dashboard-ui/scripts/dashboardpage.js
@@ -798,6 +798,7 @@
text = "Thank you for supporting Media Browser.";
$('.supporterIconContainer', page).html('' + text + '');
+ $('.supporterIconContainer', page).hide();
} else {
imgUrl = "css/images/supporter/nonsupporterbadge.png";
diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js
index 8f9daf3c64..5af3083381 100644
--- a/dashboard-ui/scripts/site.js
+++ b/dashboard-ui/scripts/site.js
@@ -194,6 +194,15 @@ var Dashboard = {
}
},
+ importCss: function (url) {
+ if (document.createStyleSheet) {
+ document.createStyleSheet(url);
+ }
+ else {
+ $('').appendTo('head');
+ }
+ },
+
showError: function (message) {
$.mobile.loading('show', {
@@ -256,7 +265,7 @@ var Dashboard = {
if (Dashboard.initialServerVersion != info.Version) {
- Dashboard.showDashboardVersionWarning();
+ Dashboard.showDashboardRefreshNotification();
}
}
@@ -329,7 +338,7 @@ var Dashboard = {
$('#serverRestartWarning').remove();
},
- showDashboardVersionWarning: function () {
+ showDashboardRefreshNotification: function () {
var html = '' + Globalize.translate('MessagePleaseRefreshPage') + '';
@@ -1331,6 +1340,7 @@ var Dashboard = {
ConnectionManager.addApiClient(ApiClient, true).fail(Dashboard.logout);
} else {
Dashboard.logout();
+ return;
}
}
@@ -1345,6 +1355,8 @@ var Dashboard = {
ConnectionManager.addApiClient(ApiClient);
}
+ Dashboard.importCss(ApiClient.getUrl('Branding/Css'));
+
})();
$(function () {