[feature/bbcode-icon-name] Add icon preview to ACP form

PHPBB3-17326
This commit is contained in:
Daniel James 2024-06-16 22:29:11 +01:00
parent 6db2bb6e08
commit 8d3d6ebd8a
2 changed files with 9 additions and 1 deletions

View file

@ -51,7 +51,10 @@
<legend>{{ lang('APPEARANCE') }}</legend>
<dl>
<dt><label for="bbcode_font_icon">{{ lang('BBCODE_FONT_ICON') }}</label><br /><span>{{ lang('BBCODE_FONT_EXPLAIN') }}</span></dt>
<dd><input type="text" name="bbcode_font_icon" id="bbcode_font_icon" value="{{ BBCODE_FONT_ICON }}" /></dd>
<dd>
<input type="text" name="bbcode_font_icon" id="bbcode_font_icon" value="{{ BBCODE_FONT_ICON }}" />
<i id="bbcode_icon_preview" class="icon fa-{{ BBCODE_FONT_ICON }}" aria-hidden="true"></i>
</dd>
</dl>
</fieldset>

View file

@ -259,5 +259,10 @@ function parse_document(container)
$('.actions a:has(i.acp-icon)').mouseover(function () {
$(this).css("text-decoration", "none");
});
// Live update BBCode font icon preview
$('#bbcode_font_icon').on('keyup', function(e) {
$('#bbcode_icon_preview').attr('class', "icon fa-" + $('#bbcode_font_icon').val());
});
});
})(jQuery);