Mobile Rich Text Editor artEditor and text editor arteditor
Abstract:
Because mobile phones are relatively slow in typing and are not suitable for long articles, there are very few rich text editors on the Mobile End. ArtEditor is a jQuery-based mobile Rich Text Editor that supports image insertion and other functions.
Plug-in address: https://github.com/baixuexiyang/artEditor welcome star or fork.
Demo
Reference:
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <script src="artEditor.min.js"></script>
Parameter: imgTar
Image Upload button
LimitSize
Maximum image size. Default Value: 3 MB
ShowServer
Displays images returned from the server. By default, images of local resources are displayed.
UploadUrl
Path strength of image uploading
Data
Other Image Upload Parameters
UploadField
Upload Image Fields
Placeholader
Rich Text Editor holder
ValidHtml
Remove invalid html tags when pasting
UploadSuccess
Callback for successful Image Upload
UploadError
Image Upload failure callback
Example:
Html:
<div id="content"></div>
Js:
$ ('# Content '). artEditor ({imgTar: '# imageUpload', limitSize: 5, // MB showServer: false, uploadUrl: '', data: {}, uploadField: 'image', placeholader: '<p> enter the body of the article </p>', validHtml: ["br"], uploadSuccess: function (res) {// return img url return res. path;}, uploadError: function (res) {// something error console. log (res );}});