2011-02-17 4 views

답변

2

은 당신이 뭔가를 할 수 있습니다 :

의 jQuery 버전 :

$('textarea.editor1').tinymce(
{ 
    script_url : '../admin/tiny_mce/tiny_mce.js', 
    theme : "simple", 
    plugins : "", // put plugins here 
    setup : function(ed) 
    { 
     ed.onInit.add(function(ed) 
     { 

     });    
    } 
}); 

$('textarea.editor2').tinymce(
{ 
    script_url : '../admin/tiny_mce/tiny_mce.js', 
    theme : "simple", 
    plugins : "", // put plugins here 
    setup : function(ed) 
    { 
     ed.onInit.add(function(ed) 
     { 

     });    
    } 
}); 

비의 jQuery 버전 :

tinyMCE.init(
{ 
    mode : "textareas", 
    theme : "simple", 
    editor_selector : "editor1" 
}); 

tinyMCE.init(
    { 
     mode : "textareas", 
    theme : "simple", 
    editor_selector : "editor2" 

    }); 
+1

이 만 jQuery를 - TinyMCE에 빌드를 위해 작동합니다 ! (타이핑 된 입력을 처리 할 때 꽤 느리기 때문에이 빌드를 사용하지 말 것을 권한다.) – Thariama

+1

jquery가 아닌 버전 – TNC

+1

+1로 업데이트되었습니다. +1되었습니다. – Thariama

1

이 달성하기 쉽습니다. jQuery 라이브러리를 사용하여 코드를 저장하지만 jQuery없이이 코드를 작성하는 것은 쉽습니다. 가정 당신은 당신이해야 할 모든에 대한 TinyMCE를 얻을하고자하는 것으로, "my_id1"IDS "my_id1"를 가진 HTML 요소 (예 : 텍스트 영역)을 가지고 것은 :

var config_tinymce_1 = { 

     plugins :"save", 

     theme_advanced_buttons1 : "bold,italic,underline,save", 
     theme_advanced_buttons2 : "", 
     ... 
}; 


var config_tinymce_2 = { 

     plugins :"save", 

     theme_advanced_buttons1 : "save", 
     theme_advanced_buttons2 : "", 
     ... 
}; 

$(document).ready(function(){ 
     init_obj_1 = {element_id:'my_id1', window: window}; 
     $.extend(true, init_obj_1, config_tinymce_1); 
     tinyMCE.execCommand('mceAddFrameControl',false, init_obj_1); 

     init_obj_2 = {element_id:'my_id2', window: window}; 
     $.extend(true, init_obj_2, config_tinymce_2); 
     tinyMCE.execCommand('mceAddFrameControl',false, init_obj_2); 
}); 
관련 문제