<commit_before>{* $Id$ *}

{title admpage=freetags}{tr}Browse related tags{/tr}{/title}

{if $prefs.feature_morcego eq 'y' and $prefs.freetags_feature_3d eq 'y'}
	<div class="morcego_embedded">
		<h2>{tr}Network of Tags related to:{/tr} <span id="currentTag1">{$tag}</span></h2>
		<applet codebase="./lib/wiki3d" archive="morcego-0.6.0.jar" code="br.arca.morcego.Morcego" width="{$prefs.freetags_3d_width}" height="{$prefs.freetags_3d_height}">
			<param name="serverUrl" value="{$base_url}tiki-freetag3d_xmlrpc.php">
			<param name="startNode" value="{$tag}">
			<param name="windowWidth" value="{$prefs.freetags_3d_width}">
			<param name="windowHeight" value="{$prefs.freetags_3d_height}">
			<param name="viewWidth" value="{$prefs.freetags_3d_width}">
			<param name="viewHeight" value="{$prefs.freetags_3d_height}">
			<param name="navigationDepth" value="{$prefs.freetags_3d_navigation_depth}">
			<param name="feedAnimationInterval" value="{$prefs.freetags_3d_feed_animation_interval}">
			<param name="controlWindowName" value="tiki">
			<param name="showArcaLogo" value="false">
			<param name="showMorcegoLogo" value="false">
			<param name="loadPageOnCenter" value="{$prefs.freetags_3d_autoload|default:"true"}">
			<param name="cameraDistance" value="{$prefs.freetags_3d_camera_distance|default:"200"}">
			<param name="adjustCameraPosition" value="{$prefs.freetags_3d_adjust_camera|default:"true"}">
			<param name="fieldOfView" value="{$prefs.freetags_3d_fov|default:"250"}">
			<param name="nodeSize" value="{$prefs.freetags_3d_node_size|default:"30"}">
			<param name="textSize" value="{$prefs.freetags_3d_text_size|default:"40"}">
			<param name="frictionConstant" value="{$prefs.freetags_3d_friction_constant|default:"0.4f"}">
			<param name="elasticConstant" value="{$prefs.freetags_3d_elastic_constant|default:"0.5f"}">
			<param name="eletrostaticConstant" value="{$prefs.freetags_3d_eletrostatic_constant|default:"1000f"}">
			<param name="springSize" value="{$prefs.freetags_3d_spring_size|default:"100"}">
			<param name="nodeMass" value="{$prefs.freetags_3d_node_mass|default:"5"}">
			<param name="nodeCharge" value="{$prefs.freetags_3d_node_charge|default:"1"}">
		</applet>
	</div>
{/if}

<form class="freetagsearch" action="tiki-browse_freetags.php" method="get">
	<div class="freetagskeywords">
		<b>{tr}Tags{/tr}</b> 
		<input type="text" id="tagBox" name="tag" size="25" value="{$tagString|escape}">
		{button _onclick="clearTags(); return false;" _text="{tr}Clear{/tr}"}
		<input type="submit" value="{tr}Go{/tr}">
		<br>
		<input type="hidden" name="sort_mode" value="{$sort_mode|escape}">
		<input type="radio" name="broaden" id="stopb1" value="n"{if $broaden eq 'n'} checked="checked"{/if}>
		<label for="stopb1">{tr}With all selected tags{/tr}</label>
		<input type="radio" name="broaden" id="stopb2" value="y"{if $broaden eq 'y'} checked="checked"{/if}>
		<label for="stopb2">{tr}With one selected tag{/tr}</label>
		<input type="radio" name="broaden" id="stopb3" value="last"{if $broaden eq 'last'} checked="checked"{/if}>
		<label for="stopb3">{tr}With last selected tag{/tr}</label>
	</div>

	{if $prefs.freetags_browse_show_cloud eq 'y'}
		{jq notonready=true}
				function addTag(tag) {
					if (tag.search(/ /) >= 0) tag = '"'+tag+'"';
					document.getElementById('tagBox').value = document.getElementById('tagBox').value + ' ' + tag;	
				}
				function clearTags() {
					document.getElementById('tagBox').value = '';
				}
		{/jq}

		<div class="freetaglist"> 
			{foreach from=$most_popular_tags item=popular_tag}
				{capture name=tagurl}{if (strstr($popular_tag.tag, ' '))}"{$popular_tag.tag}"{else}{$popular_tag.tag}{/if}{/capture}
				<a class="freetag_{$popular_tag.size}{if $tag eq $popular_tag.tag|escape} selectedtag{/if}" href="tiki-browse_freetags.php?tag={$smarty.capture.tagurl|escape:'url'}" onclick="javascript:addTag('{$popular_tag.tag|escape:'javascript'}');return false;" ondblclick="location.href=this.href;"{if $popular_tag.color} style="color:{$popular_tag.color}"{/if}>{$popular_tag.tag|escape}</a> <commit_msg>[ENH] Browse Freetags: added autocomplete to the freetag search field (thanks to <NAME>, libertylion.ch)<commit_after>{* $Id$ *}

{title admpage=freetags}{tr}Browse related tags{/tr}{/title}

