2009-05-28 7 views

답변

1

바울은 "bullist"를 가지고 주제 - 고급 - BUTTONS1을 설정합니다. 또한 theme-advanced-buttons2, 3 및 4를 아무 것도 설정하지 않아도됩니다. 다음은 전체 예제 :

<html> 
<head> 
    <title>Application Name</title> 
    <script type="text/javascript" src="tiny_mce/tiny_mce.js"></script> 
    <script type="text/javascript"> 
     tinyMCE.init({ 
      // General options 
      mode : "exact", 
      elements: "description_edit_box", 
      theme : "advanced", 
      plugins : "safari,pagebreak,inlinepopups,paste,searchreplace", 

      // Theme options 
      theme_advanced_buttons1 : "bullist", 
      theme_advanced_buttons2 : "", 
      theme_advanced_buttons3 : "", 
      theme_advanced_buttons4 : "", 
      theme_advanced_toolbar_location : "top", 
      theme_advanced_toolbar_align : "left", 
      theme_advanced_statusbar_location : "bottom", 
      theme_advanced_resizing : true, 

      // Drop lists for link/image/media/template dialogs 
      external_link_list_url : "lists/link_list.js" 
     }); 
    </script> 
</head> 

<body> 
<textarea id="description_edit_box" rows="5" ></textarea> 
</body> 
</html> 
5

TinyMCE에 고급 테마를 사용하면 도움이 될 두 가지 옵션이 있습니다. 첫 번째는 theme_advanced_buttons<n>이며 편집기와 함께 표시되는 버튼을 결정합니다. 고급 테마는 기본적으로 3 행의 버튼을 정의하기 때문에 각 행을 다시 정의해야합니다.

두 번째는 valid_elements이며 TinyMCE는 나열되지 않은 태그를 제거 할 수 있습니다. 또한 한 태그를 다른 태그로 변환 할 수 있습니다. 예를 들어 번호 매기기 목록을 글 머리 기호 목록으로 전환 할 수 있습니다. 그러나 이것은 실제로 보안이 아닙니다. 악의적 인 사용자 나 악의적 인 사용자의 잘못된 입력을 차단하기 위해 서버 측 검사를 수행해야합니다.

당신이 정말로 글 머리 기호 목록을 제외한 모든 태그를 차단하려면 다음 옵션을 할 수 있습니다 귀하의 초기화 호출이 : 다른 한편으로는, 당신은 단지 번호 목록을 방지하려는 경우

tinyMCE.init({ 
    // Select the advanced theme 
    theme : "advanced", 

    // Choose which buttons to show 
    theme_advanced_buttons1 : "bullist", 
    theme_advanced_buttons2 : "", 
    theme_advanced_buttons3 : "", 

    // Which html tags to allow 
    valid_elements : "-ul/-ol,-li", 

    // Other options, including what to make editable 
    mode : ... 
}); 

, 구성이 수도 더보기 :

tinyMCE.init({ 
    // Select the advanced theme 
    theme : "advanced", 

    // Choose which buttons to show 
    theme_advanced_buttons1 : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor", 
    theme_advanced_buttons2 : "bullist,separator,outdent,indent,separator,undo,redo,separator", 
    theme_advanced_buttons3 : "hr,removeformat,visualaid,separator,sub,sup,separator,charmap", 

    // Which html tags to allow 
    valid_elements : "@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|" + 
     "onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|" + 
     "onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|" + 
     "name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u," + 
     "#p[align],-ul[type|compact]/-ol[type|compact],-li,br,img[longdesc|usemap|" + 
     "src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup," + 
     "-blockquote,-table[border=0|cellspacing|cellpadding|width|frame|rules|" + 
     "height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|" + 
     "height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot," + 
     "#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor" + 
     "|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div," + 
     "-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face" + 
     "|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite]," + 
     "object[classid|width|height|codebase|*],param[name|value|_value],embed[type|width" + 
     "|height|src|*],script[src|type],map[name],area[shape|coords|href|alt|target],bdo," + 
     "button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|" + 
     "valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method]," + 
     "input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value]," + 
     "kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value]," + 
     "q[cite],samp,select[disabled|multiple|name|size],small," + 
     "textarea[cols|rows|disabled|name|readonly],tt,var,big", 


    // Other options, including what to make editable 
    mode : ... 
}); 
관련 문제