improve scratchpad editing

This commit is contained in:
2026-01-09 12:27:49 +01:00
parent c20b482616
commit 2d9e5ff8d0
3 changed files with 71 additions and 6 deletions

View File

@@ -133,11 +133,22 @@ class syntax_plugin_luxtools_scratchpad extends SyntaxPlugin
. ' data-sectok="' . hsc($sectok) . '"'
. '>';
// Stable, template-friendly container around the scratchpad.
$renderer->doc .= '<div class="luxtools-scratchpad-frame">';
// Invisible container around the rendered scratchpad (templates can decorate).
$renderer->doc .= '<div class="luxtools-scratchpad-rendered">';
// Well-defined place for the edit button (templates can reposition/style).
$renderer->doc .= '<div class="luxtools-scratchpad-bar">';
// Always show the scratchpad name (alias) for context.
$renderer->doc .= '<span class="luxtools-scratchpad-name">' . hsc($rawPad) . '</span>';
if ($canEdit) {
$label = (string)$this->getLang('scratchpad_edit');
if ($label === '') $label = 'Edit';
$renderer->doc .= '<a href="#" class="luxtools-scratchpad-edit" title="' . hsc($label) . '" aria-label="' . hsc($label) . '">✎</a>';
$renderer->doc .= '<a href="#" class="luxtools-scratchpad-edit" title="' . hsc($label) . '" aria-label="' . hsc($label) . '">✎ edit</a>';
}
$renderer->doc .= '</div>';
@@ -156,6 +167,9 @@ class syntax_plugin_luxtools_scratchpad extends SyntaxPlugin
$renderer->doc .= '</div>';
}
$renderer->doc .= '</div>'; // .luxtools-scratchpad-rendered
$renderer->doc .= '</div>'; // .luxtools-scratchpad-frame
$renderer->doc .= '</div>';
return true;
}