No presentaré TinyMCE. Esta es la dirección de descarga: https://www.tinymce.com/download/
Descárguelo en inglés, y es muy fácil de chino.
Primero, descargue un paquete chino en línea y luego copie el zh_cn.js en la carpeta Langs del paquete chino a la carpeta Langs del tinyMCE que descargó. Finalmente, agregue "lenguaje:" zh_cn "a tinymce.init (el código se publicará más adelante)
Solía subir y UI en jQuery para subir imágenes locales, por lo que necesito referirme a jQuery.uploadify.min.js y jQuery-ui.js
Hay dos versiones en jQuery que se basan en Flash y HTML, esta última es de $ 5. . . Todavía uso esto basado en Flash.
Entonces también debe agregar una referencia SWFObject.js. No publicaré estas citas para descargar, hay muchas en línea.
La introducción básica ha terminado, echemos un vistazo al código a continuación:
<style type = "text/css">. mceuploadify {display: block;} </style> <link rel = "stylesheet" 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 ")"> "</script> <script tipo =" text/javaScript " src = "@url.content (" ~/scripts/jQuery-1.4.4.min.js ")"> </script> <script type = "text/javascript" src = "@url.content (" ~/scripts/jquery-ui.js ")"> </script> <script type = "text/javaScript" src = "@url.content (" ~/scripts/jquery-ui.js ")"> </script> <script type = "text/javascript" src = "@url.content (" ~/uploadify/jQuery.uploadify.min.js ")"> </script> <script type = "text/javascript" "" " src = "@url.content (" ~/uploadify/swfobject.js ")"> </script> <script type = "text/javaScript"> $ (document) .ready (function () {var tinyMECETITOR; tinyMce.init ({selector: "TextAea#contenido", auto_focus: "Contenido", lenguaje: "ZH_CN", TEMPLETI ["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 | Bullist Numlist Outly Gurnent ", Barra de herramientas2:" Vista previa de pantalla completa | editor; $ ("#uploadeLoadOdit"). Dialog ({modal: false, resizable: false, width: 400, altura: 200, dialogClass: "mceuploadify"});}});}, // tinymce convertirá todos Convert_newlines_to_brs: false, // tinyMCE usará el elemento BR en lugar de insertar el párrafo force_br_newlines: false, // Al devolver o ingresar a Mozilla/Firefox, esta opción puede activar/desactivar la creación del párrafo Force_P_NewLines: False, // esta opción controla si las nuevaslines se eliminarán de la producción. Los sistemas convierten las nuevas líneas en <Br/> porque el texto se ingresa en un textAREA sin formato. Fuente oficial = Fuente oficial; Roman, Times; Verdana = Verdana, Ginebra; webdings = webdings; wingdings = wingdings, Zapf dingbats ", fontsize_formats:" 8pt 10pt 12pt 14pt 18pt 24pt 36pt "}); $ ("#tinymceuploadify "). uploadify ({'swf': '/uploadify/uploadify.swf','ButTontext': 'uploader': '/home/upload', 'auto': true, 'filetypeExts': ' *.gif; "<img src = '../../../uploadimg/" + data + "'>"; tinymceditor.insertContent (img); setTimeOut (function () {$ ("#uploadeadfedit"). dialog ('close');}, 1000);}, 'onUploaderror: function () {settimeout (function () () {$ ("#uplactOfedit"). Dialog ('Close');}, 1000); alerta ("fallado de carga");}});}); </script> <div> <div método = "post" action = "/">> <textarea id = "contenido" name = "contenido"> </textea> <input type = "Subt" Subt = "Subt =" Subt "/> Form id = 'uploadOfedit' style = "display: none;"> <input type = 'file' name = 'tinyMceuploadify' id = 'tinyMceuploadify'/> <label> Solo cargue imágenes en formatos PNG, JPG y GIF por debajoilustrar:
$("#tinymceuploadify").uploadify({'swf': '/uploadify/uploadify.swf','buttonText': 'uploader': '/Home/Upload','auto': true,'fileTypeExts': '*.gif; *.jpg; *.png','method': 'post','multi': False, 'onUploadSuccess': function (event, data, flag) {var img = "<img src = '../../../uploadimg/" + data + "'>"; tinymcedititor.insertContent (img); setTimeOut (function () {$ ("##uploadEdit"). Dialog ('cerrado');},,,,,, 1000);}, 'onUploadError': function () {setTimeOut (function () {$ ("##iboadOfedit"). Dialog ('cerrar');}, 1000); alerta ("cargar fallido");}});Los parámetros en este código, como 'swf', 'cargador', 'filetypeExts', estos parámetros importantes
Debe determinarse en base a la versión de jQuery.uploadify.js que descargó. Para más detalles, puede leer la documentación oficial.
Lo anterior es una explicación detallada de las funciones de imagen cargadas de TinyMce chinas y locales introducidas por el editor. Espero que te sea útil. Si desea saber más, preste atención al sitio web de Wulin.com.