trix-gem 0.11.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +15 -0
- data/Appraisals +23 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +181 -0
- data/LICENSE.txt +21 -0
- data/README.md +73 -0
- data/Rakefile +11 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/formtastic/inputs/trix_editor_input.rb +17 -0
- data/lib/trix.rb +8 -0
- data/lib/trix/engine.rb +17 -0
- data/lib/trix/form.rb +61 -0
- data/lib/trix/simple_form/trix_editor_input.rb +12 -0
- data/lib/trix/version.rb +3 -0
- data/trix-gem.gemspec +32 -0
- data/vendor/assets/javascripts/trix.js +21 -0
- data/vendor/assets/stylesheets/trix.css +293 -0
- metadata +197 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a6f0456463ab39eef6cc1b6b9ed04f19473d0e69
|
4
|
+
data.tar.gz: ca41e819b4a0dde3b6e3ecda1eb43c27045132d1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: cdb9afdee1b101d79902eb7df4ced6e0df6537f9c3f337057a24ac972d30eed72ae6a288a4bfde7aa4eade26ff16495a419b83db4ff7b1ea84eb698a23e239ff
|
7
|
+
data.tar.gz: c885a3b621a0a10c03c8d9eb5cafd8689f5acaf45dd3fae6b1858350af9432e0c9872909b32c461f97d0cf0aeabf638772523bd7ef3fd0a7b8f141f4a0fb64f6
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 2.2.7
|
4
|
+
- 2.3.4
|
5
|
+
- 2.4.1
|
6
|
+
gemfile:
|
7
|
+
- gemfiles/rails_4.2.gemfile
|
8
|
+
- gemfiles/rails_5.0.gemfile
|
9
|
+
- gemfiles/rails_5.1.gemfile
|
10
|
+
- gemfiles/rails_5.2.gemfile
|
11
|
+
- gemfiles/rails_master.gemfile
|
12
|
+
matrix:
|
13
|
+
allow_failures:
|
14
|
+
- gemfile: 'gemfiles/rails_master.gemfile'
|
15
|
+
before_install: gem install bundler -v 1.11.2
|
data/Appraisals
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
appraise "rails-4.2" do
|
2
|
+
gem "rails", "~> 4.2.0"
|
3
|
+
end
|
4
|
+
|
5
|
+
appraise "rails-5.0" do
|
6
|
+
gem "rails", "~> 5.0.0"
|
7
|
+
end
|
8
|
+
|
9
|
+
appraise "rails-5.1" do
|
10
|
+
gem "rails", "~> 5.1.0"
|
11
|
+
end
|
12
|
+
|
13
|
+
appraise "rails-5.2" do
|
14
|
+
gem "rails", "~> 5.2.0"
|
15
|
+
end
|
16
|
+
|
17
|
+
appraise "rails-master" do
|
18
|
+
gem "rails", git: "https://github.com/rails/rails.git", branch: "master"
|
19
|
+
gem "arel", git: "https://github.com/rails/arel.git", branch: "master"
|
20
|
+
%w[rspec-core rspec-expectations rspec-mocks rspec-rails rspec-support].each do |lib|
|
21
|
+
gem lib, git: "https://github.com/rspec/#{lib}.git", branch: 'master'
|
22
|
+
end
|
23
|
+
end
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at DRBragg@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,181 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
trix-gem (0.11.2)
|
5
|
+
rails (> 4.1, <= 6.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
actioncable (5.2.0)
|
11
|
+
actionpack (= 5.2.0)
|
12
|
+
nio4r (~> 2.0)
|
13
|
+
websocket-driver (>= 0.6.1)
|
14
|
+
actionmailer (5.2.0)
|
15
|
+
actionpack (= 5.2.0)
|
16
|
+
actionview (= 5.2.0)
|
17
|
+
activejob (= 5.2.0)
|
18
|
+
mail (~> 2.5, >= 2.5.4)
|
19
|
+
rails-dom-testing (~> 2.0)
|
20
|
+
actionpack (5.2.0)
|
21
|
+
actionview (= 5.2.0)
|
22
|
+
activesupport (= 5.2.0)
|
23
|
+
rack (~> 2.0)
|
24
|
+
rack-test (>= 0.6.3)
|
25
|
+
rails-dom-testing (~> 2.0)
|
26
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
27
|
+
actionview (5.2.0)
|
28
|
+
activesupport (= 5.2.0)
|
29
|
+
builder (~> 3.1)
|
30
|
+
erubi (~> 1.4)
|
31
|
+
rails-dom-testing (~> 2.0)
|
32
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
33
|
+
activejob (5.2.0)
|
34
|
+
activesupport (= 5.2.0)
|
35
|
+
globalid (>= 0.3.6)
|
36
|
+
activemodel (5.2.0)
|
37
|
+
activesupport (= 5.2.0)
|
38
|
+
activerecord (5.2.0)
|
39
|
+
activemodel (= 5.2.0)
|
40
|
+
activesupport (= 5.2.0)
|
41
|
+
arel (>= 9.0)
|
42
|
+
activestorage (5.2.0)
|
43
|
+
actionpack (= 5.2.0)
|
44
|
+
activerecord (= 5.2.0)
|
45
|
+
marcel (~> 0.3.1)
|
46
|
+
activesupport (5.2.0)
|
47
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
48
|
+
i18n (>= 0.7, < 2)
|
49
|
+
minitest (~> 5.1)
|
50
|
+
tzinfo (~> 1.1)
|
51
|
+
appraisal (2.2.0)
|
52
|
+
bundler
|
53
|
+
rake
|
54
|
+
thor (>= 0.14.0)
|
55
|
+
arel (9.0.0)
|
56
|
+
ast (2.4.0)
|
57
|
+
astrolabe (1.3.1)
|
58
|
+
parser (~> 2.2)
|
59
|
+
builder (3.2.3)
|
60
|
+
concurrent-ruby (1.0.5)
|
61
|
+
crass (1.0.4)
|
62
|
+
diff-lcs (1.3)
|
63
|
+
erubi (1.7.1)
|
64
|
+
formtastic (3.1.5)
|
65
|
+
actionpack (>= 3.2.13)
|
66
|
+
globalid (0.4.1)
|
67
|
+
activesupport (>= 4.2.0)
|
68
|
+
i18n (1.0.1)
|
69
|
+
concurrent-ruby (~> 1.0)
|
70
|
+
loofah (2.2.2)
|
71
|
+
crass (~> 1.0.2)
|
72
|
+
nokogiri (>= 1.5.9)
|
73
|
+
mail (2.7.0)
|
74
|
+
mini_mime (>= 0.1.1)
|
75
|
+
marcel (0.3.2)
|
76
|
+
mimemagic (~> 0.3.2)
|
77
|
+
method_source (0.9.0)
|
78
|
+
mimemagic (0.3.2)
|
79
|
+
mini_mime (1.0.0)
|
80
|
+
mini_portile2 (2.3.0)
|
81
|
+
minitest (5.11.3)
|
82
|
+
nio4r (2.3.1)
|
83
|
+
nokogiri (1.8.4)
|
84
|
+
mini_portile2 (~> 2.3.0)
|
85
|
+
parser (2.5.1.2)
|
86
|
+
ast (~> 2.4.0)
|
87
|
+
powerpack (0.1.2)
|
88
|
+
rack (2.0.5)
|
89
|
+
rack-test (1.0.0)
|
90
|
+
rack (>= 1.0, < 3)
|
91
|
+
rails (5.2.0)
|
92
|
+
actioncable (= 5.2.0)
|
93
|
+
actionmailer (= 5.2.0)
|
94
|
+
actionpack (= 5.2.0)
|
95
|
+
actionview (= 5.2.0)
|
96
|
+
activejob (= 5.2.0)
|
97
|
+
activemodel (= 5.2.0)
|
98
|
+
activerecord (= 5.2.0)
|
99
|
+
activestorage (= 5.2.0)
|
100
|
+
activesupport (= 5.2.0)
|
101
|
+
bundler (>= 1.3.0)
|
102
|
+
railties (= 5.2.0)
|
103
|
+
sprockets-rails (>= 2.0.0)
|
104
|
+
rails-dom-testing (2.0.3)
|
105
|
+
activesupport (>= 4.2.0)
|
106
|
+
nokogiri (>= 1.6)
|
107
|
+
rails-html-sanitizer (1.0.4)
|
108
|
+
loofah (~> 2.2, >= 2.2.2)
|
109
|
+
railties (5.2.0)
|
110
|
+
actionpack (= 5.2.0)
|
111
|
+
activesupport (= 5.2.0)
|
112
|
+
method_source
|
113
|
+
rake (>= 0.8.7)
|
114
|
+
thor (>= 0.18.1, < 2.0)
|
115
|
+
rainbow (2.2.2)
|
116
|
+
rake
|
117
|
+
rake (10.5.0)
|
118
|
+
rspec-activemodel-mocks (1.0.3)
|
119
|
+
activemodel (>= 3.0)
|
120
|
+
activesupport (>= 3.0)
|
121
|
+
rspec-mocks (>= 2.99, < 4.0)
|
122
|
+
rspec-core (3.7.1)
|
123
|
+
rspec-support (~> 3.7.0)
|
124
|
+
rspec-expectations (3.7.0)
|
125
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
126
|
+
rspec-support (~> 3.7.0)
|
127
|
+
rspec-mocks (3.7.0)
|
128
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
129
|
+
rspec-support (~> 3.7.0)
|
130
|
+
rspec-rails (3.7.2)
|
131
|
+
actionpack (>= 3.0)
|
132
|
+
activesupport (>= 3.0)
|
133
|
+
railties (>= 3.0)
|
134
|
+
rspec-core (~> 3.7.0)
|
135
|
+
rspec-expectations (~> 3.7.0)
|
136
|
+
rspec-mocks (~> 3.7.0)
|
137
|
+
rspec-support (~> 3.7.0)
|
138
|
+
rspec-support (3.7.1)
|
139
|
+
rubocop (0.35.1)
|
140
|
+
astrolabe (~> 1.3)
|
141
|
+
parser (>= 2.2.3.0, < 3.0)
|
142
|
+
powerpack (~> 0.1)
|
143
|
+
rainbow (>= 1.99.1, < 3.0)
|
144
|
+
ruby-progressbar (~> 1.7)
|
145
|
+
tins (<= 1.6.0)
|
146
|
+
ruby-progressbar (1.9.0)
|
147
|
+
simple_form (4.0.1)
|
148
|
+
actionpack (>= 5.0)
|
149
|
+
activemodel (>= 5.0)
|
150
|
+
sprockets (3.7.2)
|
151
|
+
concurrent-ruby (~> 1.0)
|
152
|
+
rack (> 1, < 3)
|
153
|
+
sprockets-rails (3.2.1)
|
154
|
+
actionpack (>= 4.0)
|
155
|
+
activesupport (>= 4.0)
|
156
|
+
sprockets (>= 3.0.0)
|
157
|
+
thor (0.20.0)
|
158
|
+
thread_safe (0.3.6)
|
159
|
+
tins (1.6.0)
|
160
|
+
tzinfo (1.2.5)
|
161
|
+
thread_safe (~> 0.1)
|
162
|
+
websocket-driver (0.7.0)
|
163
|
+
websocket-extensions (>= 0.1.0)
|
164
|
+
websocket-extensions (0.1.3)
|
165
|
+
|
166
|
+
PLATFORMS
|
167
|
+
ruby
|
168
|
+
|
169
|
+
DEPENDENCIES
|
170
|
+
appraisal
|
171
|
+
bundler (~> 1.10)
|
172
|
+
formtastic (~> 3.0)
|
173
|
+
rake (~> 10.0)
|
174
|
+
rspec-activemodel-mocks
|
175
|
+
rspec-rails
|
176
|
+
rubocop (= 0.35.1)
|
177
|
+
simple_form (~> 4.0)
|
178
|
+
trix-gem!
|
179
|
+
|
180
|
+
BUNDLED WITH
|
181
|
+
1.16.1
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 DRBragg
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
# Trix Gem
|
2
|
+
|
3
|
+
Want to include Basecamp's awesome [Trix WYSIWYG
|
4
|
+
editor](http://trix-editor.org) in your Ruby on Rails application?
|
5
|
+
You've come to the right place!
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
The `trix-gem` makes it easy to drop Trix into Rails with the asset pipeline.
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'trix-gem'
|
15
|
+
```
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
$ bundle
|
20
|
+
|
21
|
+
Or install it yourself as:
|
22
|
+
|
23
|
+
$ gem install trix-gem
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
Import Trix styles in `app/assets/stylesheets/application.css`:
|
28
|
+
|
29
|
+
```css
|
30
|
+
*= require trix
|
31
|
+
```
|
32
|
+
|
33
|
+
Require Trix Javascript magic in `app/assets/javascripts/application.js`:
|
34
|
+
|
35
|
+
```js
|
36
|
+
//= require trix
|
37
|
+
```
|
38
|
+
|
39
|
+
Finally, any place where you would like to use the Trix editor in your
|
40
|
+
forms, just use the `trix_editor` helper:
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
f.trix_editor :body
|
44
|
+
```
|
45
|
+
|
46
|
+
If you are using the [Formtastic](https://github.com/justinfrench/formtastic) gem or the [Simple Form](https://github.com/plataformatec/simple_form) gem, you can do this:
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
f.input :body, as: :trix_editor
|
50
|
+
```
|
51
|
+
|
52
|
+
## Trix
|
53
|
+
|
54
|
+
For the official Trix Github repository, go
|
55
|
+
[here](https://github.com/basecamp/trix).
|
56
|
+
|
57
|
+
## Development
|
58
|
+
|
59
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
60
|
+
|
61
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
62
|
+
|
63
|
+
## Contributing
|
64
|
+
|
65
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/DRBragg/trix-gem. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
66
|
+
|
67
|
+
## License
|
68
|
+
|
69
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
70
|
+
|
71
|
+
## Code of Conduct
|
72
|
+
|
73
|
+
Everyone interacting in the Trix-gem project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/DRBragg/trix-gem/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "trix"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|