New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jquery.bangla

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jquery.bangla

A versatile bangla input tool for the web

1.3.2
latest
Source
npm
Version published
Weekly downloads
16
33.33%
Maintainers
1
Weekly downloads
 
Created
Source

Bangla Input Tools

npm (tag) Build Status NPM Downloads Maintainability License GitHub stars

A versatile bangla input tools for the web

Live Demo: https://dipu-bd.github.io/jquery.bangla/

Installation

npm i --save jquery jquery.bangla

Usage

import 'jquery.bangla';

// Or,
require('jquery.bangla');

// Then, on some editable elements...

$('input[type="text"]').bangla(); // input box

$('textarea').bangla(); // text area

$('div[contenteditable="true"]').bangla(); // content editable div

$('.note-editable').bangla() // summer-note (a free WYSWYG editor)

Usage (Browser)

  • Clone this repository and go to project folder.
  • Perform npm install
  • Then npm run build
  • Copy the script file inside dist/ folder to your static assets directory
  • See the example in gh-pages branch for usage.

API

Initial Configuration

You an pass the following configs during initialization (all configs are optional):

// all the default values are given here
$('<some-element-selectoor>').bangla({
  enable: false,
  maxSuggestions: 10,
  disableSuggestion: false,
  storeKey: '__avro--candidates',
  store: window.localStorage,
  provider: /* see below */
})
Config: enable

Pass true to enable bangla right after initialization.

Config: maxSuggestions

The maximum number of suggestions that user will see for a word.

Config: disableSuggestion

Pass true if you do not want to display the suggestion box.

Config: storeKey

The key that is used for storing candidate words.

Config: store

The storage to save candidate words. A cadidate word is a bangla word that user had select against an english word. In the next suggestion box for that english word, the cadidate word will be automatically selected.

The store should haeve two fields:

  • getItem(key): Returns the value given the key
  • setItem(key, val): Stores the value against the key to retriee it later.
Config: provider

By default, Avro Phonetic from https://github.com/omicronlab/avro-pad is used. But you can define your own provider. A provider should have three fields.

  • suggest(word): This will return an object containing words field. The field words is an array of possible bangla word for the given english word.
  • candidate(word): This will return previously selected bangla word for the english input.
  • commit(word, bangla): It will save the candidate bangla word for an english word.

Methods

You can customize the input tool after initialization:

  • $('input').bangla('toggle'): Toggles the input option between bangla and english.
  • $('input').bangla('on'): Enables the bangla mode.
  • $('input').bangla('off'): Disables the bangla mode.
  • $('input').bangla('enable'): Get whether the bangla is enabled for a single element.
  • $('input').bangla('enable', true): Enables the bangla mode.
  • $('input').bangla('enable', false): Disable the bangla mode.
  • $('input').bangla('tool'): Access the BanglaInputTool instance for a single element.

License

Mozilla Public License Version 2.0

Keywords

bangla

FAQs

Package last updated on 19 Mar 2023

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