<!DOCTYPE html>
<html lang="ko"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	layout:decorator="mob/common/layout/MypageLayoutMob">
<!--
 *******************************************************************************
 * @source  : MypageReviewCreateFormMob.html
 * @desc    : 마이페이지 > 리뷰 작성Page
 *============================================================================
 * STYLE24
 * Copyright(C) 2020 TSIT, All rights reserved.
 *============================================================================
 * VER  DATE         AUTHOR      DESCRIPTION
 * ===  ===========  ==========  =============================================
 * 1.0  2021.05.11   sowon     최초 작성
 *******************************************************************************
 -->
<body>
<th:block layout:fragment="content">
<main role="" id="" class="container my">
			<section class="content review">
				<form class="form_wrap" id="reviewForm"  th:action="@{'/mypage/review/save'}" th:with="imageUrl=${@environment.getProperty('upload.goods.view')}">
				<input type="hidden" name="ordNo" th:value="${reviewInfo.ordNo}">
						<input type="hidden" name="ordDtlNo" th:value="${reviewInfo.ordDtlNo}">
						<input type="hidden" name="goodsCd" th:value="${reviewInfo.goodsCd}">
						<input type="hidden" name="custNo" th:value="${reviewInfo.custNo}">
						<input type="hidden" name="reviewStat" th:value="${reviewStat}">
						<input type="hidden" name="reviewSq" th:if="${reviewStat == 'u'}" th:value="${reviewInfo.reviewSq}">
					<div class="inner bg_gray">
						<ul class="note">
							<li>일반 리뷰 작성 시 150P, 포토/영상 리뷰는 350P가 추가 적립됩니다!</li>
							<li>상품기준, 월 최대 10개의 상품까지 작성 및 적립 가능합니다.<br>(동일상품의 옵션만 상이한 경우는 적립되지 않음)</li>
							<li>베스트 리뷰로 선정되면 10,000P가 추가 적립됩니다!</li>
							<li>리뷰는 주문일 기준 90일간 작성이 가능합니다.</li>
						</ul>
					</div>
					<div class="inner">
						<div class="part_goods">
							<!-- 굿즈_리뷰 -->
							<div class="goods_section">
								<div class="goods_detail">
									<a th:onclick="cfnGoToGoodsDetail([[${ reviewInfo.goodsCd}]])" >
										<div class="thumb_box">
											<img th:src="${imageUrl + '/' + reviewInfo.sysImgNm}" alt="tmp_pdClickother1">
										</div>
										<div class="info_box">
											<div class="od_name">
												<div class="goods_date"><span class="date" th:text="${reviewInfo.ordDt}"></span> 구매</div>
												<div class="brand">
													<span th:text="${reviewInfo.brandNm}"></span>
												</div>
												<div class="name" th:text="${reviewInfo.goodsNm}"></div>
											</div>
											<div class="od_opt">
												<div class="option" id="optionDiv">
													<!-- <em>Black</em><em>XXL</em> -->
												</div>
											</div>
										</div>
									</a>
								</div>
							</div>
							<!-- //굿즈_리뷰 -->
						</div>
					</div>
					<div class="inner">
						<div class="titWrap">
							<div class="">별점을 선택해주세요</div>
						</div>
						<div class="review_score">
							<div id="star_grade">
								<input type="hidden" id="score" name="score">
								<button type="button" id="starBtn"></button>
								<button type="button" id="starBtn"></button>
								<button type="button" id="starBtn"></button>
								<button type="button" id="starBtn"></button>
								<button type="button" id="starBtn"></button>
							</div>
						</div>
					</div>
					<div class="inner">
						<div class="my_edit_section">
							<div class="tbl_wrap">
								<div class="tbl_tit">
									<h3>키/몸무게</h3>
								</div>
								<div class="tbl">
									<div class="tbl_row">
										<table>
											<colgroup>
												<col width="*">
											</colgroup>
											<tr>
												<th>키</th>
												<td>
													<div class="form_field rev_height">
														<input type="number" pattern="\d*" class="form_control" oninput='handleOnInput(this, 3)' id="height" name="height" data-valid-type="numeric" placeholder="키를 숫자만 입력해주세요."><span>cm</span>
													</div>
												</td>
											</tr>
											<tr>
												<th>몸무게</th>
												<td>
													<div class="form_field rev_height">
														<input type="number" pattern="\d*" class="form_control" oninput='handleOnInput(this, 3)' id="weight" name="weight" data-valid-type="numeric" placeholder="몸무게를 숫자만 입력해주세요."><span>kg</span>
													</div>
												</td>
											</tr>
										</table>
									</div>
								</div>
							</div>
							<th:block th:if="${reviewInfo.sizeGb == 'T' or reviewInfo.sizeGb == 'B' or reviewInfo.sizeGb == 'S'}">
							<div class="tbl_wrap">
								<div class="tbl_tit">
									<h3>상품평가</h3>
								</div>
								<div class="tbl">
									<div class="tbl_row">
										<table data-name="rating">
											<colgroup>
												<col width="*">
											</colgroup>
											<th:block th:if="${reviewInfo.sizeGb == 'T' or reviewInfo.sizeGb == 'B' or reviewInfo.sizeGb == 'S'}">
											<tr>
												<th>사이즈</th>
												<td>
													<div class="form_field review_radio">
														<div class="radio_li">
															<input id="chk-1" type="radio" name="scoreSize" value="1"><label for="chk-1"> <span>작음</span></label>
														</div>
														<div class="radio_li">
															<input id="chk-2" type="radio" name="scoreSize" value="2"><label for="chk-2"> <span>딱맞음</span></label>
														</div>
														<div class="radio_li">
															<input id="chk-3" type="radio" name="scoreSize" value="3"><label for="chk-3"> <span>큼</span></label>
														</div>
													</div>
												</td>
											</tr>
											<tr>
												<th>컬러</th>
												<td>
													<div class="form_field review_radio">
														<div class="radio_li">
															<input id="chk-4" type="radio" name="scoreColor" value="1"><label for="chk-4"> <span>밝음</span></label>
														</div>
														<div class="radio_li">
															<input id="chk-5" type="radio" name="scoreColor" value="2"><label for="chk-5"> <span>똑같음</span></label>
														</div>
														<div class="radio_li">
															<input id="chk-6" type="radio" name="scoreColor" value="3"><label for="chk-6"> <span>어두움</span></label>
														</div>
													</div>
												</td>
											</tr>
											</th:block>
											<th:block th:if="${reviewInfo.sizeGb == 'T' or reviewInfo.sizeGb == 'B'}">
											<tr>
												<th>핏</th>
												<td>
													<div class="form_field review_radio">
														<div class="radio_li">
															<input id="chk-7" type="radio" name="scoreFit" value="1"><label for="chk-7"> <span>슬림</span></label>
														</div>
														<div class="radio_li">
															<input id="chk-8" type="radio" name="scoreFit" value="2"><label for="chk-8"> <span>레귤러</span></label>
														</div>
														<div class="radio_li">
															<input id="chk-9" type="radio" name="scoreFit" value="3"><label for="chk-9"> <span>오버</span></label>
														</div>
													</div>
												</td>
											</tr>
											<tr>
												<th>두께감</th>
												<td>
													<div class="form_field review_radio">
														<div class="radio_li">
															<input id="chk-10" type="radio" name="scoreThick" value="1"><label for="chk-10"> <span>얇음</span></label>
														</div>
														<div class="radio_li">
															<input id="chk-11" type="radio" name="scoreThick" value="2"><label for="chk-11"> <span>적당함</span></label>
														</div>
														<div class="radio_li">
															<input id="chk-12" type="radio" name="scoreThick" value="3"><label for="chk-12"> <span>도톰함</span></label>
														</div>
													</div>
												</td>
											</tr>
											</th:block>
											<th:block th:if="${reviewInfo.sizeGb == 'S'}">
											<tr>
												<th>무게감</th>
												<td>
													<div class="form_field review_radio">
														<div class="radio_li">
															<input id="chk-13" type="radio" name="scoreWeight" value="1"><label for="chk-13"> <span>가벼움</span></label>
														</div>
														<div class="radio_li">
															<input id="chk-14" type="radio" name="scoreWeight" value="2"><label for="chk-14"> <span>적당함</span></label>
														</div>
														<div class="radio_li">
															<input id="chk-15" type="radio" name="scoreWeight" value="3"><label for="chk-15"> <span>무거움</span></label>
														</div>
													</div>
												</td>
											</tr>
											<tr>
												<th>볼너비</th>
												<td>
													<div class="form_field review_radio">
														<div class="radio_li">
															<input id="chk-16" type="radio" name="scoreBall" value="1"><label for="chk-16"> <span>작음</span></label>
														</div>
														<div class="radio_li">
															<input id="chk-17" type="radio" name="scoreBall" value="2"><label for="chk-17"> <span>딱맞음</span></label>
														</div>
														<div class="radio_li">
															<input id="chk-18" type="radio" name="scoreBall" value="3"><label for="chk-18"> <span>큼</span></label>
														</div>
													</div>
												</td>
											</tr>
											</th:block>
										</table>
									</div>
								</div>
							</div>
							</th:block>
							<div class="tbl_wrap">
								<div class="tbl">
									<div class="tbl_row">
										<table>
											<colgroup>
												<col width="*">
											</colgroup>
											<tr>
												<th>
													<span class="tit">고객님의 리뷰가<br>다른 고객님께 도움이 될 수 있어요! </span>

													<div class="tip_wrap tip2" >
														<div class="tip_tit">?</div>
														<div class="tip_contents">
															<ul>
																<li>리뷰 내용은 최소 10자 이상 입력해주세요.</li>
																<li>상품과 무관하거나 스팸, 음란, 불법적인 내용의 리뷰는 통보없이 삭제되며, 지금된 포인트는 회수 될 수 있습니다.</li>
															</ul>
														</div>
													</div>
												</th>
												<td>
													<div class="textarea_wrap">
													<textarea class="doc_review" name="reviewContent" id="reviewContent" cols="30" rows="10" maxlength="500"></textarea>
													<p class="txt_cnt"><span id="review_cnt" class="c_primary">0</span>/500</p>
													</div>
												</td>
											</tr>
											
											<tr>
												<th>
													<span class="tit">포토/영상 첨부</span>
												</th>
												<td>
													<div class="form_field">
														<div class="input_wrap">
															<!-- 이미지첨부 -->
															<div class="form_field">
																<div class="imgUpload">
																	<label for="fileAdd" class="fileAdd" id="fileAdd_reply">첫번째업로드</label>
																	<input type="file" id="fileAdd" name="files" accept="image/png, image/jpeg, image/jpg, video/mp4, video/x-m4v"> <!-- 210507_추가 : accept 속성 추가 -->
																</div>
															</div>
															<!-- //이미지첨부 -->
														</div>
													</div>

													<p class="review_desc">최대 10개까지 등록 가능</p>
													<p class="review_desc">동영상 첨부 시 관리자 승인이 필요하여 바로 노출이 되지 않을 수 있습니다.</p>
												</td>
											</tr>

										</table>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="inner">
						<div class="goods_btn_wrap btn_group_flex">
							<div><button type="button" id="btn_review_cancle" class="btn btn_default" onclick="reviewCancel()"><span>취소</span></button></div>
							<div th:if="${reviewStat == 'c'}"><button type="button" id="btn_review_confirm" class="btn btn_dark"  onclick="reviewCreate()"><span>등록</span></button></div>
							<div th:if="${reviewStat == 'u'}"><button type="button" id="btn_review_confirm" class="btn btn_dark"  onclick="reviewUpdate()"><span>수정</span></button></div>
						</div>
					</div>
				</form>
			</section>
		</main>
