<commit_before><div class="files-field uninitialized">
{if $field.limit}
	{remarksbox _type=info title="{tr}Attached files limitation{/tr}"}
		{tr _0=$field.limit}The amount of files that can be attached is limited to <strong>%0</strong>. The latest files will be preserved.{/tr}
	{/remarksbox}
{/if}
<ol class="tracker-item-files current-list">
	{foreach from=$field.files item=info}
		<li data-file-id="{$info.fileId|escape}">
			{$info.name|escape}
			<label>{icon _id=cross}</label>
		</li>
	{/foreach}
</ol>
<input class="input" type="text" name="{$field.ins_id|escape}" value="{$field.value|escape}"/>
{if $field.canUpload}
	<fieldset id="{$field.ins_id|escape}-drop" class="file-drop">
		<legend>{tr}Upload files{/tr}</legend>
		<p style="display:none;">{tr}Drop files from your desktop here or browse for them{/tr}</p>
		<input class="ignore" type="file" name="{$field.ins_id|escape}[]" accept="{$field.filter|escape}" multiple="multiple"/>
	</fieldset>
{/if}
{if $prefs.fgal_tracker_existing_search eq 'y'}
	<fieldset>
		<legend>{tr}Existing files{/tr}</legend>
		<input type="text" class="search" placeholder="{tr}Search query{/tr}"/>
		{if $prefs.fgal_elfinder_feature eq 'y'}
			{button href='tiki-list_file_gallery.php' _text="{tr}Browse files{/tr}"
				_onclick="return openElFinderDialog(this, {ldelim}defaultGalleryId:{$field.options_array[0]|escape},deepGallerySearch:{$field.options_array[6]|escape},getFileCallback:function(file,elfinder){ldelim}window.handleFinderFile(file,elfinder){rdelim}{rdelim});"
				title="{tr}Browse files{/tr}"}
		{/if}
		<ol class="results tracker-item-files">
		</ol>
	</fieldset>
{/if}
{if $prefs.fgal_upload_from_source eq 'y' and $field.canUpload}
	<fieldset>
		<legend>{tr}Upload from URL{/tr}</legend>
		<label>{tr}URL:{/tr} <input class="url" name="url" placeholder="http://"/></label>
		{tr}Type or paste the URL and press ENTER{/tr}
	</fieldset>
{/if}
</div>
{jq}
$('.files-field.uninitialized').removeClass('uninitialized').each(function () {
var $drop = $('.file-drop', this);
var $files = $('.current-list', this);
var $field = $('.input', this);
var $search = $('.search', this);
var $url = $('.url', this);
var $fileinput = $drop.find('input');<commit_msg>[FIX] elfinder: Sometimes (?) the field options come back as an empty string instead of 0, so test (thanks marclaporte)<commit_after><div class="files-field uninitialized">
{if $field.limit}
	{remarksbox _type=info title="{tr}Attached files limitation{/tr}"}
		{tr _0=$field.limit}The amount of files that can be attached is limited to <strong>%0</strong>. The latest files will be preserved.{/tr}
	{/remarksbox}
{/if}
<ol class="tracker-item-files current-list">
	{foreach from=$field.files item=info}
		<li data-file-id="{$info.fileId|escape}">
			{$info.name|escape}
			<label>{icon _id=cross}</label>
		</li>
	{/foreach}
</ol>
<input class="input" type="text" name="{$field.ins_id|escape}" value="{$field.value|escape}"/>
{if $field.canUpload}
	<fieldset id="{$field.ins_id|escape}-drop" class="file-drop">
		<legend>{tr}Upload files{/tr}</legend>
		<p style="display:none;">{tr}Drop files from your desktop here or browse for them{/tr}</p>
		<input class="ignore" type="file" name="{$field.ins_id|escape}[]" accept="{$field.filter|escape}" multiple="multiple"/>
	</fieldset>
{/if}
{if $prefs.fgal_tracker_existing_search eq 'y'}
	<fieldset>
		<legend>{tr}Existing files{/tr}</legend>
		<input type="text" class="search" placeholder="{tr}Search query{/tr}"/>
		{if $prefs.fgal_elfinder_feature eq 'y'}
			{button href='tiki-list_file_gallery.php' _text="{tr}Browse files{/tr}"
				_onclick="return openElFinderDialog(this, {ldelim}defaultGalleryId:{if empty($field.options_array[0])}0{else}{$field.options_array[0]|escape}{/if},deepGallerySearch:{if empty($field.options_array[6])}0{else}{$field.options_array[6]|escape}{/if},getFileCallback:function(file,elfinder){ldelim}window.handleFinderFile(file,elfinder){rdelim}{rdelim});"
				title="{tr}Browse files{/tr}"}
		{/if}
		<ol class="results tracker-item-files">
		</ol>
	</fieldset>
{/if}
{if $prefs.fgal_upload_from_source eq 'y' and $field.canUpload}
	<fieldset>
		<legend>{tr}Upload from URL{/tr}</legend>
		<label>{tr}URL:{/tr} <input class="url" name="url" placeholder="http://"/></label>
		{tr}Type or paste the URL and press ENTER{/tr}
	</fieldset>
{/if}
</div>
{jq}
$('.files-field.uninitialized').removeClass('uninitialized').each(function () {
var $drop = $('.file-drop', this);
var $files = $('.current-list', this);
var $field = $('.input', this);
var $search = $('.search', this);
var $url = $('.url', this);
var $fileinput = $drop.find('input');
{'fraction_non_alphanumeric': 0.20781182563659906, 'fraction_numerical': 0.0028053517479499353, 'mean_word_length': 6.264890282131661, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 0, '>': 67, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1861692', 'n_tokens_mistral': 1755, 'n_tokens_neox': 1674, 'n_words': 337}