mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
rework nav drawer
This commit is contained in:
parent
52f247c51a
commit
ff8014a721
66 changed files with 5861 additions and 6234 deletions
|
@ -199,21 +199,14 @@
|
|||
|
||||
var context = getParameterByName('context');
|
||||
|
||||
$('.syncTabs', page).hide();
|
||||
$('.pluginTabs', page).hide();
|
||||
$('.livetvTabs', page).hide();
|
||||
$('.notificationsTabs', page).hide();
|
||||
|
||||
if (context == 'sync') {
|
||||
$('.syncTabs', page).show();
|
||||
|
||||
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Sync');
|
||||
Dashboard.setPageTitle(Globalize.translate('TitleSync'));
|
||||
}
|
||||
else if (context == 'livetv') {
|
||||
|
||||
$('.livetvTabs', page).show();
|
||||
|
||||
Dashboard.setPageTitle(Globalize.translate('TitleLiveTV'));
|
||||
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Live%20TV');
|
||||
}
|
||||
|
@ -225,8 +218,6 @@
|
|||
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Notifications');
|
||||
}
|
||||
else {
|
||||
$('.pluginTabs', page).show();
|
||||
|
||||
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Plugins');
|
||||
Dashboard.setPageTitle(Globalize.translate('TitlePlugins'));
|
||||
}
|
||||
|
|
|
@ -2,20 +2,6 @@
|
|||
|
||||
function loadPage(page, config, systemInfo) {
|
||||
|
||||
var os = systemInfo.OperatingSystem.toLowerCase();
|
||||
|
||||
if (os.indexOf('windows') != -1) {
|
||||
$('#windowsStartupDescription', page).show();
|
||||
} else {
|
||||
$('#windowsStartupDescription', page).hide();
|
||||
}
|
||||
|
||||
if (systemInfo.SupportsAutoRunAtStartup) {
|
||||
$('#fldRunAtStartup', page).show();
|
||||
} else {
|
||||
$('#fldRunAtStartup', page).hide();
|
||||
}
|
||||
|
||||
if (systemInfo.CanSelfUpdate) {
|
||||
$('.fldAutomaticUpdates', page).show();
|
||||
$('.lnlAutomaticUpdateLevel', page).html(Globalize.translate('LabelAutomaticUpdateLevel'));
|
||||
|
@ -26,7 +12,6 @@
|
|||
|
||||
$('#chkEnableAutomaticServerUpdates', page).checked(config.EnableAutoUpdate);
|
||||
$('#chkEnableAutomaticRestart', page).checked(config.EnableAutomaticRestart);
|
||||
$('#chkUsageData', page).checked(config.EnableAnonymousUsageReporting);
|
||||
|
||||
if (systemInfo.CanSelfRestart) {
|
||||
$('#fldEnableAutomaticRestart', page).show();
|
||||
|
@ -35,9 +20,7 @@
|
|||
}
|
||||
|
||||
$('#selectAutomaticUpdateLevel', page).val(config.SystemUpdateLevel).trigger('change');
|
||||
$('#chkDebugLog', page).checked(config.EnableDebugLevelLogging);
|
||||
|
||||
$('#chkRunAtStartup', page).checked(config.RunAtStartup);
|
||||
|
||||
$('#chkEnableDashboardResponseCache', page).checked(config.EnableDashboardResponseCaching);
|
||||
$('#chkEnableMinification', page).checked(config.EnableDashboardResourceMinification);
|
||||
|
@ -53,13 +36,9 @@
|
|||
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
config.EnableDebugLevelLogging = $('#chkDebugLog', form).checked();
|
||||
|
||||
config.RunAtStartup = $('#chkRunAtStartup', form).checked();
|
||||
config.SystemUpdateLevel = $('#selectAutomaticUpdateLevel', form).val();
|
||||
config.EnableAutomaticRestart = $('#chkEnableAutomaticRestart', form).checked();
|
||||
config.EnableAutoUpdate = $('#chkEnableAutomaticServerUpdates', form).checked();
|
||||
config.EnableAnonymousUsageReporting = $('#chkUsageData', form).checked();
|
||||
|
||||
config.EnableDashboardResourceMinification = $('#chkEnableMinification', form).checked();
|
||||
config.EnableDashboardResponseCaching = $('#chkEnableDashboardResponseCache', form).checked();
|
||||
|
|
|
@ -80,8 +80,6 @@
|
|||
|
||||
var context = getParameterByName('context');
|
||||
|
||||
$('.sectionTabs', page).hide();
|
||||
|
||||
if (context == 'sync') {
|
||||
Dashboard.setPageTitle(Globalize.translate('TitleSync'));
|
||||
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Sync');
|
||||
|
@ -95,9 +93,6 @@
|
|||
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Notifications');
|
||||
}
|
||||
|
||||
$('.sectionTabs', page).hide();
|
||||
$('.' + context + 'SectionTabs', page).show();
|
||||
|
||||
}).on('pageshow', "#appServicesPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
define(['jQuery'], function ($) {
|
||||
|
||||
function loadPage(page, config) {
|
||||
|
||||
$('#selectChannelResolution', page).val(config.PreferredStreamingWidth || '');
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getNamedConfiguration("channels").then(function (config) {
|
||||
|
||||
// This should be null if empty
|
||||
config.PreferredStreamingWidth = $('#selectChannelResolution', form).val() || null;
|
||||
|
||||
ApiClient.updateNamedConfiguration("channels", config).then(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#channelSettingsPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('.channelSettingsForm', page).off('submit', onSubmit).on('submit', onSubmit);
|
||||
|
||||
}).on('pageshow', "#channelSettingsPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
||||
ApiClient.getNamedConfiguration("channels").then(function (config) {
|
||||
|
||||
loadPage(page, config);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
|
@ -5,13 +5,21 @@
|
|||
|
||||
var currentLanguage;
|
||||
|
||||
function loadPage(page, config, languageOptions) {
|
||||
function loadPage(page, config, languageOptions, systemInfo) {
|
||||
|
||||
if (Dashboard.lastSystemInfo) {
|
||||
Dashboard.setPageTitle(Dashboard.lastSystemInfo.ServerName);
|
||||
var os = systemInfo.OperatingSystem.toLowerCase();
|
||||
|
||||
if (os.indexOf('windows') != -1) {
|
||||
$('#windowsStartupDescription', page).show();
|
||||
} else {
|
||||
$('#windowsStartupDescription', page).hide();
|
||||
}
|
||||
|
||||
refreshPageTitle(page);
|
||||
if (systemInfo.SupportsAutoRunAtStartup) {
|
||||
$('#fldRunAtStartup', page).show();
|
||||
} else {
|
||||
$('#fldRunAtStartup', page).hide();
|
||||
}
|
||||
|
||||
page.querySelector('#txtServerName').value = config.ServerName || '';
|
||||
page.querySelector('#txtCachePath').value = config.CachePath || '';
|
||||
|
@ -23,18 +31,12 @@
|
|||
})).val(config.UICulture);
|
||||
|
||||
currentLanguage = config.UICulture;
|
||||
$('#chkUsageData', page).checked(config.EnableAnonymousUsageReporting);
|
||||
$('#chkRunAtStartup', page).checked(config.RunAtStartup);
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
function refreshPageTitle(page) {
|
||||
|
||||
ApiClient.getSystemInfo().then(function (systemInfo) {
|
||||
|
||||
Dashboard.setPageTitle(systemInfo.ServerName);
|
||||
});
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
|
@ -52,9 +54,10 @@
|
|||
Dashboard.showDashboardRefreshNotification();
|
||||
}
|
||||
|
||||
ApiClient.updateServerConfiguration(config).then(function () {
|
||||
config.EnableAnonymousUsageReporting = $('#chkUsageData', form).checked();
|
||||
config.RunAtStartup = $('#chkRunAtStartup', form).checked();
|
||||
|
||||
refreshPageTitle(page);
|
||||
ApiClient.updateServerConfiguration(config).then(function () {
|
||||
|
||||
ApiClient.getNamedConfiguration(brandingConfigKey).then(function (brandingConfig) {
|
||||
|
||||
|
@ -77,11 +80,9 @@
|
|||
return false;
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#dashboardGeneralPage", function () {
|
||||
return function (view, params) {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('#btnSelectCachePath', page).on("click.selectDirectory", function () {
|
||||
$('#btnSelectCachePath', view).on("click.selectDirectory", function () {
|
||||
|
||||
require(['directorybrowser'], function (directoryBrowser) {
|
||||
|
||||
|
@ -92,7 +93,7 @@
|
|||
callback: function (path) {
|
||||
|
||||
if (path) {
|
||||
page.querySelector('#txtCachePath').value = path;
|
||||
view.querySelector('#txtCachePath').value = path;
|
||||
}
|
||||
picker.close();
|
||||
},
|
||||
|
@ -104,32 +105,27 @@
|
|||
});
|
||||
});
|
||||
|
||||
$('.dashboardGeneralForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||
$('.dashboardGeneralForm', view).off('submit', onSubmit).on('submit', onSubmit);
|
||||
|
||||
}).on('pageshow', "#dashboardGeneralPage", function () {
|
||||
view.addEventListener('viewshow', function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
var promise1 = ApiClient.getServerConfiguration();
|
||||
var promise2 = ApiClient.getJSON(ApiClient.getUrl("Localization/Options"));
|
||||
var promise3 = ApiClient.getSystemInfo();
|
||||
|
||||
var page = this;
|
||||
Promise.all([promise1, promise2, promise3]).then(function (responses) {
|
||||
|
||||
var promise1 = ApiClient.getServerConfiguration();
|
||||
loadPage(view, responses[0], responses[1], responses[2]);
|
||||
|
||||
var promise2 = ApiClient.getJSON(ApiClient.getUrl("Localization/Options"));
|
||||
});
|
||||
|
||||
Promise.all([promise1, promise2]).then(function (responses) {
|
||||
ApiClient.getNamedConfiguration(brandingConfigKey).then(function (config) {
|
||||
|
||||
loadPage(page, responses[0], responses[1]);
|
||||
currentBrandingOptions = config;
|
||||
|
||||
view.querySelector('#txtLoginDisclaimer').value = config.LoginDisclaimer || '';
|
||||
view.querySelector('#txtCustomCss').value = config.CustomCss || '';
|
||||
});
|
||||
});
|
||||
|
||||
ApiClient.getNamedConfiguration(brandingConfigKey).then(function (config) {
|
||||
|
||||
currentBrandingOptions = config;
|
||||
|
||||
page.querySelector('#txtLoginDisclaimer').value = config.LoginDisclaimer || '';
|
||||
page.querySelector('#txtCustomCss').value = config.CustomCss || '';
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
});
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
}
|
||||
|
||||
if (Dashboard.lastSystemInfo) {
|
||||
Dashboard.setPageTitle(Dashboard.lastSystemInfo.ServerName);
|
||||
page.querySelector('.serverNameHeader').innerHTML = Dashboard.lastSystemInfo.ServerName;
|
||||
}
|
||||
|
||||
DashboardPage.newsStartIndex = 0;
|
||||
|
@ -84,7 +84,7 @@
|
|||
|
||||
ApiClient.getSystemInfo().then(function (systemInfo) {
|
||||
|
||||
Dashboard.setPageTitle(systemInfo.ServerName);
|
||||
page.querySelector('.serverNameHeader').innerHTML = systemInfo.ServerName;
|
||||
Dashboard.updateSystemInfo(systemInfo);
|
||||
|
||||
$('#appVersionNumber', page).html(Globalize.translate('LabelVersionNumber').replace('{0}', systemInfo.Version));
|
||||
|
@ -835,10 +835,10 @@
|
|||
var version = packageInfo[0];
|
||||
|
||||
if (!version) {
|
||||
$('#pUpToDate', page).show();
|
||||
page.querySelector('#pUpToDate').classList.remove('hide');
|
||||
$('#pUpdateNow', page).hide();
|
||||
} else {
|
||||
$('#pUpToDate', page).hide();
|
||||
page.querySelector('#pUpToDate').classList.add('hide');
|
||||
|
||||
$('#pUpdateNow', page).show();
|
||||
|
||||
|
@ -849,7 +849,7 @@
|
|||
|
||||
} else {
|
||||
|
||||
$('#pUpToDate', page).hide();
|
||||
page.querySelector('#pUpToDate').classList.add('hide');
|
||||
|
||||
$('#pUpdateNow', page).hide();
|
||||
}
|
||||
|
|
|
@ -1,63 +0,0 @@
|
|||
define(['jQuery'], function ($) {
|
||||
|
||||
function loadPage(page, config, users) {
|
||||
|
||||
$('#chkEnableServer', page).checked(config.EnableServer);
|
||||
$('#chkBlastAliveMessages', page).checked(config.BlastAliveMessages);
|
||||
$('#txtBlastInterval', page).val(config.BlastAliveMessageIntervalSeconds);
|
||||
|
||||
$('#chkEnableMovieFolders', page).checked(config.EnableMovieFolders);
|
||||
|
||||
var usersHtml = users.map(function (u) {
|
||||
return '<option value="' + u.Id + '">' + u.Name + '</option>';
|
||||
}).join('');
|
||||
|
||||
$('#selectUser', page).html(usersHtml).val(config.DefaultUserId || '');
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getNamedConfiguration("dlna").then(function (config) {
|
||||
|
||||
config.EnableServer = $('#chkEnableServer', form).checked();
|
||||
config.BlastAliveMessages = $('#chkBlastAliveMessages', form).checked();
|
||||
config.BlastAliveMessageIntervalSeconds = $('#txtBlastInterval', form).val();
|
||||
config.DefaultUserId = $('#selectUser', form).val();
|
||||
|
||||
config.EnableMovieFolders = $('#chkEnableMovieFolders', form).checked();
|
||||
|
||||
ApiClient.updateNamedConfiguration("dlna", config).then(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#dlnaServerSettingsPage", function () {
|
||||
|
||||
$('.dlnaServerSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||
|
||||
}).on('pageshow', "#dlnaServerSettingsPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
||||
var promise1 = ApiClient.getNamedConfiguration("dlna");
|
||||
var promise2 = ApiClient.getUsers();
|
||||
|
||||
Promise.all([promise1, promise2]).then(function (responses) {
|
||||
|
||||
loadPage(page, responses[0], responses[1]);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
|
@ -1,12 +1,24 @@
|
|||
define(['jQuery'], function ($) {
|
||||
|
||||
function loadPage(page, config) {
|
||||
function loadPage(page, config, users) {
|
||||
|
||||
page.querySelector('#chkEnablePlayTo').checked = config.EnablePlayTo;
|
||||
page.querySelector('#chkEnableDlnaDebugLogging').checked = config.EnableDebugLog;
|
||||
|
||||
$('#txtClientDiscoveryInterval', page).val(config.ClientDiscoveryIntervalSeconds);
|
||||
|
||||
$('#chkEnableServer', page).checked(config.EnableServer);
|
||||
$('#chkBlastAliveMessages', page).checked(config.BlastAliveMessages);
|
||||
$('#txtBlastInterval', page).val(config.BlastAliveMessageIntervalSeconds);
|
||||
|
||||
$('#chkEnableMovieFolders', page).checked(config.EnableMovieFolders);
|
||||
|
||||
var usersHtml = users.map(function (u) {
|
||||
return '<option value="' + u.Id + '">' + u.Name + '</option>';
|
||||
}).join('');
|
||||
|
||||
$('#selectUser', page).html(usersHtml).val(config.DefaultUserId || '');
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
|
@ -23,6 +35,13 @@
|
|||
|
||||
config.ClientDiscoveryIntervalSeconds = $('#txtClientDiscoveryInterval', form).val();
|
||||
|
||||
config.EnableServer = $('#chkEnableServer', form).checked();
|
||||
config.BlastAliveMessages = $('#chkBlastAliveMessages', form).checked();
|
||||
config.BlastAliveMessageIntervalSeconds = $('#txtBlastInterval', form).val();
|
||||
config.DefaultUserId = $('#selectUser', form).val();
|
||||
|
||||
config.EnableMovieFolders = $('#chkEnableMovieFolders', form).checked();
|
||||
|
||||
ApiClient.updateNamedConfiguration("dlna", config).then(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
|
@ -40,9 +59,12 @@
|
|||
|
||||
var page = this;
|
||||
|
||||
ApiClient.getNamedConfiguration("dlna").then(function (config) {
|
||||
var promise1 = ApiClient.getNamedConfiguration("dlna");
|
||||
var promise2 = ApiClient.getUsers();
|
||||
|
||||
loadPage(page, config);
|
||||
Promise.all([promise1, promise2]).then(function (responses) {
|
||||
|
||||
loadPage(page, responses[0], responses[1]);
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
define(['imageLoader', 'jQuery', 'paper-icon-button', 'paper-button', 'emby-icons'], function (imageLoader, $) {
|
||||
|
||||
var mainDrawerPanel = document.querySelector('.mainDrawerPanel');
|
||||
|
||||
function renderHeader() {
|
||||
|
||||
var html = '';
|
||||
|
@ -43,10 +45,9 @@
|
|||
|
||||
var viewMenuBar = document.createElement('div');
|
||||
viewMenuBar.classList.add('viewMenuBar');
|
||||
viewMenuBar.classList.add('ui-body-b');
|
||||
viewMenuBar.innerHTML = html;
|
||||
|
||||
document.body.appendChild(viewMenuBar);
|
||||
document.querySelector('.skinHeader').appendChild(viewMenuBar);
|
||||
|
||||
imageLoader.lazyChildren(document.querySelector('.viewMenuBar'));
|
||||
|
||||
|
@ -216,18 +217,15 @@
|
|||
return LibraryBrowser.getHref(item, context);
|
||||
}
|
||||
|
||||
var requiresDrawerRefresh = true;
|
||||
var requiresDashboardDrawerRefresh = true;
|
||||
var requiresUserRefresh = true;
|
||||
var lastOpenTime = new Date().getTime();
|
||||
|
||||
function toggleMainDrawer() {
|
||||
|
||||
var drawerPanel = document.querySelector('.mainDrawerPanel');
|
||||
if (drawerPanel.selected == 'drawer') {
|
||||
closeMainDrawer(drawerPanel);
|
||||
if (mainDrawerPanel.selected == 'drawer') {
|
||||
closeMainDrawer(mainDrawerPanel);
|
||||
} else {
|
||||
openMainDrawer(drawerPanel);
|
||||
openMainDrawer(mainDrawerPanel);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -243,38 +241,6 @@
|
|||
if (browserInfo.mobile) {
|
||||
document.body.classList.add('bodyWithPopupOpen');
|
||||
}
|
||||
|
||||
var pageElem = $.mobile.activePage;
|
||||
|
||||
if (requiresDrawerRefresh || requiresDashboardDrawerRefresh) {
|
||||
|
||||
ConnectionManager.user(window.ApiClient).then(function (user) {
|
||||
|
||||
var drawer = document.querySelector('.mainDrawerPanel .mainDrawer');
|
||||
|
||||
if (requiresDrawerRefresh) {
|
||||
ensureDrawerStructure(drawer);
|
||||
|
||||
refreshUserInfoInDrawer(user, drawer);
|
||||
refreshLibraryInfoInDrawer(user, drawer);
|
||||
refreshBottomUserInfoInDrawer(user, drawer);
|
||||
|
||||
document.dispatchEvent(new CustomEvent("libraryMenuCreated", {}));
|
||||
updateLibraryMenu(user.localUser);
|
||||
}
|
||||
|
||||
if (requiresDrawerRefresh || requiresDashboardDrawerRefresh) {
|
||||
refreshDashboardInfoInDrawer(pageElem, user, drawer);
|
||||
requiresDashboardDrawerRefresh = false;
|
||||
}
|
||||
|
||||
requiresDrawerRefresh = false;
|
||||
});
|
||||
}
|
||||
|
||||
updateLibraryNavLinks(pageElem);
|
||||
|
||||
document.querySelector('.mainDrawerPanel #drawer').classList.add('verticalScrollingDrawer');
|
||||
}
|
||||
function closeMainDrawer(drawerPanel) {
|
||||
|
||||
|
@ -287,101 +253,47 @@
|
|||
|
||||
if (drawer.selected != 'drawer') {
|
||||
document.body.classList.remove('bodyWithPopupOpen');
|
||||
document.querySelector('.mainDrawerPanel #drawer').classList.remove('verticalScrollingDrawer');
|
||||
} else {
|
||||
onMainDrawerOpened();
|
||||
}
|
||||
}
|
||||
|
||||
function ensureDrawerStructure(drawer) {
|
||||
|
||||
if (drawer.querySelector('.mainDrawerContent')) {
|
||||
return;
|
||||
}
|
||||
|
||||
var html = '<div class="mainDrawerContent">';
|
||||
|
||||
html += '<div class="userheader">';
|
||||
html += '</div>';
|
||||
html += '<div class="libraryDrawerContent">';
|
||||
html += '</div>';
|
||||
html += '<div class="dashboardDrawerContent">';
|
||||
html += '</div>';
|
||||
html += '<div class="userFooter">';
|
||||
html += '</div>';
|
||||
|
||||
html += '</div>';
|
||||
|
||||
drawer.innerHTML = html;
|
||||
}
|
||||
|
||||
function refreshUserInfoInDrawer(user, drawer) {
|
||||
|
||||
var html = '';
|
||||
|
||||
var homeHref = window.ApiClient ? 'home.html' : 'selectserver.html?showuser=1';
|
||||
|
||||
html += '<div style="margin-top:5px;"></div>';
|
||||
|
||||
html += '<a class="lnkMediaFolder sidebarLink" href="' + homeHref + '" onclick="return LibraryMenu.onLinkClicked(event, this);">';
|
||||
html += '<div style="background-image:url(\'css/images/mblogoicon.png\');width:' + 28 + 'px;height:' + 28 + 'px;background-size:contain;background-repeat:no-repeat;background-position:center center;border-radius:1000px;vertical-align:middle;margin:0 1.6em 0 1.5em;display:inline-block;"></div>';
|
||||
html += Globalize.translate('ButtonHome');
|
||||
html += '</a>';
|
||||
|
||||
html += '<a class="sidebarLink lnkMediaFolder" data-itemid="remote" href="nowplaying.html" onclick="return LibraryMenu.onLinkClicked(event, this);"><iron-icon icon="tablet-android" class="sidebarLinkIcon" style="color:#673AB7;"></iron-icon><span class="sidebarLinkText">' + Globalize.translate('ButtonRemote') + '</span></a>';
|
||||
|
||||
var userHeader = drawer.querySelector('.userheader');
|
||||
|
||||
userHeader.innerHTML = html;
|
||||
|
||||
require(['imageLoader'], function (imageLoader) {
|
||||
imageLoader.fillImages(userHeader.getElementsByClassName('lazy'));
|
||||
});
|
||||
}
|
||||
|
||||
function refreshLibraryInfoInDrawer(user, drawer) {
|
||||
|
||||
var html = '';
|
||||
|
||||
var homeHref = window.ApiClient ? 'home.html' : 'selectserver.html?showuser=1';
|
||||
|
||||
html += '<a class="lnkMediaFolder sidebarLink" href="' + homeHref + '" onclick="return LibraryMenu.onLinkClicked(event, this);">';
|
||||
html += '<div style="background-image:url(\'css/images/mblogoicon.png\');width:' + 28 + 'px;height:' + 28 + 'px;background-size:contain;background-repeat:no-repeat;background-position:center center;border-radius:1000px;vertical-align:middle;margin:0 1.6em 0 1.5em;display:inline-block;"></div>';
|
||||
html += Globalize.translate('ButtonHome');
|
||||
html += '</a>';
|
||||
|
||||
html += '<a class="sidebarLink lnkMediaFolder" data-itemid="remote" href="nowplaying.html" onclick="return LibraryMenu.onLinkClicked(event, this);"><iron-icon icon="tablet-android" class="sidebarLinkIcon"></iron-icon><span class="sidebarLinkText">' + Globalize.translate('ButtonRemote') + '</span></a>';
|
||||
|
||||
html += '<div class="sidebarDivider"></div>';
|
||||
|
||||
html += '<div class="libraryMenuOptions">';
|
||||
html += '</div>';
|
||||
|
||||
drawer.querySelector('.libraryDrawerContent').innerHTML = html;
|
||||
}
|
||||
var localUser = user.localUser;
|
||||
if (localUser && localUser.Policy.IsAdministrator) {
|
||||
|
||||
function refreshDashboardInfoInDrawer(page, user, drawer) {
|
||||
html += '<div class="adminMenuOptions">';
|
||||
html += '<div class="sidebarDivider"></div>';
|
||||
|
||||
var html = '';
|
||||
html += '<div class="sidebarHeader">';
|
||||
html += Globalize.translate('HeaderAdmin');
|
||||
html += '</div>';
|
||||
|
||||
html += '<div class="sidebarDivider"></div>';
|
||||
html += '<a class="sidebarLink lnkMediaFolder lnkManageServer" data-itemid="dashboard" href="#"><iron-icon icon="dashboard" class="sidebarLinkIcon"></iron-icon><span class="sidebarLinkText">' + Globalize.translate('ButtonManageServer') + '</span></a>';
|
||||
html += '<a class="sidebarLink lnkMediaFolder editorViewMenu" data-itemid="editor" onclick="return LibraryMenu.onLinkClicked(event, this);" href="edititemmetadata.html"><iron-icon icon="mode-edit" class="sidebarLinkIcon"></iron-icon><span class="sidebarLinkText">' + Globalize.translate('ButtonMetadataManager') + '</span></a>';
|
||||
|
||||
html += Dashboard.getToolsMenuHtml(page);
|
||||
|
||||
html = html.split('href=').join('onclick="return LibraryMenu.onLinkClicked(event, this);" href=');
|
||||
|
||||
drawer.querySelector('.dashboardDrawerContent').innerHTML = html;
|
||||
}
|
||||
|
||||
function refreshBottomUserInfoInDrawer(user, drawer) {
|
||||
|
||||
var html = '';
|
||||
|
||||
html += '<div class="adminMenuOptions">';
|
||||
html += '<div class="sidebarDivider"></div>';
|
||||
|
||||
html += '<div class="sidebarHeader">';
|
||||
html += Globalize.translate('HeaderAdmin');
|
||||
html += '</div>';
|
||||
|
||||
html += '<a class="sidebarLink lnkMediaFolder lnkManageServer" data-itemid="dashboard" href="#"><iron-icon icon="dashboard" class="sidebarLinkIcon"></iron-icon><span class="sidebarLinkText">' + Globalize.translate('ButtonManageServer') + '</span></a>';
|
||||
html += '<a class="sidebarLink lnkMediaFolder editorViewMenu" data-itemid="editor" onclick="return LibraryMenu.onLinkClicked(event, this);" href="edititemmetadata.html"><iron-icon icon="mode-edit" class="sidebarLinkIcon"></iron-icon><span class="sidebarLinkText">' + Globalize.translate('ButtonMetadataManager') + '</span></a>';
|
||||
|
||||
if (!browserInfo.mobile) {
|
||||
html += '<a class="sidebarLink lnkMediaFolder" data-itemid="reports" onclick="return LibraryMenu.onLinkClicked(event, this);" href="reports.html"><iron-icon icon="insert-chart" class="sidebarLinkIcon"></iron-icon><span class="sidebarLinkText">' + Globalize.translate('ButtonReports') + '</span></a>';
|
||||
if (!browserInfo.mobile) {
|
||||
html += '<a class="sidebarLink lnkMediaFolder" data-itemid="reports" onclick="return LibraryMenu.onLinkClicked(event, this);" href="reports.html"><iron-icon icon="insert-chart" class="sidebarLinkIcon"></iron-icon><span class="sidebarLinkText">' + Globalize.translate('ButtonReports') + '</span></a>';
|
||||
}
|
||||
html += '</div>';
|
||||
}
|
||||
html += '</div>';
|
||||
|
||||
html += '<div class="userMenuOptions">';
|
||||
|
||||
|
@ -403,9 +315,101 @@
|
|||
|
||||
html += '</div>';
|
||||
|
||||
drawer.querySelector('.userFooter').innerHTML = html;
|
||||
var drawer = mainDrawerPanel.querySelector('.mainDrawer');
|
||||
|
||||
drawer.querySelector('.lnkManageServer').addEventListener('click', onManageServerClicked);
|
||||
drawer.innerHTML = html;
|
||||
|
||||
var lnkManageServer = drawer.querySelector('.lnkManageServer');
|
||||
if (lnkManageServer) {
|
||||
lnkManageServer.addEventListener('click', onManageServerClicked);
|
||||
}
|
||||
|
||||
require(['imageLoader'], function (imageLoader) {
|
||||
imageLoader.fillImages(mainDrawerPanel.getElementsByClassName('lazy'));
|
||||
});
|
||||
}
|
||||
|
||||
function refreshDashboardInfoInDrawer(page, user) {
|
||||
|
||||
if (!mainDrawerPanel.querySelector('.adminDrawerLogo')) {
|
||||
createDashboardMenu(page);
|
||||
} else {
|
||||
updateDashboardMenuSelectedItem();
|
||||
}
|
||||
}
|
||||
|
||||
function parentWithTag(elem, tagName) {
|
||||
|
||||
while (elem.tagName != tagName) {
|
||||
elem = elem.parentNode;
|
||||
|
||||
if (!elem) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return elem;
|
||||
}
|
||||
|
||||
function updateDashboardMenuSelectedItem() {
|
||||
|
||||
var links = mainDrawerPanel.querySelectorAll('.sidebarLink');
|
||||
|
||||
for (var i = 0, length = links.length; i < length; i++) {
|
||||
var link = links[i];
|
||||
|
||||
var selected = false;
|
||||
|
||||
var pageIds = link.getAttribute('data-pageids');
|
||||
if (pageIds) {
|
||||
selected = pageIds.split(',').indexOf($.mobile.activePage.id) != -1
|
||||
}
|
||||
|
||||
if (selected) {
|
||||
link.classList.add('selectedSidebarLink');
|
||||
|
||||
var collapsible = parentWithTag(link, 'EMBY-COLLAPSIBLE');
|
||||
if (collapsible) {
|
||||
collapsible.expanded = true;
|
||||
}
|
||||
|
||||
var title = collapsible.title || '';
|
||||
title += '<span class="title-separator">–</span>';
|
||||
title += (link.innerText || link.textContent).trim();
|
||||
|
||||
Dashboard.setPageTitle(title);
|
||||
|
||||
} else {
|
||||
link.classList.remove('selectedSidebarLink');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function createDashboardMenu() {
|
||||
require(['emby-collapsible'], function () {
|
||||
var html = '';
|
||||
|
||||
//html += '<div class="userHeader">';
|
||||
//html += '<div class="userHeaderActionMenu">';
|
||||
//html += '<div>';
|
||||
//html += localUser.Name;
|
||||
//html += '</div>';
|
||||
//html += '<paper-icon-button icon="expand-more"></paper-icon-button>';
|
||||
//html += '</div>';
|
||||
//html += '</div>';
|
||||
|
||||
html += '<a class="adminDrawerLogo clearLink" href="dashboard.html">'
|
||||
html += '<img src="css/images/logo.png" />';
|
||||
html += '</a>'
|
||||
|
||||
html += Dashboard.getToolsMenuHtml();
|
||||
|
||||
html = html.split('href=').join('onclick="return LibraryMenu.onLinkClicked(event, this);" href=');
|
||||
|
||||
mainDrawerPanel.querySelector('.mainDrawer').innerHTML = html;
|
||||
|
||||
updateDashboardMenuSelectedItem();
|
||||
});
|
||||
}
|
||||
|
||||
function onSidebarLinkClick() {
|
||||
|
@ -473,7 +477,6 @@
|
|||
|
||||
if (!user) {
|
||||
|
||||
showBySelector('.adminMenuOptions', false);
|
||||
showBySelector('.lnkMySync', false);
|
||||
showBySelector('.userMenuOptions', false);
|
||||
return;
|
||||
|
@ -560,12 +563,6 @@
|
|||
}
|
||||
});
|
||||
|
||||
if (user.Policy.IsAdministrator) {
|
||||
showBySelector('.adminMenuOptions', true);
|
||||
} else {
|
||||
showBySelector('.adminMenuOptions', false);
|
||||
}
|
||||
|
||||
if (user.Policy.EnableSync) {
|
||||
showBySelector('.lnkMySync', true);
|
||||
} else {
|
||||
|
@ -573,8 +570,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
var requiresLibraryMenuRefresh = false;
|
||||
|
||||
function onManageServerClicked() {
|
||||
|
||||
closeMainDrawer();
|
||||
|
@ -654,7 +649,19 @@
|
|||
},
|
||||
|
||||
setTitle: function (title) {
|
||||
document.querySelector('.libraryMenuButtonText').innerHTML = title;
|
||||
|
||||
var html = '<span>' + title + '</span>';
|
||||
|
||||
var page = $.mobile.activePage;
|
||||
if (page) {
|
||||
var helpUrl = page.getAttribute('data-helpurl');
|
||||
|
||||
if (helpUrl) {
|
||||
html += '<a href="' + helpUrl + '" target="_blank" class="clearLink" style="margin-left:1em;" title="' + Globalize.translate('ButtonHelp') + '"><paper-icon-button icon="info"></paper-icon-button></a>';
|
||||
}
|
||||
}
|
||||
|
||||
document.querySelector('.libraryMenuButtonText').innerHTML = html;
|
||||
},
|
||||
|
||||
setBackButtonVisible: function (visible) {
|
||||
|
@ -798,7 +805,7 @@
|
|||
|
||||
if (msg.Data.Id == Dashboard.getCurrentUserId()) {
|
||||
|
||||
requiresLibraryMenuRefresh = true;
|
||||
// refresh library menu
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -833,22 +840,29 @@
|
|||
}
|
||||
});
|
||||
|
||||
pageClassOn('pagebeforeshow', 'page', function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
if (page.classList.contains('type-interior')) {
|
||||
requiresDashboardDrawerRefresh = true;
|
||||
}
|
||||
|
||||
buildViewMenuBar(page);
|
||||
updateTabLinks(page);
|
||||
});
|
||||
|
||||
pageClassOn('pageshow', 'page', function (e) {
|
||||
|
||||
var page = this;
|
||||
|
||||
var isDashboardPage = page.classList.contains('type-interior');
|
||||
|
||||
if (isDashboardPage) {
|
||||
refreshDashboardInfoInDrawer(page);
|
||||
mainDrawerPanel.forceNarrow = false;
|
||||
} else {
|
||||
|
||||
if (mainDrawerPanel.classList.contains('adminDrawerPanel')) {
|
||||
refreshLibraryDrawer();
|
||||
}
|
||||
|
||||
mainDrawerPanel.forceNarrow = true;
|
||||
}
|
||||
|
||||
setDrawerClass(page);
|
||||
|
||||
buildViewMenuBar(page);
|
||||
updateTabLinks(page);
|
||||
|
||||
if (!e.detail.isRestored) {
|
||||
// Scroll back up so in case vertical scroll was messed with
|
||||
window.scrollTo(0, 0);
|
||||
|
@ -857,15 +871,13 @@
|
|||
updateTitle(page);
|
||||
updateBackButton(page);
|
||||
|
||||
var isLibraryPage = page.classList.contains('libraryPage');
|
||||
|
||||
if (isLibraryPage) {
|
||||
if (page.classList.contains('libraryPage')) {
|
||||
|
||||
document.body.classList.add('libraryDocument');
|
||||
document.body.classList.remove('dashboardDocument');
|
||||
document.body.classList.remove('hideMainDrawer');
|
||||
}
|
||||
else if (page.classList.contains('type-interior')) {
|
||||
else if (isDashboardPage) {
|
||||
|
||||
document.body.classList.remove('libraryDocument');
|
||||
document.body.classList.add('dashboardDocument');
|
||||
|
@ -877,6 +889,8 @@
|
|||
document.body.classList.remove('dashboardDocument');
|
||||
document.body.classList.add('hideMainDrawer');
|
||||
}
|
||||
|
||||
updateLibraryNavLinks(page);
|
||||
});
|
||||
|
||||
function updateTitle(page) {
|
||||
|
@ -890,12 +904,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
if (!title) {
|
||||
if (page.classList.contains('type-interior')) {
|
||||
title = Globalize.translate('ButtonHome');
|
||||
}
|
||||
}
|
||||
|
||||
if (title) {
|
||||
LibraryMenu.setTitle(title);
|
||||
}
|
||||
|
@ -946,7 +954,6 @@
|
|||
|
||||
function initializeApiClient(apiClient) {
|
||||
|
||||
requiresLibraryMenuRefresh = true;
|
||||
Events.off(apiClient, 'websocketmessage', onWebSocketMessage);
|
||||
|
||||
Events.on(apiClient, 'websocketmessage', onWebSocketMessage);
|
||||
|
@ -956,15 +963,41 @@
|
|||
initializeApiClient(window.ApiClient);
|
||||
}
|
||||
|
||||
function setDrawerClass() {
|
||||
function setDrawerClass(page) {
|
||||
|
||||
var drawer = document.querySelector('.mainDrawerPanel #drawer');
|
||||
if (drawer) {
|
||||
drawer.classList.add('darkDrawer');
|
||||
var admin = false;
|
||||
|
||||
if (!page) {
|
||||
if (window.$ && window.$.mobile) {
|
||||
page = $.mobile.activePage;
|
||||
}
|
||||
}
|
||||
|
||||
if (page && page.classList.contains('type-interior')) {
|
||||
admin = true;
|
||||
}
|
||||
|
||||
if (admin) {
|
||||
mainDrawerPanel.classList.add('adminDrawerPanel');
|
||||
mainDrawerPanel.classList.remove('darkDrawerPanel');
|
||||
} else {
|
||||
mainDrawerPanel.classList.add('darkDrawerPanel');
|
||||
mainDrawerPanel.classList.remove('adminDrawerPanel');
|
||||
}
|
||||
}
|
||||
|
||||
var mainDrawerPanel = document.querySelector('.mainDrawerPanel');
|
||||
function refreshLibraryDrawer(user) {
|
||||
|
||||
var promise = user ? Promise.resolve(user) : ConnectionManager.user(window.ApiClient);
|
||||
|
||||
promise.then(function (user) {
|
||||
refreshLibraryInfoInDrawer(user);
|
||||
|
||||
document.dispatchEvent(new CustomEvent("libraryMenuCreated", {}));
|
||||
updateLibraryMenu(user.localUser);
|
||||
});
|
||||
}
|
||||
|
||||
mainDrawerPanel.addEventListener('iron-select', onMainDrawerSelect);
|
||||
|
||||
renderHeader();
|
||||
|
@ -974,14 +1007,15 @@
|
|||
});
|
||||
|
||||
Events.on(ConnectionManager, 'localusersignedin', function (e, user) {
|
||||
requiresLibraryMenuRefresh = true;
|
||||
requiresDrawerRefresh = true;
|
||||
setDrawerClass();
|
||||
ConnectionManager.user(ConnectionManager.getApiClient(user.ServerId)).then(updateUserInHeader);
|
||||
ConnectionManager.user(ConnectionManager.getApiClient(user.ServerId)).then(function (user) {
|
||||
refreshLibraryDrawer(user);
|
||||
updateUserInHeader(user);
|
||||
});
|
||||
});
|
||||
|
||||
Events.on(ConnectionManager, 'localusersignedout', function () {
|
||||
requiresLibraryMenuRefresh = true;
|
||||
requiresDrawerRefresh = true;
|
||||
updateUserInHeader();
|
||||
});
|
||||
|
|
|
@ -15,9 +15,110 @@
|
|||
page.querySelector('#chkEnableAudioArchiveFiles').checked = config.EnableAudioArchiveFiles;
|
||||
page.querySelector('#chkEnableVideoArchiveFiles').checked = config.EnableVideoArchiveFiles;
|
||||
|
||||
$('#chkSaveMetadataHidden', page).checked(config.SaveMetadataHidden);
|
||||
|
||||
$('#txtMetadataPath', page).val(config.MetadataPath || '');
|
||||
|
||||
$('#chkPeopleActors', page).checked(config.PeopleMetadataOptions.DownloadActorMetadata);
|
||||
$('#chkPeopleComposers', page).checked(config.PeopleMetadataOptions.DownloadComposerMetadata);
|
||||
$('#chkPeopleDirectors', page).checked(config.PeopleMetadataOptions.DownloadDirectorMetadata);
|
||||
$('#chkPeopleProducers', page).checked(config.PeopleMetadataOptions.DownloadProducerMetadata);
|
||||
$('#chkPeopleWriters', page).checked(config.PeopleMetadataOptions.DownloadWriterMetadata);
|
||||
$('#chkPeopleOthers', page).checked(config.PeopleMetadataOptions.DownloadOtherPeopleMetadata);
|
||||
$('#chkPeopleGuestStars', page).checked(config.PeopleMetadataOptions.DownloadGuestStarMetadata);
|
||||
|
||||
$('#chkDownloadImagesInAdvance', page).checked(config.DownloadImagesInAdvance);
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
function loadMetadataConfig(page, config) {
|
||||
|
||||
$('#selectDateAdded', page).val((config.UseFileCreationTimeForDateAdded ? '1' : '0'));
|
||||
}
|
||||
|
||||
function loadTmdbConfig(page, config) {
|
||||
|
||||
$('#chkEnableTmdbUpdates', page).checked(config.EnableAutomaticUpdates);
|
||||
}
|
||||
|
||||
function loadTvdbConfig(page, config) {
|
||||
|
||||
$('#chkEnableTvdbUpdates', page).checked(config.EnableAutomaticUpdates);
|
||||
}
|
||||
|
||||
function loadFanartConfig(page, config) {
|
||||
|
||||
$('#chkEnableFanartUpdates', page).checked(config.EnableAutomaticUpdates);
|
||||
$('#txtFanartApiKey', page).val(config.UserApiKey || '');
|
||||
}
|
||||
|
||||
function loadChapters(page, config, providers) {
|
||||
|
||||
$('#chkChaptersMovies', page).checked(config.EnableMovieChapterImageExtraction);
|
||||
$('#chkChaptersEpisodes', page).checked(config.EnableEpisodeChapterImageExtraction);
|
||||
$('#chkChaptersOtherVideos', page).checked(config.EnableOtherVideoChapterImageExtraction);
|
||||
|
||||
$('#chkExtractChaptersDuringLibraryScan', page).checked(config.ExtractDuringLibraryScan);
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
function saveFanart(form) {
|
||||
|
||||
ApiClient.getNamedConfiguration("fanart").then(function (config) {
|
||||
|
||||
config.EnableAutomaticUpdates = $('#chkEnableFanartUpdates', form).checked();
|
||||
config.UserApiKey = $('#txtFanartApiKey', form).val();
|
||||
|
||||
ApiClient.updateNamedConfiguration("fanart", config);
|
||||
});
|
||||
}
|
||||
|
||||
function saveTvdb(form) {
|
||||
|
||||
ApiClient.getNamedConfiguration("tvdb").then(function (config) {
|
||||
|
||||
config.EnableAutomaticUpdates = $('#chkEnableTvdbUpdates', form).checked();
|
||||
|
||||
ApiClient.updateNamedConfiguration("tvdb", config);
|
||||
});
|
||||
}
|
||||
|
||||
function saveTmdb(form) {
|
||||
|
||||
ApiClient.getNamedConfiguration("themoviedb").then(function (config) {
|
||||
|
||||
config.EnableAutomaticUpdates = $('#chkEnableTmdbUpdates', form).checked();
|
||||
|
||||
ApiClient.updateNamedConfiguration("themoviedb", config);
|
||||
});
|
||||
}
|
||||
|
||||
function saveMetadata(form) {
|
||||
|
||||
ApiClient.getNamedConfiguration("metadata").then(function (config) {
|
||||
|
||||
config.UseFileCreationTimeForDateAdded = $('#selectDateAdded', form).val() == '1';
|
||||
|
||||
ApiClient.updateNamedConfiguration("metadata", config);
|
||||
});
|
||||
}
|
||||
|
||||
function saveChapters(form) {
|
||||
|
||||
ApiClient.getNamedConfiguration("chapters").then(function (config) {
|
||||
|
||||
config.EnableMovieChapterImageExtraction = $('#chkChaptersMovies', form).checked();
|
||||
config.EnableEpisodeChapterImageExtraction = $('#chkChaptersEpisodes', form).checked();
|
||||
config.EnableOtherVideoChapterImageExtraction = $('#chkChaptersOtherVideos', form).checked();
|
||||
|
||||
config.ExtractDuringLibraryScan = $('#chkExtractChaptersDuringLibraryScan', form).checked();
|
||||
|
||||
ApiClient.updateNamedConfiguration("chapters", config);
|
||||
});
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
|
@ -32,9 +133,33 @@
|
|||
config.EnableAudioArchiveFiles = form.querySelector('#chkEnableAudioArchiveFiles').checked;
|
||||
config.EnableVideoArchiveFiles = form.querySelector('#chkEnableVideoArchiveFiles').checked;
|
||||
|
||||
config.SaveMetadataHidden = $('#chkSaveMetadataHidden', form).checked();
|
||||
|
||||
config.EnableTvDbUpdates = $('#chkEnableTvdbUpdates', form).checked();
|
||||
config.EnableTmdbUpdates = $('#chkEnableTmdbUpdates', form).checked();
|
||||
config.EnableFanArtUpdates = $('#chkEnableFanartUpdates', form).checked();
|
||||
config.MetadataPath = $('#txtMetadataPath', form).val();
|
||||
config.FanartApiKey = $('#txtFanartApiKey', form).val();
|
||||
|
||||
config.DownloadImagesInAdvance = $('#chkDownloadImagesInAdvance', form).checked();
|
||||
|
||||
config.PeopleMetadataOptions.DownloadActorMetadata = $('#chkPeopleActors', form).checked();
|
||||
config.PeopleMetadataOptions.DownloadComposerMetadata = $('#chkPeopleComposers', form).checked();
|
||||
config.PeopleMetadataOptions.DownloadDirectorMetadata = $('#chkPeopleDirectors', form).checked();
|
||||
config.PeopleMetadataOptions.DownloadGuestStarMetadata = $('#chkPeopleGuestStars', form).checked();
|
||||
config.PeopleMetadataOptions.DownloadProducerMetadata = $('#chkPeopleProducers', form).checked();
|
||||
config.PeopleMetadataOptions.DownloadWriterMetadata = $('#chkPeopleWriters', form).checked();
|
||||
config.PeopleMetadataOptions.DownloadOtherPeopleMetadata = $('#chkPeopleOthers', form).checked();
|
||||
|
||||
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
saveChapters(form);
|
||||
saveMetadata(form);
|
||||
saveTmdb(form);
|
||||
saveTvdb(form);
|
||||
saveFanart(form);
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
}
|
||||
|
@ -48,13 +173,63 @@
|
|||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
loadPage(page, config);
|
||||
});
|
||||
|
||||
ApiClient.getNamedConfiguration("metadata").then(function (metadata) {
|
||||
|
||||
loadMetadataConfig(page, metadata);
|
||||
});
|
||||
|
||||
ApiClient.getNamedConfiguration("fanart").then(function (metadata) {
|
||||
|
||||
loadFanartConfig(page, metadata);
|
||||
});
|
||||
|
||||
ApiClient.getNamedConfiguration("themoviedb").then(function (metadata) {
|
||||
|
||||
loadTmdbConfig(page, metadata);
|
||||
});
|
||||
|
||||
ApiClient.getNamedConfiguration("tvdb").then(function (metadata) {
|
||||
|
||||
loadTvdbConfig(page, metadata);
|
||||
});
|
||||
|
||||
var promise1 = ApiClient.getNamedConfiguration("chapters");
|
||||
var promise2 = ApiClient.getJSON(ApiClient.getUrl("Providers/Chapters"));
|
||||
|
||||
Promise.all([promise1, promise2]).then(function (responses) {
|
||||
|
||||
loadChapters(page, responses[0], responses[1]);
|
||||
});
|
||||
|
||||
}).on('pageinit', "#librarySettingsPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('#btnSelectMetadataPath', page).on("click.selectDirectory", function () {
|
||||
|
||||
require(['directorybrowser'], function (directoryBrowser) {
|
||||
|
||||
var picker = new directoryBrowser();
|
||||
|
||||
picker.show({
|
||||
|
||||
callback: function (path) {
|
||||
if (path) {
|
||||
$('#txtMetadataPath', page).val(path);
|
||||
}
|
||||
picker.close();
|
||||
},
|
||||
|
||||
header: Globalize.translate('HeaderSelectMetadataPath'),
|
||||
|
||||
instruction: Globalize.translate('HeaderSelectMetadataPathHelp')
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$('.librarySettingsForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||
|
||||
ApiClient.getSystemInfo().then(function (systemInfo) {
|
||||
|
|
|
@ -1,11 +1,20 @@
|
|||
define(['jQuery'], function ($) {
|
||||
define(['jQuery', 'paper-fab', 'paper-item-body', 'paper-icon-item'], function ($) {
|
||||
|
||||
$(document).on('pagebeforeshow', "#logPage", function () {
|
||||
return function (view, params) {
|
||||
|
||||
var page = this;
|
||||
Dashboard.showLoadingMsg();
|
||||
view.querySelector('#chkDebugLog').addEventListener('change', function () {
|
||||
|
||||
require(['paper-fab', 'paper-item-body', 'paper-icon-item'], function () {
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
config.EnableDebugLevelLogging = view.querySelector('#chkDebugLog').checked;
|
||||
|
||||
ApiClient.updateServerConfiguration(config);
|
||||
});
|
||||
});
|
||||
|
||||
view.addEventListener('viewbeforeshow', function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var apiClient = ApiClient;
|
||||
|
||||
|
@ -55,11 +64,15 @@
|
|||
|
||||
html += '</div>';
|
||||
|
||||
$('.serverLogs', page).html(html);
|
||||
$('.serverLogs', view).html(html);
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
|
||||
apiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
view.querySelector('#chkDebugLog').checked = config.EnableDebugLevelLogging;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
});
|
|
@ -1,221 +0,0 @@
|
|||
define(['jQuery'], function ($) {
|
||||
|
||||
function loadAdvancedConfig(page, config) {
|
||||
|
||||
$('#chkSaveMetadataHidden', page).checked(config.SaveMetadataHidden);
|
||||
|
||||
$('#txtMetadataPath', page).val(config.MetadataPath || '');
|
||||
|
||||
$('#chkPeopleActors', page).checked(config.PeopleMetadataOptions.DownloadActorMetadata);
|
||||
$('#chkPeopleComposers', page).checked(config.PeopleMetadataOptions.DownloadComposerMetadata);
|
||||
$('#chkPeopleDirectors', page).checked(config.PeopleMetadataOptions.DownloadDirectorMetadata);
|
||||
$('#chkPeopleProducers', page).checked(config.PeopleMetadataOptions.DownloadProducerMetadata);
|
||||
$('#chkPeopleWriters', page).checked(config.PeopleMetadataOptions.DownloadWriterMetadata);
|
||||
$('#chkPeopleOthers', page).checked(config.PeopleMetadataOptions.DownloadOtherPeopleMetadata);
|
||||
$('#chkPeopleGuestStars', page).checked(config.PeopleMetadataOptions.DownloadGuestStarMetadata);
|
||||
|
||||
$('#chkDownloadImagesInAdvance', page).checked(config.DownloadImagesInAdvance);
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
function loadMetadataConfig(page, config) {
|
||||
|
||||
$('#selectDateAdded', page).val((config.UseFileCreationTimeForDateAdded ? '1' : '0'));
|
||||
}
|
||||
|
||||
function loadTmdbConfig(page, config) {
|
||||
|
||||
$('#chkEnableTmdbUpdates', page).checked(config.EnableAutomaticUpdates);
|
||||
}
|
||||
|
||||
function loadTvdbConfig(page, config) {
|
||||
|
||||
$('#chkEnableTvdbUpdates', page).checked(config.EnableAutomaticUpdates);
|
||||
}
|
||||
|
||||
function loadFanartConfig(page, config) {
|
||||
|
||||
$('#chkEnableFanartUpdates', page).checked(config.EnableAutomaticUpdates);
|
||||
$('#txtFanartApiKey', page).val(config.UserApiKey || '');
|
||||
}
|
||||
|
||||
function loadChapters(page, config, providers) {
|
||||
|
||||
$('#chkChaptersMovies', page).checked(config.EnableMovieChapterImageExtraction);
|
||||
$('#chkChaptersEpisodes', page).checked(config.EnableEpisodeChapterImageExtraction);
|
||||
$('#chkChaptersOtherVideos', page).checked(config.EnableOtherVideoChapterImageExtraction);
|
||||
|
||||
$('#chkExtractChaptersDuringLibraryScan', page).checked(config.ExtractDuringLibraryScan);
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
var form = this;
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
saveAdvancedConfig(form);
|
||||
saveChapters(form);
|
||||
saveMetadata(form);
|
||||
saveTmdb(form);
|
||||
saveTvdb(form);
|
||||
saveFanart(form);
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#advancedMetadataConfigurationPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('#btnSelectMetadataPath', page).on("click.selectDirectory", function () {
|
||||
|
||||
require(['directorybrowser'], function (directoryBrowser) {
|
||||
|
||||
var picker = new directoryBrowser();
|
||||
|
||||
picker.show({
|
||||
|
||||
callback: function (path) {
|
||||
if (path) {
|
||||
$('#txtMetadataPath', page).val(path);
|
||||
}
|
||||
picker.close();
|
||||
},
|
||||
|
||||
header: Globalize.translate('HeaderSelectMetadataPath'),
|
||||
|
||||
instruction: Globalize.translate('HeaderSelectMetadataPathHelp')
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$('.advancedMetadataConfigurationForm').on('submit', onSubmit).on('submit', onSubmit);
|
||||
|
||||
|
||||
}).on('pageshow', "#advancedMetadataConfigurationPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
ApiClient.getServerConfiguration().then(function (configuration) {
|
||||
|
||||
loadAdvancedConfig(page, configuration);
|
||||
|
||||
});
|
||||
|
||||
ApiClient.getNamedConfiguration("metadata").then(function (metadata) {
|
||||
|
||||
loadMetadataConfig(page, metadata);
|
||||
|
||||
});
|
||||
|
||||
ApiClient.getNamedConfiguration("fanart").then(function (metadata) {
|
||||
|
||||
loadFanartConfig(page, metadata);
|
||||
});
|
||||
|
||||
ApiClient.getNamedConfiguration("themoviedb").then(function (metadata) {
|
||||
|
||||
loadTmdbConfig(page, metadata);
|
||||
});
|
||||
|
||||
ApiClient.getNamedConfiguration("tvdb").then(function (metadata) {
|
||||
|
||||
loadTvdbConfig(page, metadata);
|
||||
});
|
||||
|
||||
var promise1 = ApiClient.getNamedConfiguration("chapters");
|
||||
var promise2 = ApiClient.getJSON(ApiClient.getUrl("Providers/Chapters"));
|
||||
|
||||
Promise.all([promise1, promise2]).then(function (responses) {
|
||||
|
||||
loadChapters(page, responses[0], responses[1]);
|
||||
});
|
||||
});
|
||||
|
||||
function saveFanart(form) {
|
||||
|
||||
ApiClient.getNamedConfiguration("fanart").then(function (config) {
|
||||
|
||||
config.EnableAutomaticUpdates = $('#chkEnableFanartUpdates', form).checked();
|
||||
config.UserApiKey = $('#txtFanartApiKey', form).val();
|
||||
|
||||
ApiClient.updateNamedConfiguration("fanart", config);
|
||||
});
|
||||
}
|
||||
|
||||
function saveTvdb(form) {
|
||||
|
||||
ApiClient.getNamedConfiguration("tvdb").then(function (config) {
|
||||
|
||||
config.EnableAutomaticUpdates = $('#chkEnableTvdbUpdates', form).checked();
|
||||
|
||||
ApiClient.updateNamedConfiguration("tvdb", config);
|
||||
});
|
||||
}
|
||||
|
||||
function saveTmdb(form) {
|
||||
|
||||
ApiClient.getNamedConfiguration("themoviedb").then(function (config) {
|
||||
|
||||
config.EnableAutomaticUpdates = $('#chkEnableTmdbUpdates', form).checked();
|
||||
|
||||
ApiClient.updateNamedConfiguration("themoviedb", config);
|
||||
});
|
||||
}
|
||||
|
||||
function saveAdvancedConfig(form) {
|
||||
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
config.SaveMetadataHidden = $('#chkSaveMetadataHidden', form).checked();
|
||||
|
||||
config.EnableTvDbUpdates = $('#chkEnableTvdbUpdates', form).checked();
|
||||
config.EnableTmdbUpdates = $('#chkEnableTmdbUpdates', form).checked();
|
||||
config.EnableFanArtUpdates = $('#chkEnableFanartUpdates', form).checked();
|
||||
config.MetadataPath = $('#txtMetadataPath', form).val();
|
||||
config.FanartApiKey = $('#txtFanartApiKey', form).val();
|
||||
|
||||
config.DownloadImagesInAdvance = $('#chkDownloadImagesInAdvance', form).checked();
|
||||
|
||||
config.PeopleMetadataOptions.DownloadActorMetadata = $('#chkPeopleActors', form).checked();
|
||||
config.PeopleMetadataOptions.DownloadComposerMetadata = $('#chkPeopleComposers', form).checked();
|
||||
config.PeopleMetadataOptions.DownloadDirectorMetadata = $('#chkPeopleDirectors', form).checked();
|
||||
config.PeopleMetadataOptions.DownloadGuestStarMetadata = $('#chkPeopleGuestStars', form).checked();
|
||||
config.PeopleMetadataOptions.DownloadProducerMetadata = $('#chkPeopleProducers', form).checked();
|
||||
config.PeopleMetadataOptions.DownloadWriterMetadata = $('#chkPeopleWriters', form).checked();
|
||||
config.PeopleMetadataOptions.DownloadOtherPeopleMetadata = $('#chkPeopleOthers', form).checked();
|
||||
|
||||
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
}
|
||||
|
||||
function saveMetadata(form) {
|
||||
|
||||
ApiClient.getNamedConfiguration("metadata").then(function (config) {
|
||||
|
||||
config.UseFileCreationTimeForDateAdded = $('#selectDateAdded', form).val() == '1';
|
||||
|
||||
ApiClient.updateNamedConfiguration("metadata", config);
|
||||
});
|
||||
}
|
||||
|
||||
function saveChapters(form) {
|
||||
|
||||
ApiClient.getNamedConfiguration("chapters").then(function (config) {
|
||||
|
||||
config.EnableMovieChapterImageExtraction = $('#chkChaptersMovies', form).checked();
|
||||
config.EnableEpisodeChapterImageExtraction = $('#chkChaptersEpisodes', form).checked();
|
||||
config.EnableOtherVideoChapterImageExtraction = $('#chkChaptersOtherVideos', form).checked();
|
||||
|
||||
config.ExtractDuringLibraryScan = $('#chkExtractChaptersDuringLibraryScan', form).checked();
|
||||
|
||||
ApiClient.updateNamedConfiguration("chapters", config);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
|
@ -655,41 +655,50 @@ var Dashboard = {
|
|||
}
|
||||
},
|
||||
|
||||
getToolsLinkHtml: function (item) {
|
||||
|
||||
var menuHtml = '';
|
||||
var pageIds = item.pageIds ? item.pageIds.join(',') : '';
|
||||
pageIds = pageIds ? (' data-pageids="' + pageIds + '"') : '';
|
||||
menuHtml += '<a class="sidebarLink" href="' + item.href + '"' + pageIds + '>';
|
||||
|
||||
var icon = item.icon;
|
||||
|
||||
if (icon) {
|
||||
menuHtml += '<iron-icon icon="' + icon + '" class="sidebarLinkIcon"></iron-icon>';
|
||||
}
|
||||
|
||||
menuHtml += '<span class="sidebarLinkText">';
|
||||
menuHtml += item.name;
|
||||
menuHtml += '</span>';
|
||||
menuHtml += '</a>';
|
||||
return menuHtml;
|
||||
},
|
||||
|
||||
getToolsMenuHtml: function (page) {
|
||||
|
||||
var items = Dashboard.getToolsMenuLinks(page);
|
||||
|
||||
var i, length, item;
|
||||
var menuHtml = '';
|
||||
|
||||
menuHtml += '<div class="drawerContent">';
|
||||
for (i = 0, length = items.length; i < length; i++) {
|
||||
|
||||
item = items[i];
|
||||
|
||||
if (item.divider) {
|
||||
menuHtml += "<div class='sidebarDivider'></div>";
|
||||
}
|
||||
if (item.items) {
|
||||
|
||||
if (item.href) {
|
||||
|
||||
var style = item.color ? ' style="color:' + item.color + '"' : '';
|
||||
|
||||
if (item.selected) {
|
||||
menuHtml += '<a class="sidebarLink selectedSidebarLink" href="' + item.href + '">';
|
||||
if (item.icon) {
|
||||
menuHtml += '<emby-collapsible icon="' + item.icon + '" title="' + item.name + '">';
|
||||
} else {
|
||||
menuHtml += '<a class="sidebarLink" href="' + item.href + '">';
|
||||
menuHtml += '<emby-collapsible title="' + item.name + '">';
|
||||
}
|
||||
menuHtml += item.items.map(Dashboard.getToolsLinkHtml).join('');
|
||||
menuHtml += '</emby-collapsible>';
|
||||
}
|
||||
else if (item.href) {
|
||||
|
||||
var icon = item.icon;
|
||||
|
||||
if (icon) {
|
||||
menuHtml += '<iron-icon icon="' + icon + '" class="sidebarLinkIcon"' + style + '></iron-icon>';
|
||||
}
|
||||
|
||||
menuHtml += '<span class="sidebarLinkText">';
|
||||
menuHtml += item.name;
|
||||
menuHtml += '</span>';
|
||||
menuHtml += '</a>';
|
||||
menuHtml += Dashboard.getToolsLinkHtml(item);
|
||||
} else {
|
||||
|
||||
menuHtml += '<div class="sidebarHeader">';
|
||||
|
@ -697,132 +706,258 @@ var Dashboard = {
|
|||
menuHtml += '</div>';
|
||||
}
|
||||
}
|
||||
menuHtml += '</div>';
|
||||
|
||||
return menuHtml;
|
||||
},
|
||||
|
||||
ensureToolsMenu: function (page) {
|
||||
|
||||
var sidebar = page.querySelector('.toolsSidebar');
|
||||
|
||||
if (!sidebar) {
|
||||
|
||||
var html = '<div class="content-secondary toolsSidebar">';
|
||||
|
||||
html += '<div class="sidebarLinks">';
|
||||
|
||||
html += Dashboard.getToolsMenuHtml(page);
|
||||
// sidebarLinks
|
||||
html += '</div>';
|
||||
|
||||
// content-secondary
|
||||
html += '</div>';
|
||||
|
||||
$('.content-primary', page).before(html);
|
||||
}
|
||||
},
|
||||
|
||||
getToolsMenuLinks: function (page) {
|
||||
|
||||
var pageElem = page;
|
||||
|
||||
var isServicesPage = page.classList.contains('appServicesPage');
|
||||
var context = getParameterByName('context');
|
||||
getToolsMenuLinks: function () {
|
||||
|
||||
return [{
|
||||
name: Globalize.translate('TabServer'),
|
||||
href: "dashboard.html",
|
||||
selected: page.classList.contains("dashboardHomePage"),
|
||||
icon: 'dashboard',
|
||||
color: '#38c'
|
||||
}, {
|
||||
name: Globalize.translate('TabDevices'),
|
||||
href: "devices.html",
|
||||
selected: page.classList.contains("devicesPage"),
|
||||
icon: 'tablet',
|
||||
color: '#ECA403'
|
||||
}, {
|
||||
name: Globalize.translate('TabUsers'),
|
||||
href: "userprofiles.html",
|
||||
selected: page.classList.contains("userProfilesPage"),
|
||||
icon: 'people',
|
||||
color: '#679C34'
|
||||
items: [
|
||||
{
|
||||
name: Globalize.translate('TabDashboard'),
|
||||
href: "dashboard.html",
|
||||
pageIds: ['dashboardPage'],
|
||||
icon: 'dashboard'
|
||||
}, {
|
||||
name: Globalize.translate('TabSettings'),
|
||||
href: "dashboardgeneral.html",
|
||||
pageIds: ['dashboardGeneralPage'],
|
||||
icon: 'settings'
|
||||
}, {
|
||||
name: Globalize.translate('TabDevices'),
|
||||
href: "devices.html",
|
||||
pageIds: ['devicesPage'],
|
||||
icon: 'tablet'
|
||||
}, {
|
||||
name: Globalize.translate('TabUsers'),
|
||||
href: "userprofiles.html",
|
||||
pageIds: ['userProfilesPage'],
|
||||
icon: 'people'
|
||||
}
|
||||
]
|
||||
}, {
|
||||
name: Globalize.translate('TabLibrary'),
|
||||
divider: true,
|
||||
href: "library.html",
|
||||
selected: page.classList.contains("librarySectionPage"),
|
||||
icon: 'video-library'
|
||||
}, {
|
||||
name: Globalize.translate('TabMetadata'),
|
||||
href: "metadata.html",
|
||||
selected: page.classList.contains('metadataConfigurationPage'),
|
||||
icon: 'insert-drive-file'
|
||||
}, {
|
||||
name: Globalize.translate('TabPlayback'),
|
||||
href: "playbackconfiguration.html",
|
||||
selected: page.classList.contains('playbackConfigurationPage'),
|
||||
icon: 'play-circle-filled'
|
||||
}, {
|
||||
name: Globalize.translate('TabSync'),
|
||||
href: "syncactivity.html",
|
||||
selected: page.classList.contains('syncConfigurationPage') || (isServicesPage && context == 'sync'),
|
||||
icon: 'sync'
|
||||
}, {
|
||||
divider: true,
|
||||
name: Globalize.translate('TabExtras')
|
||||
}, {
|
||||
name: Globalize.translate('TabAutoOrganize'),
|
||||
href: "autoorganizelog.html",
|
||||
selected: page.classList.contains("organizePage"),
|
||||
icon: 'folder',
|
||||
color: '#01C0DD'
|
||||
items: [
|
||||
{
|
||||
name: Globalize.translate('TabFolders'),
|
||||
href: "library.html",
|
||||
pageIds: ['mediaLibraryPage'],
|
||||
icon: 'folder'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('TabMetadata'),
|
||||
href: "metadata.html",
|
||||
pageIds: ['metadataConfigurationPage'],
|
||||
icon: 'insert-drive-file'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('TabServices'),
|
||||
href: "metadataimages.html",
|
||||
pageIds: ['metadataImagesConfigurationPage'],
|
||||
icon: 'insert-drive-file'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('TabNfoSettings'),
|
||||
href: "metadatanfo.html",
|
||||
pageIds: ['metadataNfoPage'],
|
||||
icon: 'insert-drive-file'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('TabPathSubstitution'),
|
||||
href: "librarypathmapping.html",
|
||||
pageIds: ['libraryPathMappingPage'],
|
||||
icon: 'mode-edit'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('TabSubtitles'),
|
||||
href: "metadatasubtitles.html",
|
||||
pageIds: ['metadataSubtitlesPage'],
|
||||
icon: 'closed-caption'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('TabAdvanced'),
|
||||
href: "librarysettings.html",
|
||||
pageIds: ['librarySettingsPage'],
|
||||
icon: 'settings'
|
||||
}
|
||||
]
|
||||
}, {
|
||||
name: Globalize.translate('TabDLNA'),
|
||||
href: "dlnasettings.html",
|
||||
selected: page.classList.contains("dlnaPage"),
|
||||
icon: 'tv',
|
||||
color: '#E5342E'
|
||||
name: Globalize.translate('DLNA'),
|
||||
icon: 'live-tv',
|
||||
items: [
|
||||
{
|
||||
name: Globalize.translate('TabSettings'),
|
||||
href: "dlnasettings.html",
|
||||
pageIds: ['dlnaSettingsPage'],
|
||||
icon: 'settings'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('TabProfiles'),
|
||||
href: "dlnaprofiles.html",
|
||||
pageIds: ['dlnaProfilesPage', 'dlnaProfilePage'],
|
||||
icon: 'live-tv'
|
||||
}
|
||||
]
|
||||
}, {
|
||||
name: Globalize.translate('TabLiveTV'),
|
||||
href: "livetvstatus.html",
|
||||
selected: page.classList.contains("liveTvSettingsPage") || (isServicesPage && context == 'livetv'),
|
||||
icon: 'live-tv',
|
||||
color: '#293AAE'
|
||||
icon: 'dvr',
|
||||
items: [
|
||||
{
|
||||
name: Globalize.translate('TabSettings'),
|
||||
href: "livetvstatus.html",
|
||||
pageIds: ['liveTvStatusPage'],
|
||||
icon: 'settings'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('TabAdvanced'),
|
||||
href: "livetvsettings.html",
|
||||
pageIds: ['liveTvSettingsPage'],
|
||||
icon: 'settings'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('TabServices'),
|
||||
href: "appservices.html?context=livetv",
|
||||
//selected: (isServicesPage && context == 'livetv'),
|
||||
icon: 'add-shopping-cart'
|
||||
}
|
||||
]
|
||||
}, {
|
||||
name: Globalize.translate('TabNotifications'),
|
||||
href: "notificationsettings.html",
|
||||
selected: page.classList.contains("notificationConfigurationPage"),
|
||||
icon: 'notifications',
|
||||
color: 'brown'
|
||||
name: Globalize.translate('TabPlayback'),
|
||||
icon: 'play-circle-filled',
|
||||
items: [
|
||||
{
|
||||
name: Globalize.translate('TabCinemaMode'),
|
||||
href: "cinemamodeconfiguration.html",
|
||||
pageIds: ['cinemaModeConfigurationPage'],
|
||||
icon: 'local-movies'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('TabResumeSettings'),
|
||||
href: "playbackconfiguration.html",
|
||||
pageIds: ['playbackConfigurationPage'],
|
||||
icon: 'play-circle-filled'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('TabStreaming'),
|
||||
href: "streamingsettings.html",
|
||||
pageIds: ['streamingSettingsPage'],
|
||||
icon: 'wifi'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('TabTranscoding'),
|
||||
href: "encodingsettings.html",
|
||||
pageIds: ['encodingSettingsPage'],
|
||||
icon: 'play-circle-filled'
|
||||
}
|
||||
]
|
||||
}, {
|
||||
name: Globalize.translate('TabPlugins'),
|
||||
href: "plugins.html",
|
||||
selected: page.classList.contains("pluginConfigurationPage"),
|
||||
icon: 'add-shopping-cart',
|
||||
color: '#9D22B1'
|
||||
items: [
|
||||
{
|
||||
name: Globalize.translate('TabMyPlugins'),
|
||||
href: "plugins.html",
|
||||
pageIds: ['pluginsPage'],
|
||||
icon: 'file-download'
|
||||
}, {
|
||||
name: Globalize.translate('TabCatalog'),
|
||||
href: "plugincatalog.html",
|
||||
pageIds: ['pluginCatalogPage'],
|
||||
icon: 'add-shopping-cart'
|
||||
}
|
||||
]
|
||||
}, {
|
||||
divider: true,
|
||||
name: Globalize.translate('TabExpert')
|
||||
name: Globalize.translate('TabSync'),
|
||||
icon: 'sync',
|
||||
items: [
|
||||
{
|
||||
name: Globalize.translate('TabSyncJobs'),
|
||||
href: "syncactivity.html",
|
||||
pageIds: ['syncActivityPage', 'syncJobPage'],
|
||||
icon: 'menu'
|
||||
}, {
|
||||
name: Globalize.translate('TabCameraUpload'),
|
||||
href: "devicesupload.html",
|
||||
pageIds: ['devicesUploadPage'],
|
||||
icon: 'photo'
|
||||
}, {
|
||||
name: Globalize.translate('TabServices'),
|
||||
href: "appservices.html?context=sync",
|
||||
//selected: (isServicesPage && context == 'sync'),
|
||||
icon: 'add-shopping-cart'
|
||||
}, {
|
||||
name: Globalize.translate('TabSettings'),
|
||||
href: "syncsettings.html",
|
||||
pageIds: ['syncSettingsPage'],
|
||||
icon: 'settings'
|
||||
}
|
||||
]
|
||||
}, {
|
||||
name: Globalize.translate('TabAdvanced'),
|
||||
href: "advanced.html",
|
||||
selected: page.classList.contains("advancedConfigurationPage"),
|
||||
icon: 'settings',
|
||||
color: '#F16834'
|
||||
}, {
|
||||
name: Globalize.translate('TabScheduledTasks'),
|
||||
href: "scheduledtasks.html",
|
||||
selected: page.classList.contains("scheduledTasksConfigurationPage"),
|
||||
icon: 'schedule',
|
||||
color: '#38c'
|
||||
items: [
|
||||
{
|
||||
name: Globalize.translate('TabAutoOrganize'),
|
||||
href: "autoorganizelog.html",
|
||||
pageIds: ['libraryFileOrganizerPage', 'libraryFileOrganizerSmartMatchPage', 'libraryFileOrganizerLogPage'],
|
||||
icon: 'folder'
|
||||
}, {
|
||||
name: Globalize.translate('TabGeneral'),
|
||||
href: "advanced.html",
|
||||
pageIds: ['advancedConfigurationPage'],
|
||||
icon: 'mode-edit'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('TabHosting'),
|
||||
href: "dashboardhosting.html",
|
||||
pageIds: ['dashboardHostingPage'],
|
||||
icon: 'wifi'
|
||||
}, {
|
||||
name: Globalize.translate('TabNotifications'),
|
||||
href: "notificationsettings.html",
|
||||
pageIds: ['notificationSettingsPage', 'notificationSettingPage'],
|
||||
icon: 'notifications'
|
||||
}, {
|
||||
name: Globalize.translate('TabScheduledTasks'),
|
||||
href: "scheduledtasks.html",
|
||||
pageIds: ['scheduledTasksPage', 'scheduledTaskPage'],
|
||||
icon: 'schedule'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('TabSecurity'),
|
||||
href: "serversecurity.html",
|
||||
pageIds: ['serverSecurityPage'],
|
||||
icon: 'lock'
|
||||
}
|
||||
]
|
||||
}, {
|
||||
name: Globalize.translate('TabHelp'),
|
||||
divider: true,
|
||||
href: "support.html",
|
||||
selected: pageElem.id == "supportPage" || pageElem.id == "logPage" || pageElem.id == "supporterPage" || pageElem.id == "supporterKeyPage" || pageElem.id == "aboutPage",
|
||||
icon: 'help',
|
||||
color: '#679C34'
|
||||
icon: 'info',
|
||||
items: [
|
||||
{
|
||||
name: Globalize.translate('TabAbout'),
|
||||
href: "about.html",
|
||||
pageIds: ['aboutPage'],
|
||||
icon: 'info'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('TabLogs'),
|
||||
href: "log.html",
|
||||
pageIds: ['logPage'],
|
||||
icon: 'menu'
|
||||
},
|
||||
{
|
||||
name: Globalize.translate('TabEmbyPremiere'),
|
||||
href: "supporterkey.html",
|
||||
pageIds: ['supporterKeyPage'],
|
||||
icon: 'add-circle'
|
||||
}
|
||||
]
|
||||
}];
|
||||
|
||||
},
|
||||
|
@ -1148,49 +1283,9 @@ var Dashboard = {
|
|||
});
|
||||
},
|
||||
|
||||
ensurePageTitle: function (page) {
|
||||
|
||||
if (!page.classList.contains('type-interior')) {
|
||||
return;
|
||||
}
|
||||
|
||||
var pageElem = page;
|
||||
|
||||
if (pageElem.querySelector('.pageTitle')) {
|
||||
return;
|
||||
}
|
||||
|
||||
var parent = pageElem.querySelector('.content-primary');
|
||||
|
||||
if (!parent) {
|
||||
parent = pageElem.getElementsByClassName('ui-content')[0];
|
||||
}
|
||||
|
||||
var helpUrl = pageElem.getAttribute('data-helpurl');
|
||||
|
||||
var html = '<div>';
|
||||
html += '<h1 class="pageTitle" style="display:inline-block;">' + (document.title || ' ') + '</h1>';
|
||||
|
||||
if (helpUrl) {
|
||||
html += '<a href="' + helpUrl + '" target="_blank" class="clearLink" style="margin-top:-10px;display:inline-block;vertical-align:middle;margin-left:1em;"><paper-button raised class="secondary mini"><iron-icon icon="info"></iron-icon><span>' + Globalize.translate('ButtonHelp') + '</span></paper-button></a>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
|
||||
$(parent).prepend(html);
|
||||
},
|
||||
|
||||
setPageTitle: function (title) {
|
||||
|
||||
var page = $.mobile.activePage;
|
||||
|
||||
if (page) {
|
||||
var elem = $(page)[0].querySelector('.pageTitle');
|
||||
|
||||
if (elem) {
|
||||
elem.innerHTML = title;
|
||||
}
|
||||
}
|
||||
LibraryMenu.setTitle(title || 'Emby');
|
||||
|
||||
if (title) {
|
||||
document.title = title;
|
||||
|
@ -2110,11 +2205,12 @@ var AppInfo = {};
|
|||
var drawer = document.querySelector('.mainDrawerPanel');
|
||||
drawer.classList.remove('mainDrawerPanelPreInit');
|
||||
drawer.forceNarrow = true;
|
||||
|
||||
var drawerWidth = screen.availWidth - 50;
|
||||
// At least 240
|
||||
drawerWidth = Math.max(drawerWidth, 240);
|
||||
// But not exceeding 310
|
||||
drawerWidth = Math.min(drawerWidth, 310);
|
||||
// But not exceeding 270
|
||||
drawerWidth = Math.min(drawerWidth, 270);
|
||||
|
||||
drawer.drawerWidth = drawerWidth + "px";
|
||||
|
||||
|
@ -2301,7 +2397,8 @@ var AppInfo = {};
|
|||
|
||||
defineRoute({
|
||||
path: '/dashboardgeneral.html',
|
||||
dependencies: [],
|
||||
dependencies: ['emby-collapsible', 'paper-textarea', 'paper-input', 'paper-checkbox'],
|
||||
controller: 'scripts/dashboardgeneral',
|
||||
autoFocus: false,
|
||||
roles: 'admin'
|
||||
});
|
||||
|
@ -2552,9 +2649,9 @@ var AppInfo = {};
|
|||
|
||||
defineRoute({
|
||||
path: '/log.html',
|
||||
dependencies: [],
|
||||
autoFocus: false,
|
||||
roles: 'admin'
|
||||
dependencies: ['paper-toggle-button'],
|
||||
roles: 'admin',
|
||||
controller: 'scripts/logpage'
|
||||
});
|
||||
|
||||
defineRoute({
|
||||
|
@ -3288,18 +3385,8 @@ pageClassOn('viewshow', "page", function () {
|
|||
document.documentElement.classList.remove('darkScrollbars');
|
||||
}
|
||||
|
||||
Dashboard.ensurePageTitle(page);
|
||||
|
||||
var apiClient = window.ApiClient;
|
||||
|
||||
if (apiClient && apiClient.isLoggedIn()) {
|
||||
|
||||
if (page.classList.contains('type-interior')) {
|
||||
|
||||
Dashboard.ensureToolsMenu(page);
|
||||
}
|
||||
}
|
||||
|
||||
Dashboard.ensureHeader(page);
|
||||
|
||||
if (apiClient && apiClient.isLoggedIn() && !apiClient.isWebSocketOpen()) {
|
||||
|
|
|
@ -4,6 +4,12 @@
|
|||
|
||||
$('#txtRemoteClientBitrateLimit', page).val((config.RemoteClientBitrateLimit / 1000000) || '');
|
||||
|
||||
ApiClient.getNamedConfiguration("channels").then(function (channelConfig) {
|
||||
|
||||
$('#selectChannelResolution', page).val(channelConfig.PreferredStreamingWidth || '');
|
||||
|
||||
});
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
|
@ -19,6 +25,14 @@
|
|||
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
ApiClient.getNamedConfiguration("channels").then(function (config) {
|
||||
|
||||
// This should be null if empty
|
||||
config.PreferredStreamingWidth = $('#selectChannelResolution', form).val() || null;
|
||||
|
||||
ApiClient.updateNamedConfiguration("channels", config).then(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue