effective_bootstrap 0.10.11 → 0.10.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7def34ec9dc81a3f0d75be46a758bbef451f8b8eb589c3d45e339219b3ffebd3
|
4
|
+
data.tar.gz: 2502f9cb998f7627048892094f9746a46cd03762bd09028d22cd6c839afb9f75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10224457b7040e414505ee7a6f8c79558aa1e03d21e88fc5f8509c2faa260c6df45a025ea6bd032572ab7d602162910418d8f9a7fb469924cd9995ce8eca34d2
|
7
|
+
data.tar.gz: d4c0ffd205cbfd7849fdb5b64ec8d0235e5c3abc0929f94306188fd855a8f3815e9ffb16ac7c886f54b127731b29a7c2d276becb31ff0a69f7b7e3fbaa0e23ab
|
@@ -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
|
-
|
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
|
-
|
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
|
-
|
45
|
-
|
46
|
-
|
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']
|
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.
|
4
|
+
version: 0.10.14
|
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-
|
11
|
+
date: 2022-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|