lEditor
A clean web text editor
Usage
- It uses jQuery
- Include
lEditor.jsandlEditor.css - Bind
$(some-div).lEditor();to onload event - It's possible to add more options:
$(some-div).lEditor({ height: '300px', color: '#ff0' });
Options
- height
- a css size string, the total height of the editor, default is
200px. - textarea_bg_color
- background color for the text area, default is
#fff. - toolbar_color
- button color, default is
#444. - toolbar_bg_color
- background color for the toolbar, default is
#ddd. - text
- initial text in the editor. HTML tags are also ok.
- font
- initial text font, default is
Arial. - font_size
- initial text font size, a number from 1 - 7, default is 4.
- color
- initial text color, default is
#000. - bg_color
- initial text background color, default is
#fff. - toolbar
-
layout of button groups in the toolbar, default layout is the same as the top one. It accecpts an array of strings. Possible strings are:
String Buttons undoundo, redo headingheading fontfont name, font size stylebold, italic, underline colortext color, background color alignleft, center, right listul, ol linkadd, remove mediaimage textblockhr, quote, code removeclear format, clear all - button_size
- a css size string for the button size, default is
14px. - full_screen
- true/ false, enable full screen mode. A full screen button will show in the toolbar. Default is false.
- tab
- 'off' / 'on', button groups will be put into different tab pages automatically. Useful when there are too much buttons. Default is
'on' - about
- 'off' / 'on', add an "about" tab showing about information. Default is
'off'. - callback
- a function called when text changes. the function accepts a parameter which is the html code of the text.
editor appearance
text initialization
toolbar buttons
getting the text
Demo
$('#demo1').lEditor({
tab: 'off',
height: '150px',
toolbar: ['undo', 'style', 'link'],
font: 'Georgia',
textarea_bg_color: '#2e2e2e',
toolbar_bg_color: '#525151',
toolbar_color: '#4bd7ea',
color: '#fff',
callback: function(str){
$('#demo1-code').val(str);
}
});