
<script>
	var form_name = 'postform';
	var text_name = <!-- IF $SIG_EDIT -->'signature'<!-- ELSE -->'message'<!-- ENDIF -->;
	var load_draft = false;
	var upload = false;

	// Define the bbCode tags
	var bbcode = new Array();
	var bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->);
	var imageTag = false;

	function change_palette()
	{
		phpbb.toggleDisplay('colour_palette');
		e = document.getElementById('colour_palette');

		if (e.style.display == 'block')
		{
			document.getElementById('bbpalette').value = '{LA_FONT_COLOR_HIDE}';
		}
		else
		{
			document.getElementById('bbpalette').value = '{LA_FONT_COLOR}';
		}
	}
</script>

{% include 'mentions_templates.html' %}

<!-- INCLUDEJS {T_ASSETS_PATH}/javascript/editor.js -->
<!-- INCLUDEJS {T_ASSETS_PATH}/javascript/tribute.min.js -->
<!-- INCLUDEJS {T_ASSETS_PATH}/javascript/mentions.js -->

<!-- IF S_BBCODE_ALLOWED -->
<div id="colour_palette" style="display: none;">
	<dl style="clear: left;">
		<dt><label>{L_FONT_COLOR}{L_COLON}</label></dt>
		<dd id="color_palette_placeholder" class="color_palette_placeholder" data-color-palette="h" data-height="12" data-width="15" data-bbcode="true"></dd>
	</dl>
</div>

<!-- EVENT posting_editor_buttons_before -->
<div id="format-buttons" class="format-buttons"<!-- IF S_ALLOW_MENTIONS --> data-mention-url="{U_MENTION_URL}" data-mention-names-limit="{S_MENTION_NAMES_LIMIT}" data-topic-id="{S_TOPIC_ID}" data-user-id="{S_USER_ID}"<!-- ENDIF -->>
	<button type="button" class="button button-icon-only bbcode-b" accesskey="b" name="addbbcode0" value=" B " onclick="bbstyle(0)" title="{L_BBCODE_B_HELP}">
		{{ Icon('font', 'bold', '', true, 'fas c-button-icon') }}
	</button>
	<button type="button" class="button button-icon-only bbcode-i" accesskey="i" name="addbbcode2" value=" i " onclick="bbstyle(2)" title="{L_BBCODE_I_HELP}">
		{{ Icon('font', 'italic', '', true, 'fas c-button-icon') }}
	</button>
	<button type="button" class="button button-icon-only bbcode-u" accesskey="u" name="addbbcode4" value=" u " onclick="bbstyle(4)" title="{L_BBCODE_U_HELP}">
		{{ Icon('font', 'underline', '', true, 'fas c-button-icon') }}
	</button>
	<!-- IF S_BBCODE_QUOTE -->
	<button type="button" class="button button-icon-only bbcode-quote" accesskey="q" name="addbbcode6" value="Quote" onclick="bbstyle(6)" title="{L_BBCODE_Q_HELP}">
		{{ Icon('font', 'quote-left', '', true, 'fas c-button-icon') }}
	</button>
	<!-- ENDIF -->
	<button type="button" class="button button-icon-only bbcode-code" accesskey="c" name="addbbcode8" value="Code" onclick="bbstyle(8)" title="{L_BBCODE_C_HELP}">
		{{ Icon('font', 'code', '', true, 'fas c-button-icon') }}
	</button>
	<button type="button" class="button button-icon-only bbcode-list" accesskey="l" name="addbbcode10" value="List" onclick="bbstyle(10)" title="{L_BBCODE_L_HELP}">
		{{ Icon('font', 'list-ul', '', true, 'fas c-button-icon') }}
	</button>
	<button type="button" class="button button-icon-only bbcode-list-" accesskey="o" name="addbbcode12" value="List=" onclick="bbstyle(12)" title="{L_BBCODE_O_HELP}">
		{{ Icon('font', 'list-ol', '', true, 'fas c-button-icon') }}
	</button>
	<button type="button" class="button button-icon-only bbcode-asterisk" accesskey="y" name="addlistitem" value="[*]" onclick="bbstyle(-1)" title="{L_BBCODE_LISTITEM_HELP}">
		{{ Icon('font', 'asterisk', '', true, 'fas c-button-icon') }}
	</button>
	<!-- IF S_BBCODE_IMG -->
	<button type="button" class="button button-icon-only bbcode-img" accesskey="p" name="addbbcode14" value="Img" onclick="bbstyle(14)" title="{L_BBCODE_P_HELP}">
		{{ Icon('font', 'image', '', true, 'far c-button-icon') }}
	</button>
	<!-- ENDIF -->
	<!-- IF S_LINKS_ALLOWED -->
	<button type="button" class="button button-icon-only bbcode-url" accesskey="w" name="addbbcode16" value="URL" onclick="bbstyle(16)" title="{L_BBCODE_W_HELP}">
		{{ Icon('font', 'link', '', true, 'fas c-button-icon') }}
	</button>
	<!-- ENDIF -->
	<button type="button" class="button button-icon-only bbcode-color" name="bbpalette" id="bbpalette" value="{L_FONT_COLOR}" onclick="change_palette();" title="{L_BBCODE_S_HELP}">
		{{ Icon('font', 'droplet', '', true, 'fas c-button-icon') }}
	</button>
	<select name="addbbcode20" class="bbcode-size" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" title="{L_BBCODE_F_HELP}">
		<option value="50">{L_FONT_TINY}</option>
		<option value="85">{L_FONT_SMALL}</option>
		<option value="100" selected="selected">{L_FONT_NORMAL}</option>
		<!-- IF not MAX_FONT_SIZE or MAX_FONT_SIZE >= 150 -->
			<option value="150">{L_FONT_LARGE}</option>
			<!-- IF not MAX_FONT_SIZE or MAX_FONT_SIZE >= 200 -->
				<option value="200">{L_FONT_HUGE}</option>
			<!-- ENDIF -->
		<!-- ENDIF -->
	</select>

	<!-- EVENT posting_editor_buttons_custom_tags_before -->

	<!-- BEGIN custom_tags -->
	<button type="button" class="button button-secondary bbcode-{custom_tags.BBCODE_TAG_CLEAN}" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})" title="{{ custom_tags.BBCODE_HELPLINE }}">
		{custom_tags.BBCODE_TAG}
	</button>
	<!-- END custom_tags -->
</div>
<!-- EVENT posting_editor_buttons_after -->
<!-- ENDIF -->
