mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update form
This commit is contained in:
parent
8a5107f748
commit
799e86de4a
2 changed files with 16 additions and 13 deletions
|
@ -1,21 +1,20 @@
|
||||||
<div id="notificationSettingPage" data-role="page" class="page type-interior notificationConfigurationPage withTabs" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Notifications" data-require="scripts/notificationsetting,paper-input,jqmcheckbox">
|
<div id="notificationSettingPage" data-role="page" class="page type-interior notificationConfigurationPage withTabs" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Notifications" data-require="scripts/notificationsetting,paper-input,paper-checkbox">
|
||||||
|
|
||||||
<div data-role="content">
|
<div data-role="content">
|
||||||
<div class="content-primary">
|
<div class="content-primary">
|
||||||
|
|
||||||
<h2 class="notificationType" style="margin-bottom: 0;"></h2>
|
<h1 class="notificationType" style="margin-top:0;"></h1>
|
||||||
|
|
||||||
<form class="notificationSettingForm">
|
<form class="notificationSettingForm">
|
||||||
|
|
||||||
<ul data-role="listview" class="ulForm">
|
<ul data-role="listview" class="ulForm">
|
||||||
<li>
|
<li>
|
||||||
<input type="checkbox" id="chkEnabled" data-mini="true" />
|
<paper-checkbox id="chkEnabled">${LabelNotificationEnabled}</paper-checkbox>
|
||||||
<label for="chkEnabled">${LabelNotificationEnabled}</label>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="monitorUsers" style="display: none;">
|
<div class="monitorUsers" style="display: none;">
|
||||||
<label>${LabelMonitorUsers}</label>
|
<div class="paperCheckboxListLabel">${LabelMonitorUsers}</div>
|
||||||
<div class="monitorUsersList">
|
<div class="monitorUsersList">
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
|
|
@ -4,17 +4,15 @@
|
||||||
|
|
||||||
function fillItems(elem, items, cssClass, idPrefix, currentList, isEnabledList) {
|
function fillItems(elem, items, cssClass, idPrefix, currentList, isEnabledList) {
|
||||||
|
|
||||||
var html = '<div data-role="controlgroup">';
|
var html = '<div class="paperCheckboxList paperList" style="padding: .5em 1em;">';
|
||||||
|
|
||||||
html += items.map(function (u) {
|
html += items.map(function (u) {
|
||||||
|
|
||||||
var id = idPrefix + u.Id;
|
|
||||||
|
|
||||||
var isChecked = isEnabledList ? currentList.indexOf(u.Id) != -1 : currentList.indexOf(u.Id) == -1;
|
var isChecked = isEnabledList ? currentList.indexOf(u.Id) != -1 : currentList.indexOf(u.Id) == -1;
|
||||||
|
|
||||||
var checkedHtml = isChecked ? ' checked="checked"' : '';
|
var checkedHtml = isChecked ? ' checked="checked"' : '';
|
||||||
|
|
||||||
return '<label for="' + id + '">' + u.Name + '</label><input class="' + cssClass + '" type="checkbox" data-itemid="' + u.Id + '" id="' + id + '"' + checkedHtml + ' />';
|
return '<paper-checkbox class="' + cssClass + '" type="checkbox" data-itemid="' + u.Id + '"' + checkedHtml + '>' + u.Name + '</paper-checkbox>';
|
||||||
|
|
||||||
}).join('');
|
}).join('');
|
||||||
|
|
||||||
|
@ -86,7 +84,7 @@
|
||||||
fillItems($('.sendToUsersList', page), users, 'chkSendTo', 'chkSendTo', notificationConfig.SendToUsers, true);
|
fillItems($('.sendToUsersList', page), users, 'chkSendTo', 'chkSendTo', notificationConfig.SendToUsers, true);
|
||||||
fillItems($('.servicesList', page), services, 'chkService', 'chkService', notificationConfig.DisabledServices);
|
fillItems($('.servicesList', page), services, 'chkService', 'chkService', notificationConfig.DisabledServices);
|
||||||
|
|
||||||
$('#chkEnabled', page).checked(notificationConfig.Enabled || false).checkboxradio('refresh');
|
$('#chkEnabled', page).checked(notificationConfig.Enabled || false);
|
||||||
|
|
||||||
$('#txtTitle', page).val(notificationConfig.Title || typeInfo.DefaultTitle);
|
$('#txtTitle', page).val(notificationConfig.Title || typeInfo.DefaultTitle);
|
||||||
|
|
||||||
|
@ -135,15 +133,21 @@
|
||||||
notificationConfig.Title = null;
|
notificationConfig.Title = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
notificationConfig.DisabledMonitorUsers = $('.chkMonitor:not(:checked)', page).get().map(function (c) {
|
notificationConfig.DisabledMonitorUsers = $('.chkMonitor', page).get().filter(function (c) {
|
||||||
|
return !c.checked;
|
||||||
|
}).map(function (c) {
|
||||||
return c.getAttribute('data-itemid');
|
return c.getAttribute('data-itemid');
|
||||||
});
|
});
|
||||||
|
|
||||||
notificationConfig.SendToUsers = $('.chkSendTo:checked', page).get().map(function (c) {
|
notificationConfig.SendToUsers = $('.chkSendTo', page).get().filter(function (c) {
|
||||||
|
return c.checked;
|
||||||
|
}).map(function (c) {
|
||||||
return c.getAttribute('data-itemid');
|
return c.getAttribute('data-itemid');
|
||||||
});
|
});
|
||||||
|
|
||||||
notificationConfig.DisabledServices = $('.chkService:not(:checked)', page).get().map(function (c) {
|
notificationConfig.DisabledServices = $('.chkService', page).get().filter(function (c) {
|
||||||
|
return !c.checked;
|
||||||
|
}).map(function (c) {
|
||||||
return c.getAttribute('data-itemid');
|
return c.getAttribute('data-itemid');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue