<commit_before><%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<html:form action="/nanoparticleFunction">
	<table width="100%" align="center">
		<tr>
			<td>
				<h4>
					<br>
					Particle ${submitType} Function
					<html:hidden property="function.type" value="${submitType}" />
				</h4>
			</td>
			<td align="right" width="15%">
				<a href="javascript:openHelpWindow('webHelp/caLAB_0.5/index.html?single=true&amp;context=caLAB_0.5&amp;topic=create_nanoparticle')" class="helpText">Help</a>
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<h5 align="center">
					${nanoparticleFunctionForm.map.particleName} (${nanoparticleFunctionForm.map.particleType})
				</h5>
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<jsp:include page="/bodyMessage.jsp?bundle=submit" />
				<jsp:include page="bodyFunctionSummary.jsp" />

				<%-- Function Linkage Agent --%>

				<table class="topBorderOnly" cellspacing="0" cellpadding="3" width="100%" align="center" summary="" border="0">
					<tbody>
						<tr class="topBorder">
							<td class="formTitle" colspan="4">
								<div align="justify">
									Linkage Information
								</div>
							</td>
						</tr>
						<tr>
							<td class="leftLabel">
								<strong>Number of Linkages </strong>
							</td>
							<td class="label">
								<c:choose>
									<c:when test="${canUserUpdateParticle eq 'true'}">
										<html:text property="function.numberOfLinkages" />
									</c:when>
									<c:otherwise>
										${nanoparticleFunctionForm.map.function.numberOfLinkages}&nbsp;
									</c:otherwise>
								</c:choose>
							</td>
							<td class="rightLabel" colspan="2">
								&nbsp;
								<c:choose>
									<c:when test="${canUserUpdateParticle eq 'true'}">
										<input type="button" onclick="javascript:updateFunctionLinkages()" value="Update Linkages">
									</c:when>
								</c:choose>
							</td>
						</tr>
						<tr>
							<td class="completeLabel" colspan="4">
								<logic:iterate id="linkage" name="nanoparticleFunctionForm" property="function.linkages" indexId="linkageInd">
									<table class="topBorderOnly" cellspacing="0" cellpadding="3" width="100%" align="center" summary="" border="0">
										<tbody>
											<tr class="topBorder">
												<td class="formSubTitle" colspan="4">
													<div align="justify">
														Linkage ${linkageInd+1}
													</div>
												</td>
											</tr>
											<tr>
												<td class="leftLabel">
													<strong>Linkage Type </strong>
												</td>
												<td class="rightlabel" colspan="3">
													<table cellspacing="0" cellpadding="3" width="100%" align="center" summary="" border="0">
														<c:choose>
															<c:when test="${canUserUpdateParticle eq 'true'}">
																<tr>
																	<td class="borderlessLabel">
																		<html:radio property="function.linkages[${linkageInd}].type" value="Attachment" />
																		Attachement
																	</td>
																	<td class="borderlessLabel">
																		<strong>Bond Type</strong>
																		<html:text property="function.linkages[${linkageInd}].bondType" />
																		&nbsp;
																	</td>
																</tr>
																<tr>
																	<td class="borderlessLabel">
																		<html:radio property="function.linkages[${linkageInd}].type" value="Encapsulation" />
																		Encapsulation
																	</td>
																	<td class="borderlessLabel">
																		<strong>Localization</strong>
																		<html:text property="function.linkages[${linkageInd}].localization" />
																		&nbsp;
																	</td>
																</tr>
																<tr>
																	<td class="borderlessLabel">
																		<html:radio property="function.linkages[${linkageInd}].type" value="Other" />
																		Other
																	</td>
																	<td></td>
																</tr>
															</c:when>
															<%--  read only view --%>
															<c:otherwise>
																<tr>
																	<td class="borderlessLabel">
																		${linkage.type}&nbsp;
																	</td>
																	<c:choose>
																		<c:when test="${linkage.type eq 'Attachment'}">
																			<td class="borderlessLabel">
																				<strong>Bond Type</strong>&nbsp;
																			</td>
																			<td class="borderlessLabel">
																				${linkage.bondType}&nbsp;
																			</td>
																		</c:when>
																		<c:when test="${linkage.type eq 'Encapsulation'}">
																			<td class="borderlessLabel">
																				<strong>Localization</strong>&nbsp;
																			</td>
																			<td class="rightLabel">
																				${linkage.localization}&nbsp;
																			</td>
																		</c:when>
																		<c:when test="${agentType eq 'Other'}">
																			<td class="borderlessLabel">
																				<strong>Other</strong>&nbsp;
																			</td>
																			<td class="borderlessLabel">
																				&nbsp;
																			</td>
																		</c:when>
																	</c:choose>
																</tr>
															</c:otherwise>
														</c:choose>
													</table>
												</td>
											</tr>
											<tr>
												<td class="leftLabel">
													<Strong>Linkage Description</Strong>
												</td>
												<td class="rightLabel" colspan="3">
													<c:choose>
														<c:when test="${canUserUpdateParticle eq 'true'}">
															<html:textarea property="function.linkages[${linkageInd}].description" rows="3" cols="50" />
														</c:when>
														<c:otherwise>
															${linkage.description}&nbsp;
														</c:otherwise>
													</c:choose>
												</td>
											</tr>
											<tr>
												<td class="leftLabel" width="15%">
													<strong>Agent Type</strong>
												</td>
												<td class="rightLabel" colspan="3">
													<table cellspacing="0" cellpadding="3" width="100%" align="center" summary="" border="0">
														<c:choose>
															<%-- read and write view --%>
															<c:when test="${canUserUpdateParticle eq 'true'}">
																<c:forEach var="agentType" items="${allAgentTypes[submitType]}" varStatus="status">
																	<tr>
																		<td class="borderlessLabel">
																			<html:radio property="function.linkages[${linkageInd}].agent.type" value="${agentType}" />
																			${agentType}
																		</td>
																		<c:choose>
																			<c:when test="${agentType eq 'Peptide'}">
																				<td class="borderlessLabel" colspan="2">
																					<strong>Sequence</strong>
																					<html:text property="function.linkages[${linkageInd}].peptide.sequence" size="50" />
																				</td>
																			</c:when>
																			<c:when test="${agentType eq 'DNA'}">
																				<td class="borderlessLabel" colspan="2">
																					<strong>Sequence</strong><commit_msg>added onclick events on radio buttons<commit_after><%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<script language="JavaScript">