<script type="text/javascript" src="/ux/plugins/gaga/gaga.kollus.js"></script>
<script type="text/javascript" src="/ux/plugins/load-image.all.min.js"></script>
<script th:inline="javascript">
let reviewList = [[${reviewInfo}]];
let reviewStat = [[${reviewStat}]];
let reviewAttach = [[${alreadyReviewAttach}]];

//별점 class="on"
var $starEls = $('#star_grade button#starBtn');
var rate = 1;

$starEls.each(function (index, el) {
    $(el).on('click', function () {
        rating(index);
        $("#score").attr("value",index+1);
    });
});


function rating(score) {
    $starEls.each(function (i, el) {
        if (i <= score) {
            $(el).addClass('on');
        } else {
            $(el).removeClass('on');
        }
    });

    rate = score;
}

// 리뷰  취소
var reviewCancel = function() {

	mcxDialog.confirm('취소하시겠습니까?', {
        cancelBtnText: "취소",
        sureBtnText: "확인",
        sureBtnClick: function(){
        	cfnGoToPage(_PAGE_MYPAGE_REVIEW);
        }
    });
}


//리뷰 등록
var reviewCreate = function () {
	if($("#score").val()=='' || $("#score").val()==null){
		mcxDialog.alert('별점을 선택하세요.');
		return;
	}


	// 2021.08.11 이슈리스트 수정사항 선택값으로등록
	//if($("#reviewForm input[name=height]").val() == '' || $("#reviewForm input[name=height]").val() == null){
	//	mcxDialog.alert('키를 입력하세요.');
	//	return;
	//}

	//if($("#reviewForm input[name=weight]").val() == '' || $("#reviewForm input[name=weight]").val() == null){
	//	mcxDialog.alert('몸무게를 입력하세요.');
	//	return;
	//}

	if(reviewList.sizeGb == 'T' || reviewList.sizeGb == 'B' || reviewList.sizeGb == 'S'){
		if($('#reviewForm input:radio[name=scoreSize]:checked').length == 0){
			mcxDialog.alert('상품 사이즈를 평가해주세요.');
			return false;
		}

		if($('#reviewForm input:radio[name=scoreColor]:checked').length == 0){
			mcxDialog.alert('상품 컬러를 평가해주세요.');
			return false;
		}
	}

	if(reviewList.sizeGb == 'T' || reviewList.sizeGb == 'B'){
		if($('#reviewForm input:radio[name=scoreFit]:checked').length == 0){
			mcxDialog.alert('상품 핏을 평가해주세요.');
			return false;
		}
		if($('#reviewForm input:radio[name=scoreThick]:checked').length == 0){
			mcxDialog.alert('상품 두께감을 평가해주세요.');
			return false;
		}
	}

	if(reviewList.sizeGb == 'S' ){
		if($('#reviewForm input:radio[name=scoreWeight]:checked').length == 0){
			mcxDialog.alert('상품 무게감을 평가해주세요.');
			return false;
		}

		if($('#reviewForm input:radio[name=scoreBall]:checked').length == 0){
			mcxDialog.alert('상품 볼넓이를 평가해주세요.');
			return false;
		}
	}

	if($('#reviewContent').val().length<10){
		mcxDialog.alert("리뷰 내용을 10자 이상 입력해주세요.");
		return false;
	}


	mcxDialog.confirm('리뷰를 등록하시겠습니까?', {
     cancelBtnText: "취소",
     sureBtnText: "확인",
     sureBtnClick: function(){
     	gagajf.ajaxFormSubmit($('#reviewForm').prop('action'), '#reviewForm', fnSaveCallback, true);
     }
 });


}


