Ueditor is developed by the Baidu Web front-end research and development department to see the Rich Text Web editor, with a lightweight, customizable, focus on user experience and other characteristics, open source based on the MIT protocol, allowing free use and modification of code, covering popular Rich text editor features, unique new editing operation mode.
below to see Ueditor upload pictures, in the content exhibition to modify the image 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.
The above describes how Baidu Ueditor upload pictures after how to set the style, including the content of Baidu Ueditor, I hope that the PHP tutorial interested friends have helped.