autogrow-textarea-rails 3.1.0
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.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +20 -0
- data/Rakefile +1 -0
- data/autogrow-textarea-rails.gemspec +23 -0
- data/lib/autogrow-textarea-rails.rb +5 -0
- data/lib/autogrow-textarea/engine.rb +6 -0
- data/lib/autogrow-textarea/version.rb +3 -0
- data/vendor/assets/stylesheets/jquery.autogrowtextarea.js +61 -0
- metadata +83 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 39f3e57a8a211df9505e7978afb195ece04c48c8
|
4
|
+
data.tar.gz: 6fb414e1e17ef1feaea0db4463e25c5a2955c24e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c8076bfce6df0ea0f0777b508ebd2a479842f7796df47fa70881ad2fba8ee198f6f3331ec9624bf846399b9bb1db49c802541529fe946641b8cb91c4d5fe7d4c
|
7
|
+
data.tar.gz: 7eaa7adde4405510369edd4b66b4207f8d296b6f25b0c8bdab6bcce21f782b4fe089345c84fa11758c188b360e4f7d46e5d3fd357707def099e5dba8a7169518
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Caleb Thompson
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# Autogrow-Textarea for Rails
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
Rails asset pipeline wrapper for [Autogrow-Textarea](https://github.com/jevin/Autogrow-Textarea)
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
gem 'autogrow-textarea-rails'
|
11
|
+
|
12
|
+
And in `app/assets/javascripts/application.js`:
|
13
|
+
|
14
|
+
//= require "jquery.autogrowtextarea"
|
15
|
+
|
16
|
+
## License
|
17
|
+
|
18
|
+
Autogrow-Textarea is licensed under Beerware.
|
19
|
+
|
20
|
+
http://www.technoreply.com/autogrow-textarea-plugin-3-0/
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'autogrow-textarea/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "autogrow-textarea-rails"
|
8
|
+
spec.version = AutogrowTextarea::VERSION
|
9
|
+
spec.authors = ["Caleb Thompson"]
|
10
|
+
spec.email = ["cjaysson@gmail.com"]
|
11
|
+
spec.summary = "A jQuery plugin that allows textareas to grow vertically when text is typed in."
|
12
|
+
spec.description = "Rails asset pipeline around Autogrow-Textarea"
|
13
|
+
spec.homepage = "http://www.technoreply.com/autogrow-textarea-plugin-3-0/"
|
14
|
+
spec.license = "Beerware"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
/*
|
2
|
+
* ----------------------------------------------------------------------------
|
3
|
+
* "THE BEER-WARE LICENSE" (Revision 42):
|
4
|
+
* <jevin9@gmail.com> wrote this file. As long as you retain this notice you
|
5
|
+
* can do whatever you want with this stuff. If we meet some day, and you think
|
6
|
+
* this stuff is worth it, you can buy me a beer in return. Jevin O. Sewaruth
|
7
|
+
* ----------------------------------------------------------------------------
|
8
|
+
*
|
9
|
+
* Autogrow Textarea Plugin Version v3.1
|
10
|
+
* http://www.technoreply.com/autogrow-textarea-plugin-3-0
|
11
|
+
*
|
12
|
+
* THIS PLUGIN IS DELIVERD ON A PAY WHAT YOU WHANT BASIS. IF THE PLUGIN WAS
|
13
|
+
* USEFUL TO YOU, PLEASE CONSIDER BUYING THE PLUGIN HERE :
|
14
|
+
* https://sites.fastspring.com/technoreply/instant/autogrowtextareaplugin
|
15
|
+
*
|
16
|
+
* Date: February 7, 2013
|
17
|
+
*/
|
18
|
+
|
19
|
+
jQuery.fn.autoGrow = function() {
|
20
|
+
return this.each(function() {
|
21
|
+
|
22
|
+
var createMirror = function(textarea) {
|
23
|
+
jQuery(textarea).after('<div class="autogrow-textarea-mirror"></div>');
|
24
|
+
return jQuery(textarea).next('.autogrow-textarea-mirror')[0];
|
25
|
+
}
|
26
|
+
|
27
|
+
var sendContentToMirror = function (textarea) {
|
28
|
+
mirror.innerHTML = String(textarea.value).replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '>').replace(/\n/g, '<br />') + '.<br/>.';
|
29
|
+
|
30
|
+
if (jQuery(textarea).height() != jQuery(mirror).height())
|
31
|
+
jQuery(textarea).height(jQuery(mirror).height());
|
32
|
+
}
|
33
|
+
|
34
|
+
var growTextarea = function () {
|
35
|
+
sendContentToMirror(this);
|
36
|
+
}
|
37
|
+
|
38
|
+
// Create a mirror
|
39
|
+
var mirror = createMirror(this);
|
40
|
+
|
41
|
+
// Style the mirror
|
42
|
+
mirror.style.display = 'none';
|
43
|
+
mirror.style.wordWrap = 'break-word';
|
44
|
+
mirror.style.padding = jQuery(this).css('padding');
|
45
|
+
mirror.style.width = jQuery(this).css('width');
|
46
|
+
mirror.style.fontFamily = jQuery(this).css('font-family');
|
47
|
+
mirror.style.fontSize = jQuery(this).css('font-size');
|
48
|
+
mirror.style.lineHeight = jQuery(this).css('line-height');
|
49
|
+
|
50
|
+
// Style the textarea
|
51
|
+
this.style.overflow = "hidden";
|
52
|
+
this.style.minHeight = this.rows+"em";
|
53
|
+
|
54
|
+
// Bind the textarea's event
|
55
|
+
this.onkeyup = growTextarea;
|
56
|
+
|
57
|
+
// Fire the event for text already present
|
58
|
+
sendContentToMirror(this);
|
59
|
+
|
60
|
+
});
|
61
|
+
};
|
metadata
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: autogrow-textarea-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Caleb Thompson
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-04-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: Rails asset pipeline around Autogrow-Textarea
|
42
|
+
email:
|
43
|
+
- cjaysson@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- .gitignore
|
49
|
+
- Gemfile
|
50
|
+
- LICENSE.txt
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- autogrow-textarea-rails.gemspec
|
54
|
+
- lib/autogrow-textarea-rails.rb
|
55
|
+
- lib/autogrow-textarea/engine.rb
|
56
|
+
- lib/autogrow-textarea/version.rb
|
57
|
+
- vendor/assets/stylesheets/jquery.autogrowtextarea.js
|
58
|
+
homepage: http://www.technoreply.com/autogrow-textarea-plugin-3-0/
|
59
|
+
licenses:
|
60
|
+
- Beerware
|
61
|
+
metadata: {}
|
62
|
+
post_install_message:
|
63
|
+
rdoc_options: []
|
64
|
+
require_paths:
|
65
|
+
- lib
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
requirements: []
|
77
|
+
rubyforge_project:
|
78
|
+
rubygems_version: 2.0.0
|
79
|
+
signing_key:
|
80
|
+
specification_version: 4
|
81
|
+
summary: A jQuery plugin that allows textareas to grow vertically when text is typed
|
82
|
+
in.
|
83
|
+
test_files: []
|