//리뷰 수정
var reviewUpdate = function() {

	if($("#reviewForm input[name=height]").val() == '' || $("#reviewForm input[name=height]").val() == null){
		mcxDialog.alert('키를 입력하세요.');
		return;
	}

	if($("#reviewForm input[name=weight]").val() == '' || $("#reviewForm input[name=weight]").val() == null){
		mcxDialog.alert('몸무게를 입력하세요.');
		return;
	}

	if($('#reviewContent').val().length<10){
		mcxDialog.alert("리뷰 내용을 10자 이상 입력해주세요.");
		return;
	}

	mcxDialog.confirm('리뷰를 수정하시겠습니까?', {
     cancelBtnText: "취소",
     sureBtnText: "확인",
     sureBtnClick: function(){
     	gagajf.ajaxFormSubmit("/mypage/review/update", '#reviewForm', fnUpdateCallback);
     }
 });
}

var fnSaveCallback = function (result) {
	// 2021.08.11
	if(result.status == "200"){
		if (result.resultStr == "SUCESS") {
			if (document.getElementsByName("kufKeyArr").length>0 || document.getElementsByName("orgFileNmArr").length>0) {
				mcxDialog.confirm("상품리뷰를 등록 하였습니다. 350P 적립 예정입니다.", {
					sureBtnText: "확인",
					sureBtnClick: function() {
						cfnGoToPage(_PAGE_MYPAGE_REVIEW);
					}
				});
			}else{
				mcxDialog.confirm("상품리뷰를 등록 하였습니다. 150P 적립 예정입니다.", {
					sureBtnText: "확인",
					sureBtnClick: function() {
						cfnGoToPage(_PAGE_MYPAGE_REVIEW);
					}
				});
			}
		}
		else {
			mcxDialog.confirm("상품리뷰를 등록 하였습니다.", {
				sureBtnText: "확인",
				sureBtnClick: function() {
					cfnGoToPage(_PAGE_MYPAGE_REVIEW);
				}
			});
		}
	}
}

