Git Product home page Git Product logo

prateekkalra / selection-js Goto Github PK

View Code? Open in Web Editor NEW
91.0 6.0 61.0 77 KB

A lightweight javascipt library which provides users with a set of options in the form of a small popover over the selected portion of text.

Home Page: https://prateekkalra.github.io/Selection-js/

License: MIT License

CSS 1.88% HTML 20.51% JavaScript 77.61%
selection copy-paste facebook twitter text-to-speech popover javascript javascript-library vanilla-javascript google-search

selection-js's Introduction

SelectionJS

A lightweight javascript library which provides users with a set of options in the form of a small popover over the selected portion of text.

Live Demo

Usage

To get started with Selection.js, download the Script and add it to your project

Basic

<script src="selection.min.js"></script>
<script>
  var selection = new Selection();
  selection.init();
</script>

Advanced

<script src="selection.min.js"></script>
<script>
  var selection = new Selection();
  selection.config({
    facebook: true,
    twitter: true,
    search:true,
    copy:true,
    speak:true,
    backgroundColor: 'crimson',
    iconColor: '#fff',
  }).init();
</script>

Result

Demo

selection-js's People

Contributors

brandnpatterson avatar palashmon avatar prateekkalra avatar salman18123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

selection-js's Issues

Fix some code linting issues

Like:

  • Unexpected var, use let or const instead.
  • Missing spaces around some infix operators.
  • Missing semicolon in most places.
  • Eliminating the type-unsafe equality operator.
  • Eliminate shadowed variable declaration.

Regards!

Forked version with most UI and code improvements

XelectionJS

Since this repository is no longer updated (and pull request have been there for years), I have forked the repository and added most of the request / improvements:

  • Translate tool.
  • Dictionary tool: English, Spanish, French, Chinese, Hindi, Arabic, Malay, Russian, Bengali & Portugese. Follows browser config.
  • Google Image search tool.
  • Print tool.
  • GitHub tool.
  • E-mail tool.
  • Opacity option.
  • Pressing 'Tab' key switches focus to buttons bar when it's opened -instead of following current position-, on first button.
  • Pressing 'Esc' key closes buttons bar.
  • 'CustomActions' option for custom buttons. Takes an array of objects with the same properties than the default ones (title, onClick, icon). Example is provided on html file.
  • Scale configuration option to change overall size.
  • Tooltip text on icons.
  • General code cleanup.
  • Popover is now animated.
  • Buttons bar is now displayed at bottom if it can not be drawn at top.
  • Icons are now buttons for all accessibility purposes (can be used with 'Tab' key).

I plan to maintain it and keep updating it.

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.