<!--
function clearOtherAgents(agentType, elementPrefix) {
	var sequenceTypes=new Array('peptide', 'dna');
	var nameTypes=new Array('smallMolecule', 'antibody', 'probe', 'imageContrastAgent');
	var typeTypes=new Array('probe', 'imageContrastAgent');
	
	for (var i=0; i<sequenceTypes.length; i++) {
	  disableTextElement(nanoparticleFunctionForm, elementPrefix+'.'+sequenceTypes[i]+'.sequence');	  
	}	
	for (var i=0; i<nameTypes.length; i++) {
	  disableTextElement(nanoparticleFunctionForm, elementPrefix+'.'+nameTypes[i]+'.name');
	}
	for (var i=0; i<typeTypes.length; i++) {
	  disableTextElement(nanoparticleFunctionForm, elementPrefix+'.'+typeTypes[i]+'.type');
	}	
	disableTextElement(nanoparticleFunctionForm, elementPrefix+'.antibody.species');
	disableTextElement(nanoparticleFunctionForm, elementPrefix+'.smallMolecule.compoundName');
	
	if (agentType =='Peptide') {
	  enableTextElement(nanoparticleFunctionForm, elementPrefix+'.peptide.sequence');
	}
	else if (agentType=='DNA') {
	  enableTextElement(nanoparticleFunctionForm, elementPrefix+'.dna.sequence');
	}
	else if (agentType=='Antibody') {
	  enableTextElement(nanoparticleFunctionForm, elementPrefix+'.antibody.name');
	  enableTextElement(nanoparticleFunctionForm, elementPrefix+'.antibody.species');
	}
	else if (agentType=='Small Molecule') {
	  enableTextElement(nanoparticleFunctionForm, elementPrefix+'.smallMolecule.name');
	  enableTextElement(nanoparticleFunctionForm, elementPrefix+'.smallMolecule.compoundName');
	}
	else if (agentType=='Probe') {
	  enableTextElement(nanoparticleFunctionForm, elementPrefix+'.probe.name');
	  enableTextElement(nanoparticleFunctionForm, elementPrefix+'.probe.type');
	}
	else if (agentType=='Image Contrast Agent') {
	  enableTextElement(nanoparticleFunctionForm, elementPrefix+'.imageContrastAgent.name');
	  enableTextElement(nanoparticleFunctionForm, elementPrefix+'.imageContrastAgent.type');
	}
}
//-->
</script>
<html:form action="/nanoparticleFunction">
	<table width="100%" align="center">
		<tr>
			<td>
				<h4>
					<br>
					Particle ${submitType} Function
					<html:hidden property="function.type" value="${submitType}" />
				</h4>
			</td>
			<td align="right" width="15%">
				<a href="javascript:openHelpWindow('webHelp/caLAB_0.5/index.html?single=true&amp;context=caLAB_0.5&amp;topic=create_nanoparticle')" class="helpText">Help</a>
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<h5 align="center">
					${nanoparticleFunctionForm.map.particleName} (${nanoparticleFunctionForm.map.particleType})
				</h5>
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<jsp:include page="/bodyMessage.jsp?bundle=submit" />
				<jsp:include page="bodyFunctionSummary.jsp" />

				<%-- Function Linkage Agent --%>

				<table class="topBorderOnly" cellspacing="0" cellpadding="3" width="100%" align="center" summary="" border="0">
					<tbody>
						<tr class="topBorder">
							<td class="formTitle" colspan="4">
								<div align="justify">
									Linkage Information
								</div>
							</td>
						</tr>
						<tr>
							<td class="leftLabel">
								<strong>Number of Linkages </strong>
							</td>
							<td class="label">
								<c:choose>
									<c:when test="${canUserUpdateParticle eq 'true'}">
										<html:text property="function.numberOfLinkages" />
									</c:when>
									<c:otherwise>
										${nanoparticleFunctionForm.map.function.numberOfLinkages}&nbsp;
									</c:otherwise>
								</c:choose>
							</td>
							<td class="rightLabel" colspan="2">
								&nbsp;
								<c:choose>
									<c:when test="${canUserUpdateParticle eq 'true'}">
										<input type="button" onclick="javascript:updateFunctionLinkages()" value="Update Linkages">
									</c:when>
								</c:choose>
							</td>
						</tr>
						<tr>
							<td class="completeLabel" colspan="4">
								<logic:iterate id="linkage" name="nanoparticleFunctionForm" property="function.linkages" indexId="linkageInd">
									<table class="topBorderOnly" cellspacing="0" cellpadding="3" width="100%" align="center" summary="" border="0">
										<tbody>
											<tr class="topBorder">
												<td class="formSubTitle" colspan="4">
													<div align="justify">
														Linkage ${linkageInd+1}
													</div>
												</td>
											</tr>
											<tr>
												<td class="leftLabel">
													<strong>Linkage Type </strong>
												</td>
												<td class="rightlabel" colspan="3">
													<table cellspacing="0" cellpadding="3" width="100%" align="center" summary="" border="0">
														<c:choose>
															<c:when test="${canUserUpdateParticle eq 'true'}">
																<tr>
																	<td class="borderlessLabel">
																		<html:radio property="function.linkages[${linkageInd}].type" value="Attachment"
																			onclick="javascript:disableTextElement(this.form, 'function.linkages[${linkageInd}].localization');enableTextElement(this.form, 'function.linkages[${linkageInd}].bondType');" />
																		Attachement
																	</td>
																	<td class="borderlessLabel">
																		<strong>Bond Type</strong>
																		<html:text property="function.linkages[${linkageInd}].bondType" />
																		&nbsp;
																	</td>
																</tr>
																<tr>
																	<td class="borderlessLabel">
																		<html:radio property="function.linkages[${linkageInd}].type" value="Encapsulation"
																			onclick="javascript:disableTextElement(this.form, 'function.linkages[${linkageInd}].bondType');enableTextElement(this.form, 'function.linkages[${linkageInd}].localization');" />
																		Encapsulation
																	</td>
																	<td class="borderlessLabel">
																		<strong>Localization</strong>
																		<html:text property="function.linkages[${linkageInd}].localization" />
																		&nbsp;
																	</td>
																</tr>
																<tr>
																	<td class="borderlessLabel">
																		<html:radio property="function.linkages[${linkageInd}].type" value="Other"
																			onclick="javascript:disableTextElement(this.form, 'function.linkages[${linkageInd}].localization');disableTextElement(this.form, 'function.linkages[${linkageInd}].bondType');" />
																		Other
																	</td>
																	<td></td>
																</tr>
															</c:when>
															<%--  read only view --%>
															<c:otherwise>
																<tr>
																	<td class="borderlessLabel">
																		${linkage.type}&nbsp;
																	</td>
																	<c:choose>
																		<c:when test="${linkage.type eq 'Attachment'}">
																			<td class="borderlessLabel">
																				<strong>Bond Type</strong>&nbsp;
																			</td>
																			<td class="borderlessLabel">
																				${linkage.bondType}&nbsp;
																			</td>
																		</c:when>
																		<c:when test="${linkage.type eq 'Encapsulation'}">
																			<td class="borderlessLabel">
																				<strong>Localization</strong>&nbsp;
																			</td>
																			<td class="rightLabel">
																				${linkage.localization}&nbsp;
																			</td>
																		</c:when>
																		<c:when test="${agentType eq 'Other'}">
																			<td class="borderlessLabel">
																				<strong>Other</strong>&nbsp;
																			</td>
																			<td class="borderlessLabel">
																				&nbsp;
																			</td>
																		</c:when>
																	</c:choose>
																</tr>
															</c:otherwise>
														</c:choose>
													</table>
												</td>
											</tr>
											<tr>
												<td class="leftLabel">
													<Strong>Linkage Description</Strong>
												</td>
												<td class="rightLabel" colspan="3">
													<c:choose>
														<c:when test="${canUserUpdateParticle eq 'true'}">
															<html:textarea property="function.linkages[${linkageInd}].description" rows="3" cols="50" />
														</c:when>
														<c:otherwise>
															${linkage.description}&nbsp;
														</c:otherwise>
													</c:choose>
												</td>
											</tr>
											<tr>
												<td class="leftLabel" width="15%">
													<strong>Agent Type</strong>
												</td>
												<td class="rightLabel" colspan="3">
													<table cellspacing="0" cellpadding="3" width="100%" align="center" summary="" border="0">
														<c:choose>
															<%-- read and write view --%>
															<c:when test="${canUserUpdateParticle eq 'true'}">
																<c:forEach var="agentType" items="${allAgentTypes[submitType]}" varStatus="status">
																	<tr>
																		<td class="borderlessLabel">
																			<html:radio property="function.linkages[${linkageInd}].agent.type" value="${agentType}" onclick="javascript:clearOtherAgents('${agentType}', 'function.linkages[${linkageInd}]')" />
																			${agentType}
																		</td>
																		<c:choose>
																			<c:when test="${agentType eq 'Peptide'}">
																				<td class="borderlessLabel" colspan="2">
																					<strong>Sequence</strong>
																					<html:text property="function.linkages[${linkageInd}].peptide.sequence" size="50" />
																				</td>
																			</c:when>
																			<c:when test="${agentType eq 'DNA'}">
																				<td class="borderlessLabel" colspan="2">
																					<strong>Sequence</strong>
{'fraction_non_alphanumeric': 0.1572049935039259, 'fraction_numerical': 0.006496074111732475, 'mean_word_length': 1.882448713774015, 'pattern_counts': {'":': 0, '<': 383, '<?xml version=': 0, '>': 380, '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': '6261937', 'n_tokens_mistral': 9035, 'n_tokens_neox': 5236, 'n_words': 823}