Giter VIP home page Giter VIP logo

whatsapp-editor's Introduction

Whatsapp Editor

The plugin allows user to format text online. The result text can be directly sent to whatsapp API which will be consistent against format, or show in the browser to be sent, in text format, to the WhatsApp web.

Usage

  1. Include jQuery

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

  1. Include plugin's code:

<script src="src/js/whatsapp-editor.js"></script>

  1. Use the plugin

$("#element").whatsappEditor(); OR $("#element").whatsappEditor(OPTIONS);

Use

var editor=$("#element").whatsappEditor(); // Initialize editor

var content=editor.getFormattedContent(); // Formatted WhatsApp content

Supported Options

  • bold: Allows user to select text and mark them as Bold
  • italic: Allows user to select text and mark them as Italic
  • Strikethrough: Allows user to select text and mark them as Strikethrough
  • Monospace: Allows user to select text and mark them as Monospace
  • html_contet: Allows user to return text in html format. Default is false
  • Content: Allows developer to specify default text for converting to whatsapp type text.

For more information see index.html file.

whatsapp-editor's People

Contributors

hirandesai avatar luizpicolo avatar

Stargazers

Aditya Nugroho avatar  avatar  avatar  avatar Ado Setiawan avatar Yied Pozi avatar Daniel Xavier avatar Raphael Machado avatar Norlihazmey Ghazali avatar Cláudio Oliveira avatar  avatar Washington Indacochea Delgado avatar

Watchers

 avatar

whatsapp-editor's Issues

empty line is take formated !!

Empty lines take the formatting before them!
Can you edit the lines in 121 so it replaces the empty line with no formatting
I tried but it seems to require less code

htmlContent= htmlContent.replaceAll('<div><b><br></b></div>', '\n');

in function prepareFormattedContent

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.