1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

added some user access settings

This commit is contained in:
Luke Pulverenti 2013-07-08 12:13:21 -04:00
parent 1663b40737
commit a2ce0bdce6
10 changed files with 252 additions and 19 deletions

View file

@ -0,0 +1,68 @@
(function ($, document, window) {
function loadPage(page, config) {
var clients = config.ManualLoginClients;
$('#chkMobileClients', page).checked(clients.filter(function (i) {
return i == "Mobile";
}).length > 0).checkboxradio("refresh");
$('#chkMBT', page).checked(clients.filter(function (i) {
return i == "MediaBrowserTheater";
}).length > 0).checkboxradio("refresh");
Dashboard.hideLoadingMsg();
}
$(document).on('pageshow', "#allUserSettingsPage", function () {
Dashboard.showLoadingMsg();
var page = this;
ApiClient.getServerConfiguration().done(function (config) {
loadPage(page, config);
});
});
function allUserSettingsPage() {
var self = this;
self.onSubmit = function () {
Dashboard.showLoadingMsg();
var form = this;
ApiClient.getServerConfiguration().done(function (config) {
var clients = [];
if ($('#chkMobileClients', form).checked()) {
clients.push("Mobile");
}
if ($('#chkMBT', form).checked()) {
clients.push("MediaBrowserTheater");
}
config.ManualLoginClients = clients;
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
return false;
};
}
window.AllUserSettingsPage = new allUserSettingsPage();
})(jQuery, document, window);