TinyEditor is a simple and easy-to-use HTML WYSIWYG editor

TinyEditor is a simple and easy-to-use HTML WYSIWYG editor

TinyEditor

A few days ago, I introduced to you a domestic xhtml editor . Today I want to recommend you TinyEditor, which is a simple and easy-to-use html WYSIWYG editor just released by the well-known foreign web design blog leigeber.com .

TinyEditor has the following features

  • It is written in Javascript and does not depend on other libraries.
  • This is a lightweight editor, the file to be called is only 8kb
  • It can handle most HTML formatting needs, and has built-in functionality to keep the generated markup as concise as possible.
  • The small icons used in the editor use CSS Sprite technology to reduce the number of http connections.
  • Tested in major browsers
  • Can be used in personal or commercial projects under the Creative Commons license

Here's how to use it:

  1. Reference the js and css files provided by TinyEditor in the web page file
  2. Add the tags required by the editor in the web page file, which is actually a textarea, as follows
     < textarea id = "input" style = "width:400px; height:200px" >< / textarea >

    Note that the length and width defined in the textarea are the size of the editor.

  3. Initialize the editor through the script and configure various parameters as follows:
     new TINY. editor . edit ( 'editor' , {
    	id : 'input' , 
    // (Required) The id of the textarea defined in step 2 above
    	width : 584 , 
    // (optional) editor width
    	height : 175 ,
     // (optional) editor height
    	cssclass : 'te' ,
     // (optional) The class of the editor, used to control the style through CSS
    	controlclass : 'tecontrol' ,
     // (optional) class of the editor button
    	rowclass : 'teheader' ,
     // (optional) class for the editor button row
    	dividerclass : 'tedivider' , 
    // (optional) The style of the dividing line between editor buttons
    	controls : [ 'bold' , 'italic' , 'underline' , 'strikethrough' , '|' , 'subscript' , 'superscript' , '|' , 'orderedlist' , 'unorderedlist' , '|' , 'outdent' , 'indent' , '|' , 'leftalign' , 'centeralign' , 'rightalign' , 'blockjustify' , '|' , 'unformat' , '|' , 'undo' , 'redo' , 'n' , 'font' , 'size' , 'style' , '|' , 'image' , 'hr' , 'link' , 'unlink' , '|' , 'cut' , 'copy' , 'paste' , 'print' ] ,
     // (Required) Add button controls to the editor as needed, where '|' represents the vertical dividing line between function buttons, and 'n' represents the dividing line between button rows
    	footer : true , 
    // (Optional) Whether to display the bottom of the editor
    	fonts : [ 'Verdana' , 'Arial' , 'Georgia' , 'Trebuchet MS' ] ,  
    // (optional) fonts that can be selected in the editor
    	xhtml : true , 
    // (optional) Whether the editor generates xhtml or html tags
    	cssfile : 'style.css' , 
    // (optional) external css file to attach to the editor
    	content : 'starting content' , 
    // (optional) Set the initial content in the editor editing area
    	css : 'body{background-color:#ccc}' ,
     // (optional) Set the editor editing area background
    	bodyid : 'editor' , 
    // (optional) Set the edit area ID
    	footerclass : 'tefooter' , 
    // (optional) Set the editor bottom class
    	toggle : { text : 'Source code' , activetext : 'Visualization' , cssclass : 'toggle' } ,
     // (Optional) Set the source code browsing switch text and the switch button class
    	resize : { cssclass : 'resize' } 
    // (optional) Set the class of the editor resize button
    } ) ;

    It can be said that it is highly configurable, and the configuration items are relatively clear.

In the actual application of TinyEditor, it should be noted that before submitting the editor content, the instance.post() function must be called to ensure that the latest visual content in the editing area is converted into markup text.

See example: http://sandbox.leigeber.com/tinyeditor/
Download: TinyEditor source code and sample files

<<:  How to configure the same domain name for the front and back ends of nginx

>>:  isPrototypeOf Function in JavaScript

Recommend

A Preliminary Study on Vue Unit Testing

Table of contents Preface Why introduce unit test...

In-depth explanation of MySQL user account management and permission management

Preface The MySQL permission table is loaded into...

JavaScript css3 to implement simple video barrage function

This article attempts to write a demo to simulate...

VMware virtualization kvm installation and deployment tutorial summary

Virtualization 1. Environment Centos7.3 Disable s...

...

Comprehensive summary of MYSQL tables

Table of contents 1. Create a table 1.1. Basic sy...

Why MySQL chooses Repeatable Read as the default isolation level

Table of contents Oracle Isolation Levels MySQL I...

HTML thead tag definition and usage detailed introduction

Copy code The code is as follows: <thead> &...

How to install iso file in Linux system

How to install iso files under Linux system? Inst...

Detailed explanation of Vite's new experience

What is Vite? (It’s a new toy on the front end) V...

Detailed explanation of MySQL master-slave replication and read-write separation

Table of contents Preface 1. Overview 2. Read-wri...

Detailed explanation of several ways to export data in Mysql

There are many purposes for exporting MySQL data,...