Demo 2 : NicEdit Configuration
NicEdit is highly configurable by passing the configuration when you create the NicEditor. Pass your configuration when you call:
new NicEditor({CONFIG HERE})
Add .panelInstance('ID TO TEXTAREA HERE') to add the editor to the textarea.
See the examples below:
Default (No Config Specified)
new nicEditor().panelInstance('area1');
All Available Buttons {fullPanel : true}
new nicEditor({fullPanel : true}).panelInstance('area2');
Change Path to Icon File {iconsPath : 'path/to/nicEditorIcons.gif'}
new nicEditor({iconsPath : 'nicEditorIcons.gif'}).panelInstance('area3');
Customize the Panel Buttons/Select List
{buttonList : ['fontSize','bold','italic','underline','strikeThrough','subscript','superscript']}
Set a maximum expansion size (maxHeight)
{maxHeight : 100}
Source Code
<div id="sample"> <script type="text/javascript"> bkLib.onDomLoaded(function() { new nicEditor().panelInstance('area1'); new nicEditor({fullPanel : true}).panelInstance('area2'); new nicEditor({iconsPath : '../nicEditorIcons.gif'}).panelInstance('area3'); new nicEditor({buttonList : ['fontSize','bold','italic','underline','strikeThrough','subscript','superscript','html','image']}).panelInstance('area4'); new nicEditor({maxHeight : 100}).panelInstance('area5'); }); </script> <h4> Default (No Config Specified) </h4> <p> new nicEditor().panelInstance('area1'); </p> <h4> All Available Buttons {fullPanel : true} </h4> <p> new nicEditor({fullPanel : true}).panelInstance('area2'); </p> <h4> Change Path to Icon File {iconsPath : 'path/to/nicEditorIcons.gif'} </h4> <p> new nicEditor({iconsPath : 'nicEditorIcons.gif'}).panelInstance('area3'); </p> <h4> Customize the Panel Buttons/Select List </h4> <p> {buttonList : ['fontSize','bold','italic','underline','strikeThrough','subscript','superscript']} </p> <h4> Set a maximum expansion size (maxHeight) </h4> <p> {maxHeight : 100} </p> </div>