RC-5 Versiopn: 1.6.3
release-tag / release-image (push) Successful in 1m47s

This commit is contained in:
2026-07-22 05:58:38 +02:00
parent 862f86dc3e
commit 133fb10a93
25 changed files with 877 additions and 105 deletions
+96 -5
View File
@@ -35,6 +35,36 @@
});
}
function legalCategories() {
const values = [];
if ($('legal-deepfake')?.checked) values.push('deepfake');
if ($('legal-public-interest')?.checked) values.push('publicInterestText');
if ($('legal-creative')?.checked) values.push('artisticCreativeSatiricalFictional');
if ($('legal-other-voluntary')?.checked) values.push('otherVoluntary');
return values;
}
function substantiveReview(mode) {
return mode === 'editorial' || mode === 'expert';
}
function legalAssessment(locale, articleMode) {
const categories = legalCategories();
const deepfake = categories.includes('deepfake');
const publicInterest = categories.includes('publicInterestText');
const creative = categories.includes('artisticCreativeSatiricalFictional');
if (categories.length === 0) return {text: locale.text.legal_assessment_none, legal: false, badge: locale.text.badge_article || 'Article transparency'};
if (categories.includes('otherVoluntary')) return {text: locale.text.legal_assessment_voluntary, legal: false, badge: locale.text.badge_article || 'Article transparency'};
if (deepfake) return {text: creative ? locale.text.legal_assessment_deepfake_creative : locale.text.legal_assessment_deepfake, legal: true, badge: locale.text.badge_legal_disclosure || 'AI-generated / manipulated content'};
if (publicInterest) {
const review = articleMode ? $('article-text-review').value : ($('component').value === 'text' ? $('review').value : 'none');
const hasResponsibility = Boolean(value('responsible'));
if (substantiveReview(review) && hasResponsibility) return {text: locale.text.legal_assessment_public_exemption, legal: false, badge: locale.text.badge_article || 'Article transparency'};
return {text: locale.text.legal_assessment_public_required, legal: true, badge: locale.text.badge_public_interest || 'AI-generated / edited content'};
}
return {text: locale.text.legal_assessment_voluntary, legal: false, badge: locale.text.badge_article || 'Article transparency'};
}
function update(applyPreset = false) {
const mode = $('declaration-mode').value;
const articleMode = mode === 'article';
@@ -68,8 +98,11 @@
params.set('lang', lang);
params.set('assurance', assurance);
if ($('subject').value.trim()) params.set('subject', $('subject').value.trim());
if (value('responsible-role')) params.set('responsibleRole', value('responsible-role'));
if (value('responsible')) params.set('responsible', value('responsible'));
if (value('responsible-url')) params.set('responsibleUrl', value('responsible-url'));
const legal = legalCategories();
if (legal.length) params.set('legalContext', legal.join(','));
if (cfg.capabilities.custom_text) {
if (value('custom-title')) params.set('customTitle', value('custom-title'));
@@ -88,15 +121,27 @@
badgeParams.set('link', declarationURL);
const badgeURL = `${base}/v1/badge.svg?${badgeParams}`;
const manifestURL = `${base}/v1/declaration.json?${params}`;
const alt = articleMode
? (locale.text.badge_article || 'Article transparency')
: ((locale.presets[preset] && locale.presets[preset].title) || locale.extents[$('extent').value] || 'AI usage disclosure');
const assessment = legalAssessment(locale, articleMode);
const alt = assessment.legal
? assessment.badge
: (articleMode
? (locale.text.badge_article || 'Article transparency')
: ((locale.presets[preset] && locale.presets[preset].title) || locale.extents[$('extent').value] || 'AI usage disclosure'));
if ($('legal-assessment')) {
$('legal-assessment').innerHTML = `<strong>${locale.text.legal_assessment_heading || 'Article 50 assessment'}</strong><span>${assessment.text || ''}</span>`;
$('legal-assessment').dataset.level = assessment.legal ? 'attention' : 'info';
}
$('preview-badge').src = badgeURL;
$('preview-badge').alt = alt;
$('preview-link').href = declarationURL;
$('html-code').value = `<a href="${declarationURL}"><img src="${badgeURL}" alt="${alt}"></a>`;
$('markdown-code').value = `[![${alt}](${badgeURL})](${declarationURL})`;
const imageMarkup = `<a href="${declarationURL}"><img src="${badgeURL}" alt="${alt}"></a>`;
$('html-code').value = assessment.legal && $('theme').value === 'emoji'
? `${imageMarkup} <span>${assessment.badge}</span>`
: imageMarkup;
$('markdown-code').value = assessment.legal && $('theme').value === 'emoji'
? `[![${alt}](${badgeURL})](${declarationURL}) **${assessment.badge}**`
: `[![${alt}](${badgeURL})](${declarationURL})`;
$('json-code').value = manifestURL;
}
@@ -114,6 +159,52 @@
});
});
function alignLegalContextWithContent(changedId) {
if (changedId === 'legal-deepfake' && $('legal-deepfake')?.checked) {
if ($('legal-other-voluntary')) $('legal-other-voluntary').checked = false;
if ($('declaration-mode').value === 'single') {
if ($('legal-public-interest')?.checked) {
$('declaration-mode').value = 'article';
} else if (!['coverImage', 'image', 'audio', 'video'].includes($('component').value)) {
$('preset').value = '';
$('component').value = 'image';
if ($('extent').value === 'none') $('extent').value = 'partial';
}
}
}
if (changedId === 'legal-public-interest' && $('legal-public-interest')?.checked) {
if ($('legal-other-voluntary')) $('legal-other-voluntary').checked = false;
if ($('declaration-mode').value === 'single') {
if ($('legal-deepfake')?.checked) {
$('declaration-mode').value = 'article';
} else {
$('preset').value = '';
$('component').value = 'text';
if ($('extent').value === 'none') $('extent').value = 'partial';
}
}
if ($('declaration-mode').value === 'article' && $('article-text').value === 'none') {
$('article-text').value = 'partial';
}
}
if (changedId === 'legal-creative' && $('legal-creative')?.checked && $('legal-other-voluntary')) {
$('legal-other-voluntary').checked = false;
}
if ($('declaration-mode').value === 'article' && $('legal-deepfake')?.checked) {
const media = ['article-cover-image', 'article-image'];
const hasMedia = media.some(id => $(id)?.value !== 'none');
if (!hasMedia && $('article-image')) $('article-image').value = 'partial';
}
}
['legal-deepfake', 'legal-public-interest', 'legal-creative'].forEach(id => {
$(id)?.addEventListener('change', () => alignLegalContextWithContent(id));
});
$('legal-other-voluntary')?.addEventListener('change', () => {
if (!$('legal-other-voluntary').checked) return;
['legal-deepfake', 'legal-public-interest', 'legal-creative'].forEach(id => { if ($(id)) $(id).checked = false; });
});
form.addEventListener('input', event => update(event.target.id === 'preset'));
form.addEventListener('change', event => update(event.target.id === 'preset'));
document.querySelector('.pro-panel')?.addEventListener('input', () => update(false));
+3
View File
@@ -59,3 +59,6 @@
line-height: 1.5;
}
.compliance-notice { margin-top: 14px; }
/* Article 50 context and cautious assessment */
.legal-context-builder{border:1px solid var(--line);border-radius:14px;padding:22px;background:#fbfaf7}.legal-context-builder legend{padding:0 8px;font-weight:800}.legal-context-builder>p{margin-top:0;color:var(--muted)}.generator-grid .check-row{display:grid;grid-template-columns:22px 1fr;gap:10px;align-items:start;padding:10px 0;font-weight:400}.check-row input{width:18px;height:18px;margin-top:3px}.check-row span{display:flex;flex-direction:column;gap:3px}.check-row strong{font-weight:800}.legal-assessment{margin-top:14px;border-radius:12px;padding:16px 18px;background:#eeeae2;display:flex;flex-direction:column;gap:6px}.legal-assessment[data-level="attention"]{border-left:4px solid #8f2d1f}.legal-assessment[data-level="info"]{border-left:4px solid #5d5a50}.legal-assessment-section{margin-top:32px}.legal-assessment-card{border:1px solid var(--line);border-radius:14px;padding:20px;background:#fbfaf7}.legal-assessment-card.attention{border-left:5px solid #8f2d1f}.legal-assessment-card.info{border-left:5px solid #5d5a50}