var fnUpdateCallback = function (result) {
	if(result.status == "200"){
		mcxDialog.confirm("상품 리뷰를 수정하였습니다.", {
			sureBtnText: "확인",
			sureBtnClick: function() {
				cfnGoToPage(_PAGE_MYPAGE_REVIEW);
			}
		});

	}
}

//header scroll
$(document).on('click', '.tabIndex li a', function() {


	var $this = $(this),
		$tabList = $this.parents('ul'),
		_idx = $this.closest('li').index();

	$tabList.children().eq(_idx).addClass('active').siblings().removeClass('active');
	$tabList.next().children().eq(_idx).addClass('active').siblings().removeClass('active');
});

$(function(){

	$('#htopTitle').text('리뷰 쓰기');
	var tag = '';

	if (reviewList.goodsType == 'G056_S') {
		tag += '<em>';
		$.each(reviewList.colorNmArr, function(index, option) {

			tag += reviewList.itemNmArr[index] + ' / ' + option + '<br>';
		});
		tag += '</em>';
		$("#optionDiv").append(tag);
	}else{
		tag += '<em>';
		tag += reviewList.optCd1+' / '+reviewList.optCd2;
		tag += '</em>';
		$(".option").append(tag);
	}


	 if(reviewStat=='u'){
		 var reviewScore = reviewList.score;
		 $("#score").val(reviewScore);
		 rating(reviewScore-1);
		$("#reviewForm input[name=height]").val(reviewList.height);
		$("#reviewForm input[name=weight]").val(reviewList.weight);
		$("#reviewForm textarea[name=reviewContent]").val(reviewList.reviewContent.escapeHtml());
		if(reviewList.scoreSize == "1"){
			$('#reviewForm input:radio[name=scoreSize]:radio[value="1"]').prop('checked', true);
		}else if(reviewList.scoreSize == "2"){
			$('#reviewForm input:radio[name=scoreSize]:radio[value="2"]').prop('checked', true);
		}else if(reviewList.scoreSize == "3"){
			$('#reviewForm input:radio[name=scoreSize]:radio[value="3"]').prop('checked', true);
		}

		if(reviewList.scoreColor == "1"){
			$('#reviewForm input:radio[name=scoreColor]:radio[value="1"]').prop('checked', true);
		}else if(reviewList.scoreColor == "2"){
			$('#reviewForm input:radio[name=scoreColor]:radio[value="2"]').prop('checked', true);
		}else if(reviewList.scoreColor == "3"){
			$('#reviewForm input:radio[name=scoreColor]:radio[value="3"]').prop('checked', true);
		}

		if(reviewList.scoreFit == "1"){
			$('#reviewForm input:radio[name=scoreFit]:radio[value="1"]').prop('checked', true);
		}else if(reviewList.scoreFit == "2"){
			$('#reviewForm input:radio[name=scoreFit]:radio[value="2"]').prop('checked', true);
		}else if(reviewList.scoreFit == "3"){
			$('#reviewForm input:radio[name=scoreFit]:radio[value="3"]').prop('checked', true);
		}

		if(reviewList.scoreThick == "1"){
			$('#reviewForm input:radio[name=scoreThick]:radio[value="1"]').prop('checked', true);
		}else if(reviewList.scoreThick == "2"){
			$('#reviewForm input:radio[name=scoreThick]:radio[value="2"]').prop('checked', true);
		}else if(reviewList.scoreThick == "3"){
			$('#reviewForm input:radio[name=scoreThick]:radio[value="3"]').prop('checked', true);
		}

		if(reviewList.scoreWeight == "1"){
			$('#reviewForm input:radio[name=scoreWeight]:radio[value="1"]').prop('checked', true);
		}else if(reviewList.scoreWeight == "2"){
			$('#reviewForm input:radio[name=scoreWeight]:radio[value="2"]').prop('checked', true);
		}else if(reviewList.scoreWeight == "3"){
			$('#reviewForm input:radio[name=scoreWeight]:radio[value="3"]').prop('checked', true);
		}

		if(reviewList.scoreBall == "1"){
			$('#reviewForm input:radio[name=scoreBall]:radio[value="1"]').prop('checked', true);
		}else if(reviewList.scoreBall == "2"){
			$('#reviewForm input:radio[name=scoreBall]:radio[value="2"]').prop('checked', true);
		}else if(reviewList.scoreBall == "3"){
			$('#reviewForm input:radio[name=scoreBall]:radio[value="3"]').prop('checked', true);
		}

		if(reviewAttach.length>0){
			for (var i = 0; i < reviewAttach.length; i++) {
				if(reviewAttach[i].reviewSq == reviewList.reviewSq){
					if(reviewAttach[i].fileGb == "I"){
						$("<span class=\"pics\">" +
								"<img class=\"picsThumbs\" src=\"" + _uploadImageUrl + '/' + reviewAttach[i].sysFileNm + "\" />" +
								"<input type='hidden' name='orgFileNmArr' value='"+reviewAttach[i].orgFileNm+"'>" +
								"<input type='hidden' name='sysFileNmArr' value='"+reviewAttach[i].sysFileNm+"'>" +
								"<br/><span class=\"removes\">Removes image</span>" +
								"</span>").insertBefore(".fileAdd");
					}else{
						$("<span class=\"pics mov\">" +
								"<img class=\"picsThumbs\" src=\"" + _kollusMediaUrl + '/poster/' + reviewAttach[i].kmcKey + "\"/>" +
								"<input type='hidden' name='kmcKeyArr' value='" + reviewAttach[i].kmcKey + "'>" +
								"<input type='hidden' name='kufKeyArr' value='" + reviewAttach[i].kufKey + "'>" +
								"<br/><span class=\"removes\">Removes image</span>" +
								"</span>").insertBefore(".fileAdd");
					}
				}

			}
			$(".removes").click(function(){
				$(this).parent(".pics").remove();
			});

		}
	}

	$(window).scroll(function(){
		var scroll = $(this).scrollTop();
		var headerH = $(".header").height();
		if ($(window).scrollTop() > headerH){
			$(".header").addClass("minify");
			return false;
		}
		else {
			$(".header").removeClass("minify");
			return false;
		}
	});

	$('#star_grade button').click(function(){
		$(this).parent().children("button").removeClass("on");  /* 별점의 on 클래스 전부 제거 */
		$(this).addClass("on").prevAll("button").addClass("on"); /* 클릭한 별과, 그 앞 까지 별점에 on 클래스 추가 */
		return false;
	});

	//리뷰 내용 글자 수 제한
	$('.doc_review').keyup(function (e){
		var content = $(this).val();
		$('#review_cnt').html(content.length);
		if (content.length > 500){
			$(this).val(content.substring(0, 500));
			$('#review_cnt').html("500");
		}
	});

	$('.doc_review').bind('input paste', function() {
		  $(this).trigger('keyup');
	});
});

