effective_bootstrap 0.10.12 → 0.10.15

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: 4457e76be27c68a8b073ec08835d3e1b23afa2b3286f82fabf576216b8adbcbb
4
- data.tar.gz: a1137338109b7e8abc7198fe3e203628bb2e889bb8a5b058b85549297f1db571
3
+ metadata.gz: 42ed4914d6a6c9b7e550da4022a4f841b69f52b6c75bb2d40df6c059349a556b
4
+ data.tar.gz: '00785b9307efdc2ba1e118a26c82dbd83f3cfd9f48c0e0bce393df2d1270ffc5'
5
5
  SHA512:
6
- metadata.gz: be559b52ec51afe5efdf66f0d990fe36fd59eb0f0be1774f0a0b8d332619027ff24b03564dd4a4a9dbc1938dc423268f15f559756d64fc8587719c480f31df96
7
- data.tar.gz: 2caa306b24fb77284da25f3e026e2e1ff9085b1611327088abc7e01376b5e0f047a857fa91edca983bad08497cc5c6448d3e035ca4b48c7707f0797c2cd0b43b
6
+ metadata.gz: caad34594f6cbaf4aa91b166ffc73fc6819d37b60fc2257a83b473535e061eb1dd43f85455b65838b4d8b04528300727f7647bdc9dc28dcffa8bec456192badb
7
+ data.tar.gz: 4be68cd869c439ae190ec4b8c44bd829609a0fede0a0592cb20a9c8cfec810e65b47afc078eefe448adf266bcea612e2a0464f8d96dc8018b1b4536a8c58775e
@@ -15,6 +15,7 @@
15
15
  else
16
16
  $element.fadeIn()
17
17
  $element.find('input,textarea,select,button').removeAttr('disabled')
18
+ $element.find('textarea.effective_article_editor').each (i, editor) -> ArticleEditor('#' + $(editor).attr('id')).enable()
18
19
 
19
20
  # Maybe disable it now
20
21
  if options.needDisable
@@ -35,6 +36,7 @@
35
36
  if matches
36
37
  $element.fadeIn()
37
38
  $element.find('input,textarea,select,button').removeAttr('disabled')
39
+ $element.find('textarea.effective_article_editor').each (i, editor) -> ArticleEditor('#' + $(editor).attr('id')).enable()
38
40
  else
39
41
  $element.hide()
40
42
  $element.find('input,textarea,select,button').prop('disabled', true)
@@ -54,6 +56,8 @@
54
56
  if found
55
57
  $element.fadeIn()
56
58
  $element.find('input,textarea,select,button').removeAttr('disabled')
59
+ $element.find('textarea.effective_article_editor').each (i, editor) -> ArticleEditor('#' + $(editor).attr('id')).enable()
60
+
57
61
  else
58
62
  $element.hide()
59
63
  $element.find('input,textarea,select,button').prop('disabled', true)
@@ -1,24 +1,24 @@
1
1
  # https://select2.github.io/examples.html
2
2
 
3
- formatWithGlyphicon = (data, container) ->
4
- if data.element && data.element.className
5
- $("<span><i class='glyphicon #{data.element.className}'></i> #{data.text}</span>")
6
- else
7
- data.text
8
-
9
- formatWithHtml = (data, container) ->
3
+ effectiveFormat = (data, container) ->
10
4
  if data.element && data.element.getAttribute('data-html')
11
5
  $(data.element.getAttribute('data-html'))
6
+ else if data.text.startsWith("<") && data.text.endsWith(">")
7
+ $(data.text)
12
8
  else
13
9
  data.text
14
10
 
15
- matchWithHtml = (params, data) ->
11
+ effectiveMatch = (params, data) ->
16
12
  return data if $.trim(params.term) == ''
17
13
  return null unless data.element?
18
14
 
19
15
  # Single item mode
20
16
  term = params.term.toLowerCase()
17
+
18
+ # The text value
21
19
  text = $(data.element.getAttribute('data-html')).text()
20
+ text = $(data.text).text() if text.length == 0
21
+ text = data.text if text.length == 0
22
22
 
23
23
  if(text.length > 0)
24
24
  if text.toLowerCase().indexOf(term) > -1 then return(data) else return(null)
@@ -29,7 +29,11 @@ matchWithHtml = (params, data) ->
29
29
  filteredChildren = []
30
30
 
31
31
  $.each(data.children, (idx, child) ->
32
+ # Text value
32
33
  text = $(child.element.getAttribute('data-html')).text()
34
+ text = $(data.text).text() if text.length == 0
35
+ text = data.text if text.length == 0
36
+
33
37
  filteredChildren.push(child) if text.toLowerCase().indexOf(term) > -1
34
38
  )
35
39
 
@@ -41,14 +45,9 @@ matchWithHtml = (params, data) ->
41
45
  return modifiedData
42
46
 
43
47
  (this.EffectiveBootstrap || {}).effective_select = ($element, options) ->
44
- switch options['template']
45
- when 'glyphicon'
46
- options['templateResult'] = formatWithGlyphicon
47
- options['templateSelection'] = formatWithGlyphicon
48
- when 'html'
49
- options['templateResult'] = formatWithHtml
50
- options['templateSelection'] = formatWithHtml
51
- options['matcher'] = matchWithHtml
48
+ options['templateResult'] = effectiveFormat
49
+ options['templateSelection'] = effectiveFormat
50
+ options['matcher'] = effectiveMatch
52
51
 
53
52
  if options['noResults']
54
53
  noResults = options['noResults']
@@ -43,7 +43,7 @@ module Effective
43
43
  '12': 'col-sm-12'
44
44
  }
45
45
  },
46
- plugins: ['blockcode', 'cellcolor', 'imageposition', 'imageresize', 'inlineformat', 'listitem', 'removeformat', 'reorder', 'style', 'filelink'],
46
+ plugins: ['blockcode', 'cellcolor', 'collapse', 'imageposition', 'imageresize', 'inlineformat', 'listitem', 'removeformat', 'reorder', 'style', 'filelink'],
47
47
  quote: {
48
48
  template: '<blockquote><p></p></blockquote>'
49
49
  },
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.10.12'.freeze
2
+ VERSION = '0.10.15'.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.10.12
4
+ version: 0.10.15
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: 2022-06-16 00:00:00.000000000 Z
11
+ date: 2022-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails