feat: UI-feinschliff, scan-vorlagenerkennung, einmal-laden, DE/EN-sprachen
UI:
- Ein-/Ausklappen jetzt mit grossem +/- Icon statt kleinem Pfeil.
- "Entfernen" ist ein Papierkorb-Symbol (dashicon).
- Aktiver Tab klar gekennzeichnet (Akzent-Unterstrich + Farbe).
- 20px Abstand zwischen Tabs und Inhalt.
Funktionen:
- Scan erkennt Anbieter, fuer die es eine Vorlage gibt ("Vorlage verfuegbar"),
und "Vorlage uebernehmen" fuellt die komplette Vorlage statt nur Host/Pattern.
- Platzhalter: Checkbox "Diesen Dienst kuenftig immer laden" (Standard AN).
Abgewaehlt -> Inhalt wird nur einmal geladen, keine dauerhafte Einwilligung.
i18n:
- Sprachumschaltung: Deutsch fuer alle de_* Locales, Englisch fuer alle anderen
(plugin_locale-Filter). Vollstaendige englische Uebersetzung (126 Strings,
inkl. Vorlagentexte/Empfaenger) als gdpr-content-blocker-en_US.po/.mo.
- Helper-Skripte (extract/build) in hilfsdaten/.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
function setExpanded( box, open ) {
|
||||
$( '.cb-service-grid', box ).toggle( open );
|
||||
const $btn = $( '.cb-service-toggle', box );
|
||||
$btn.attr( 'aria-expanded', open ? 'true' : 'false' ).text( open ? '▾' : '▸' );
|
||||
$btn.attr( 'aria-expanded', open ? 'true' : 'false' ).text( open ? '−' : '+' );
|
||||
}
|
||||
function bindToggle( box ) {
|
||||
$( '.cb-service-toggle', box ).on( 'click', function () {
|
||||
@@ -211,21 +211,33 @@
|
||||
$ex.append( $( '<code></code>' ).css( { fontSize: '11px', wordBreak: 'break-all' } ).text( sample ) );
|
||||
$tr.append( $ex );
|
||||
|
||||
// Does a ready-made template exist for this finding?
|
||||
const preset = ( f.preset && cbAdmin.presets && cbAdmin.presets[ f.preset ] )
|
||||
? cbAdmin.presets[ f.preset ]
|
||||
: null;
|
||||
|
||||
// Status
|
||||
const $st = $( '<td></td>' );
|
||||
if ( f.covered ) {
|
||||
$st.append( $( '<span></span>' ).css( { color: '#1a7f37', fontWeight: '600' } ).text( '✓ ' + ( i18n.covered || 'covered' ) ) );
|
||||
} else if ( preset ) {
|
||||
$st.append( $( '<span></span>' ).css( { color: '#2043B7', fontWeight: '600' } ).text( '★ ' + ( i18n.templateAvail || 'Vorlage verfügbar' ) ) );
|
||||
}
|
||||
$tr.append( $st );
|
||||
|
||||
// Action: take over as a new service (only useful for uncovered third parties)
|
||||
const $act = $( '<td></td>' );
|
||||
if ( f.third_party && ! f.covered ) {
|
||||
// Prefill from the matching preset (full data) if there is one,
|
||||
// otherwise just seed host + pattern.
|
||||
const data = preset
|
||||
? preset
|
||||
: { name: f.host, match_pattern: f.suggested_pattern || f.host, third_country: true };
|
||||
$( '<button type="button" class="button button-small"></button>' )
|
||||
.text( i18n.addService || 'Add as service' )
|
||||
.text( preset ? ( i18n.useTemplate || 'Vorlage übernehmen' ) : ( i18n.addService || 'Add as service' ) )
|
||||
.on( 'click', function () {
|
||||
activateTab( 'services' );
|
||||
const $box = addServiceRow( { name: f.host, match_pattern: f.suggested_pattern || f.host, third_country: true } );
|
||||
const $box = addServiceRow( data );
|
||||
if ( $box && $box.length ) {
|
||||
$box[ 0 ].scrollIntoView( { behavior: 'smooth', block: 'center' } );
|
||||
$box.find( '.cb-input-id' ).trigger( 'focus' );
|
||||
|
||||
Reference in New Issue
Block a user