Skip to content

mwanji/jscolor-rails

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 

jscolor-rails

A gem that makes JSColor available to Rails applications.

Installation

Add this line to your application's Gemfile:

gem 'jscolor-rails'

And then execute:

$ bundle

Or install it yourself as:

$ gem install jscolor-rails

Usage

Add the following to any JavaScript file:

//= require jscolor

Notes

The gem's jscolor.js is NOT the library itself. It simply requires the original jscolor file (renamed to jscolor_vendor.js) and adds compatibility with Turbolinks and the asset pipeline.

jscolor.dir's default value has been changed to '/assets/' because jscolor's auto-detect fails to find the images in production mode. To change the path to the asset directory, do the following in your application's JS files:

jscolor.dir = '/path/to/assets/';

Versioning

The gem version number tracks JSColor's version number.

The major, minor, and patch version numbers will always represent the JSColor version. Should a gem bug be discovered, a 4th version identifier will be added and incremented.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Changelog

  • 17/12/2014 1.4.4 Updated jscolor.js to 1.4.4
  • 07/02/2013 1.4.2.1 Support for Rails 4 asset pipeline and Turbolinks. Moved customisations out of vendor jscolor.js.
  • 17/12/2013 1.4.2 Updated jscolor.js to 1.4.2
  • 21/01/2013 1.4.0.1 Fixed image URL in production mode
  • 20/12/2013 1.4.0 Initial release

About

Integrates JSColor into the Rails asset pipeline

Resources

License

Stars

Watchers

Forks

Packages

No packages published