feat: kein interner-name-feld mehr - ID automatisch aus anbietername
- Dienst-Zeile zeigt/erfordert nur noch den Anbietername. - Interne ID wird beim Speichern aus dem Namen abgeleitet (sanitize_title), bestehende IDs bleiben via Hidden-Field stabil; Eindeutigkeit erzwungen. - Shortcode-Hilfe erklaert: ID = Anbietername in Kleinbuchstaben mit Bindestrichen. - EN-Uebersetzung (120) aktualisiert. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -11,15 +11,13 @@
|
||||
$( '.cb-color-picker', ctx ).wpColorPicker();
|
||||
}
|
||||
|
||||
/* ── Live header update: "interner-name — Anbietername" ── */
|
||||
/* ── Live header update: provider name ── */
|
||||
function syncTitle( box ) {
|
||||
const id = ( $( '.cb-input-id', box ).val() || '' ).trim();
|
||||
const name = ( $( '.cb-input-name', box ).val() || '' ).trim();
|
||||
const head = ( id || ( cbAdmin.newServiceLbl || 'neu' ) ) + ( name ? ' — ' + name : '' );
|
||||
$( '.cb-service-title', box ).first().text( head );
|
||||
$( '.cb-service-title', box ).first().text( name || ( cbAdmin.newServiceLbl || 'Neuer Dienst' ) );
|
||||
}
|
||||
function bindNameSync( box ) {
|
||||
$( '.cb-input-name, .cb-input-id', box ).on( 'input', function () {
|
||||
$( '.cb-input-name', box ).on( 'input', function () {
|
||||
syncTitle( box );
|
||||
} );
|
||||
}
|
||||
@@ -239,7 +237,7 @@
|
||||
const $box = addServiceRow( data );
|
||||
if ( $box && $box.length ) {
|
||||
$box[ 0 ].scrollIntoView( { behavior: 'smooth', block: 'center' } );
|
||||
$box.find( '.cb-input-id' ).trigger( 'focus' );
|
||||
$box.find( '.cb-input-name' ).trigger( 'focus' );
|
||||
}
|
||||
} )
|
||||
.appendTo( $act );
|
||||
|
||||
Reference in New Issue
Block a user