2011-08-25 39 views
2

Tinymce從所有元素中丟失了我的內聯樣式。我已經嘗試了幾乎所有的東西。Tinymce提交的屬性

 
    language : "fi", 
    theme : "advanced", 
    plugins : "style,paste,table,media,layer,fullscreen,autoresize", 
    theme_advanced_disable : "help,sub,sup,anchor", 
    theme_advanced_buttons1_add : "styleprops,fontselect,fontsizeselect,forecolor", 
    theme_advanced_buttons2_add : "pastetext,pasteword", 
    theme_advanced_buttons3 : "tablecontrols,hr,removeformat,media,fullscreen", 
    remove_linebreaks : true, 
    remove_trailing_nbsp : true, 
    relative_urls : false, 
    remove_script_host : false, 
    entity_encoding : "raw", 
    fix_nesting: true, 
    theme_advanced_toolbar_location : "top", 
    theme_advanced_toolbar_align : "left", 
    theme_advanced_resize_horizontal : true, 
    theme_advanced_resizing : true, 
    theme_advanced_path_location : "bottom", 
    file_browser_callback : 'myFileBrowser', 
    valid_elements : '*[*]', 
    inline_styles : true 

我想不出還有更多的事情可以讓用戶去做。但仍然。當我點擊我的表格時,打開屬性,將寬度更改爲600並查看HTML,它表示style =「width:600px」。

但是,當我提交它時,下一頁將不會獲得該樣式屬性。這讓我很生氣,我不知道去哪裏看,因爲我做過的任何事情都沒有改變。我的語法有問題,我看不到,因爲我太生氣或什麼?任何其他想法?

謝謝

回答

1

在特殊事件中,編輯器內容被寫回到前一個html元素。 Tinymce具有內置清理功能,可根據您的tinymce設置清理您的內容(這通常發生在保存和onSubmit上)。你將不得不檢查以下TinyMCE的設置:

確保表可以有width屬性。

+1

您可能會錯過我的valid_elements:'* [*]'line in configuration。 – Jasmo

+0

對不起,確實錯過了那一個。你如何提交你的編輯內容?你使用哪個瀏覽器? – Thariama

+0

我有谷歌瀏覽器,它是正常形式的普通文本區,它使用POST發佈到下一個PHP文件,該文件現在將其打印出來。我也用Firefox測試了它 – Jasmo

0

我用下面的配置,並有nosuch那樣的問題:

tinyMCE.init({ 
     // General options 
     mode : "textareas", 
     theme : "advanced", 
     plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template", 

     // Theme options 
     theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect", 
     theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", 
     theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", 
     theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak", 
     theme_advanced_toolbar_location : "top", 
     theme_advanced_toolbar_align : "left", 
     theme_advanced_statusbar_location : "bottom", 
     theme_advanced_resizing : true, 

     // Example content CSS (should be your site CSS) 
     content_css : "css/example.css", 

     // Drop lists for link/image/media/template dialogs 
     template_external_list_url : "js/template_list.js", 
     external_link_list_url : "js/link_list.js", 
     external_image_list_url : "js/image_list.js", 
     media_external_list_url : "js/media_list.js", 

     // Replace values for the template plugin 
     template_replace_values : { 
       username : "Some User", 
       staffid : "991234" 
     } 
}); 

你認爲你必須設置valid_elements?我沒有設置和工作很好,我看到了。可能是默認設置效果更好。 tinyMCE minorVersion:「3.9.3」,releaseDate:「2010-12-20」