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}
+1 -1
View File
@@ -158,7 +158,7 @@
</section>
</main>
<footer><span>{{.Background.Footer}} · App 1.6.2 · Schema 1.1 · {{.License.Edition}}</span>{{template "legal-links" .}}</footer>
<footer><span>{{.Background.Footer}} · App 1.6.3 · Schema 1.2 · {{.License.Edition}}</span>{{template "legal-links" .}}</footer>
<script src="/static/marketing.js" defer></script>
</body>
</html>
+7
View File
@@ -48,6 +48,13 @@
</div>
</section>
{{if .LegalAssessment.Text}}
<section class="legal-assessment-section" aria-labelledby="legal-assessment-title">
<h2 id="legal-assessment-title">{{.LegalAssessment.Heading}}</h2>
<div class="legal-assessment-card {{.LegalAssessment.Level}}">{{.LegalAssessment.Text}}</div>
</section>
{{end}}
<dl class="facts metadata-facts">
{{range .Facts}}<div><dt>{{.Label}}</dt><dd>{{if .Link}}<a href="{{.Link}}">{{.Value}}</a>{{else}}{{.Value}}{{end}}</dd></div>{{end}}
</dl>
+18 -1
View File
@@ -71,6 +71,15 @@
<div class="article-component"><label>Code<select id="article-code" data-review="article-code-review">{{range .Extents}}<option value="{{.Value}}" {{if eq .Value "none"}}selected{{end}}>{{.Label}}</option>{{end}}</select></label><label>{{index .Text "field_review"}}<select id="article-code-review">{{range .Reviews}}<option value="{{.Value}}" {{if eq .Value "none"}}selected{{end}}>{{.Label}}</option>{{end}}</select></label></div>
</div>
</fieldset>
<fieldset class="legal-context-builder wide">
<legend>{{index .Text "legal_context_legend"}}</legend>
<p>{{index .Text "legal_context_help"}}</p>
<label class="check-row"><input id="legal-deepfake" type="checkbox" value="deepfake"><span><strong>{{index .Text "legal_deepfake"}}</strong><small>{{index .Text "legal_deepfake_help"}}</small></span></label>
<label class="check-row"><input id="legal-public-interest" type="checkbox" value="publicInterestText"><span><strong>{{index .Text "legal_public_interest"}}</strong><small>{{index .Text "legal_public_interest_help"}}</small></span></label>
<label class="check-row"><input id="legal-creative" type="checkbox" value="artisticCreativeSatiricalFictional"><span><strong>{{index .Text "legal_creative"}}</strong><small>{{index .Text "legal_creative_help"}}</small></span></label>
<label class="check-row"><input id="legal-other-voluntary" type="checkbox" value="otherVoluntary"><span><strong>{{index .Text "legal_other_voluntary"}}</strong></span></label>
<div id="legal-assessment" class="legal-assessment" role="status" aria-live="polite"></div>
</fieldset>
<label>{{index .Text "field_language"}}
<select id="lang" name="lang">{{range .Languages}}<option value="{{.Code}}" {{if eq $.Lang .Code}}selected{{end}}>{{.Name}}</option>{{end}}</select>
</label>
@@ -84,12 +93,20 @@
<label class="wide">{{index .Text "field_subject"}}
<input id="subject" name="subject" type="url" placeholder="https://example.org/article">
</label>
<label class="wide">{{index .Text "field_responsibility_role"}}
<select id="responsible-role" name="responsibleRole">
<option value="">{{index .Text "responsibility_none"}}</option>
<option value="publisher">{{index .Text "responsibility_publisher"}}</option>
<option value="other">{{index .Text "responsibility_other"}}</option>
</select>
</label>
<label>{{index .Text "field_responsible"}}
<input id="responsible" name="responsible" maxlength="200" placeholder="{{index .Text "responsible_placeholder"}}">
</label>
<label>{{index .Text "field_responsible_url"}}
<input id="responsible-url" name="responsibleUrl" type="url" placeholder="https://example.org/impressum">
</label>
<p class="form-warning wide">{{index .Text "review_legal_text"}}</p>
</form>
{{if or .CustomText .CustomBadge}}
@@ -143,7 +160,7 @@
<article><p class="eyebrow">HA</p><h2>{{index .Text "api_stateless_title"}}</h2><p>{{index .Text "api_stateless_desc"}}</p></article>
</section>
</main>
<footer><span>AI Usage Disclosure · App 1.6.2 · Schema 1.1 · {{.License.Edition}}</span>{{template "legal-links" .}}</footer>
<footer><span>AI Usage Disclosure · App 1.6.3 · Schema 1.2 · {{.License.Edition}}</span>{{template "legal-links" .}}</footer>
<script nonce="{{.CSPNonce}}">window.APP_CONFIG={{.AppConfig}};</script>
<script src="/static/app.js" defer></script>
</body>
+2 -2
View File
@@ -46,7 +46,7 @@
<img src="/badge/full.svg?lang={{.Lang}}&amp;theme=color" alt="Full generation badge">
<pre><code>{
"@type": "AIUsageDeclaration",
"schemaVersion": "1.1",
"schemaVersion": "1.2",
"assurance": "selfDeclared"
}</code></pre>
</div>
@@ -119,7 +119,7 @@
</section>
</main>
<footer><span>{{.Marketing.Footer}} · App 1.6.2 · Schema 1.1 · {{.License.Edition}}</span>{{template "legal-links" .}}</footer>
<footer><span>{{.Marketing.Footer}} · App 1.6.3 · Schema 1.2 · {{.License.Edition}}</span>{{template "legal-links" .}}</footer>
<script src="/static/marketing.js" defer></script>
</body>
</html>