Use of editor2 in Dojo 0.4

Source: Internet
Author: User
The use of editor2 in Dojo 0.4 was just introduced. I also just used dojo and studied it for a few days. Since the editor will be deleted in 0.5, editor2 is still used. However, there are few documents and examples about editor2 on the official site, and they haven't been found much after half a day, I had to touch it myself. I do not study simple usage of defining the dojo attribute in page elements. I generally do not use this method. Generally, JavaScript is used for dynamic creation. 1. Create var ARGs = {sharsponlbar: false,
Toolbaralwaysvisible: false,
Focusonload: True,
Closeonsave: True,
Toolbartemplatepath: "src/widget/templates/editortoolbar.html ",
Height: 100}; var E = dojo. widget. createwidget ("editor2", argS, dojo. byid ("divid"); note: the official example also contains the creation parameter commandlist: ["bold", "italic", "underline", "insertimage ", "save"], but how can I try to use toolbartemplatepath In the toolbar. The toolbar content is defined in the src/widget/templates/editortoolbar.html file and can be modified by yourself. 2. modify the template files of the original tool bar, such as src/widget/templates/editortoolbar.html, without the font and font size. Modify src/widget/templates/editortoolbar.html, add the following content: <TD width = "36">
<SPAN class = "iconcontainer dojoeditortoolbaritem" dojoetitemname = "fontname">
<Span Title = "Set Font"> font </span>
</Span>
</TD>
<TD width = "36">
<SPAN class = "iconcontainer dojoeditortoolbaritem" dojoetitemname = "fontsize">
<Span Title = "Set Font size"> font size </span>
</Span>
</TD> open the file src/widget/templates/editor2/fontname.html and src/widget/templates/editor2/fontsize.html to customize the font and font size. 3. Use A. Update contentE. replaceeditorcontent ("Author: Wu you "); B. Obtain contentAlert (E. geteditorcontent ()); C. Execute the command: insert contentE.exe ccommand ("inserthtml", "Author: Wu you"); Note: Commands: inserthtml setbackcolor forecolor backcolor fontsize setfontname setblockformat unlink hilitecolor CreateLink 4. some bugs are found during the test and we look forward to the next version 5. discovery and prototype. JS conflict
Related Article

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.