effective_bootstrap 0.0.20 → 0.0.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/effective_bootstrap.js +1 -0
- data/app/assets/javascripts/effective_bootstrap/base.js.coffee +1 -1
- data/app/assets/javascripts/effective_editor/initialize.js.coffee +12 -0
- data/app/assets/javascripts/effective_editor/input.js +2 -0
- data/app/assets/javascripts/effective_editor/quill.js +11489 -0
- data/app/assets/stylesheets/effective_bootstrap.scss +1 -0
- data/app/assets/stylesheets/effective_editor/input.scss +2 -0
- data/app/assets/stylesheets/effective_editor/overrides.scss +13 -0
- data/app/assets/stylesheets/effective_editor/quill.css +945 -0
- data/app/models/effective/form_builder.rb +4 -0
- data/app/models/effective/form_inputs/editor.rb +32 -0
- data/lib/effective_bootstrap/version.rb +1 -1
- metadata +9 -2
@@ -41,6 +41,10 @@ module Effective
|
|
41
41
|
Effective::FormInputs::Delete.new(name, options, builder: self).to_html(&block)
|
42
42
|
end
|
43
43
|
|
44
|
+
def editor(name, options = {}, &block)
|
45
|
+
Effective::FormInputs::Editor.new(name, options, builder: self).to_html(&block)
|
46
|
+
end
|
47
|
+
|
44
48
|
def email_field(name, options = {})
|
45
49
|
Effective::FormInputs::EmailField.new(name, options, builder: self).to_html { super(name, options) }
|
46
50
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Effective
|
2
|
+
module FormInputs
|
3
|
+
class Editor < Effective::FormInput
|
4
|
+
|
5
|
+
def build_input(&block)
|
6
|
+
content = value.presence || (capture(&block) if block_given?)
|
7
|
+
|
8
|
+
@builder.super_text_field(name, options[:input]) +
|
9
|
+
content_tag(:div, '', class: 'ql-effective', id: unique_id + '_editor')
|
10
|
+
end
|
11
|
+
|
12
|
+
def input_html_options
|
13
|
+
{ class: 'effective-editor form-control', id: unique_id }
|
14
|
+
end
|
15
|
+
|
16
|
+
def input_js_options
|
17
|
+
{ modules: { toolbar: toolbar }, theme: 'snow', placeholder: "Add #{name.to_s.pluralize}..." }
|
18
|
+
end
|
19
|
+
|
20
|
+
def toolbar
|
21
|
+
[
|
22
|
+
[{ 'header': [1, 2, 3, 4, false] }],
|
23
|
+
['bold', 'italic', 'underline'],
|
24
|
+
['link', 'image', 'video', 'code-block'],
|
25
|
+
[{ 'list': 'ordered'}, { 'list': 'bullet' }],
|
26
|
+
[{ 'align': [] }, 'clean'],
|
27
|
+
]
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_bootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -382,6 +382,9 @@ files:
|
|
382
382
|
- app/assets/javascripts/effective_datetime/moment.js
|
383
383
|
- app/assets/javascripts/effective_datetime/overrides.js.coffee
|
384
384
|
- app/assets/javascripts/effective_datetime/turbolinks.js.coffee
|
385
|
+
- app/assets/javascripts/effective_editor/initialize.js.coffee
|
386
|
+
- app/assets/javascripts/effective_editor/input.js
|
387
|
+
- app/assets/javascripts/effective_editor/quill.js
|
385
388
|
- app/assets/javascripts/effective_file/initialize.js.coffee
|
386
389
|
- app/assets/javascripts/effective_file/input.js
|
387
390
|
- app/assets/javascripts/effective_phone/initialize.js.coffee
|
@@ -406,6 +409,9 @@ files:
|
|
406
409
|
- app/assets/stylesheets/effective_datetime/bootstrap-datetimepicker.scss
|
407
410
|
- app/assets/stylesheets/effective_datetime/input.scss
|
408
411
|
- app/assets/stylesheets/effective_datetime/overrides.scss
|
412
|
+
- app/assets/stylesheets/effective_editor/input.scss
|
413
|
+
- app/assets/stylesheets/effective_editor/overrides.scss
|
414
|
+
- app/assets/stylesheets/effective_editor/quill.css
|
409
415
|
- app/assets/stylesheets/effective_file/input.scss
|
410
416
|
- app/assets/stylesheets/effective_radio/input.scss
|
411
417
|
- app/assets/stylesheets/effective_select/bootstrap-theme.css
|
@@ -425,6 +431,7 @@ files:
|
|
425
431
|
- app/models/effective/form_inputs/date_field.rb
|
426
432
|
- app/models/effective/form_inputs/datetime_field.rb
|
427
433
|
- app/models/effective/form_inputs/delete.rb
|
434
|
+
- app/models/effective/form_inputs/editor.rb
|
428
435
|
- app/models/effective/form_inputs/email_field.rb
|
429
436
|
- app/models/effective/form_inputs/error_field.rb
|
430
437
|
- app/models/effective/form_inputs/file_field.rb
|