Skip to content

Ouadie/jquery-overlay

 
 

Repository files navigation

Simple Decorator for Textarea

Demo

How to Use

$('textarea').overlay(strategies);

strategies MUST an Array of Object.

strategies = [strategy];

Each strategy MUST have match and css properties.

strategy = {
  match: matchObject,
  css: cssObject
};

matchObject MUST be a RegExp, a String or an Array of String. When it is a RegExp, it SHOULD include 'g' flag.

matchObject = 'abc';  // every 'abc' match
matchobject = ['a', 'b', 'c'];  // every 'a' 'b' and 'c' match
matchObject = /\B@\w+/g; // every words start with @ match

cssObject MUST be a Object. Currently 'background-color' is only available.

cssObject = {
  'background-color': 'glay',
  color: 'red'  // ignored
};

Todo

  • Auto resizing textarea

License

Licensed under the MIT License

About

Simple Decorator for Textarea

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 86.0%
  • CSS 11.7%
  • HTML 2.3%