Add AI auto-check worker, share link message/link fields, and update journal/settings UI
This commit is contained in:
@@ -96,6 +96,8 @@ function showError(msg) {
|
||||
document.getElementById('title').textContent = msg;
|
||||
document.getElementById('grid').innerHTML = `<div class="empty"><div class="big">🤔</div>${esc(msg)}</div>`;
|
||||
document.getElementById('photosBlock').style.display = 'none';
|
||||
document.getElementById('shareMessage').style.display = 'none';
|
||||
document.getElementById('shareLinkBlock').style.display = 'none';
|
||||
}
|
||||
|
||||
function renderShare(data, password) {
|
||||
@@ -107,6 +109,29 @@ function renderShare(data, password) {
|
||||
if (data.date_from || data.date_to) chips.push(`Период: <b>${fmt(data.date_from)}</b> — <b>${fmt(data.date_to)}</b>`);
|
||||
document.getElementById('chips').innerHTML = chips.map(c => `<span class="chip">${c}</span>`).join('');
|
||||
|
||||
const msgEl = document.getElementById('shareMessage');
|
||||
if (data.message) {
|
||||
msgEl.textContent = data.message;
|
||||
msgEl.style.display = 'block';
|
||||
} else {
|
||||
msgEl.style.display = 'none';
|
||||
}
|
||||
|
||||
const linkBlock = document.getElementById('shareLinkBlock');
|
||||
linkBlock.innerHTML = '';
|
||||
if (data.link_url && /^https?:\/\//i.test(data.link_url)) {
|
||||
const a = document.createElement('a');
|
||||
a.className = 'share-link-btn';
|
||||
a.href = data.link_url;
|
||||
a.target = '_blank';
|
||||
a.rel = 'noopener noreferrer';
|
||||
a.textContent = '🔗 Перейти по ссылке';
|
||||
linkBlock.appendChild(a);
|
||||
linkBlock.style.display = 'block';
|
||||
} else {
|
||||
linkBlock.style.display = 'none';
|
||||
}
|
||||
|
||||
const pb = document.getElementById('photosBlock');
|
||||
if (data.photos && data.photos.length) {
|
||||
document.getElementById('photosGrid').innerHTML = data.photos.map(p => `
|
||||
|
||||
Reference in New Issue
Block a user