mirror of
https://code.castopod.org/adaures/castopod
synced 2025-05-11 08:45:45 +00:00

- add podcast sidebar navigation - add podcast dashboard with latest episodes - add pagination to podcast episodes - add components helper to reuse ui components (button, data_table, etc.) - enhance podcast and episode forms by splitting them into form sections - add hint tooltips to podcast and episode forms - transform radio inputs as buttons for better ux - replace explicit field by parental_advisory - replace author field by publisher - add podcasts_categories table to set multiple categories - use choices.js to enhance multiselect fields - update Language files - update js dependencies to latest versions closes #31, #9
25 lines
617 B
TypeScript
25 lines
617 B
TypeScript
const EnclosureInput = (): void => {
|
|
const enclosureInput = document.querySelector(
|
|
".form-enclosure-input"
|
|
) as HTMLInputElement;
|
|
|
|
if (enclosureInput) {
|
|
const label = enclosureInput?.nextElementSibling?.querySelector(
|
|
"span"
|
|
) as HTMLSpanElement;
|
|
const labelVal = label.innerHTML;
|
|
|
|
enclosureInput.addEventListener("change", (e: Event) => {
|
|
const fileName = (e.target as HTMLInputElement).value.split("\\").pop();
|
|
|
|
if (fileName) {
|
|
label.innerHTML = fileName;
|
|
} else {
|
|
label.innerHTML = labelVal;
|
|
}
|
|
});
|
|
}
|
|
};
|
|
|
|
export default EnclosureInput;
|