effective_bootstrap 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c8ff2ddc7846693eda910018d90b746abe50f7a617eea476edd16920672df78
4
- data.tar.gz: 544986295a3ac4a9b05e5cdf70f17b766682c4f95c8ba9ac0a551ebfa8c07fef
3
+ metadata.gz: 4538dcdf672ff18dadb24146b5186498ffad746ff81d736fbfd24ba8f23a7f89
4
+ data.tar.gz: b0a95bd9c6d58c1a3cf86da55a871c5d5da85faa4296d9d5de3201bd6b45ba67
5
5
  SHA512:
6
- metadata.gz: ee013e77368c0443632902e1a67870012d270e8d15fa4051aa9cf3e67d479b4f121e40a4b2b8aee389370bf183fcecdbc4dac0c79f8dae4c75b9c580d63d38ce
7
- data.tar.gz: 363f67e6ac798acd14506af81b769d5e8d56fe130281719bd71743f1738193a615e943b7df7df7039446eb19cd2bc359e4b8776040a43279f39eb4c4b9e5829b
6
+ metadata.gz: 653f533b1ae794be6558a9da86c99fc4c69bab5fe19c85a16395a10b24d3c8d43c4878386586006dea73d1380177c09ffeb5fca5986dc317b452f5a003251ea9
7
+ data.tar.gz: eedc133811ffea31458b65ae3d2c76a2562b410ac285d25bdf07056568cc0ac587b708b310bcedc278f180bf769970ee5996f27afde0bd4ac0d04e2999bf76d4
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.input :end_at, date_linked: false
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
- //= require ./effective_editor/input
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
- $(document).on 'confirm:complete', (event) -> $(event.target).data('confirmed')
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
+ .trix-content {
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; }
@@ -154,11 +154,13 @@ module EffectiveBootstrapHelper
154
154
  end
155
155
 
156
156
  # Works with dots ao and dropdown do
157
- def dropdown_divider
157
+ def dropdown_divider(options = {})
158
+ options[:class] = [options[:class], 'dropdown-divider'].compact.join(' ')
159
+
158
160
  unless @_dropdown_link_tos
159
- content_tag(:div, '', class: 'dropdown-divider')
161
+ content_tag(:div, '', options)
160
162
  else
161
- @_dropdown_link_tos << content_tag(:div, '', class: 'dropdown-divider')
163
+ @_dropdown_link_tos << content_tag(:div, '', options)
162
164
  nil
163
165
  end
164
166
  end
@@ -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
@@ -0,0 +1,11 @@
1
+ module Effective
2
+ module FormInputs
3
+ class RichTextArea < Effective::FormInput
4
+
5
+ def input_html_options
6
+ { class: 'form-control effective_rich_text_area trix-content', id: tag_id }
7
+ end
8
+
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.8.1'.freeze
2
+ VERSION = '0.9.0'.freeze
3
3
  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.8.1
4
+ version: 0.9.0
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-08-29 00:00:00.000000000 Z
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.2
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.