1. ÏÂÔرà¼Æ÷
ÏÂÔØ KindEditor ×îа汾£¬ÏÂÔØÖ®ºó´ò¿ª examples/index.html ¾Í¿ÉÒÔ¿´µ½ÑÝʾ¡£
ÏÂÔØÒ³Ãæ: http://www.kindsoft.net/down.php
2. ²¿Êð±à¼Æ÷
½âѹ kindeditor-x.x.x.zip Îļþ£¬½«ËùÓÐÎļþÉÏ´«µ½ÄúµÄÍøÕ¾³ÌÐòĿ¼ÀÀýÈ磺http://ÄúµÄÓòÃû/editor/
Note
Äú¿ÉÒÔ¸ù¾ÝÐèÇóɾ³ýÒÔÏÂĿ¼ºóÉÏ´«µ½·þÎñÆ÷¡£
- asp - ASP³ÌÐò
- asp.net - ASP.NET³ÌÐò
- php - PHP³ÌÐò
- jsp - JSP³ÌÐò
- examples - ÑÝʾÎļþ
3. ÐÞ¸ÄHTMLÒ³Ãæ
- ÔÚÐèÒªÏÔʾ±à¼Æ÷µÄλÖÃÌí¼ÓtextareaÊäÈë¿ò¡£
- <textarea id="editor_id" name="content" style="width:700px;height:300px;">
- <strong>HTMLÄÚÈÝ</strong>
- </textarea>
Note
- idÔÚµ±Ç°Ò³Ãæ±ØÐëÊÇΨһµÄÖµ¡£
- ÔÚtextareaÀïÉèÖÃHTMLÄÚÈݼ´¿ÉʵÏֱ༣¬ÔÚÕâÀïÐèҪעÒâµÄÊÇ£¬Èç¹û´Ó·þÎñÆ÷¶Ë³ÌÐò(ASP¡¢PHP¡¢ASP.NETµÈ)Ö±½ÓÏÔʾÄÚÈÝ£¬Ôò±ØÐëת»»HTMLÌØÊâ×Ö·û(>,<,&,”)¡£¾ßÌåÇë²Î¿¼¸÷ÓïÑÔĿ¼ÏÂÃæµÄdemo.xxx³ÌÐò£¬Ä¿Ç°Ö§³ÖASP¡¢ASP.NET¡¢PHP¡¢JSP¡£
- ÔÚÓÐЩä¯ÀÀÆ÷Éϲ»Éè¿í¶ÈºÍ¸ß¶È¿ÉÄÜÏÔʾÓÐÎÊÌ⣬ËùÒÔ×îºÃÉèһϿí¶ÈºÍ¸ß¶È¡£¿í¶ÈºÍ¸ß¶È¿ÉÓÃinlineÑùʽÉèÖã¬Ò²¿ÉÓà ±à¼Æ÷³õʼ»¯²ÎÊý ÉèÖá£
- ÔÚ¸ÃHTMLÒ³ÃæÌí¼ÓÒÔϽű¾¡£
<script> KindEditor.ready(function(K) { window.editor = K.create('#editor_id'); }); </script>
Note
- µÚÒ»¸ö²ÎÊý¿ÉÓÃÆäËüCSSÑ¡ÔñÆ÷£¬Æ¥Åä¶à¸ötextareaʱֻÔÚµÚÒ»¸öÔªËØÉϼÓÔرà¼Æ÷¡£
- ͨ¹ýK.createº¯ÊýµÄµÚ¶þ¸ö²ÎÊý£¬¿ÉÒÔ¶Ô±à¼Æ÷½øÐÐÅäÖ㬾ßÌå²ÎÊýÇë²Î¿¼ ±à¼Æ÷³õʼ»¯²ÎÊý ¡£
var options = { cssPath : '/css/index.css', filterMode : true }; var editor = K.create('textarea[name="content"]', options);
4. »ñÈ¡HTMLÊý¾Ý
// È¡µÃHTMLÄÚÈÝ html = editor.html(); // ͬ²½Êý¾Ýºó¿ÉÒÔÖ±½ÓÈ¡µÃtextareaµÄvalue editor.sync(); html = document.getElementById('editor_id').value; // ÔÉúAPI html = K('#editor_id').val(); // KindEditor Node API html = $('#editor_id').val(); // jQuery // ÉèÖÃHTMLÄÚÈÝ editor.html('HTMLÄÚÈÝ');
Note
- KindEditorµÄ¿ÉÊÓ»¯²Ù×÷ÔÚд´½¨µÄiframeÉÏÖ´ÐУ¬´úÂëģʽϵÄtextarea¿òÒ²ÊÇд´½¨µÄ£¬ËùÒÔ×îºóÌύǰÐèÒªÖ´ÐÐ sync() ½«HTMLÊý¾ÝÉèÖõ½ÔÀ´µÄtextarea¡£
- KindEditorÔÚĬÈÏÇé¿öÏÂ×Ô¶¯Ñ°ÕÒtextareaËùÊôµÄformÔªËØ£¬ÕÒµ½formºóonsubmitʼþÀïÌí¼Ósyncº¯Êý£¬ËùÒÔÓÃform·½Ê½Ìá½»Êý¾Ý£¬²»ÐèÒªÊÖ¶¯Ö´ÐÐsync()º¯Êý¡£
- KindEditorĬÈϲÉÓð×Ãûµ¥¹ýÂË·½Ê½£¬¿ÉÓà htmlTags ²ÎÊý¶¨ÒåÒª±£ÁôµÄ±êÇ©ºÍÊôÐÔ¡£µ±È»Ò²¿ÉÒÔÓà filterMode ²ÎÊý¹Ø±Õ¹ýÂËģʽ£¬±£ÁôËùÓбêÇ©¡£
// ¹Ø±Õ¹ýÂËģʽ£¬±£ÁôËùÓбêÇ© KindEditor.options.filterMode = false; KindEditor.ready(function(K)) { K.create('#editor_id'); }
- µ«ÊÇÈç¹ûÒª½øÐÐͼƬ¡¢flash»òÕßÊÓƵµÄÉÏ´«µÄ»°£¬Äã¾Í»áºÜÓôÃÆÁË£¬ºÜ¶àʱºò¶¼»áÒòΪÉÏ´«Â·¾¶²»¶Ô¶ø³ö´í£¬Òò´ËÄãÐèÒªÉèÖÃÄãµÄͼƬ¡¢flash»òÕßÊÓƵÎļþµÄ·¾¶£»Ö»Ð轫ÉÏÃæÒ»¶Î´úÂë¸ÄΪÈçϲ¿·ÖÔò¿ÉÒÔÂú×ã»ù±¾µÄÐèÇóÁË£º
- <script language=< span="">"javascript" type="text/javascript"> </script language=<>
- KindEditor.ready(function (K) {
- K.create('#editor_id', {
- uploadJson: '../Content/kindeditor-4.1.4/asp.net/upload_json.ashx',
- fileManagerJson: '../Content/kindeditor-4.1.4/asp.net/file_manager_json.ashx',
- allowFileManager: true
- });
- });
ÉÏÃæ±ê¼ÇÑÕÉ«µÄ²¿·ÖÓ¦¸Ã¸ù¾Ý×Ô¼ºµÄÎļþ·¾¶Ñ¡ÔñºÏÊʵÄ·¾¶£»
×îºó¾ÍÊÇÓйرà¼Æ÷ÖеĿؼþ²¢²»ÊÇ×Ô¼ºËùÐèÒªµÄ£¬ËùÒÔÄãÐèÒªÔÚÈçϵķ¾¶½øÐÐÅäÖãº
Õ¹¿ªkindeditor-4.1.4£¬ÕÒµ½kindeditor.jsÎļþ£¬Ë«»÷¾ÍÈ¥£¬È»ºóÕÒµ½ÔÚ246Ò³×óÓÒ£¬¾ÍÓÐÒ»¸öItems£¬ÔÚÖ®ºóÓÖÈçϵÄÅäÖòÎÊý£º
- [
- 'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template',
- 'code', 'cut', 'copy', 'paste',
- 'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter',
- 'justifyright',
- 'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent',
- 'outdent', 'subscript',
- 'superscript', 'clearhtml', 'quickformat', 'selectall', '|',
- 'fullscreen', '/',
- 'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
- 'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat',
- '|', 'image', 'multiimage',
- 'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
- 'anchor', 'link', 'unlink', '|', 'about'
- ]
source | HTML´úÂë |
preview | Ô¤ÀÀ |
undo | ºóÍË |
redo | Ç°½ø |
cut | ¼ôÇÐ |
copy | ¸´ÖÆ |
paste | Õ³Ìù |
plainpaste | Õ³ÌùΪÎÞ¸ñʽÎı¾ |
wordpaste | ´ÓWordÕ³Ìù |
selectall | È«Ñ¡ |
justifyleft | ×ó¶ÔÆë |
justifycenter | ¾ÓÖÐ |
justifyright | ÓÒ¶ÔÆë |
justifyfull | Á½¶Ë¶ÔÆë |
insertorderedlist | 񅧏 |
insertunorderedlist | ÏîÄ¿·ûºÅ |
indent | Ôö¼ÓËõ½ø |
outdent | ¼õÉÙËõ½ø |
subscript | 챐 |
superscript | Éϱê |
formatblock | ¶ÎÂä |
fontname | ×ÖÌå |
fontsize | ÎÄ×Ö´óС |
forecolor | ÎÄ×ÖÑÕÉ« |
hilitecolor | ÎÄ×Ö±³¾° |
bold | ´ÖÌå |
italic | бÌå |
underline | Ï»®Ïß |
strikethrough | ɾ³ýÏß |
removeformat | ɾ³ý¸ñʽ |
image | ͼƬ |
flash | Flash |
media | ÊÓÒôƵ |
table | ±í¸ñ |
hr | ²åÈëºáÏß |
emoticons | ²åÈë±íÇé |
link | ³¬¼¶Á´½Ó |
unlink | È¡Ïû³¬¼¶Á´½Ó |
fullscreen | È«ÆÁÏÔʾ |
about | ¹ØÓÚ |
´òÓ¡ | |
code | ²åÈë³ÌÐò´úÂë |
map | GoogleµØͼ |
baidumap | °Ù¶ÈµØͼ |
lineheight | Ðоà |
clearhtml | ÇåÀíHTML´úÂë |
pagebreak | ²åÈë·ÖÒ³·û |
quickformat | Ò»¼üÅÅ°æ |
insertfile | ²åÈëÎļþ |
template | ²åÈëÄ£°å |
anchor | ²åÈëêµã |
±¾Õ¾»¶ÓÈκÎÐÎʽµÄתÔØ£¬µ«ÇëÎñ±Ø×¢Ã÷³ö´¦£¬×ðÖØËûÈËÀͶ¯³É¹û
תÔØÇë×¢Ã÷£º ÎÄÕÂתÔØ×Ô£º°®Ë¼×ÊÔ´Íø http://www.aseoe.com/show-33-201-1.html
תÔØÇë×¢Ã÷£º ÎÄÕÂתÔØ×Ô£º°®Ë¼×ÊÔ´Íø http://www.aseoe.com/show-33-201-1.html