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

#35 - Make IBN path configurable

This commit is contained in:
Luke Pulverenti 2013-04-23 15:17:21 -04:00
parent 38397af423
commit e8d26d4158
5 changed files with 167 additions and 67 deletions

View file

@ -31,6 +31,26 @@
<label for="txtWebSocketPortNumber">Web socket port number: </label> <label for="txtWebSocketPortNumber">Web socket port number: </label>
<input type="number" id="txtWebSocketPortNumber" name="txtWebSocketPortNumber" pattern="[0-9]*" required="required" min="1" /> <input type="number" id="txtWebSocketPortNumber" name="txtWebSocketPortNumber" pattern="[0-9]*" required="required" min="1" />
</li> </li>
</ul>
<h2>Images By Name</h2>
<ul data-role="listview" class="ulForm">
<li>
<input type="checkbox" id="chkEnableCustomIBNPath" name="chkEnableCustomIBNPath" />
<label for="chkEnableCustomIBNPath">Use custom IBN path</label>
</li>
<li id="fieldEnterIBNPath" style="display: none;">
<label for="txtItemsByNamePath">Images by name path: </label>
<div style="display: inline-block; width: 92%;">
<input type="text" id="txtItemsByNamePath" name="txtItemsByNamePath" />
</div>
<button id="btnSelectIBNPath" type="button" data-icon="folder-close" data-iconpos="notext" data-inline="true">Select Directory</button>
<div class="fieldDescription">
Supply a custom path for images by name. MB server must have write access to this folder.
</div>
</li>
</ul>
<h2>Miscellaneous</h2>
<ul data-role="listview" class="ulForm">
<li> <li>
<input type="checkbox" id="chkEnableDeveloperTools" name="chkEnableDeveloperTools" /> <input type="checkbox" id="chkEnableDeveloperTools" name="chkEnableDeveloperTools" />
<label for="chkEnableDeveloperTools">Enable developer tools</label> <label for="chkEnableDeveloperTools">Enable developer tools</label>

View file

@ -82,38 +82,40 @@
<a href="musicgenres.html" data-role="button" class="ui-btn-active">Genres</a> <a href="musicgenres.html" data-role="button" class="ui-btn-active">Genres</a>
</div> </div>
</div> </div>
<div class="detailPagePrimaryInfo"> <div class="detailPageContent">
<div class="itemImageBlock"> <div class="detailPagePrimaryInfo">
<div id="itemMedia" style="position: relative;"> <div class="itemImageBlock">
<div id="itemImage"></div> <div id="itemMedia" style="position: relative;">
<div id="itemImage"></div>
</div>
</div>
<div class="itemDetailBlock">
<h1 id="itemName" class="detailPageName"></h1>
<p id="itemMiscInfo" class="itemMiscInfo"></p>
<p id="itemOverview"></p>
<p id="itemRatings"></p>
<p id="itemBirthday"></p>
<p id="itemBirthLocation"></p>
<p id="itemDeathDate"></p>
<p id="itemLinks"></p>
</div> </div>
</div> </div>
</div>
<div class="itemDetailBlock"> <div id="itemTabs" style="margin-top: 20px; text-align: center;"></div>
<h1 id="itemName" class="detailPageName"></h1>
<p id="itemMiscInfo" class="itemMiscInfo"></p>
<p id="itemOverview"></p>
<p id="itemRatings"></p>
<p id="itemBirthday"></p>
<p id="itemBirthLocation"></p>
<p id="itemDeathDate"></p>
<p id="itemLinks"></p>
<div class="viewSettings">
<div class="viewControls">
</div> </div>
<div class="listTopPaging">
<div id="itemTabs" style="margin-top: 20px;"></div>
<div class="viewSettings">
<div class="viewControls">
</div>
<div class="listTopPaging">
</div>
</div>
<div id="items">
</div> </div>
</div> </div>
<div id="items">
</div>
</div> </div>
</div> </div>
</body> </body>

