<commit_before><#import "../common/spring.ftl" as spring/>
<script src="${req.getContextPath()}/js/jquery.validate.js"></script>
<script type="text/javascript">
	
	$(document).ready(function(){
		<#if !(user?has_content)>
		$(".collapse").collapse();
		$("#user_pw_head").attr("href","");

		var userIdValidMsg;
		jQuery.validator.addMethod("userIdFmt", function(userId, element ) {
			var patrn = "^[a-zA-Z]{1}([a-zA-Z0-9]|[_]|[-]|[.]){0,19}$";
			var rule = new RegExp(patrn);
			if (!rule.test($.trim(userId))) {
				validateError(this);
				userIdValidMsg = "<@spring.message "user.info.warning.userId.intro"/>";
				return false;
			}
			return true;
		}, "<@spring.message 'user.info.warning.userId.invalid'/>" );
		
		
		jQuery.validator.addMethod("userPhoneNumber", function(mobilePhone, element ) {
			
			var patrn = /^\d{2}-\d{4}-\d{5}/;
			var rule = new RegExp(patrn);
			if (!rule.test($.trim($("#mobilePhone").val()))) {
				userIdValidMsg = "<@spring.message "user.info.warning.userId.intro"/>";
				return false;
			}
			return true;
		}, "<@spring.message 'user.info.warning.userId.invalid'/>" );
		
		
		

		jQuery.validator.addMethod("userIdExist", function( userId, element ) {
			if(userId != null && userId.length > 0){
				var result ;
				$.ajax({
					  url: "${req.getContextPath()}/user/checkUserId?userId="+userId,
					  async: false,
					  cache: false,
					  type: "GET",
					  dataType:'json',
					  success: function(res) {
					  	result = res.success;
  					  }
				}); 
				return result;
			}
			return false;
		}, "<@spring.message 'user.info.warning.userId.exist'/>");
		
		</#if>
		
		$('.collapse').on('hidden', function () {
  			$("#password").removeClass("required");
  			$("#cpwd").removeClass("required");
  			$("#cpwd").attr("equalTo","");
  			$("#password").val("");
  			$("#cpwd").val("");
		});
		
		$('.collapse').on('shown', function () {
			
  			$("#password").addClass("required");
  			$("#cpwd").addClass("required");
  			$("#cpwd").attr("equalTo","#password");

		});
		
		<commit_msg>[NGRINDER-42]UI element cleanup.<commit_after><#import "../common/spring.ftl" as spring/>
<script src="${req.getContextPath()}/js/jquery.validate.js"></script>
<script type="text/javascript">
	
	$(document).ready(function(){
		<#if !(user?has_content)>
		$(".collapse").collapse();
		$("#user_pw_head").attr("href","");

		var userIdValidMsg;
		jQuery.validator.addMethod("userIdFmt", function(userId, element ) {
			var patrn = "^[a-zA-Z]{1}([a-zA-Z0-9]|[_]|[-]|[.]){0,19}$";
			var rule = new RegExp(patrn);
			if (!rule.test($.trim(userId))) {
				validateError(this);
				userIdValidMsg = "<@spring.message "user.info.warning.userId.intro"/>";
				return false;
			}
			return true;
		}, "<@spring.message 'user.info.warning.userId.invalid'/>" );
		

		jQuery.validator.addMethod("userIdExist", function( userId, element ) {
			if(userId != null && userId.length > 0){
				var result ;
				$.ajax({
					  url: "${req.getContextPath()}/user/checkUserId?userId="+userId,
					  async: false,
					  cache: false,
					  type: "GET",
					  dataType:'json',
					  success: function(res) {
					  	result = res.success;
  					  }
				}); 
				return result;
			}
			return false;
		}, "<@spring.message 'user.info.warning.userId.exist'/>");
		
		</#if>
		
		jQuery.validator.addMethod("userPhoneNumber", function(mobilePhone, element ) {
			
			var patrn = /^\d{2}-\d{4}-\d{5}/;
			var rule = new RegExp(patrn);
			if (!rule.test($.trim($("#mobilePhone").val()))) {
				userIdValidMsg = "<@spring.message "user.info.warning.phone.intro"/>";
				return false;
			}
			return true;
		}, "<@spring.message 'user.info.warning.phone.intro'/>" );
		
		
		$('.collapse').on('hidden', function () {
  			$("#password").removeClass("required");
  			$("#cpwd").removeClass("required");
  			$("#cpwd").attr("equalTo","");
  			$("#password").val("");
  			$("#cpwd").val("");
		});
		
		$('.collapse').on('shown', function () {
			
  			$("#password").addClass("required");
  			$("#cpwd").addClass("required");
  			$("#cpwd").attr("equalTo","#password");

		});
		
		
{'fraction_non_alphanumeric': 0.2356084527568618, 'fraction_numerical': 0.005343696866650474, 'mean_word_length': 3.3301787592008414, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 27, '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': '1088070', 'n_tokens_mistral': 1677, 'n_tokens_neox': 1433, 'n_words': 204}