{if $prefs.feature_morcego eq 'y' and $prefs.freetags_feature_3d eq 'y'}
	<div class="morcego_embedded">
		<h2>{tr}Network of Tags related to:{/tr} <span id="currentTag1">{$tag}</span></h2>
		<applet codebase="./lib/wiki3d" archive="morcego-0.6.0.jar" code="br.arca.morcego.Morcego" width="{$prefs.freetags_3d_width}" height="{$prefs.freetags_3d_height}">
			<param name="serverUrl" value="{$base_url}tiki-freetag3d_xmlrpc.php">
			<param name="startNode" value="{$tag}">
			<param name="windowWidth" value="{$prefs.freetags_3d_width}">
			<param name="windowHeight" value="{$prefs.freetags_3d_height}">
			<param name="viewWidth" value="{$prefs.freetags_3d_width}">
			<param name="viewHeight" value="{$prefs.freetags_3d_height}">
			<param name="navigationDepth" value="{$prefs.freetags_3d_navigation_depth}">
			<param name="feedAnimationInterval" value="{$prefs.freetags_3d_feed_animation_interval}">
			<param name="controlWindowName" value="tiki">
			<param name="showArcaLogo" value="false">
			<param name="showMorcegoLogo" value="false">
			<param name="loadPageOnCenter" value="{$prefs.freetags_3d_autoload|default:"true"}">
			<param name="cameraDistance" value="{$prefs.freetags_3d_camera_distance|default:"200"}">
			<param name="adjustCameraPosition" value="{$prefs.freetags_3d_adjust_camera|default:"true"}">
			<param name="fieldOfView" value="{$prefs.freetags_3d_fov|default:"250"}">
			<param name="nodeSize" value="{$prefs.freetags_3d_node_size|default:"30"}">
			<param name="textSize" value="{$prefs.freetags_3d_text_size|default:"40"}">
			<param name="frictionConstant" value="{$prefs.freetags_3d_friction_constant|default:"0.4f"}">
			<param name="elasticConstant" value="{$prefs.freetags_3d_elastic_constant|default:"0.5f"}">
			<param name="eletrostaticConstant" value="{$prefs.freetags_3d_eletrostatic_constant|default:"1000f"}">
			<param name="springSize" value="{$prefs.freetags_3d_spring_size|default:"100"}">
			<param name="nodeMass" value="{$prefs.freetags_3d_node_mass|default:"5"}">
			<param name="nodeCharge" value="{$prefs.freetags_3d_node_charge|default:"1"}">
		</applet>
	</div>
{/if}
{jq}
	$('#tagBox').tiki('autocomplete', 'tag', {multiple: true, multipleSeparator: " "} );
{/jq}
<form class="freetagsearch" action="tiki-browse_freetags.php" method="get">
	<div class="freetagskeywords">
		<b>{tr}Tags{/tr}</b> 
		<input type="text" id="tagBox" name="tag" size="25" value="{$tagString|escape}">
		{button _onclick="clearTags(); return false;" _text="{tr}Clear{/tr}"}
		<input type="submit" value="{tr}Go{/tr}">
		<br>
		<input type="hidden" name="sort_mode" value="{$sort_mode|escape}">
		<input type="radio" name="broaden" id="stopb1" value="n"{if $broaden eq 'n'} checked="checked"{/if}>
		<label for="stopb1">{tr}With all selected tags{/tr}</label>
		<input type="radio" name="broaden" id="stopb2" value="y"{if $broaden eq 'y'} checked="checked"{/if}>
		<label for="stopb2">{tr}With one selected tag{/tr}</label>
		<input type="radio" name="broaden" id="stopb3" value="last"{if $broaden eq 'last'} checked="checked"{/if}>
		<label for="stopb3">{tr}With last selected tag{/tr}</label>
	</div>

	{if $prefs.freetags_browse_show_cloud eq 'y'}
		{jq notonready=true}
				function addTag(tag) {
					if (tag.search(/ /) >= 0) tag = '"'+tag+'"';
					document.getElementById('tagBox').value = document.getElementById('tagBox').value + ' ' + tag;	
				}
				function clearTags() {
					document.getElementById('tagBox').value = '';
				}
		{/jq}

		<div class="freetaglist"> 
			{foreach from=$most_popular_tags item=popular_tag}
				{capture name=tagurl}{if (strstr($popular_tag.tag, ' '))}"{$popular_tag.tag}"{else}{$popular_tag.tag}{/if}{/capture}
				<a class="freetag_{$popular_tag.size}{if $tag eq $popular_tag.tag|escape} selectedtag{/if}" href="tiki-browse_freetags.php?tag={$smarty.capture.tagurl|escape:'url'}" onclick="javascript:addTag('{$popular_tag.tag|escape:'javascript'}');return false;" ondblclick="location.href=this.href;"{if $popular_tag.color} style="color:{$popular_tag.color}"{/if}>{$popular_tag.tag|escape}</a> 
{'fraction_non_alphanumeric': 0.20062282908132711, 'fraction_numerical': 0.01461252844652054, 'mean_word_length': 7.494404883011191, 'pattern_counts': {'":': 0, '<': 108, '<?xml version=': 0, '>': 110, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6594244', 'n_tokens_mistral': 3411, 'n_tokens_neox': 3134, 'n_words': 442}