Fix: /admin/content is nu boom-editor + image-grootte knop + custom syntax
- /admin/content is nu de boom-editor (plugin-file-tree structuur),
consistent met plugin- en thema-editors. Oude tabelweergave verhuisd
naar /admin/content-list, bereikbaar via 'Boom weergave'/'Lijst
weergave' knoppen. /admin/content-files redirect naar /admin/content.
- Image-grootte knop in markdown editor-toolbar: selecteer ,
klik knop, breedte/hoogte dialog, {:width=... height=...} syntax
toevoegen/vervangen. Bestaande waarden worden in prompts getoond.
- Custom-grootte syntax {:width=...} nu ook correct herschreven naar
/-media/ endpoint (was alleen gewone  herschreven).
- Handleidingen bijgewerkt (content-beheer.md NL+EN: boom/lijst
weergave uitleg + image-grootte + images in content sectie)
- Release notes v2.6.2 bijgewerkt
- Pentest 30/30, WCAG 25/25
This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
{ cmd: 'quote', icon: 'bi-chat-quote', title: 'Citaat' },
|
||||
null,
|
||||
{ cmd: 'hr', icon: 'bi-hr', title: 'Horizontale lijn' },
|
||||
{ cmd: 'image-size', icon: 'bi-arrows-angle-expand', title: 'Afbeelding grootte' },
|
||||
null,
|
||||
{ cmd: 'media', icon: 'bi-images', title: 'Media invoegen' }
|
||||
],
|
||||
@@ -152,6 +153,43 @@
|
||||
modal.show();
|
||||
}
|
||||
break;
|
||||
case 'image-size':
|
||||
// Set width/height on a markdown image: {:width="W" height="H"}
|
||||
var selImg = editor.getSelection();
|
||||
if (!selImg) {
|
||||
// No selection — ask the user to select an image first
|
||||
alert('Selecteer eerst een afbeelding in de editor () om de grootte in te stellen.');
|
||||
editor.focus();
|
||||
break;
|
||||
}
|
||||
// Match  optionally followed by {:...}
|
||||
var imgMatch = selImg.match(/^!\[([^\]]*)\]\(([^)]+)\)(\s*\{:([^}]*)\})?/);
|
||||
if (!imgMatch) {
|
||||
alert('Selectie is geen afbeelding. Selecteer een afbeelding in markdown formaat: ');
|
||||
editor.focus();
|
||||
break;
|
||||
}
|
||||
var alt = imgMatch[1];
|
||||
var url = imgMatch[2];
|
||||
// Parse existing width/height from the {:...} block
|
||||
var existingAttrs = imgMatch[4] || '';
|
||||
var existingW = (existingAttrs.match(/width\s*=\s*"([^"]*)"/) || [])[1] || '';
|
||||
var existingH = (existingAttrs.match(/height\s*=\s*"([^"]*)"/) || [])[1] || '';
|
||||
var width = prompt('Breedte (px of %, leeg = niet instellen):', existingW);
|
||||
if (width === null) { editor.focus(); break; }
|
||||
var height = prompt('Hoogte (px of %, leeg = niet instellen):', existingH);
|
||||
if (height === null) { editor.focus(); break; }
|
||||
// Build the {:width=... height=...} suffix
|
||||
var attrs = [];
|
||||
if (width.trim() !== '') attrs.push('width="' + width.replace(/"/g, '') + '"');
|
||||
if (height.trim() !== '') attrs.push('height="' + height.replace(/"/g, '') + '"');
|
||||
var replacement = '';
|
||||
if (attrs.length > 0) {
|
||||
replacement += '{:' + attrs.join(' ') + '}';
|
||||
}
|
||||
editor.replaceSelection(replacement);
|
||||
editor.focus();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-check-lg"></i> {{ ta.rename|default('Hernoemen') }}
|
||||
</button>
|
||||
<a href="/admin/content?dir={{ dir|url_encode }}" class="btn btn-outline-secondary">{{ ta.cancel|default('Annuleren') }}</a>
|
||||
<a href="/admin/content-list?dir={{ dir|url_encode }}" class="btn btn-outline-secondary">{{ ta.cancel|default('Annuleren') }}</a>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -5,7 +5,7 @@
|
||||
{% block content %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-4 flex-wrap gap-2">
|
||||
<h2 class="mb-0"><i class="bi bi-pencil"></i> {{ ta.rename_folder|default('Map hernoemen') }}</h2>
|
||||
<a href="/admin/content-files" class="btn btn-outline-secondary btn-sm">
|
||||
<a href="/admin/content" class="btn btn-outline-secondary btn-sm">
|
||||
<i class="bi bi-arrow-left"></i> {{ ta.back|default('Terug') }}
|
||||
</a>
|
||||
</div>
|
||||
@@ -28,7 +28,7 @@
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-check-lg"></i> {{ ta.rename|default('Hernoemen') }}
|
||||
</button>
|
||||
<a href="/admin/content-files" class="btn btn-outline-secondary">{{ ta.cancel|default('Annuleren') }}</a>
|
||||
<a href="/admin/content" class="btn btn-outline-secondary">{{ ta.cancel|default('Annuleren') }}</a>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -71,7 +71,7 @@
|
||||
<i class="bi bi-eye"></i> {{ ta.preview|default('Preview') }}
|
||||
</a>
|
||||
{% endif %}
|
||||
<a href="/admin/content?dir={{ fileDir|url_encode }}" class="btn btn-outline-secondary" id="back-btn">{{ ta.back|default('Terug') }}</a>
|
||||
<a href="/admin/content-list?dir={{ fileDir|url_encode }}" class="btn btn-outline-secondary" id="back-btn">{{ ta.back|default('Terug') }}</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<a href="/admin/content-files?file={{ n.path|url_encode }}"
|
||||
<a href="/admin/content?file={{ n.path|url_encode }}"
|
||||
class="tree-link {{ isActive ? 'is-active' : '' }}"
|
||||
title="{{ n.path }}">
|
||||
<span class="tree-chevron-spacer"></span>
|
||||
@@ -159,7 +159,7 @@
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm" data-bs-toggle="modal" data-bs-target="#newDirModal" data-in-dir="">
|
||||
<i class="bi bi-folder-plus"></i> {{ ta.new_folder|default('Nieuwe map') }}
|
||||
</button>
|
||||
<a href="/admin/content" class="btn btn-outline-secondary btn-sm">
|
||||
<a href="/admin/content-list" class="btn btn-outline-secondary btn-sm">
|
||||
<i class="bi bi-list"></i> {{ ta.list_view|default('Lijst weergave') }}
|
||||
</a>
|
||||
</div>
|
||||
@@ -228,7 +228,7 @@
|
||||
{% if loop.last %}
|
||||
<li class="breadcrumb-item active" aria-current="page">{{ part }}</li>
|
||||
{% else %}
|
||||
<li class="breadcrumb-item"><a href="/admin/content-files?file={{ crumbPath|url_encode }}">{{ part }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="/admin/content?file={{ crumbPath|url_encode }}">{{ part }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ol>
|
||||
@@ -236,7 +236,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% if isEditable %}
|
||||
<form method="POST" action="/admin/content-files?file={{ relFile|url_encode }}" id="editor-form">
|
||||
<form method="POST" action="/admin/content?file={{ relFile|url_encode }}" id="editor-form">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
@@ -297,7 +297,7 @@
|
||||
<a href="/{{ currentLang }}{% if fileDir %}/{{ fileDir }}{% endif %}/{{ fileName|replace({'.md': '', '.php': '', '.html': ''}) }}" target="_blank" class="btn btn-outline-info" title="{{ ta.open_new_tab|default('Open in nieuw tabblad') }}">
|
||||
<i class="bi bi-eye"></i> {{ ta.preview|default('Preview') }}
|
||||
</a>
|
||||
<a href="/admin/content?dir={{ fileDir|url_encode }}" class="btn btn-outline-secondary">{{ ta.list_view|default('Lijst weergave') }}</a>
|
||||
<a href="/admin/content-list?dir={{ fileDir|url_encode }}" class="btn btn-outline-secondary">{{ ta.list_view|default('Lijst weergave') }}</a>
|
||||
</div>
|
||||
</form>
|
||||
{% else %}
|
||||
@@ -319,7 +319,7 @@
|
||||
<div class="modal fade" id="newFileModal" tabindex="-1" aria-labelledby="newFileModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form method="POST" action="/admin/content-files">
|
||||
<form method="POST" action="/admin/content">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<input type="hidden" name="action" value="new_file">
|
||||
<input type="hidden" name="in_dir" id="newFileDir" value="">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{% block content %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-4 flex-wrap gap-2">
|
||||
<h2 class="mb-0"><i class="bi bi-arrows-move"></i> {{ ta.file|default('Bestand') }} {{ ta.move_suffix|default('verplaatsen') }}</h2>
|
||||
<a href="/admin/content-files?file={{ relFile|url_encode }}" class="btn btn-outline-secondary btn-sm">
|
||||
<a href="/admin/content?file={{ relFile|url_encode }}" class="btn btn-outline-secondary btn-sm">
|
||||
<i class="bi bi-arrow-left"></i> {{ ta.back|default('Terug') }}
|
||||
</a>
|
||||
</div>
|
||||
@@ -32,7 +32,7 @@
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-check-lg"></i> {{ ta.move|default('Verplaatsen') }}
|
||||
</button>
|
||||
<a href="/admin/content-files?file={{ relFile|url_encode }}" class="btn btn-outline-secondary">{{ ta.cancel|default('Annuleren') }}</a>
|
||||
<a href="/admin/content?file={{ relFile|url_encode }}" class="btn btn-outline-secondary">{{ ta.cancel|default('Annuleren') }}</a>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -34,7 +34,7 @@
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-check-lg"></i> {{ ta.create|default('Aanmaken') }}
|
||||
</button>
|
||||
<a href="/admin/content?dir={{ dir|url_encode }}" class="btn btn-outline-secondary">{{ ta.cancel|default('Annuleren') }}</a>
|
||||
<a href="/admin/content-list?dir={{ dir|url_encode }}" class="btn btn-outline-secondary">{{ ta.cancel|default('Annuleren') }}</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h2><i class="bi bi-file-earmark-text"></i> {{ ta.content|default('Content') }}</h2>
|
||||
<div>
|
||||
<a href="/admin/content" class="btn btn-outline-primary btn-sm me-1" title="{{ ta.tree_view|default('Boom weergave') }}">
|
||||
<i class="bi bi-diagram-3"></i> {{ ta.tree_view|default('Boom weergave') }}
|
||||
</a>
|
||||
<button type="button" class="btn btn-outline-success btn-sm me-1" data-bs-toggle="collapse" data-bs-target="#uploadForm">
|
||||
<i class="bi bi-cloud-upload"></i> {{ ta.upload|default('Upload') }}
|
||||
</button>
|
||||
@@ -24,7 +27,7 @@
|
||||
<div class="collapse mb-4" id="uploadForm">
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
<form method="POST" action="/admin/content?dir={{ subdir|url_encode }}" enctype="multipart/form-data">
|
||||
<form method="POST" action="/admin/content-list?dir={{ subdir|url_encode }}" enctype="multipart/form-data">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<div class="mb-3">
|
||||
<label for="file" class="form-label">{{ ta.select_files|default('Bestanden selecteren') }}</label>
|
||||
@@ -43,7 +46,7 @@
|
||||
{% set parentDir = subdir|split('/')|slice(0, -1)|join('/') %}
|
||||
<nav aria-label="breadcrumb" class="mb-3">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="/admin/content"><i class="bi bi-house"></i></a></li>
|
||||
<li class="breadcrumb-item"><a href="/admin/content-list"><i class="bi bi-house"></i></a></li>
|
||||
{% set crumbPath = '' %}
|
||||
{% for crumb in subdir|split('/') %}
|
||||
{% set crumbPath = crumbPath ? crumbPath ~ '/' ~ crumb : crumb %}
|
||||
@@ -51,7 +54,7 @@
|
||||
{% if crumbPath == subdir %}
|
||||
{{ crumb }}
|
||||
{% else %}
|
||||
<a href="/admin/content?dir={{ crumbPath|url_encode }}">{{ crumb }}</a>
|
||||
<a href="/admin/content-list?dir={{ crumbPath|url_encode }}">{{ crumb }}</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
@@ -86,7 +89,7 @@
|
||||
<tr data-name="{{ item.name|lower }}">
|
||||
<td>
|
||||
{% if item.is_dir %}
|
||||
<a href="/admin/content?dir={{ item.path|url_encode }}">
|
||||
<a href="/admin/content-list?dir={{ item.path|url_encode }}">
|
||||
<i class="bi bi-folder-fill text-warning"></i> {{ item.name }}
|
||||
</a>
|
||||
{% else %}
|
||||
|
||||
Reference in New Issue
Block a user