只是所见即所得富文本编辑器的另一个jQuery实现,它使用Font Awesome Iconic Font作为编辑器图标。根据AGPL-3.0许可。
1.加载所需的Font Awesome 4或Font Awosome 5标志性字体:
<link rel="stylesheet" href="/path/to/font-awesome.min.css" />
2.加载richtext.min.css格式为编辑器设置样式。
<link rel="stylesheet" href="richtext.min.css">
3.加载JQuery库和richtext.min.js格式在网页的末尾。
<script src="/path/to/cdn/jquery.min.js"></script> <script src="/path/to/jquery.richtext.min.js"></script>
4.创建法线文本区域元素。
<textarea class="content" name="example"></textarea>
5.调用插件将转换文本区域元素转换为基本的所见即所得富文本编辑器。
$('.content').richText();
6.通过覆盖以下参数选项来自定义编辑器。
$('.content').richText({
// text formatting
bold: true,
italic: true,
underline: true,
// text alignment
leftAlign: true,
centerAlign: true,
rightAlign: true,
justify: true,
// lists
ol: true,
ul: true,
// title
heading: true,
// fonts
fonts: true,
fontList: ["Arial",
"Arial Black",
"Comic Sans MS",
"Courier New",
"Geneva",
"Georgia",
"Helvetica",
"Impact",
"Lucida Console",
"Tahoma",
"Times New Roman",
"Verdana"
],
fontColor: true,
fontSize: true,
// uploads
imageUpload: true,
fileUpload: true,
// media
videoEmbed: true,
// link
urls: true,
// tables
table: true,
// code
removeStyles: true,
code: true,
// colors
colors: [],
// dropdowns
fileHTML: '',
imageHTML: '',
// translations
translations: {
'title': 'Title',
'white': 'White',
'black': 'Black',
'brown': 'Brown',
'beige': 'Beige',
'darkBlue': 'Dark Blue',
'blue': 'Blue',
'lightBlue': 'Light Blue',
'darkRed': 'Dark Red',
'red': 'Red',
'darkGreen': 'Dark Green',
'green': 'Green',
'purple': 'Purple',
'darkTurquois': 'Dark Turquois',
'turquois': 'Turquois',
'darkOrange': 'Dark Orange',
'orange': 'Orange',
'yellow': 'Yellow',
'imageURL': 'Image URL',
'fileURL': 'File URL',
'linkText': 'Link text',
'url': 'URL',
'size': 'Size',
'responsive': 'Responsive',
'text': 'Text',
'openIn': 'Open in',
'sameTab': 'Same tab',
'newTab': 'New tab',
'align': 'Align',
'left': 'Left',
'justify': 'Justify',
'center': 'Center',
'right': 'Right',
'rows': 'Rows',
'columns': 'Columns',
'add': 'Add',
'pleaseEnterURL': 'Please enter an URL',
'videoURLnotSupported': 'Video URL not supported',
'pleaseSelectImage': 'Please select an image',
'pleaseSelectFile': 'Please select a file',
'bold': 'Bold',
'italic': 'Italic',
'underline': 'Underline',
'alignLeft': 'Align left',
'alignCenter': 'Align centered',
'alignRight': 'Align right',
'addOrderedList': 'Add ordered list',
'addUnorderedList': 'Add unordered list',
'addHeading': 'Add Heading/title',
'addFont': 'Add font',
'addFontColor': 'Add font color',
'addFontSize': 'Add font size',
'addImage': 'Add image',
'addVideo': 'Add video',
'addFile': 'Add file',
'addURL': 'Add URL',
'addTable': 'Add table',
'removeStyles': 'Remove styles',
'code': 'Show HTML code',
'undo': 'Undo',
'redo': 'Redo',
'close': 'Close'
},
// privacy
youtubeCookies: false,
// preview
preview: false,
// placeholder
placeholder: '',
// dev settings
useSingleQuotes: false,
height: 0,
heightPercentage: 0,
id: "",
class: "",
useParagraph: false,
maxlength: 0,
useTabForNext: false,
// callback function after init
callback: undefined,
});
2022-12-15
2022-11-26
2021-12-10
2021-12-10
2021-02-26
2020-6-21
2019-11-20
2019-08-28
2019-04-24
2019-04-13
2019-01-17
2018-08-27
2018-08-18
2018-07-17
2018-07-16
2018-06-13
2018-05-26
2018-05-01
2018-03-14
2018-02-21
2018-02-09
2018-01-25
2018-01-24
2018-01-15
2018-01-03
2017-12-09
2017-11-21
2017-10-19
2017-10-01
2017-09-20
2017-09-18
2017-09-15
2017-09-11
2017-09-10
2017-09-02
2017-09-01
2017-08-26
2017-08-24
2017-08-18
2017-08-17
2017-08-09
2017-08-04
2017-08-01
2017-07-30
2017-07-11
Â