On the problem of rich text tinymce

Source: Internet
Author: User

Due to the separation of the front and back, but also required to upload local pictures and so on a series of needs, where the use of TINYMCE to solve a lot of holes in the middle, write a memo.


The first page introduces

<type=src="/js/admin/tinymce.full.min.js"></Script ",
Also introduce the JS you need to instantiate
In HTML <id="text"></textarea>
The following is the page JS

ConstBAR1 = [' fontsizeselect fontselect formatselect ',' bold italic underline strikethrough ',' codesample blockquote subscript superscript ',' alignleft aligncenter alignright alignjustify ',' bullist numlist '];ConstBAR2 = [' ForeColor BackColor ',' outdent indent ',' link anchor imageupload ',' Table InsertDateTime ',' hr PageBreak ',' Pastetext unlink Removeformat ',' visualblocks code preview fullscreen ',' undo Redo '];Constfonts = [' song BODY = song,' Andale mono=andale mono,times ',' Arial=arial,helvetica,sans-serif ',' Arial black=arial black,avant Garde ',' book Antiqua=book Antiqua,palatino ',' comic Sans ms=comic Sans Ms,sans-serif ',' Courier new=courier new,courier ',' Georgia=georgia,palatino ',' Helvetica=helvetica ',' Impact=impact,chicago ',' Symbol=symbol ',' Tahoma=tahoma,arial,helvetica,sans-serif ',' Terminal=terminal,monaco ',' Times New roman=times new Roman,times ',' trebuchet ms=trebuchet Ms,geneva ',' Verdana=verdana,geneva ',' webdings=webdings ',' Wingdings=wingdings,zapf dingbats ']; TINYMCE Editor SettingsTinyMCE.suffix='. Min ';TinyMCE. Init ({selector:' #text ',Height: 400,MenuBar:false,language:' ZH_CN ',Convert_urls:false,Imageupload_url:'/treasureweb/fileupload/uploadpicture.do ',Plugins: [' lists link preview hr anchor pagebreak ',' wordcount visualblocks visualchars code fullscreen ',' insertdatetime Media table Imageupload ',' paste textcolor colorpicker codesample ' ],toolbar1: Bar1.join (' | '),toolbar2: Bar2.join (' | '),' Image_advtab ':true,' Imagetools_toolbar ':' Rotateleft rotateright | FLIPV fliph | editimage imageoptions ',' Font_formats ': Fonts.join (';')
});
Here imageupload is our own definition of plug-ins, need to put into the tinymce.js of the plugins of the same directory, imageupload inside is our own need to define plug-ins. The area of the pit is mainly due to the environmental packaging issues when online, will be prompted $ undefined here we directly introduce JQ in plugins or introduce CDN in front of the page.

Students who need imageupload can contact me.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.