Baidu Ueditor upload pictures after how to set the style, ueditor upload pictures _php tutorial

Source: Internet
Author: User

Baidu Ueditor upload pictures after how to set the style, ueditor upload pictures


Recently encountered a problem in the project, ueditor after uploading the picture, in the content exhibition to modify the picture style. But the expression is also an IMG tag, so the global modification is problematic,

So you can only start to modify the plugin code.

First find the image upload server segment file. Here is the main explanation of PHP

Find Uploader.class.php 337 lines in the PHP directory

Public Function GetFileInfo ()   {       return array (           "state" = = $this->stateinfo,           "url" = = $this- >fullname, "           title" and "$this->filename,           " "Original" and $this->oriname,           "type" and "= $this- >filetype,   "class" and "AAA", "           size" (= $this->filesize,       );   }

This returns the value of the JSON more than one class property

One is to modify JS

Find Ueditor.all.js in 24461 below code

Modify JS

function callback () {Try{var link, json, loader,body = (iframe.contentdocument | | iframe.contentWindow.document). Body, result = Body.innertext | | body.textcontent | | "; json = (New Function (" return "+ result)); link = me.options.imageUrlPrefix + json.url;if (json.state = = ' SUCCESS ' &amp ;& json.url) {loader = Me.document.getElementById (loadingid); Loader.setattribute (' src ', link); Loader.setattribute (' _src ', link); Loader.setattribute (' class ', Json.class | | ''); Add line Code loader.setattribute (' title ', Json.title | | "); Loader.setattribute (' Alt ', json.original | | | Loader.removeattribute (' id ');d omutils.removeclasses (loader, ' Loadingclass ');} else {showerrorloader && showerrorloader (json.state);}} catch (er) {showerrorloader && showerrorloader (Me.getlang (' simpleupload.loaderror '));} Form.reset ();d omutils.un (iframe, ' Load ', callback);}

This way, you can see that the uploaded images are more of a style.

http://www.bkjia.com/PHPjc/918063.html www.bkjia.com true http://www.bkjia.com/PHPjc/918063.html techarticle Baidu Ueditor upload pictures after how to set the style, Ueditor upload pictures recently encountered a problem in the project, Ueditor upload pictures after the content exhibition to modify the image style. But the expression ...

  • 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.