function dateSelectall( field ) { $( field ).datepicker ({ changeYear: true, changeMonth: true, altFormat: 'yy-mm-dd', dateFormat: 'yy-mm-dd', //minDate: "2022-04-29", monthNames:[ '1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월' ], monthNamesShort:[ '1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월' ], dayNames:[ '일', '월', '화', '수', '목', '금', '토' ], dayNamesShort:[ '일', '월', '화', '수', '목', '금', '토' ], dayNamesMin:[ '일', '월', '화', '수', '목', '금', '토' ] }); } function ReviewAjaxWrite( no, name, value, item ) { $.ajax({ type: 'POST', async:false, url : "../review/review_prc.php?prc_mode=R3AvKzIvU21Da2lkV2hGL201T1JVZXUrVkRzQUxjaTNXbzVDMFAvMzcwaz0", data: { 'no' : no, 'name' : name, 'value' : value, 'item' : item }, error: function ( request, status, error ) { console.log("code: " + request.status) console.log("message: " + request.responseText) console.log("error: " + error); } }); } //웹에디터 생성 - placeholder 지정 function webNote( field, width, height, placeholder ) { if( placeholder == '' ) placeholder = '내용을 작성해주세요.'; //여기 아래 부분 $( field ).summernote({ codeviewFilter: true, codeviewIframeFilter: true, width:width, height: height, // 에디터 높이 minHeight: 350, // 최소 높이 maxHeight: null, // 최대 높이 focus: false, // 에디터 로딩후 포커스를 맞출지 여부 lang: "ko-KR", // 한글 설정 toolbar : [ // 글꼴 설정 ['fontname', ['fontname']], // 글자 크기 설정 ['fontsize', ['fontsize']], // 굵기, 기울임꼴, 밑줄,취소 선, 서식지우기 ['style', ['bold', 'italic', 'underline','strikethrough', 'clear', 'superscript', 'subscript']], // 글자색 ['color', ['forecolor','color']], // 표만들기 ['table', ['table']], // 글머리 기호, 번호매기기, 문단정렬 ['para', ['ul', 'ol', 'paragraph']], // 줄간격 ['height', ['height']], // 그림첨부, 링크만들기, 동영상첨부 ['insert',['picture','link','video']], // 코드보기, 확대해서보기, 도움말 ['view', ['codeview','fullscreen', 'help']] ], placeholder: placeholder, //placeholder 설정 callbacks: { //여기 부분이 이미지를 첨부하는 부분 onImageUpload : function(files) { for (var i = files.length - 1; i >= 0; i--) { uploadSummernoteImageFile(files[i], this); } }, onPaste: function (e) { var clipboardData = e.originalEvent.clipboardData; if (clipboardData && clipboardData.items && clipboardData.items.length) { var item = clipboardData.items[0]; if (item.kind === 'file' && item.type.indexOf('image/') !== -1) { e.preventDefault(); } } } } }); } //웹에디터 이미지 파일 업로드 function uploadSummernoteImageFile(file, editor) { data = new FormData(); data.append("file", file); $.ajax({ data : data, dataType : "json", type : "POST", url : "https://iacuc.kaist.ac.kr/summernote/summernote-ajax.php?prc_mode=file_upload_ajax", contentType : false, processData : false, success : function(data) { //항상 업로드된 파일의 url이 있어야 한다. $(editor).summernote('insertImage', data); } }); }