feat(editorial): widen sections and add local track pages
Unify the editorial canvas across section pages, keep release tracks out of Journal, and give each song a listening surface with audio, metadata, platform links, sharing, and optional featured art. Document and seed the local The No Names fixture without changing production data.
This commit is contained in:
23 files changed
+770
-50
No files matched your search
@@ -104,6 +104,13 @@
|
||||
return el(
|
||||
wp.editPost.PluginDocumentSettingPanel,
|
||||
{ name: 'chrnx-track', title: __( 'Track', 'chrnx' ) },
|
||||
el( wp.components.TextareaControl, {
|
||||
label: __( 'Track description', 'chrnx' ),
|
||||
value: meta.chrnx_track_description || '',
|
||||
onChange( value ) {
|
||||
setMeta( 'chrnx_track_description', value );
|
||||
},
|
||||
} ),
|
||||
el( wp.components.TextControl, {
|
||||
label: __( 'Track number', 'chrnx' ),
|
||||
type: 'number',
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
( function () {
|
||||
'use strict';
|
||||
|
||||
document.addEventListener( 'click', function ( event ) {
|
||||
const button = event.target.closest( '[data-chrnx-share]' );
|
||||
if ( ! button ) {
|
||||
return;
|
||||
}
|
||||
|
||||
const title = button.dataset.shareTitle || document.title;
|
||||
const url = button.dataset.shareUrl || window.location.href;
|
||||
const done = function () {
|
||||
const original = button.dataset.originalLabel || button.textContent;
|
||||
button.dataset.originalLabel = original;
|
||||
button.textContent = 'Enlace copiado';
|
||||
window.setTimeout( function () {
|
||||
button.textContent = original;
|
||||
}, 1800 );
|
||||
};
|
||||
|
||||
if ( navigator.share ) {
|
||||
navigator.share( { title, url } ).catch( function () {} );
|
||||
return;
|
||||
}
|
||||
if ( navigator.clipboard && navigator.clipboard.writeText ) {
|
||||
navigator.clipboard
|
||||
.writeText( url )
|
||||
.then( done )
|
||||
.catch( function () {} );
|
||||
}
|
||||
} );
|
||||
} )();
|
||||
Reference in new issue
Block a user