Skip to content

A custom built rich text editor making use of the contenteditable html feature

License

Notifications You must be signed in to change notification settings

MrLewk/html5-Rich-Text-Editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

HTML5 Rich Text Demo

A custom built rich text editor making use of the contenteditable html feature

Installation

Put this in your <head>:

    <link rel="stylesheet" href="html5-wysiwyg-webboss/html5editor-styles.css">
    <script src="html5-wysiwyg-webboss/html5editor-widget.js">script>

And then create a DIV with the ID or CLASS name with the same name you set in the jQuery selector variable:

<script>
$('.html5editor').html5editor({  
    editorName: 'ed_demo',  
    theme: "default",  
    toolbarSize: "full",  
    createInput: true,  
    inputName: "demoEditor",  
    height: 400  
});
script>

Custom Toolbars

You can define a custom toolbar by creating an array of button options:

<script>  
    $('.html5editor').html5editor({  
        editorName: 'ed_demo',  
        theme: "default",  
        toolbarSize: "custom",  
        toolbar: ['New', 'Undo', 'Redo', 'Bold', 'Italics', 'Underline', 'Strike Through', 'Align Left', 'Align Center', 'Align Right', 'Justify', 'Bullet List', 'Numbered List', 'H1', 'H2', 'H3', 'Paragraph', 'Link', 'Unlink', 'Image', 'HTML', 'Remove Formatting', 'Reset', 'View Source'],  
        createInput: true,  
        inputName: "demoEditor",  
        height: 400  
  });  
script>

Settings

  • editorName - Element selector

  • path - Relative path to the plugin installation

  • theme - CSS theme name (only default available as standard)

  • toolbarSize - full or mini or custom

  • toolbar - If toolbarSize is set to custom, create an array of buttons here from the following:

    'New', 'Select All', 'Undo', 'Redo', 'Text Colour', 'Highlight Colour', 'Bold', 'Italics', 'Underline', 'Strike Through', 'Align Left', 'Align Center', 'Align', ' Right', 'Justify', 'Indent', 'Outdent', 'Bullet List', 'Numbered List', 'H1', 'H2', 'H3', 'Paragraph', 'Link', 'Unlink', 'Image', 'Paragraph', 'Blockquote', 'HR', 'Subscript', 'Superscript', 'HTML', 'Remove Formatting', 'Reset', 'Print', 'View Source'

  • createInput - true/false: This will create a hidden input and copy all editor content into it on keyup and blur so that you can pass the data via POST/GET

  • inputName - The input name of the above hidden input so you can retrieve the POST/GET data

  • colorPalette - Array of colour values (array can be #HEX, RGB() or ColourName)

  • width / height - Width and Height of editor (either by px of %)

Dependancies

  • jQuery
  • jQuery UI
  • Font Awesome

Support

Supported by most modern browsers. Partial support for most common functions (ie. bold, italic, underline) in IE.

License

  • MIT
  • Version 1.1
  • Last updated: 8th June 2018

Known issues/To Do

  • Add localStorage to save draft content
  • Make jQuery UI dialog for nicer image and URL inputs
  • Add new CSS theme options
  • Create Table insert options
  • Add Image and Table editing options

Copyright

2018 Luke Wilson/WebBoss Ltd
Github | WebBoss.io | WebBoss Websites

About

A custom built rich text editor making use of the contenteditable html feature

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published