티스토리 뷰

Programming/Java

CKEditor 4.6

파란크리스마스 2017. 4. 9. 17:29
728x90

CKEditor 4.6

출처 : CKEditor 4.6
CKEditor not working after opening jQuery UI Dialog - Stack Overflow

CKEditor - JQuery UI Dialog와 같이 사용하기

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="<c:url value="/resources/js/jquery-1.12.0.js"/>"></script>
<script type="text/javascript" src="<c:url value="/resources/js/jquery-ui.js"/>"></script>
<script type="text/javascript" src="<c:url value="/resources/ckeditor/ckeditor.js"/>"></script>
<link rel="stylesheet" href="<c:url value="/resources/css/jquery-ui.css"/>">
<title>JQuery Dialog</title>
<script type="text/javascript">
// CKEditor 기본 경로 설정 - config.js의 경로 설정
window.CKEDITOR_BASEPATH = '<c:url value="/resources/ckeditor"/>';
//window.parent.CKEDITOR.tools.callFunction('콜백의 식별 ID 값', '파일의 URL', '전송완료 메시지')

// CKEditor 제거 함수 - CKEditor 생성 되어 있는지 확인 후 제거
function DestryoCKEditorInstances(textarea_name) {
	if (CKEDITOR.instances[textarea_name])	{
		CKEDITOR.instances[textarea_name].destroy();
	}
}

function insertPopUpForSubject(){
	// 팝업 다이얼로그
	$("#tabb_subject_insert").dialog({
		position : {
			my : 'center center',
			at : 'center top'
		},
		width : 800,
		//height : 800,
		modal : true,
		open: function( event, ui ) {
			// 팝업창 열릴때 CKEditor 설정
			CKEDITOR.replace( 'example_subject_insert' , {
				extraPlugins: 'uploadimage,image2',
				uploadUrl: '<c:url value="/dragdrop/fileUpload/ckeditor2.do"/>',
				filebrowserImageUploadUrl: '<c:url value="/dragdrop/fileUpload/ckeditor.do"/>'
			});
		},
		close: function () {
			// 반듯이 팝업창 닫힐때 제거 되어함
			DestryoCKEditorInstances('example_subject_insert');
		}
	});
}
</script>
</head>
<body>

<button class="button button2" onclick="javascript:insertPopUpForSubject();">문제 입력1</button>

<div id="tabb_subject_insert"  title="문제 입력!"  style="display:none">
	<table align="center" width="90%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		 <td>seq</td>
		 <td><input type="text" size="20" id="seq_subject_insert" ></td>
	</tr>
	<tr>
		 <td>보기</td>
		 <td>
			<textarea id="example_subject_insert" name="example_subject_insert" form="usrform">Enter text here...</textarea>
		 </td>
	</tr>
	</table>
	<center>
		<button class="button button5" onclick="javascript:insert_subject1_complete(1);">입력 완료(과목1)</button>
		<button class="button button5" onclick="javascript:cancle_insert();">취 소</button>
	</center>
</div>

</body>
</html>


댓글
300x250
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함