function dateSelectall( field ) { $( field ).datepicker ({ changeYear: true, changeMonth: true, altFormat: 'yy-mm-dd', dateFormat: 'yy-mm-dd', minDate: "2015-01-01", 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 dateSelecttoday( field ) { $( field ).datepicker ({ changeYear: true, changeMonth: true, altFormat: 'yy-mm-dd', dateFormat: 'yy-mm-dd', minDate: "2022-04-28", maxDate: '2024-04-28', 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 webNote( field, width, height ) { if( width == '' ) width = 1000; if( height == '' ) height = 350; //여기 아래 부분 $( field ).summernote({ width:width, height: height, // 에디터 높이 minHeight: null, // 최소 높이 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 설정 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://spf.kaist.ac.kr/summernote/summernote-ajax.php?prc_mode=file_upload_ajax", contentType : false, processData : false, success : function(data) { //항상 업로드된 파일의 url이 있어야 한다. $(editor).summernote('insertImage', data); } }); }