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 ' & ;& 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 ...