improve scratchpad editing
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user