maxchars 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  module Maxchars
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/maxchars.rb CHANGED
@@ -1,5 +1,8 @@
1
1
  require "maxchars/version"
2
2
 
3
3
  module Maxchars
4
- # Your code goes here...
4
+ module Rails
5
+ class Engine < ::Rails::Engine
6
+ end
7
+ end
5
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maxchars
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-07-04 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jquery-rails
16
- requirement: &70217719998200 !ruby/object:Gem::Requirement
16
+ requirement: &70240659838860 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '1.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70217719998200
24
+ version_requirements: *70240659838860
25
25
  description: jquery plugin to restrict characters that can be put into an input field
26
26
  or text area. Displays remaining characters in a tipsy tooltip.
27
27
  email:
@@ -38,8 +38,6 @@ files:
38
38
  - lib/maxchars.rb
39
39
  - lib/maxchars/version.rb
40
40
  - maxchars.gemspec
41
- - vendor/assets/javascripts/maxChars.js
42
- - vendor/assets/javascripts/maxChars.js.coffee
43
41
  homepage: ''
44
42
  licenses: []
45
43
  post_install_message:
@@ -1,35 +0,0 @@
1
- (function() {
2
-
3
- $.fn.extend({
4
- maxChars: function(setMaxLen) {
5
- return this.each(function() {
6
- return $(this).tipsy({
7
- gravity: 'w',
8
- trigger: 'focus',
9
- html: true
10
- }).each(function() {
11
- var el, hardLimit, maxLen, template;
12
- el = $(this);
13
- maxLen = setMaxLen != null ? setMaxLen : el.data('maxlen');
14
- template = el.data('maxlen-text') || 'remaining chars: %x';
15
- hardLimit = !el.data('maxlen-soft');
16
- return el.data('doUpdateTitle', function() {
17
- var len, remaining, remainingText;
18
- len = el.val().length;
19
- if (hardLimit && (len > maxLen)) {
20
- el.val(el.val().substr(0, maxLen));
21
- len = maxLen;
22
- }
23
- remaining = maxLen - len;
24
- remainingText = template.replace(/%x/, remaining);
25
- el.attr('title', remainingText).tipsy('hide').tipsy('show');
26
- return len;
27
- });
28
- }).live('keyup', function() {
29
- return $(this).data('doUpdateTitle')();
30
- });
31
- });
32
- }
33
- });
34
-
35
- }).call(this);
@@ -1,21 +0,0 @@
1
- # needs jquery + tipsy
2
- $.fn.extend
3
- maxChars: (setMaxLen) ->
4
- this.each ->
5
- $(this).tipsy({gravity: 'w', trigger: 'focus', html: true})
6
- .each ->
7
- el = $(this)
8
- maxLen = setMaxLen ? el.data('maxlen')
9
- template = el.data('maxlen-text') || 'remaining chars: %x'
10
- hardLimit =!el.data('maxlen-soft')
11
- el.data 'doUpdateTitle', ->
12
- len = el.val().length
13
- if hardLimit && (len > maxLen)
14
- el.val(el.val().substr(0, maxLen))
15
- len = maxLen
16
- remaining = maxLen - len
17
- remainingText = template.replace(/%x/, remaining)
18
- el.attr('title', remainingText).tipsy('hide').tipsy('show')
19
- len
20
- .live 'keyup', ->
21
- $(this).data('doUpdateTitle')()