The custom style class name after the Ueditor uploads the image. The ueditor uploads the image

Source: Internet
Author: User

The custom style class name after the Ueditor uploads the image. The ueditor uploads the image

Ueditor is a rich text plug-in of Baidu. if the user has a front-end language, it applies well, especially in mobile terminals. However, users often do not understand programming and it is impossible for them to use the front-end language. This requires us to define the entire style during development.

Under normal circumstances, the uploaded image is fixed with a high width. To apply the image to a mobile terminal, we must define the width as 100% or add a class. This is our idea.

The following is the modification code:

Ueditor. all. jsUE. plugin. register ('simpleupload', function (){... function initUploadBtn (){... domUtils. on (btnIframe, 'load', function (){... domUtils. on (input, 'change', function()..me.exe cCommand ('insertml', ' '); // you can add custom styles here. If you have tried this operation, ueditor will be reported. all. js: #24461 line me.exe cCommand ('insertml', ' '); function callback (){... domUtils. setStyle (loader, 'width', '000000'); // you can specify the style of the widget. # 100%... domUtils. addClass (loader, 'custom Style Class name'); // It is a built-in method, #24534 ...}...})...})...}...}) when setting the style, you must modify usditor at the same time. config. js (function (){... window. UEDITOR_CONFIG = {... // xss filter whitelist Source: bytes :{... img: ['src', 'alt', 'title', 'width', 'height', 'id', '_ src', 'loadingclass', 'class ', 'Data-latex ', 'style'], // Add a filter whitelist style #403 ...}...}...})

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.