TinyMCE
WYSISYGを必要とするすべてのページに使用しています。そして率直に言って、私にはたくさんあります。
私は文字通り、各ページのtinymce()jqueryプラグインをインスタンス化するために同じコードを使用していますが、各ページがすでに参照している場所で、好みのオプションを一度設定する方法があるかどうか疑問に思っています。各ページで同じかさばるコードを保持します。
これまでに各ページで行ったことは次のとおりです。
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$("textarea#comments").tinymce({
script_url : '/tiny_mce/tiny_mce.js', // Location of TinyMCE script
// General options
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,advlist",
force_p_newlines : false,
force_br_newlines : true,
/*forced_root_block : '',*/
// Theme options
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,hr,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect|styleprops,forecolor,backcolor,|,link,unlink,image,|,bullist,numlist,removeformat,code,|,preview",
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,
theme_advanced_resize_horizontal: false
});
});
</script>
私はこれを簡単に見たいです:
$("textarea#comments").tinymce();
私が理解していることからtinymce
、2つのテーマがあります:高度なものとシンプルなものです。Advancedにはオプションが多すぎますが、Simpleには十分ではありません。だから今、私は自分のオプションを厳選する必要がありますが、すべてのページで上記のコードを言い換えることは狂気のようです。
何か案は?