diff --git a/dashboard-ui/librarysettings.html b/dashboard-ui/librarysettings.html
new file mode 100644
index 0000000000..6ba012d95c
--- /dev/null
+++ b/dashboard-ui/librarysettings.html
@@ -0,0 +1,56 @@
+
+
+
+
Media Library
+
+
+
+
+
diff --git a/dashboard-ui/scripts/advancedconfigurationpage.js b/dashboard-ui/scripts/advancedconfigurationpage.js
index f6ba1ea093..637ee030f5 100644
--- a/dashboard-ui/scripts/advancedconfigurationpage.js
+++ b/dashboard-ui/scripts/advancedconfigurationpage.js
@@ -12,19 +12,6 @@
$('#selectAutomaticUpdateLevel', page).val(config.SystemUpdateLevel).selectmenu('refresh');
$('#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);
$('#chkDebugLog', page).checked(config.EnableDebugLevelLogging).checkboxradio("refresh");
@@ -44,50 +31,11 @@
var promise2 = ApiClient.getSystemInfo();
- $('#btnSelectIBNPath', page).on("click.selectDirectory", function () {
-
- Dashboard.selectDirectory({
-
- 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."
- });
- });
-
- $('#chkEnableCustomIBNPath', page).on("change.showIBNText", function() {
-
- 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() {
@@ -109,12 +57,6 @@
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);
});
diff --git a/dashboard-ui/scripts/librarysettings.js b/dashboard-ui/scripts/librarysettings.js
new file mode 100644
index 0000000000..0fd712bd5c
--- /dev/null
+++ b/dashboard-ui/scripts/librarysettings.js
@@ -0,0 +1,100 @@
+(function ($, document, window) {
+
+ function loadPage(page, config) {
+
+ $('#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");
+ }
+
+ Dashboard.hideLoadingMsg();
+ }
+
+ $(document).on('pageshow', "#librarySettingsPage", function () {
+
+ Dashboard.showLoadingMsg();
+
+ var page = this;
+
+ $('#btnSelectIBNPath', page).on("click.selectDirectory", function () {
+
+ Dashboard.selectDirectory({
+
+ 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."
+ });
+ });
+
+ $('#chkEnableCustomIBNPath', page).on("change.showIBNText", function () {
+
+ if (this.checked) {
+ $('#fieldEnterIBNPath', page).show();
+ $('#txtItemsByNamePath', page).attr("required", "required");
+ } else {
+ $('#fieldEnterIBNPath', page).hide();
+ $('#txtItemsByNamePath', page).removeAttr("required");
+ }
+
+ });
+
+ ApiClient.getServerConfiguration().done(function (config) {
+
+ loadPage(page, config);
+
+ });
+
+ }).on('pagehide', "#librarySettingsPage", function () {
+
+ Dashboard.showLoadingMsg();
+
+ var page = this;
+
+ $('#chkEnableCustomIBNPath', page).off("change.showIBNText");
+ $('#btnSelectIBNPath', page).off("click.selectDirectory");
+ });
+
+ function librarySettingsPage() {
+
+ var self = this;
+
+ self.onSubmit = function () {
+ Dashboard.showLoadingMsg();
+
+ var form = this;
+
+ ApiClient.getServerConfiguration().done(function (config) {
+
+ 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.LibrarySettingsPage = new librarySettingsPage();
+
+})(jQuery, document, window);
diff --git a/dashboard-ui/scripts/medialibrarypage.js b/dashboard-ui/scripts/medialibrarypage.js
index 66183f2cb1..86c9be5d69 100644
--- a/dashboard-ui/scripts/medialibrarypage.js
+++ b/dashboard-ui/scripts/medialibrarypage.js
@@ -16,6 +16,7 @@
if (userId) {
$('#userProfileNavigation', page).show();
+ $('#defaultNavigation', page).hide();
ApiClient.getUser(userId).done(function (user) {
Dashboard.setPageTitle(user.Name);
@@ -42,7 +43,9 @@
} else {
$('#userProfileNavigation', page).hide();
- ApiClient.getVirtualFolders().done(function(result) {
+ $('#defaultNavigation', page).show();
+
+ ApiClient.getVirtualFolders().done(function (result) {
MediaLibraryPage.reloadVirtualFolders(page, result);
});