mirror of
https://github.com/Casvt/MIND.git
synced 2026-04-03 03:00:22 -04:00
Added option to enable/disable reminders (#77)
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
--gap: 1rem;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
align-items: stretch;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--gap);
|
||||
}
|
||||
@@ -29,7 +29,7 @@
|
||||
.sub-inputs > :where(
|
||||
input, select, button, label
|
||||
) {
|
||||
width: calc(50% - (var(--gap) / 2));
|
||||
flex: 1 0;
|
||||
}
|
||||
|
||||
.form-container > form > button,
|
||||
@@ -54,6 +54,19 @@
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
#enabled-container {
|
||||
height: 4rem;
|
||||
flex: 1 0;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
gap: 1rem;
|
||||
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
#color-button {
|
||||
--color: var(--color-dark);
|
||||
background-color: var(--color);
|
||||
@@ -254,6 +267,7 @@ div.options > button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#info.show-add-static-reminder #enabled-container,
|
||||
#info.show-add-static-reminder #time-input,
|
||||
#info.show-add-static-reminder #normal-button,
|
||||
#info.show-add-static-reminder #repeat-button,
|
||||
@@ -274,6 +288,7 @@ div.options > button {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#info.show-add-template #enabled-container,
|
||||
#info.show-add-template #template-selection,
|
||||
#info.show-add-template #time-input,
|
||||
#info.show-add-template #normal-button,
|
||||
@@ -307,6 +322,7 @@ div.options > button {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#info.show-edit-static-reminder #enabled-container,
|
||||
#info.show-edit-static-reminder #template-selection,
|
||||
#info.show-edit-static-reminder #time-input,
|
||||
#info.show-edit-static-reminder #normal-button,
|
||||
@@ -326,6 +342,7 @@ div.options > button {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#info.show-edit-template #enabled-container,
|
||||
#info.show-edit-template #template-selection,
|
||||
#info.show-edit-template #time-input,
|
||||
#info.show-edit-template #normal-button,
|
||||
|
||||
@@ -81,6 +81,9 @@ function fillTable(table, results) {
|
||||
} else if (r.weekdays !== null)
|
||||
formatted_date += ` (each ${r.weekdays.map(d => week_days[d]).join(', ')})`;
|
||||
|
||||
if (!r.enabled)
|
||||
formatted_date += ' (Disabled)';
|
||||
|
||||
time.innerText = formatted_date;
|
||||
entry.appendChild(time);
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
function showAdd(type) {
|
||||
const default_service = getLocalStorage('default_service')['default_service'];
|
||||
inputs.enabled.checked = true;
|
||||
inputs.template.value = '0';
|
||||
inputs.title.value = '';
|
||||
inputs.text.value = '';
|
||||
@@ -69,6 +70,7 @@ function showEdit(id, type) {
|
||||
inputs.title.value = json.result.title;
|
||||
|
||||
if (type === Types.reminder) {
|
||||
inputs.enabled.checked = json.result.enabled;
|
||||
var trigger_date = new Date(
|
||||
(json.result.time
|
||||
+ new Date(json.result.time * 1000).getTimezoneOffset()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
const colors = ["#3c3c3c", "#49191e", "#171a42", "#083b06", "#3b3506", "#300e40"];
|
||||
|
||||
const inputs = {
|
||||
'enabled': document.querySelector('#enabled-input'),
|
||||
'template': document.querySelector('#template-selection'),
|
||||
'color_toggle': document.querySelector('#color-toggle'),
|
||||
'color_button': document.querySelector('#color-button'),
|
||||
@@ -219,6 +220,8 @@ function submitInfo() {
|
||||
const cl = document.getElementById('info').classList;
|
||||
if (cl.contains('show-add-reminder')) {
|
||||
// Add reminder
|
||||
data['enabled'] = inputs.enabled.checked;
|
||||
|
||||
data['time'] =
|
||||
(new Date(inputs.time.value) / 1000)
|
||||
+ (new Date(inputs.time.value).getTimezoneOffset() * 60);
|
||||
@@ -262,6 +265,8 @@ function submitInfo() {
|
||||
|
||||
} else if (cl.contains('show-edit-reminder')) {
|
||||
// Edit reminder
|
||||
data['enabled'] = inputs.enabled.checked;
|
||||
|
||||
data['time'] =
|
||||
(new Date(inputs.time.value) / 1000)
|
||||
+ (new Date(inputs.time.value).getTimezoneOffset() * 60);
|
||||
|
||||
Reference in New Issue
Block a user