Ueditor Call the attachment upload function

Source: Internet
Author: User

Ueditor is actually integrated Webuploader, when doing content release want to have both ueditor and a separate attachment upload button, then load a webuploader is too bloated, alone with ueditor upload function is more appropriate

The first is to display the attachment upload dialog, two ways

ue.ui._dialogs["attachment" + "Dialog"] (recommended);

Dialog = parent. $EDITORUI [Window.frameElement.id.replace (/_iframe$/, ')];

Then replace the OnOK function of dialog, the original OnOK will execute Editor.execcommand (' insertfile ', list);//dialog/attachment/attatchment.js

We re-write a OnOK function to replace the original OnOK, just simply remove the Editor.execcommand (' insertfile ', list), and get the file list to do their own processing.

In Dialog.js

In this case, combine dialog's own ID to give you the newly generated IFRAME also assigns an ID to _iframe as a suffix

contenthtml = ' <span id= "' + this.id + ' _contmask" class= "Dialogcontmask" ></span><iframe id= "' + this.id +
' _iframe ' class= "%%-iframe" height= "100%" width= "100%" frameborder= "0" src= "' + This.iframeurl + '" ></iframe> " ;

Ueditor Call the attachment upload function

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.