Skip to content

victorteokw/jquery.colorfy

Repository files navigation

jquery.colorfy

jQuery plugin that colorfies your textarea.

=> Online demo and homepage

It's available on npm and bower.

Screencast

Screencast

Usage

$("#your_text_area").colorfy("yourDescriptor");

The descriptor can be registered like this

$.fn.colorfy.yourDescriptor = {
  "keyword": /function|typeof|instanceof|var/,
  "operator": /[+-*/%]/,
  "string": /(["']).*+\1/m
}

Left hand side, aka key, is css class name. Right hand side, aka value, is regexp to match.

Known Bugs

  • It only works well in Safari and Chrome.
  • In Firefox when user press enter/return, cursor jumps incorrectly.
  • Due to system input method, Chinese and Japanese are not supported.

About

jQuery plugin that colorfies your textarea

Resources

License

Stars

Watchers

Forks

Packages

No packages published