No commit activity in last 3 years
No release in over 3 years
Integrate majTextCounter with Rails asset pipelin for easy of use
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.5
~> 4.2
~> 0.14

Runtime

~> 4.0
~> 5.0.1
 Project Readme

MajTextCounter for rails asset pipeline

MajTextCounter is a library for counting and limiting characters/words on text input, or textarea, elements (using .val()).

The maj-text-counter-rails gem integrates the MajTextCounter with the Rails asset pipeline.

Installation

Include maj-text-counter-rails in Gemefile

gem 'maj-text-counter-rails'

Then run bundle install

Usage

Add to your app/assets/javascripts/application.js if use with jQuery

//= require maj-text-counter

Add to your app/assets/stylesheets/application.css

*= require maj-text-counter

Basic usage:

$('input').majTextCounter();

Limit to a maximum words count:

$('input').majTextCounter({
	wordLimit: 10,
});

Limit to a maximum caracters count:

$('input').majTextCounter({
	carLimit: 10,
});

Speak french ?:

$('input').majTextCounter({
    words: "mots",
    letters: "lettres",
    separator: " & ",
    maximum: "MAX :",
});

Contributing

  1. Fork it ( http://github.com//majTextCounter-rails/fork )
  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

Authors

miseajour.net