$('#fileAdd').on('change', function() { fnChooseFile(this); });

var fnChooseFile = function(obj) {
	var picLength = $(".pics").length;

	// multiple 속성이 있으면 files에는 다수의 객체가 할당됨
	var file = obj.files[0];
	var fileType = file.type;


	if (!gagajf.isNull(file.name)) {
		var extension = "\.(jpg|jpeg|png)$";
		if ((new RegExp(extension, "i")).test(file.name)) {
			if ( file.size > (10 * 1000000)) {
				mcxDialog.alertC('이미지는 최대 10MB 이하 파일만 가능합니다.', {
					sureBtnText: "확인",
					sureBtnClick: function() {
						$(".pics").find(".removes").last().trigger('click');
					}
				});
				return false;
			}

			/* var limg = loadImage(file, function (img, data) {
	            img.toBlob(function (blob) {
	                var rotateFile = new File([blob], file.name, { type: fileType });
	                var reader = new FileReader();
	                reader.onload = function (e) { $(".pics").find("img").last().attr("src", e.target.result); }

	                reader.readAsDataURL(rotateFile);
					console.log(orientation);
	            }, fileType)
	        }, { orientation: 1}); */

			 gagajf.ajaxFileUpload('/common/file/upload?subDir=/review'
						, file
						, function(result) {
							// 업로드한 파일명 설정
							$(".pics").children().last().append("<input type='hidden' name='orgFileNmArr' id='orgFileNm"+(picLength+1)+"' value='"+result.oldFileName+"'>");
							$(".pics").children().last().append("<input type='hidden' name='sysFileNmArr' id='sysFileNm"+(picLength+1)+"' value='"+result.newFileName+"'>");

						}
				);
		}
		else{
			if ( file.size > (50 * 1000000)) {
				mcxDialog.alertC('동영상은 최대 50MB 이하 파일만 가능합니다.', {
					sureBtnText: "확인",
					sureBtnClick: function() {
						$(".pics").find(".removes").last().trigger('click');
					}
				});
				return false;
			}

			setTimeout(function(){
				$(".imgUpload").find('.pics').last().addClass("mov");
				$(".pics").children().last().append("<input type='hidden' name='kufKeyArr' id='kufKey"+(picLength+1)+"'>");
				$(".pics").children().last().append("<input type='hidden' name='kmcKeyArr' id='kmcKey"+(picLength+1)+"'>");
				gagaKollus.upload('Review', file, $('#kufKey'+(picLength+1)));
			}, 1000);
		}
	}
}


//210409_키, 몸무게 input 글자 수 제한
function handleOnInput(el, maxlength) {
		if(el.value.length > maxlength)  {
			el.value = el.value.substr(0, maxlength);
		}
	}
</script>
<script>
	//210524_ 추가 : textarea focus시 outline 색상 넣는 스크립트
	$(function() {
		$('.doc_review').focus(function(){
			$(this).parent('.textarea_wrap').css('outline', '1px auto rgb(229, 151, 0)');
		})
		$('.doc_review').blur(function(){
			$(this).parent('.textarea_wrap').css('outline', 'none');
		})
	});
</script>

</th:block>

</body>
</html>