WYSIWYG Editor jQuery MultiformTextEditor - Download Multi Purpose WYSIWYG Editor - jQuery MultiformTextEditor

Download Multi Purpose WYSIWYG Editor – jQuery MultiformTextEditor

Posted on

This time I will share jQuery Plugin and tutorial about Multi Purpose WYSIWYG Editor – jQuery MultiformTextEditor, hope it will help you in programming stack.

File Size: 38.4 KB
Views Total: 5787
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Multiform Text Editor is a powerful, multifunctional, highly customizable WYSIWYG Rich Text Editor for writing articles, messages, comments on the web applications.

Works with contentEditable element.

Also supports Inline Mode that displays an editor popup on the selected text within the document.

How to use it:

1. Load Font Awesome for the editor buttons.

1 <link href="/path/to/font-awesome.min.css" rel="stylesheet">

2. Load jQuery and the Multiform Text Editor plugin in the page.

1 <script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha384-tsQFqpEReu7ZLhBV2VZlAu7zcOV+rXbYlF2cqB8txI/8aZajjp4Bqd+V6D5IgvKT" crossorigin="anonymous"></script>
2 <script src="jquery.multiform-text-editor.js"></script>

3. To make your web content editable, add the contenteditable="true" attribute to the container.

1 <div id="example" contenteditable="true" placeholder="Enter text here...">
2   Editable content here
3 </div>

4. Create the HTML for the editor.

01 <div id="menu" class="menu-edit">
02   <b class="frmttxt-mn-it" data-frmt="ngrto" title="Bold">B</b>
03   <i class="frmttxt-mn-it fa" data-frmt="itlco" title="Italic" style="font-style: italic;">I</i>
04   <u class="frmttxt-mn-it" data-frmt="sblnhdo" title="Underline">U</u>
05   &nbsp;&nbsp;❘&nbsp;&nbsp;
06   <div class="frmttxt-mn-gp extra-frmt" title="Extra">
07     <span><s>S</s>²</span>
08     <div class="frmttxt-mn-drpdn">
09       <s class="frmttxt-mn-it" data-frmt="rscdo" title="strikethrough">S</s>
10       <span class="frmttxt-mn-it" data-frmt="sbrlnhdo" data-val="overline" title="overline" style="text-decoration: overline;">O</span>
11       <span class="frmttxt-mn-it sobrescrito" data-frmt="sbrscrto" title="superscript"><span>X</span>²</span>
12       <span class="frmttxt-mn-it subscrito" data-frmt="sbscrto" title="subscript"><span>X</span>₂</span>
13     </div>
14   </div>
15   &nbsp;&nbsp;
16   <div class="frmttxt-mn-gp tipo-lista" title="List">
17     <span class="fa fa-list">&nbsp;</span>
18     <div class="frmttxt-mn-drpdn">
19       <span class="frmttxt-mn-it fa fa-list-ul" data-frmt="tplist1" title="unordered"><span></span></span>
20       <span class="frmttxt-mn-it fa fa-list-ol" data-frmt="tplist2" title="ordered"><span></span></span>
21     </div>
22   </div>
23   &nbsp;&nbsp;&nbsp;❘&nbsp;&nbsp;
24   <span class="frmttxt-mn-it fa fa-ban" data-frmt="lmpfrmt" title="Clear formatting"></span>
25 </div>

5. Initialize the Multiform Text Editor plugin.

01 $(document).ready(function(){
02   $("#menu").formatTxt($("#example"), null, null, function(cx, slc, exc){
03     ShowMessage(cx, slc, exc);
04   });
05  
06   function ShowMessage(cx, slc, exc){
07     cx.keyup();
08     exc == false ? alert("Not supported - The command was not executed by this browser. If possible, upgrade to a newer version.") : null;
09   }
10 });

6. Customize the apperance of the Multiform Text Editor using your own CSS.

001 .menu-edit {
002   min-height: 30px;
003   background-color: #c1cdd4;
004   text-align: center;
005   font-family: sans-serif;
006   font-size: 1.5rem;
007   font-weight: 500;
008   color: #BBB;
009   padding: 0 15px;
010   border: 1px solid #ffffff;
011   border-bottom: none;
012   border-radius: 7px 7px 0 0;
013 }
014  
015 .menu-edit > * {
016   width: 23px;
017   padding: 2px;
018   margin: 3px 2px;
019   border: 1px solid transparent;
020   border-radius: 5px;
021   cursor: pointer;
022   display: inline-block;
023   position: relative;
024   color: #4e4e4e;
025 }