CKEDITOR.editorConfig = function( config ) | |
2 | { |
3 | //是否強制複製來的內容去除格式 plugins/pastetext/plugin.js |
4 | config.scayt_autoStartup = false; |
5 | config.forcePasteAsPlainText =false //不去除 |
6 | config.enterMode = CKEDITOR.ENTER_BR; |
7 | config.shiftEnterMode = CKEDITOR.ENTER_P; |
8 | config.font_defaultLabel = '微軟正黑體';//默認的字體名 |
9 | config.font_names = '微軟正黑體;新細明體;標楷體;Arial;New Roman;Verdana;Geneva,sans-serif'; |
10 | config.fontSize_sizes ='8/8px;10/10px;12/12px;14/14px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;72/72px'; |
11 | //設置字體大小時 使用的式樣 |
12 | config.fontSize_style = { |
13 | element : 'font', |
14 | styles : { 'font-size' : '#(size)' }, |
15 | overrides : [ { element : 'font', attributes : { 'size' : null } } ] |
16 | }; |
17 | |
18 | config.toolbar = 'Re'; |
19 | config.toolbar_Re = |
20 | [ |
21 | ['Source','RemoveFormat','Maximize', 'ShowBlocks'], |
22 | ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], |
23 | ['Link','Unlink'], |
24 | ['Image','Table','HorizontalRule','Smiley'], |
25 | '/', |
26 | ['Bold','Italic','Underline','Strike','-','NumberedList','BulletedList','-','Blockquote'], |
27 | ['Styles','Format','Font','FontSize'], |
28 | ['TextColor','BGColor'], |
29 | ]; |
30 | |
31 | config.toolbar = 'Full'; |
32 | config.toolbar_Full = |
33 | [ |
34 | ['Source','RemoveFormat','Maximize', 'ShowBlocks'], |
35 | ['-','Save','Preview','Templates'], |
36 | ['Cut','Copy','Paste','PasteText','PasteFromWord',], |
37 | ['Undo','Redo','-','Find','Replace','-','SelectAll'], |
38 | ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton'], |
39 | ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar'], |
40 | '/', |
41 | ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'], |
42 | ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'], |
43 | ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], |
44 | ['Link','Unlink','Anchor'], |
45 | |
46 | ['Styles','Format','Font','FontSize'], |
47 | ['TextColor','BGColor'], |
48 | |
49 | ]; |
50 | config.toolbarStartupExpanded = true; |
51 | //工具欄默認是否展開 |
52 | }; |
1 | <div id="WYSIWYG" name="WYSIWYG"> |
2 | <textarea id="Adopt_catcontent" name="Adopt_CatContent"></textarea> |
3 | <script type="text/javascript"> |
4 | |
5 | CKEDITOR.replace( 'Adopt_CatContent', |
6 | { |
7 | height:400,startupMode:'wysiwyg' |
8 | }); |
9 | </script> |
10 | |
11 | <a href="#" οnclick="javascript:bbcode.style.display='block';WYSIWYG.style.display='none';">BBCODE模式</a></div> |
12 | <div id="bbcode" name="bbcode" style="display:none;"> |
13 | <textarea id="Adopt_CatContent1" name="Adopt_CatContent1"></textarea> |
14 | <script type="text/javascript"> |
15 | CKEDITOR.replace( 'Adopt_CatContent1', { |
16 | height:400,startupMode:'source',toolbar:'bbcode',extraPlugins:'bbcode' |
17 | } ); |
18 | |
19 | </script> |
20 | <a href="#" οnclick="javascript:bbcode.style.display='none';WYSIWYG.style.display='block';">所見即所得WYSIWYG模式</a> |
21 | </div> |
http://www.blueshop.com.tw/board/FUM200410061525290EW/BRD20100824235150B2H.html