effective_bootstrap 0.8.2 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -1
- data/app/assets/images/icons/microsoft.svg +1 -0
- data/app/assets/javascripts/effective_bootstrap.js +1 -1
- data/app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb +10 -5
- data/app/assets/javascripts/effective_bootstrap_editor.js +1 -0
- data/app/assets/javascripts/effective_ck_editor/initialize.js.coffee +1 -2
- data/app/assets/stylesheets/effective_bootstrap.scss +1 -1
- data/app/assets/stylesheets/effective_bootstrap_editor.scss +1 -0
- data/app/assets/stylesheets/effective_rich_text_area/input.scss +25 -0
- data/app/models/effective/form_builder.rb +4 -0
- data/app/models/effective/form_inputs/rich_text_area.rb +11 -0
- data/lib/effective_bootstrap/version.rb +1 -1
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 456bfec1d309b5a42655fc3cc6f0974aa652447c03b5bb4087fac75234b5224b
|
4
|
+
data.tar.gz: 6cc6d0f44fe7e6e5e70252c12f00d28ab2f5d068ea55f327e6e134b4771e7edb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c74d48645ebb72fcc48cc64a528bb712b1217df473620a789788bb8055c8e55c4987e329d74bc69362891af23df7d2eaaa95655de5ba8e7cae16b76b596bff14
|
7
|
+
data.tar.gz: daffd96de52135a3c5b977bb1c4df77d6a32777b36c894d96ba951bda5b2005e1ce186a283bb0cc3be0942f6711b7c61a690f8d0b3c10ffec638e0b5e4978efe
|
data/README.md
CHANGED
@@ -323,7 +323,7 @@ The end date selector will have its date <= start_date disabled.
|
|
323
323
|
To disable this behaviour, call with `date_linked: false`.
|
324
324
|
|
325
325
|
```ruby
|
326
|
-
= f.
|
326
|
+
= f.date_field :end_at, date_linked: false
|
327
327
|
```
|
328
328
|
|
329
329
|
### Events
|
@@ -334,6 +334,34 @@ More info is available here:
|
|
334
334
|
|
335
335
|
http://eonasdan.github.io/bootstrap-datetimepicker/Events/
|
336
336
|
|
337
|
+
## Custom editor
|
338
|
+
|
339
|
+
A drop in ready rich text editor based on
|
340
|
+
|
341
|
+
https://quilljs.com/
|
342
|
+
|
343
|
+
To use the editor, you must make additional javascript and stylesheet includes:
|
344
|
+
|
345
|
+
In your application.js
|
346
|
+
|
347
|
+
```
|
348
|
+
//= require effective_bootstrap
|
349
|
+
//= require effective_bootstrap_editor
|
350
|
+
```
|
351
|
+
|
352
|
+
In your application.scss
|
353
|
+
|
354
|
+
```
|
355
|
+
@import 'effective_bootstrap';
|
356
|
+
@import 'effective_bootstrap_editor';
|
357
|
+
```
|
358
|
+
|
359
|
+
And then in any form, instead of a text area:
|
360
|
+
|
361
|
+
```
|
362
|
+
= f.editor :body
|
363
|
+
```
|
364
|
+
|
337
365
|
## Custom percent_field
|
338
366
|
|
339
367
|
This custom form input uses no 3rd party jQuery plugins.
|
@@ -622,6 +650,8 @@ The `f.save` is purely a input submit button.
|
|
622
650
|
```
|
623
651
|
|
624
652
|
|
653
|
+
|
654
|
+
|
625
655
|
## License
|
626
656
|
|
627
657
|
MIT License. Copyright [Code and Effect Inc.](http://www.codeandeffect.com/)
|
@@ -0,0 +1 @@
|
|
1
|
+
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Microsoft Azure icon</title><path d="M5.483 21.3H24L14.025 4.013l-3.038 8.347 5.836 6.938L5.483 21.3zM13.23 2.7L6.105 8.677 0 19.253h5.505v.014L13.23 2.7z"/></svg>
|
@@ -13,7 +13,7 @@
|
|
13
13
|
//= require ./effective_clear/input
|
14
14
|
//= require ./effective_checks/input
|
15
15
|
//= require ./effective_ck_editor/input
|
16
|
-
|
16
|
+
|
17
17
|
//= require ./effective_file/input
|
18
18
|
//= require ./effective_integer/input
|
19
19
|
//= require ./effective_number_text/input
|
@@ -1,6 +1,6 @@
|
|
1
|
-
# These next three methods hijack jquery_ujs data-confirm and do it our own way with a double click confirm
|
1
|
+
# These next three methods hijack rails/ujs and jquery_ujs data-confirm and do it our own way with a double click confirm
|
2
2
|
|
3
|
-
if <%= !!EffectiveBootstrap.use_custom_data_confirm %> && $.rails
|
3
|
+
if <%= !!EffectiveBootstrap.use_custom_data_confirm %> && (window.Rails || $.rails)
|
4
4
|
$(document).on 'confirm', (event) ->
|
5
5
|
$obj = $(event.target)
|
6
6
|
|
@@ -18,6 +18,11 @@ if <%= !!EffectiveBootstrap.use_custom_data_confirm %> && $.rails
|
|
18
18
|
, 4000)
|
19
19
|
false # don't show the confirmation dialog
|
20
20
|
|
21
|
-
$.rails.confirm = (message) -> true
|
22
|
-
$.rails.effective_bootstrap_custom_data_confirm = true
|
23
|
-
|
21
|
+
(window.Rails || $.rails).confirm = (message) -> true
|
22
|
+
(window.Rails || $.rails).effective_bootstrap_custom_data_confirm = true
|
23
|
+
|
24
|
+
$(document).on 'confirm:complete', (event) -> $(event.target).data('confirmed')
|
25
|
+
|
26
|
+
$(document).on 'click', 'a.dropdown-item[data-confirm]', (event) ->
|
27
|
+
event.preventDefault()
|
28
|
+
false
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require ./effective_editor/input
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# http://eonasdan.github.io/bootstrap-datetimepicker/Options/
|
2
1
|
(this.EffectiveBootstrap || {}).effective_ck_editor = ($element, options) ->
|
3
2
|
setupCkeditor($element)
|
4
3
|
initCkeditor($element, $element.data('input-js-options'))
|
@@ -69,4 +68,4 @@ initCkeditor = ($element, input_options) ->
|
|
69
68
|
ckeditor.on 'insertElement', (event) ->
|
70
69
|
element = $(event.data.$)
|
71
70
|
if element.is('table')
|
72
|
-
element.removeAttr('style').addClass('table')
|
71
|
+
element.removeAttr('style').addClass('table')
|
@@ -5,8 +5,8 @@
|
|
5
5
|
@import 'effective_date/input';
|
6
6
|
@import 'effective_time/input';
|
7
7
|
|
8
|
-
@import 'effective_editor/input';
|
9
8
|
@import 'effective_file/input';
|
9
|
+
@import 'effective_rich_text_area/input';
|
10
10
|
@import 'effective_select/input';
|
11
11
|
@import 'effective_select_or_text/input';
|
12
12
|
@import 'effective_radio/input';
|
@@ -0,0 +1 @@
|
|
1
|
+
@import 'effective_editor/input';
|
@@ -0,0 +1,25 @@
|
|
1
|
+
.effective_rich_text_area {
|
2
|
+
height: 100%;
|
3
|
+
border-color: #ccc;
|
4
|
+
|
5
|
+
&:hover,
|
6
|
+
&:active,
|
7
|
+
&:focus, {
|
8
|
+
border-color: #ccc;
|
9
|
+
outline: 0px !important;
|
10
|
+
-webkit-appearance: none;
|
11
|
+
box-shadow: none !important;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
// Bootstrap 4 Feedback client side
|
16
|
+
.was-validated .form-control:invalid ~ .trix-content, { border-color: #dc3545 !important; }
|
17
|
+
.was-validated .form-control:valid ~ .trix-content { border-color: #28a745 !important; }
|
18
|
+
.was-validated .form-control:invalid ~ trix-toolbar, { border-color: #dc3545 !important; }
|
19
|
+
.was-validated .form-control:valid ~ trix-toolbar { border-color: #28a745 !important; }
|
20
|
+
|
21
|
+
// Bootstrap 4 Server side feedback
|
22
|
+
.form-control.is-invalid ~ .trix-content { border-color: #dc3545 !important; }
|
23
|
+
.form-control.is-invalid ~ trix-toolbar { border-color: #dc3545 !important; }
|
24
|
+
.form-control.is-valid ~ .trix-content { border-color: #28a745 !important; }
|
25
|
+
.form-control.is-valid ~ trix-toolbar { border-color: #28a745 !important; }
|
@@ -100,6 +100,10 @@ module Effective
|
|
100
100
|
Effective::FormInputs::RemoteLinkTo.new(name, options, builder: self).to_html(&block)
|
101
101
|
end
|
102
102
|
|
103
|
+
def rich_text_area(name, options = {})
|
104
|
+
Effective::FormInputs::RichTextArea.new(name, options, builder: self).to_html { super(name, options) }
|
105
|
+
end
|
106
|
+
|
103
107
|
def search_field(name, options = {})
|
104
108
|
Effective::FormInputs::SearchField.new(name, options, builder: self).to_html { super(name, options) }
|
105
109
|
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.
|
4
|
+
version: 0.9.1
|
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: 2020-
|
11
|
+
date: 2020-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -262,6 +262,7 @@ files:
|
|
262
262
|
- app/assets/images/icons/message-square.svg
|
263
263
|
- app/assets/images/icons/mic-off.svg
|
264
264
|
- app/assets/images/icons/mic.svg
|
265
|
+
- app/assets/images/icons/microsoft.svg
|
265
266
|
- app/assets/images/icons/minimize-2.svg
|
266
267
|
- app/assets/images/icons/minimize.svg
|
267
268
|
- app/assets/images/icons/minus-circle.svg
|
@@ -395,6 +396,7 @@ files:
|
|
395
396
|
- app/assets/javascripts/effective_bootstrap/logic.js.coffee
|
396
397
|
- app/assets/javascripts/effective_bootstrap/other.js.coffee
|
397
398
|
- app/assets/javascripts/effective_bootstrap/tabs.js
|
399
|
+
- app/assets/javascripts/effective_bootstrap_editor.js
|
398
400
|
- app/assets/javascripts/effective_checks/initialize.js.coffee
|
399
401
|
- app/assets/javascripts/effective_checks/input.js
|
400
402
|
- app/assets/javascripts/effective_ck_editor/initialize.js.coffee
|
@@ -571,6 +573,7 @@ files:
|
|
571
573
|
- app/assets/stylesheets/effective_bootstrap/forms.scss
|
572
574
|
- app/assets/stylesheets/effective_bootstrap/icons.scss
|
573
575
|
- app/assets/stylesheets/effective_bootstrap/overrides.scss
|
576
|
+
- app/assets/stylesheets/effective_bootstrap_editor.scss
|
574
577
|
- app/assets/stylesheets/effective_checks/input.scss
|
575
578
|
- app/assets/stylesheets/effective_date/input.scss
|
576
579
|
- app/assets/stylesheets/effective_datetime/bootstrap-datetimepicker.scss
|
@@ -581,6 +584,7 @@ files:
|
|
581
584
|
- app/assets/stylesheets/effective_editor/quill.scss
|
582
585
|
- app/assets/stylesheets/effective_file/input.scss
|
583
586
|
- app/assets/stylesheets/effective_radio/input.scss
|
587
|
+
- app/assets/stylesheets/effective_rich_text_area/input.scss
|
584
588
|
- app/assets/stylesheets/effective_select/bootstrap-theme.css
|
585
589
|
- app/assets/stylesheets/effective_select/input.scss
|
586
590
|
- app/assets/stylesheets/effective_select/overrides.scss
|
@@ -620,6 +624,7 @@ files:
|
|
620
624
|
- app/models/effective/form_inputs/radios.rb
|
621
625
|
- app/models/effective/form_inputs/remote_link_to.rb
|
622
626
|
- app/models/effective/form_inputs/reset.rb
|
627
|
+
- app/models/effective/form_inputs/rich_text_area.rb
|
623
628
|
- app/models/effective/form_inputs/save.rb
|
624
629
|
- app/models/effective/form_inputs/search_field.rb
|
625
630
|
- app/models/effective/form_inputs/select.rb
|
@@ -663,7 +668,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
663
668
|
- !ruby/object:Gem::Version
|
664
669
|
version: '0'
|
665
670
|
requirements: []
|
666
|
-
rubygems_version: 3.1.
|
671
|
+
rubygems_version: 3.1.4
|
667
672
|
signing_key:
|
668
673
|
specification_version: 4
|
669
674
|
summary: Everything you need to get set up with bootstrap 4.
|