Param

Method

Event

 

 

CE_OnCustomMenuv1.6 higher

AddMenu로 추가된 Custom 메뉴가 선택되었을 때 발생하는 이벤트입니다.

발생한 이벤트 type이 custommenu_plugin일 경우 return 값으로 사용자가 생성한 플러그인 객체를 넘겨주어야 에디터와 연동됩니다.

 

Parameters

이벤트 발생 시 아래와 같은 객체를 반환합니다.

객체명

용도

구분

type

이벤트 발생 type

- custommenu_function
- custommenu_plugin

이벤트 공통

editorTarget

에디터 메인 클래스 객체

이벤트 공통

editorName

설정된 에디터 이름

이벤트 공통

customMenuID

설정된 Custom메뉴 ID

CE_OnCustomMenu 공통

customMenuX

에디터 X위치 값

CE_OnCustomMenu 내 custommenu_plugin type

customMenuY

에디터 Y위치 값

CE_OnCustomMenu 내 custommenu_plugin type

 

Sample Codes

[ Plugin ]

<div id="CustomLayer" style="position:absolute; display:none;z-index:1;">
   <table border="1px" bgcolor="white">
      <tr>
         <td>크로스에디터 Custom 메뉴 플러그 인 입니다.</td>
      </tr>
   </table>
</div>

 

function CE_OnCustomMenu(e){
   if (!e) return;
   if (e.type == 'custommenu_plugin' && e.customMenuID == 'userMenu'){
      //레이어가 위치 할 포지션 지정
      document.getElementById(CustomLayer).style.top=e.customMenuY;
      document.getElementById(CustomLayer).style.left=e.customMenuX;

      document.getElementById("CustomLayer").style.display  = "";
      return document.getElementById("CustomLayer");
  }
 }

 

[ Function ]

function CE_OnCustomMenu(e){
   if (!e) return;
   if (e.type=='custommenu_function' && e.customMenuID == 'userMenu'){
      //실행할 스크립트 구문
      alert(“ID : ” + e.customMenuID + “\n” + “Type : ” + e.type); 
   }
}

 

See Also

AddMenu  UserToolbar  CreateToolbar  Chevron