You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.9 KiB

4 days ago
  1. <html>
  2. <head>
  3. <title>Demo 2 : NicEdit Configuration</title>
  4. </head>
  5. <body>
  6. <div id="menu"></div>
  7. <div id="intro">
  8. <p>NicEdit is highly configurable by passing the configuration when you create the NicEditor. Pass your configuration when you call:</p>
  9. <p>new NicEditor({CONFIG HERE})</p>
  10. <p>Add .panelInstance('ID TO TEXTAREA HERE') to add the editor to the textarea.</p>
  11. <p>See the examples below:</p>
  12. </div>
  13. <br />
  14. <div id="sample">
  15. <script src="../nicEdit.js" type="text/javascript"></script>
  16. <script type="text/javascript">
  17. bkLib.onDomLoaded(function() {
  18. new nicEditor().panelInstance('area1');
  19. new nicEditor({fullPanel : true}).panelInstance('area2');
  20. new nicEditor({iconsPath : '../nicEditorIcons.gif'}).panelInstance('area3');
  21. new nicEditor({buttonList : ['fontSize','bold','italic','underline','strikeThrough','subscript','superscript','html','image']}).panelInstance('area4');
  22. new nicEditor({maxHeight : 100}).panelInstance('area5');
  23. });
  24. </script>
  25. <h4>Default (No Config Specified)</h4>
  26. <p>new nicEditor().panelInstance('area1');</p>
  27. <textarea cols="50" id="area1"></textarea>
  28. <h4>All Available Buttons {fullPanel : true}</h4>
  29. <p>new nicEditor({fullPanel : true}).panelInstance('area2');</p>
  30. <textarea cols="60" id="area2">Some Initial Content was in this textarea</textarea>
  31. <h4>Change Path to Icon File {iconsPath : 'path/to/nicEditorIcons.gif'}</h4>
  32. <p>new nicEditor({iconsPath : 'nicEditorIcons.gif'}).panelInstance('area3');</p>
  33. <textarea cols="50" id="area3"></textarea>
  34. <h4>Customize the Panel Buttons/Select List</h4>
  35. <p>{buttonList : ['fontSize','bold','italic','underline','strikeThrough','subscript','superscript']}</p>
  36. <textarea cols="50" id="area4">HTML <b>content</b> <i>default</i> in textarea</textarea>
  37. <h4>Set a maximum expansion size (maxHeight)</h4>
  38. <p>{maxHeight : 100}</p>
  39. <textarea style="height: 100px;" cols="50" id="area5">HTML <b>content</b> <i>default</i> in textarea</textarea>
  40. </div>
  41. </div>
  42. </body>
  43. </html>