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

dlna server fixes

This commit is contained in:
Luke Pulverenti 2014-04-20 01:21:08 -04:00
parent 33ea7f3a39
commit 4cee826e91
9 changed files with 172 additions and 35 deletions

View file

@ -9,13 +9,17 @@
Dashboard.showLoadingMsg();
getProfile().done(function (result) {
var promise1 = getProfile();
var promise2 = ApiClient.getUsers();
currentProfile = result;
$.when(promise1, promise2).done(function (response1, response2) {
renderProfile(page, result);
currentProfile = response1[0];
renderProfile(page, currentProfile, response2[0]);
Dashboard.hideLoadingMsg();
});
}
@ -28,13 +32,7 @@
return $.getJSON(ApiClient.getUrl(url));
}
function renderProfile(page, profile) {
if (profile.ProfileType == 'User' || !profile.Id) {
$('.btnSave', page).show();
} else {
$('.btnSave', page).hide();
}
function renderProfile(page, profile, users) {
$('#txtName', page).val(profile.Name);
@ -62,6 +60,11 @@
profile.ContainerProfiles = (profile.ContainerProfiles || []);
profile.CodecProfiles = (profile.CodecProfiles || []);
profile.ResponseProfiles = (profile.ResponseProfiles || []);
var usersHtml = '<option></option>' + users.map(function (u) {
return '<option value="' + u.Id + '">' + u.Name + '</option>';
}).join('');
$('#selectUser', page).html(usersHtml).val(profile.UserId || '').selectmenu("refresh");
renderSubProfiles(page, profile);
}
@ -646,6 +649,8 @@
profile.Identification.ManufacturerUrl = $('#txtIdManufacturerUrl', page).val();
profile.Identification.SerialNumber = $('#txtIdSerialNumber', page).val();
profile.Identification.DeviceDescription = $('#txtIdDeviceDescription', page).val();
profile.UserId = $('#selectUser', page).val();
}
$(document).on('pageinit', "#dlnaProfilePage", function () {

View file

@ -0,0 +1,59 @@
(function ($, document, window) {
function loadPage(page, config, users) {
$('#chkEnableServer', page).checked(config.DlnaOptions.EnableServer).checkboxradio("refresh");
$('#chkBlastAliveMessages', page).checked(config.DlnaOptions.BlastAliveMessages).checkboxradio("refresh");
$('#txtBlastInterval', page).val(config.DlnaOptions.BlastAliveMessageIntervalSeconds);
var usersHtml = users.map(function (u) {
return '<option value="' + u.Id + '">' + u.Name + '</option>';
}).join('');
$('#selectUser', page).html(usersHtml).val(config.DlnaOptions.DefaultUserId || '').selectmenu("refresh");
Dashboard.hideLoadingMsg();
}
$(document).on('pageshow', "#dlnaServerSettingsPage", function () {
Dashboard.showLoadingMsg();
var page = this;
var promise1 = ApiClient.getServerConfiguration();
var promise2 = ApiClient.getUsers();
$.when(promise1, promise2).done(function (response1, response2) {
loadPage(page, response1[0], response2[0]);
});
});
function onSubmit() {
Dashboard.showLoadingMsg();
var form = this;
ApiClient.getServerConfiguration().done(function (config) {
config.DlnaOptions.EnableServer = $('#chkEnableServer', form).checked();
config.DlnaOptions.BlastAliveMessages = $('#chkBlastAliveMessages', form).checked();
config.DlnaOptions.BlastAliveMessageIntervalSeconds = $('#txtBlastInterval', form).val();
config.DlnaOptions.DefaultUserId = $('#selectUser', form).val();
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
return false;
}
window.DlnaServerSettingsPage = {
onSubmit: onSubmit
};
})(jQuery, document, window);

View file

@ -16,7 +16,7 @@
html += '<a class="desktopHomeLink" href="index.html"><img src="css/images/mblogoicon.png" /></a>';
html += '<a class="viewMenuRemoteControlButton" href="nowplaying.html" data-role="button" data-icon="wireless" data-inline="true" data-iconpos="notext" title="Now Playing">Remote Control</a>';
html += '<a class="viewMenuRemoteControlButton" href="nowplaying.html" data-role="button" data-icon="play" data-inline="true" data-iconpos="notext" title="Now Playing">Remote Control</a>';
if (user.Configuration.IsAdministrator) {
html += '<a class="editorMenuLink" href="edititemmetadata.html" data-role="button" data-icon="edit" data-inline="true" data-iconpos="notext" title="Metadata Manager">Metadata Manager</a>';

View file

@ -499,7 +499,7 @@ var Dashboard = {
html += '<p><label for="chkEnableThemeSongs">Play theme songs</label><input onchange="ThemeSongManager.enabled(this.checked);" type="checkbox" id="chkEnableThemeSongs" data-mini="true" /></a>';
html += '<p><a data-mini="true" data-role="button" href="useredit.html?userId=' + user.Id + '" data-icon="user">Preferences</button></a>';
html += '<p><a data-mini="true" data-role="button" href="usersettings.html?userId=' + user.Id + '" data-icon="user">Preferences</button></a>';
html += '<p><button data-mini="true" type="button" onclick="Dashboard.logout();" data-icon="lock">Sign Out</button></p>';
html += '</form>';