Skip to content
Simple Decorator for Textarea
Branch: gh-pages
Clone or download
Pull request Compare This branch is 1 commit ahead, 2 commits behind yuku:gh-pages.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
media
.gitignore
.jshintrc
Gruntfile.js
README.md
bower.json
index.html
jquery.overlay.js
jquery.overlay.min.js
jquery.overlay.min.map
package.json

README.md

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

You can’t perform that action at this time.