Media browser: recursive scan entire content/ tree, /-media/ URL prefix, editor change detection fix

- handleMediaList() now scans content/ recursively for all media files
- URLs use /-media/ prefix mapping directly to content/ (no special cases)
- index.php: added /-media/ route, kept /-assets/ for backward compat
- editor-toolbar.js: fixed editor.on('change') placement (was inside switchMode)
- content-edit.php and content-new.php: back-btn unsaved-changes detection
- Removed unused __editorCleanup global
This commit is contained in:
2026-06-24 17:00:59 +02:00
parent d97c67c6a9
commit dc0d370e65
50 changed files with 2796 additions and 140 deletions

View File

@@ -1,4 +1,4 @@
<header class="navbar navbar-expand-lg navbar-dark" style="background-color: var(--header-bg);">
<header id="site-header" class="navbar navbar-expand-lg navbar-dark" style="background-color: transparent;">
<div class="container-fluid">
<a class="navbar-brand" href="?page={{default_page}}&lang={{current_lang}}">
<img src="/assets/icon.svg" alt="CodePress Logo" width="32" height="32" class="me-2">

View File

@@ -76,11 +76,45 @@
<!-- Dynamic theme colors -->
<style>
html, body {
height: 100%;
}
body {
display: flex;
flex-direction: column;
}
#site-header {
background-image: {{background_image_css}};
background-size: cover;
background-position: center;
background-repeat: no-repeat;
position: relative;
}
#site-header::before {
content: '';
position: absolute;
inset: 0;
background-color: var(--header-bg);
opacity: calc((100 - {{background_image_opacity}}) / 100);
pointer-events: none;
z-index: 0;
}
#site-header > * {
position: relative;
z-index: 1;
}
:root {
--header-bg: {{header_color}};
--header-font: {{header_font_color}};
--header-height: {{header_height}}px;
--nav-bg: {{navigation_color}};
--nav-font: {{navigation_font_color}};
--nav-height: {{nav_height}}px;
--sidebar-bg: {{sidebar_background}};
--sidebar-border: {{sidebar_border}};
}
@@ -88,6 +122,7 @@
/* Header styles */
.navbar {
background-color: var(--header-bg) !important;
min-height: var(--header-height);
}
.navbar .navbar-brand,
@@ -209,6 +244,7 @@
.navigation-section {
background-color: var(--nav-bg) !important;
color: var(--nav-font) !important;
min-height: var(--nav-height);
}
/* Enhanced accessibility styles */
@@ -290,7 +326,7 @@
border-right: 1px solid var(--sidebar-border) !important;
position: sticky;
top: 0;
height: 100vh;
min-height: calc(100vh - var(--header-height) - var(--nav-height) - 42px);
}
.sidebar {
@@ -310,7 +346,7 @@
/* Ensure full height layout */
.main-content {
min-height: calc(100vh - 200px);
flex: 1;
}
/* Mobile responsive */
@@ -380,9 +416,7 @@
</style>
</head>
<body>
<header role="banner" id="site-header">
{{>header}}
</header>
{{>header}}
<nav role="navigation" aria-label="Main navigation" id="site-navigation">
{{>navigation}}