Optical rendering of file and image listings
Some checks failed
DokuWiki Default Tasks / all (push) Has been cancelled
Some checks failed
DokuWiki Default Tasks / all (push) Has been cancelled
This commit is contained in:
@@ -13,3 +13,6 @@ $lang['lastmodified'] = 'Letzte Änderung';
|
||||
$lang['openlocation'] = 'Ort öffnen';
|
||||
$lang['error_nomatch'] = 'Keine Treffer';
|
||||
$lang['error_outsidejail'] = 'Zugriff verweigert';
|
||||
|
||||
$lang['empty_files'] = 'Keine Dateien';
|
||||
$lang['empty_images'] = 'Keine Bilder';
|
||||
|
||||
@@ -13,3 +13,6 @@ $lang['lastmodified'] = 'Last modified';
|
||||
$lang['openlocation'] = 'Open Location';
|
||||
$lang['error_nomatch'] = 'No match';
|
||||
$lang['error_outsidejail'] = 'Access denied';
|
||||
|
||||
$lang['empty_files'] = 'No Files';
|
||||
$lang['empty_images'] = 'No Images';
|
||||
|
||||
@@ -12,3 +12,6 @@ $lang['lastmodified'] = 'Laatst gewijzigd';
|
||||
$lang['openlocation'] = 'Locatie openen';
|
||||
$lang['error_nomatch'] = 'Niets gevonden';
|
||||
$lang['error_outsidejail'] = 'Toegang geweigerd';
|
||||
|
||||
$lang['empty_files'] = 'Geen bestanden';
|
||||
$lang['empty_images'] = 'Geen afbeeldingen';
|
||||
|
||||
17
style.css
17
style.css
@@ -29,3 +29,20 @@ div.filetools-plugin a.media.mediafile.mf_folder,
|
||||
div.filetools-plugin a.mediafile.mf_folder {
|
||||
background-image: url(../../images/fileicons/svg/folder.svg) !important;
|
||||
}
|
||||
|
||||
/* Muted empty-state message when a listing has no results. */
|
||||
div.filetools-plugin .luxtools-empty {
|
||||
opacity: 0.65;
|
||||
font-style: italic;
|
||||
padding: 0.25em 0;
|
||||
}
|
||||
|
||||
/* Image gallery spacing. */
|
||||
div.filetools-gallery {
|
||||
padding-bottom: 0.5em;
|
||||
}
|
||||
|
||||
div.filetools-gallery a.media {
|
||||
display: inline-block;
|
||||
margin: 0 0.35em 0.35em 0;
|
||||
}
|
||||
|
||||
@@ -238,6 +238,25 @@ abstract class syntax_plugin_luxtools_abstract extends SyntaxPlugin
|
||||
$renderer->cdata('[n/a: ' . $this->getLang($langKey) . ']');
|
||||
}
|
||||
|
||||
/**
|
||||
* Render a muted empty-state message (used when a listing has no results).
|
||||
*
|
||||
* @param \Doku_Renderer $renderer
|
||||
* @param string $langKey
|
||||
* @return void
|
||||
*/
|
||||
protected function renderEmptyState(\Doku_Renderer $renderer, string $langKey): void
|
||||
{
|
||||
$text = (string)$this->getLang($langKey);
|
||||
|
||||
if ($renderer instanceof \Doku_Renderer_xhtml) {
|
||||
$renderer->doc .= '<div class="filetools-plugin"><div class="luxtools-empty">' . hsc($text) . '</div></div>';
|
||||
return;
|
||||
}
|
||||
|
||||
$renderer->cdata($text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Separate a path into base directory and pattern.
|
||||
*
|
||||
|
||||
@@ -55,7 +55,7 @@ class syntax_plugin_luxtools_directory extends syntax_plugin_luxtools_abstract
|
||||
);
|
||||
|
||||
if ($items == []) {
|
||||
$this->renderError($renderer, 'error_nomatch');
|
||||
$this->renderEmptyState($renderer, 'empty_files');
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class syntax_plugin_luxtools_files extends syntax_plugin_luxtools_abstract
|
||||
);
|
||||
|
||||
if ($result == []) {
|
||||
$this->renderError($renderer, 'error_nomatch');
|
||||
$this->renderEmptyState($renderer, 'empty_files');
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ class syntax_plugin_luxtools_images extends syntax_plugin_luxtools_abstract
|
||||
$items = $this->filterImages($items);
|
||||
|
||||
if ($items == []) {
|
||||
$this->renderError($renderer, 'error_nomatch');
|
||||
$this->renderEmptyState($renderer, 'empty_images');
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user