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

add new notification options

This commit is contained in:
Luke Pulverenti 2014-04-25 16:47:56 -04:00
parent 39eb56793a
commit 7751d4f2a0
6 changed files with 117 additions and 1 deletions

View file

@ -11,6 +11,7 @@
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true"> <div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="#" data-role="button" class="ui-btn-active">${TabGeneral}</a> <a href="#" data-role="button" class="ui-btn-active">${TabGeneral}</a>
<a href="notificationsettings.html" data-role="button">${TabNotifications}</a>
<a href="advancedpaths.html" data-role="button">${TabPaths}</a> <a href="advancedpaths.html" data-role="button">${TabPaths}</a>
<a href="advancedserversettings.html" data-role="button">${TabServer}</a> <a href="advancedserversettings.html" data-role="button">${TabServer}</a>
<a href="encodingsettings.html" data-role="button">${TabTranscoding}</a> <a href="encodingsettings.html" data-role="button">${TabTranscoding}</a>
@ -22,7 +23,7 @@
<input type="checkbox" id="chkRunAtStartup" name="chkRunAtStartup" data-mini="true" /> <input type="checkbox" id="chkRunAtStartup" name="chkRunAtStartup" data-mini="true" />
<label for="chkRunAtStartup">${LabelRunServerAtStartup}</label> <label for="chkRunAtStartup">${LabelRunServerAtStartup}</label>
<div id="windowsStartupDescription" class="fieldDescription warningFieldDescription" style="display: none;"> <div id="windowsStartupDescription" class="fieldDescription warningFieldDescription" style="display: none;">
${LabelRunServerAtStartupHelp} ${LabelRunServerAtStartupHelp}
</div> </div>
</li> </li>
<li> <li>

View file

@ -11,6 +11,7 @@
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true"> <div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="advanced.html" data-role="button">${TabGeneral}</a> <a href="advanced.html" data-role="button">${TabGeneral}</a>
<a href="notificationsettings.html" data-role="button">${TabNotifications}</a>
<a href="#" data-role="button" class="ui-btn-active">${TabPaths}</a> <a href="#" data-role="button" class="ui-btn-active">${TabPaths}</a>
<a href="advancedserversettings.html" data-role="button">${TabServer}</a> <a href="advancedserversettings.html" data-role="button">${TabServer}</a>
<a href="encodingsettings.html" data-role="button">${TabTranscoding}</a> <a href="encodingsettings.html" data-role="button">${TabTranscoding}</a>

View file

@ -11,6 +11,7 @@
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true"> <div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="advanced.html" data-role="button">${TabGeneral}</a> <a href="advanced.html" data-role="button">${TabGeneral}</a>
<a href="notificationsettings.html" data-role="button">${TabNotifications}</a>
<a href="advancedpaths.html" data-role="button">${TabPaths}</a> <a href="advancedpaths.html" data-role="button">${TabPaths}</a>
<a href="#" data-role="button" class="ui-btn-active">${TabServer}</a> <a href="#" data-role="button" class="ui-btn-active">${TabServer}</a>
<a href="encodingsettings.html" data-role="button">${TabTranscoding}</a> <a href="encodingsettings.html" data-role="button">${TabTranscoding}</a>

View file

@ -11,6 +11,7 @@
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true"> <div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="advanced.html" data-role="button">${TabGeneral}</a> <a href="advanced.html" data-role="button">${TabGeneral}</a>
<a href="notificationsettings.html" data-role="button">${TabNotifications}</a>
<a href="advancedpaths.html" data-role="button">${TabPaths}</a> <a href="advancedpaths.html" data-role="button">${TabPaths}</a>
<a href="advancedserversettings.html" data-role="button">${TabServer}</a> <a href="advancedserversettings.html" data-role="button">${TabServer}</a>
<a href="#" data-role="button" class="ui-btn-active">${TabTranscoding}</a> <a href="#" data-role="button" class="ui-btn-active">${TabTranscoding}</a>

View file

@ -0,0 +1,62 @@
<!DOCTYPE html>
<html>
<head>
<title>${TitleAdvanced}</title>
</head>
<body>
<div id="notificationSettingsPage" data-role="page" class="page type-interior advancedConfigurationPage">
<div data-role="content">
<div class="content-primary">
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="advanced.html" data-role="button">${TabGeneral}</a>
<a href="#" data-role="button" class="ui-btn-active">${TabNotifications}</a>
<a href="advancedpaths.html" data-role="button">${TabPaths}</a>
<a href="advancedserversettings.html" data-role="button">${TabServer}</a>
<a href="encodingsettings.html" data-role="button">${TabTranscoding}</a>
</div>
<form class="notificationSettingsForm">
<ul data-role="listview" class="ulForm">
<li>
<label>${HeaderEnableNotificationForEvents}</label>
<div data-role="controlgroup">
<input type="checkbox" data-mini="true" id="chkNewLibraryContent" />
<label for="chkNewLibraryContent">${OptionNotifyOnNewLibraryContent}</label>
<input type="checkbox" data-mini="true" id="chkFailedTasks" />
<label for="chkFailedTasks">${OptionNotifyOnFailedTasks}</label>
<input type="checkbox" data-mini="true" id="chkUpdates" />
<label for="chkUpdates">${OptionNotifyOnUpdates}</label>
<input type="checkbox" data-mini="true" id="chkPlayback" />
<label for="chkPlayback">${OptionNotifyOnPlayback}</label>
<div class="fieldDescription">${SendNotificationHelp}</div>
</div>
</li>
</ul>
<br />
<ul data-role="listview" class="ulForm">
<li>
<button type="submit" data-theme="b" data-icon="check" data-mini="true">
${ButtonSave}
</button>
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete" data-mini="true">
${ButtonCancel}
</button>
</li>
</ul>
</form>
</div>
</div>
<script type="text/javascript">
$('.notificationSettingsForm').off('submit', NotificationSettingsPage.onSubmit).on('submit', NotificationSettingsPage.onSubmit);
</script>
</div>
</body>
</html>

View file

@ -0,0 +1,50 @@
(function () {
function reload(page) {
ApiClient.getServerConfiguration().done(function (config) {
var notificationOptions = config.NotificationOptions;
$('#chkNewLibraryContent', page).checked(notificationOptions.SendOnNewLibraryContent).checkboxradio('refresh');
$('#chkFailedTasks', page).checked(notificationOptions.SendOnFailedTasks).checkboxradio('refresh');
$('#chkUpdates', page).checked(notificationOptions.SendOnUpdates).checkboxradio('refresh');
$('#chkPlayback', page).checked(notificationOptions.SendOnPlayback).checkboxradio('refresh');
});
}
function save(page) {
ApiClient.getServerConfiguration().done(function (config) {
var notificationOptions = config.NotificationOptions;
notificationOptions.SendOnNewLibraryContent = $('#chkNewLibraryContent', page).checked();
notificationOptions.SendOnFailedTasks = $('#chkFailedTasks', page).checked();
notificationOptions.SendOnUpdates = $('#chkUpdates', page).checked();
notificationOptions.SendOnPlayback = $('#chkPlayback', page).checked();
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
});
}
$(document).on('pageshow', "#notificationSettingsPage", function () {
var page = this;
reload(page);
});
window.NotificationSettingsPage = {
onSubmit: function () {
var page = $(this).parents('.page');
save(page);
return false;
}
};
})(jQuery, window);