首页 > 其他 > 详细

TinyMCE编辑器

时间:2014-07-14 00:29:30      阅读:539      评论:0      收藏:0      [点我收藏+]

转自:http://outofmemory.cn/code-snippet/3763/tinymce-language

tinymce4发布了,比以前的更简洁更漂亮了,下载下来简单的折腾了一下,发现默认的langs目录下没有文件,可以到这里来下载需要的语言包

下载语言包之后需要放在<your tinymce path>/js/tinymce/js/langs/目录下面。

然后再配置tinymce时指定language属性即可,例如下面的例子

 1 <!DOCTYPE html>
 2 <html>
 3 <head>
 4     <title>tinymce 4 editor</title>
 5 </head>
 6 <body>
 7 
 8 <script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
 9 <script type="text/javascript" src="./js/tinymce/tinymce.min.js"></script>
10 <script type="text/javascript" src="./js/tinymce/jquery.tinymce.min.js"></script>
11 <script type="text/javascript">
12     tinymce.init({
13         selector: "textarea",
14         plugins: [
15             "advlist autolink autosave link image lists charmap print preview hr anchor pagebreak spellchecker",
16             "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
17             "table contextmenu directionality emoticons template textcolor paste fullpage textcolor"
18         ],
19 
20         toolbar1: "undo redo | cut copy paste | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | styleselect formatselect fontselect fontsizeselect",
21         toolbar2: " searchreplace | bullist numlist | outdent indent blockquote | link unlink anchor image media code | inserttime preview | forecolor backcolor",
22         toolbar3: "table | hr removeformat | subscript superscript | charmap emoticons | print fullscreen | ltr rtl | spellchecker | visualchars visualblocks nonbreaking template pagebreak restoredraft",
23 
24         menubar: false,
25         toolbar_items_size: small,
26 
27         style_formats: [
28             {title: Bold text, inline: b},
29             {title: Red text, inline: span, styles: {color: #ff0000}},
30             {title: Red header, block: h1, styles: {color: #ff0000}},
31             {title: Example 1, inline: span, classes: example1},
32             {title: Example 2, inline: span, classes: example2},
33             {title: Table styles},
34             {title: Table row 1, selector: tr, classes: tablerow1}
35         ],
36 
37         templates: [
38             {title: Test template 1, content: Test 1},
39             {title: Test template 2, content: Test 2}
40         ],
41         language:zh_CN
42     });</script>
43 
44 <form method="post" action="somepage">
45     <textarea name="content" style="width:100%"></textarea>
46 </form>
47 
48 </body>
49 </html>

 

TinyMCE编辑器,布布扣,bubuko.com

TinyMCE编辑器

原文:http://www.cnblogs.com/appll/p/3840275.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!