New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

handy-highlight

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

handy-highlight

A tiny, useful & handy highlight system which can be used with a simple API!

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

Handy-Highlight

A very handy tool for highlighting the text & having fun with it - Inspired by Medium. Demo below!!

  • Usage
  • Demo
  • API

Usage

  • Install with npm or Yarn.

    npm install handy-highlight
    

    or

    yarn add handy-highlight
    
  • Add these divs to your markup.

    <div id="cal1">&nbsp;</div>
    <div id="cal2">&nbsp;</div>
    <div id="handy-tooltip"></div>
    
  • Copy everything of /highlight.css into your stylesheet.

  • Here comes the fun part. Should be used on mouseup function on window object.

    import Highlight from 'handy-highlight'
    window.onmouseup = function(){
        Highlight({
            onclick: function(){ /*YOUR STUFF HERE*/ },   // is executed when div is clicked
            text: "<b>Hello, World</b>"   // Ignore this property if you want div's text to be highlighted text
        });
    }
    

Demo

Visit this link for the demo!!

API

Highlight(options:Object)
options = {
    extraTop:Number,
    extraLeft:Number,
    text:String,
    onclick:Function
}
extraTop:
Add some extra top to the div.
extraLeft:
Add some extra left to the div.
text:
Text of the div. Ignore this property if you want div's text to be the highlighted text.
onclick:
Function to be executed when clicked on the div.

Thnx for reading!!

Keywords

handy

FAQs

Package last updated on 22 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts