<< [배명복 시시각각] 노무현의 굴레 | | Funny Video ^^ >>

fckeditor 사용 방법

1. 다운 로드 및 설치

 - 여기(http://www.fckeditor.net/download) 최신 버전을 다운 받음
 - WebRoot/fckeditor 디렉토리 카피
 - WEB-INF/lib에 fckeditor-java-core-2.4-beta-1.jar 추가해 줌

2. 편집 메뉴 수정을 원할 경우

 - fckeditor/fckconfig.js 파일 편집
  . 기존에는 FCKConfig.ToolbarSets["Default"], FCKConfig.ToolbarSets["Basic"] 두개의 툴바가 있었으나 Basic은 너무 기능이 적고, Default는 너무 기능이 많고, 로딩 속도 또한 느려서 사용자 정의 ToolbarSets을 추가해 줄 수가 있음
FCKConfig.ToolbarSets["Middle"] = [
['Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Link','Unlink'],
['FitWindow','Source'],
'/',
['Bold','Italic','Underline','StrikeThrough'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Image','Flash','Table','Rule','SpecialChar','PageBreak']
] ;
3. 화면 적용

 - 아래의 코드를 웹 소스에 적용함

#springBind("contents")
<textarea rows="10" cols="60" id="contents" name="contents">$!{status.value}</textarea>
$!{status.value}</textarea> //해당 컨텐츠 내용을 불러옴
<script type="text/javascript">
var oFCKeditor = new FCKeditor('contents');
oFCKeditor.BasePath = "http://mimul.com/fckeditor/";
oFCKeditor.Width = 540;
oFCKeditor.Height = 300;
oFCKeditor.ToolbarSet = "Middle";//새로 정의한 ToolbaSet
oFCKeditor.CheckBrowser = true;
oFCKeditor.ReplaceTextarea();
</script>
4. 실행화면

태그 :



코멘트 달기 Send a TrackBack