DEXT5 Editor :: dext_editor_custom_action

void dext_editor_custom_action(command, editor_id)

에디터에 custom icon을 추가하였을 때 icon 클릭 시 동작하는 메소드 입니다.

command 추가

dext_editor.xml 파일에서 tool_bar_1 또는 tool_bar_2 부분에서 원하는 위치에
command는 "c_"를 앞에 붙여서 작성하고 command에 대한 설명은 "|" 뒤에 작성합니다.

예)
<tool_bar_1>
<tool>new</tool>
<tool>...</tool>
<tool>c_go_homepage|홈페이지로 이동</tool>
</tool_bar_1>

icon 추가

16x16 사이즈로 아이콘을 만들어서 dext5editor/images/dext/icon 폴더에 넣습니다.
아이콘 파일 이름은 "command".gif 형태로 저장합니다.
예) c_go_homepage.gif

parameters

command   클릭된 icon의 command 값 입니다.
editor_id   적용할 에디터의 id 입니다.

remarks

custom icon 클릭 시 동작할 메소드를 작성합니다.

sample code

<!-- ..... 생략 ..... -->

<script type="text/javascript" src="dext5/js/dext5editor.js"></script>
<script type="text/javascript">

    function dext_editor_custom_action(command) {
        //custom icon command 값이 "c_go_homepage"라고 가정합니다.
        if(command == "c_go_homepage"){
            window.open("http://www.dext5.com");
        }
        else if(command == ....){
            //work something ...
        }
        //work something ...
    } 	

</script> 	
</head>
<body>
<!-- ..... 생략 ..... -->
<div style="width:900px;height:550px">
  
    <script type="text/javascript">
        new Dext5editor("editor1");
    </script>       
 
</div>