aktueller stand
This commit is contained in:
90
web/app.js
90
web/app.js
@@ -82,6 +82,62 @@ function apiFetch(url, options = {}) {
|
||||
});
|
||||
}
|
||||
|
||||
function showToast(message, type = 'info') {
|
||||
const toast = document.createElement('div');
|
||||
toast.style.cssText = `
|
||||
position: fixed;
|
||||
bottom: 84px;
|
||||
right: 24px;
|
||||
background: ${type === 'error' ? '#e74c3c' : type === 'success' ? '#42b72a' : '#1877f2'};
|
||||
color: white;
|
||||
padding: 12px 20px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
z-index: 999999;
|
||||
max-width: 350px;
|
||||
animation: appToastSlideIn 0.3s ease-out;
|
||||
pointer-events: none;
|
||||
`;
|
||||
toast.textContent = message;
|
||||
|
||||
if (!document.getElementById('app-toast-styles')) {
|
||||
const style = document.createElement('style');
|
||||
style.id = 'app-toast-styles';
|
||||
style.textContent = `
|
||||
@keyframes appToastSlideIn {
|
||||
from {
|
||||
transform: translateX(400px);
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
transform: translateX(0);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes appToastSlideOut {
|
||||
from {
|
||||
transform: translateX(0);
|
||||
opacity: 1;
|
||||
}
|
||||
to {
|
||||
transform: translateX(400px);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
`;
|
||||
document.head.appendChild(style);
|
||||
}
|
||||
|
||||
document.body.appendChild(toast);
|
||||
|
||||
setTimeout(() => {
|
||||
toast.style.animation = 'appToastSlideOut 0.3s ease-out';
|
||||
setTimeout(() => toast.remove(), 300);
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
function markAppReady() {
|
||||
if (document && document.body) {
|
||||
document.body.classList.remove('auth-pending');
|
||||
@@ -529,8 +585,11 @@ function setPendingBulkStatus(message = '', isError = false) {
|
||||
if (!pendingBulkStatus) {
|
||||
return;
|
||||
}
|
||||
pendingBulkStatus.textContent = message || '';
|
||||
pendingBulkStatus.classList.toggle('bulk-status--error', !!isError);
|
||||
pendingBulkStatus.textContent = '';
|
||||
pendingBulkStatus.classList.remove('bulk-status--error');
|
||||
if (message) {
|
||||
showToast(message, isError ? 'error' : 'info');
|
||||
}
|
||||
}
|
||||
|
||||
function initializeFocusParams() {
|
||||
@@ -1130,18 +1189,20 @@ function formatFacebookDateParts(date) {
|
||||
}
|
||||
|
||||
function buildBookmarkFiltersParam() {
|
||||
const y = String(new Date().getFullYear()); // "2025"
|
||||
const now = new Date();
|
||||
const endYear = now.getFullYear();
|
||||
|
||||
// start_month = Monat von (heute - BOOKMARK_WINDOW_DAYS), auf Monatsanfang (ohne Padding)
|
||||
const windowAgo = new Date();
|
||||
windowAgo.setDate(windowAgo.getDate() - BOOKMARK_WINDOW_DAYS);
|
||||
const startYear = windowAgo.getFullYear();
|
||||
const startMonthNum = windowAgo.getMonth() + 1; // 1..12
|
||||
const startMonthLabel = `${y}-${startMonthNum}`; // z.B. "2025-9"
|
||||
const startMonthLabel = `${startYear}-${startMonthNum}`; // z.B. "2025-9"
|
||||
const startDayLabel = `${startMonthLabel}-1`; // z.B. "2025-9-1"
|
||||
|
||||
// Ende = Jahresende (ohne Padding), Jahre immer aktuelles Jahr als String
|
||||
const endMonthLabel = `${y}-12`;
|
||||
const endDayLabel = `${y}-12-31`;
|
||||
const endMonthLabel = `${endYear}-12`;
|
||||
const endDayLabel = `${endYear}-12-31`;
|
||||
|
||||
// Reihenfolge wie gewünscht: top_tab zuerst, dann rp_creation_time
|
||||
const filtersPayload = {
|
||||
@@ -1152,9 +1213,9 @@ const y = String(new Date().getFullYear()); // "2025"
|
||||
'rp_creation_time:0': JSON.stringify({
|
||||
name: 'creation_time',
|
||||
args: JSON.stringify({
|
||||
start_year: y, // als String
|
||||
start_year: String(startYear), // als String
|
||||
start_month: startMonthLabel,
|
||||
end_year: y, // als String
|
||||
end_year: String(endYear), // als String
|
||||
end_month: endMonthLabel,
|
||||
start_day: startDayLabel,
|
||||
end_day: endDayLabel
|
||||
@@ -2469,7 +2530,7 @@ function openNativeDeadlinePicker(post, triggerElement) {
|
||||
<div class="deadline-picker__field">
|
||||
<label>
|
||||
<span>Uhrzeit</span>
|
||||
<input type="time" class="deadline-picker__time" step="900" placeholder="hh:mm">
|
||||
<input type="time" class="deadline-picker__time" step="60" placeholder="hh:mm">
|
||||
</label>
|
||||
</div>
|
||||
<div class="deadline-picker__hint">Uhrzeit optional – Standard ist 00:00 Uhr.</div>
|
||||
@@ -4476,20 +4537,25 @@ async function openPost(postId) {
|
||||
|
||||
if (!status.canCurrentProfileCheck) {
|
||||
if (status.waitingForNames.length) {
|
||||
alert(`Wartet auf: ${status.waitingForNames.join(', ')}`);
|
||||
const proceed = confirm(`Vorherige Profile müssen zuerst bestätigen (${status.waitingForNames.join(', ')}). Trotzdem bestätigen?`);
|
||||
if (!proceed) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
alert('Der Beitrag kann aktuell nicht abgehakt werden.');
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const ignoreOrder = !status.canCurrentProfileCheck && status.waitingForNames.length > 0;
|
||||
const response = await apiFetch(`${API_URL}/check-by-url`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
url: post.url,
|
||||
profile_number: currentProfile
|
||||
profile_number: currentProfile,
|
||||
ignore_order: ignoreOrder
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user