나는 tinymce를 소개하지 않을 것입니다. 이것은 다운로드 주소입니다 : https://www.tinymce.com/download/
영어로 다운로드하면 중국어에게는 매우 쉽습니다.
먼저 중국 패키지를 온라인으로 다운로드 한 다음 중국 패키지의 Langs 폴더에서 Zh_CN.JS를 다운로드 한 TinyMce의 Langs 폴더에 복사하십시오. 마지막으로, tinymce.init에 "언어 :"zh_cn "을 추가합니다 (코드는 나중에 게시됩니다).
로컬 사진을 업로드하기 위해 jQuery로 업로드와 UI를 사용 했으므로 jQuery.uploadify.min.js 및 jQuery-ui.js를 참조해야합니다.
jQuery에는 Flash와 HTML을 기반으로하는 두 가지 버전이 있으며, 후자는 $ 5입니다. . . 나는 여전히 플래시를 기준으로 이것을 사용합니다.
그런 다음 Swfobject.js 참조를 추가해야합니다. 이러한 인용을 게시하지 않겠습니다. 온라인으로 많은 사람들이 있습니다.
기본 소개는 끝났습니다. 아래 코드를 살펴 보겠습니다.
<style type = "text/css">. mceuploadify {display : block;} </style> <link rel = "스타일 시트"href = "@url.content ("~/uploadify/uploadify.css ")"/> <script type = "text/javascript" src = "@url.content ("~/content/js/history.js ")"> </script> <script type = "text/javaScript"src = "@url.content ("~/tinymce_4.3.12/tinymce/js/tinymce/tinymce.min.js "> src = "@url.content ("~/scripts/jquery-1.4.4.min.js ")"> </script> <script type = "text/javascript"src = "@url.content ("~/scripts/jquery-ui.js ")"> <script> <text/javascript " src = "@url.content ("~/scripts/jquery-ui.js ")"> </script> <script type = "text/javaScript"src = "@url.content ("~/uplodify/jquery/jquery/jquery.uploadify.min.js ")"</script> <text/javascrip. src = "@url.content ("~/uploadify/swfobject.js ")"> </script> <script type = "text/javaScript"> $ (document) .ready (function () {var tinymeeder; tinymce.init ({셀렉터 : "TextArea#content", auto_focus : "antocn", 언어 : ",", " ["advlist autolink lists link image charmap preview","searchreplace visualblocks fullscreen","insertdatetime media table contextmenu paste","emoticons textcolor"],toolbar1: "undo redo | styleselect | fontselect | fontsizeselect | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | 편집기; $ ( "#uploadofedit"). 대화 상자 ({modal : False, Resizedable : False, Width : 400, Height : 200, DialogClass : "mceuploadify"});}});}, // tinymce는 모든 font 요소를 SPAN 변환 _FONTS_TO_SPANS로 변환합니다 : // newlines가 변환 될 것입니다. convert_newlines_to_brs : false, // tinymce는 단락을 삽입하는 대신 br 요소를 사용합니다 많은 서버 시스템은 텍스트가 형식화되지 않은 텍스트에 입력되기 때문에 remove_linebreaks : // 이미지 경로를 제거 할 수 없습니다. = 공식 글꼴; Roman, Times; Verdana = Verdana, Geneva; Webdings = Webdings = Wingdings = Wingdings, Zapf Dingbats ", fontsize_formats :"8pt 10pt 12pt 14pt 24pt 36pt "}); $ ("#tinymceuploadify "). 업로드 ({ 'swf': '/uploadify/uploadify/uploadify/ : '업 로더': '/home/upload', 'auto': 'filetypeexts': ' *.gif; *.jpg; " '>"; tinymeetitor.insertContent (img); settimeout (function () {$ ( "#uploadofedit"). 대화 상자 ('close ');}, 1000);},'onuploadError ': function () {settimeout () {$ ( "#uploadofedit"); 실패한 ");}});}); </script> <div> <form 메소드 ="post "action ="/home/"> <textRea id ="content "name ="content "> </textarea> <입력 유형 ="value = "value ="div id = 'uploadofed'style = "<input : <input : <input"style = "input. name = 'tinymceuploadify'id = 'tinymceuploadify'/> <label> png, jpg 및 gif 형식에서 사진 만 업로드하십시오 </label> </div>설명 :
$ ( "#tinymceuploadify"). uploadify ({ 'swf': '/uploadify/uploadify.swf': 'uploader': '/home/upload', 'auto': true, 'filetypeexts': ' *.jpg; *.png', 'post', 'multi': false, 'onuploadsuccess': 함수 (이벤트, 데이터, 플래그) {var img = "<img src = '../../uploadimg/" + data + "'>"; tinymeederator.insertContent (img); settimeout (function () {$ ( "#uploadofedit"); 1000);}, 'onuploadError': function () {settimeout (function () {$ ( "#uploadofedit"). 대화 상자 ( 'close');}, 1000); Alert ( "Upload Offort";}});이 코드의 매개 변수, 예 : 'SWF', '업로더', 'FileTeyXts', 이러한 중요한 매개 변수
다운로드 한 jquery.uploadify.js의 버전을 기반으로 결정해야합니다. 자세한 내용은 공식 문서를 읽을 수 있습니다.
위의 내용은 편집자가 소개 한 Tinymce Chinese 및 Local 업로드 이미지 기능에 대한 자세한 설명입니다. 나는 그것이 당신에게 도움이되기를 바랍니다. 더 알고 싶다면 Wulin.com 웹 사이트에주의를 기울이십시오.