active_admin_trix 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: cd53bcfb06558795981db6a060f8ff2fdffac68b1f7f43938589c9bd88cd2b7b
4
+ data.tar.gz: a605cf8beeb0506605057799852812eabfb3aefc321ea7e349f871f094a09a66
5
+ SHA512:
6
+ metadata.gz: 91ede5c56a4d486f4ca3ef880e5e0f0d11da11d99dc4d10f757162c81ceef760e6a1f2ad63595a329cb9b345cc26c2afd95d6f1fddc189a0e5266b83a81704fe
7
+ data.tar.gz: 227277deb57bcf7600f80072b1e4e15ec2d36099d7d9d1c3a9030873a9aeb25910a7ddcae9ec60ebdb0f039783ae847b1c119cc62a9f2a2f06da8fd8f91aab3e
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2017 Tim Glen
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # ActiveAdmin::Trix
2
+ Trix is a text editor written for Basecamp. It's simple and cool and ActiveAdmin needed a plugin for it.
3
+
4
+ ## Usage
5
+ In your config/initializer/active_admin.rb
6
+ add
7
+ ```ruby
8
+ config.register_stylesheet 'https://cdn.bootcss.com/trix/1.0.0/trix.css'
9
+ config.register_javascript 'https://cdn.bootcss.com/trix/1.0.0/trix.js'
10
+ ```
11
+
12
+ In your activeadmin form block, implement the Trix editor like so:
13
+ ```ruby
14
+ f.input :content, as: :trix
15
+ ```
16
+
17
+ ## Installation
18
+ Add this line to your application's Gemfile:
19
+
20
+ ```ruby
21
+ gem 'activeadmin-trix'
22
+ ```
23
+
24
+ And then execute:
25
+ ```bash
26
+ $ bundle
27
+ ```
28
+
29
+ Or install it yourself as:
30
+ ```bash
31
+ $ gem install activeadmin-trix
32
+ ```
33
+
34
+ ## Contributing
35
+ Contribution directions go here.
36
+
37
+ ## License
38
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,17 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'Formtastic::Trix'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.md')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ require 'bundler/gem_tasks'
@@ -0,0 +1,17 @@
1
+ .trix-editor-wrapper {
2
+ width: calc(80% - 22px);
3
+ display: inline-block;
4
+ font-size: 0.95em;
5
+ font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
6
+ outline: none;
7
+ }
8
+ trix-toolbar {}
9
+ trix-editor { background: #FFF; }
10
+
11
+ .trix-content {
12
+ ul { list-style: disc; }
13
+ ol { list-style: decimal; }
14
+ ul, ol {
15
+ li { margin-left: 1.25em; margin-bottom: 0.25em; }
16
+ }
17
+ }
@@ -0,0 +1,14 @@
1
+ class TrixInput < Formtastic::Inputs::StringInput
2
+ def to_html
3
+ input_wrapping do
4
+ editor_tag_params = {
5
+ input: input_html_options[:id],
6
+ class: 'trix-content'
7
+ }
8
+ editor_tag = template.content_tag('trix-editor', '', editor_tag_params)
9
+ hidden_field = builder.hidden_field(method, input_html_options)
10
+ editor = template.content_tag('div', editor_tag + hidden_field, class: 'trix-editor-wrapper')
11
+ label_html + editor
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,7 @@
1
+ require 'active_admin/trix/engine' if defined?(::Rails)
2
+ require 'active_admin/inputs/trix_input'
3
+
4
+ module ActiveAdmin
5
+ module Trix
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ActiveAdmin
2
+ # Required for trix.css and trix.js to be discoverable in the asset pipeline
3
+ module Trix
4
+ class Engine < ::Rails::Engine
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ module ActiveAdmin
2
+ module Trix
3
+ VERSION = '0.0.2'
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :formtastic_trix do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,95 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: active_admin_trix
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Leihb
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-01-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activeadmin
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: trix
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: A activeamdin input for the Trix Editor - https://trix-editor.org/
56
+ email:
57
+ - leihaibo1992@icloud.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - MIT-LICENSE
63
+ - README.md
64
+ - Rakefile
65
+ - app/assets/stylesheets/active_admin_trix.scss
66
+ - lib/active_admin/inputs/trix_input.rb
67
+ - lib/active_admin/trix.rb
68
+ - lib/active_admin/trix/engine.rb
69
+ - lib/active_admin/trix/version.rb
70
+ - lib/tasks/formtastic/trix_tasks.rake
71
+ homepage:
72
+ licenses:
73
+ - MIT
74
+ metadata: {}
75
+ post_install_message:
76
+ rdoc_options: []
77
+ require_paths:
78
+ - lib
79
+ required_ruby_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ requirements: []
90
+ rubyforge_project:
91
+ rubygems_version: 2.7.8
92
+ signing_key:
93
+ specification_version: 4
94
+ summary: Trix Editor for ActiveAdmin
95
+ test_files: []