View file

@ -1,22 +1,6 @@
var AdvancedConfigurationPage = { (function ($, document, window) {
onPageShow: function () { function loadPage(page, config, systemInfo) {
Dashboard.showLoadingMsg();
var promise1 = ApiClient.getServerConfiguration();
var promise2 = ApiClient.getSystemInfo();
$.when(promise1, promise2).done(function (response1, response2) {
AdvancedConfigurationPage.loadPage(response1[0], response2[0]);
});
},
loadPage: function (config, systemInfo) {
var page = $.mobile.activePage;
if (systemInfo.SupportsNativeWebSocket) { if (systemInfo.SupportsNativeWebSocket) {
@ -28,6 +12,19 @@
$('#selectAutomaticUpdateLevel', page).val(config.SystemUpdateLevel).selectmenu('refresh'); $('#selectAutomaticUpdateLevel', page).val(config.SystemUpdateLevel).selectmenu('refresh');
$('#txtWebSocketPortNumber', page).val(config.LegacyWebSocketPortNumber); $('#txtWebSocketPortNumber', page).val(config.LegacyWebSocketPortNumber);
$('#txtItemsByNamePath', page).val(config.ItemsByNamePath);
var customIbn = config.ItemsByNamePath ? true : false;
$('#chkEnableCustomIBNPath', page).checked(customIbn).checkboxradio("refresh");
if (customIbn) {
$('#fieldEnterIBNPath', page).show();
$('#txtItemsByNamePath', page).attr("required", "required");
} else {
$('#fieldEnterIBNPath', page).hide();
$('#txtItemsByNamePath', page).removeAttr("required");
}
$('#txtPortNumber', page).val(config.HttpServerPortNumber); $('#txtPortNumber', page).val(config.HttpServerPortNumber);
$('#chkDebugLog', page).checked(config.EnableDebugLevelLogging).checkboxradio("refresh"); $('#chkDebugLog', page).checked(config.EnableDebugLevelLogging).checkboxradio("refresh");
@ -35,31 +32,98 @@
$('#chkRunAtStartup', page).checked(config.RunAtStartup).checkboxradio("refresh"); $('#chkRunAtStartup', page).checked(config.RunAtStartup).checkboxradio("refresh");
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}, }
onSubmit: function () { $(document).on('pageshow', "#advancedConfigurationPage", function () {
Dashboard.showLoadingMsg(); Dashboard.showLoadingMsg();
var form = this; var page = this;
ApiClient.getServerConfiguration().done(function (config) { var promise1 = ApiClient.getServerConfiguration();
config.LegacyWebSocketPortNumber = $('#txtWebSocketPortNumber', form).val(); var promise2 = ApiClient.getSystemInfo();
config.HttpServerPortNumber = $('#txtPortNumber', form).val(); $('#btnSelectIBNPath', page).on("click.selectDirectory", function () {
config.EnableDebugLevelLogging = $('#chkDebugLog', form).checked();
config.EnableDeveloperTools = $('#chkEnableDeveloperTools', form).checked(); Dashboard.selectDirectory({
config.RunAtStartup = $('#chkRunAtStartup', form).checked();
config.SystemUpdateLevel = $('#selectAutomaticUpdateLevel', form).val();
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult); callback: function (path) {
if (path) {
$('#txtItemsByNamePath', page).val(path);
}
$('#popupDirectoryPicker', page).popup("close");
},
header: "Select Items By Name Path",
instruction: "Browse or enter the path to your items by name folder. The folder must be writeable."
});
}); });
// Disable default form submission $('#chkEnableCustomIBNPath', page).on("change.showIBNText", function() {
return false;
}
};
$(document).on('pageshow', "#advancedConfigurationPage", AdvancedConfigurationPage.onPageShow); if (this.checked) {
$('#fieldEnterIBNPath', page).show();
$('#txtItemsByNamePath', page).attr("required", "required");
} else {
$('#fieldEnterIBNPath', page).hide();
$('#txtItemsByNamePath', page).removeAttr("required");
}
});
$.when(promise1, promise2).done(function (response1, response2) {
loadPage(page, response1[0], response2[0]);
});
}).on('pagehide', "#advancedConfigurationPage", function () {
Dashboard.showLoadingMsg();
var page = this;
$('#chkEnableCustomIBNPath', page).off("change.showIBNText");
$('#btnSelectIBNPath', page).off("click.selectDirectory");
});
function advancedConfigurationPage() {
var self = this;
self.onSubmit = function () {
Dashboard.showLoadingMsg();
var form = this;
ApiClient.getServerConfiguration().done(function (config) {
config.LegacyWebSocketPortNumber = $('#txtWebSocketPortNumber', form).val();
config.HttpServerPortNumber = $('#txtPortNumber', form).val();
config.EnableDebugLevelLogging = $('#chkDebugLog', form).checked();
config.EnableDeveloperTools = $('#chkEnableDeveloperTools', form).checked();
config.RunAtStartup = $('#chkRunAtStartup', form).checked();
config.SystemUpdateLevel = $('#selectAutomaticUpdateLevel', form).val();
if ($('#chkEnableCustomIBNPath', form).checked()) {
config.ItemsByNamePath = $('#txtItemsByNamePath', form).val();
} else {
config.ItemsByNamePath = '';
}
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
return false;
};
}
window.AdvancedConfigurationPage = new advancedConfigurationPage();
})(jQuery, document, window);

View file

@ -470,8 +470,9 @@ var Dashboard = {
options = options || {}; options = options || {};
options.header = options.header || "Select Media Path"; options.header = options.header || "Select Media Path";
options.instruction = options.instruction || "Browse to or enter the folder containing the media. Network paths (UNC) are recommended for optimal playback performance.";
var html = '<div data-role="popup" id="popupDirectoryPicker" class="ui-corner-all popup">'; var html = '<div data-role="popup" id="popupDirectoryPicker" class="ui-corner-all popup" style="min-width:60%;">';
html += '<div class="ui-corner-top ui-bar-a" style="text-align: center; padding: 0 20px;">'; html += '<div class="ui-corner-top ui-bar-a" style="text-align: center; padding: 0 20px;">';
html += '<h3>' + options.header + '</h3>'; html += '<h3>' + options.header + '</h3>';
@ -479,7 +480,7 @@ var Dashboard = {
html += '<div data-role="content" class="ui-corner-bottom ui-content">'; html += '<div data-role="content" class="ui-corner-bottom ui-content">';
html += '<form>'; html += '<form>';
html += '<p>Browse to or enter the folder containing the media. Network paths (UNC) are recommended for optimal playback performance.</p>'; html += '<p>' + options.instruction + '</p>';
html += '<div data-role="fieldcontain" style="margin:0;">'; html += '<div data-role="fieldcontain" style="margin:0;">';
html += '<label for="txtDirectoryPickerPath">Current Folder:</label>'; html += '<label for="txtDirectoryPickerPath">Current Folder:</label>';

View file

@ -1,13 +1,26 @@
var WizardFinishPage = { var WizardFinishPage = {
onFinish: function() { onFinish: function () {
ApiClient.getServerConfiguration().done(function (config) { ApiClient.getServerConfiguration().done(function (config) {
config.IsStartupWizardCompleted = true; config.IsStartupWizardCompleted = true;
ApiClient.updateServerConfiguration(config).done(function() { ApiClient.updateServerConfiguration(config).done(function () {
Dashboard.navigate('dashboard.html');
ApiClient.getUsers().done(function (users) {
for (var i = 0, length = users.length; i < length; i++) {
if (users[i].Configuration.IsAdministrator) {
Dashboard.setCurrentUser(users[i].Id);
break;
}
}
Dashboard.navigate('dashboard.html');
});
}); });
}); });