style the fake icon

When no icon is provided, we use the first two letters as icon. A fancy
border makes it look more like an icon.
This commit is contained in:
Andreas Gohr 2017-02-15 14:55:47 +01:00
commit 285c4f96a7
2 changed files with 25 additions and 1 deletions

View file

@ -14,7 +14,8 @@ jQuery(function () {
const data = $me.text().split('@', 2);
const text = data[0].trim();
const $icon = jQuery('<span>')
.text(text.substr(0, 1).toUpperCase() + text.substr(1, 1).toLowerCase());
.text(text.substr(0, 1).toUpperCase() + text.substr(1, 1).toLowerCase())
.wrapInner('<strong>');
if (data[1]) {
const src = data[1].trim();
$icon.load(DOKU_BASE + 'lib/tpl/sprintdoc/svg.php?svg=' + src + '&e=1'); // directly embed