card-mod-bootstrap 0.12.0 → 0.13.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{lib/javascript → assets/script}/bootstrap_modal_decko.js +0 -0
- data/assets/script/manifest.yml +18 -0
- data/assets/script/script_colorpicker.js.coffee +3 -0
- data/{lib/javascript → assets/script}/script_load_select2.js.coffee +0 -0
- data/assets/script/script_pointer_config.js.coffee +80 -0
- data/assets/script/script_pointer_list_editor.js.coffee +67 -0
- data/db/migrate_core_cards/20180423160231_migrate_customized_bootstrap_skin.rb +1 -1
- data/db/migrate_core_cards/20200809112346_add_mod_card.rb +7 -0
- data/db/migrate_core_cards/20201129140917_remove_script_cards.rb +9 -0
- data/file/mod_bootstrap_script_bootstrap_machine_output/file.js +25 -0
- data/file/mod_bootstrap_script_pointer_machine_output/file.js +223 -0
- data/lib/stylesheets/font_awesome.css +6 -6
- data/lib/stylesheets/material_icons.css +4 -4
- data/locales/en.yml +3 -0
- data/public/{assets/fonts → fonts}/MaterialIcons-Regular.eot +0 -0
- data/public/{assets/fonts → fonts}/MaterialIcons-Regular.ijmap +0 -0
- data/public/{assets/fonts → fonts}/MaterialIcons-Regular.svg +0 -0
- data/public/{assets/fonts → fonts}/MaterialIcons-Regular.ttf +0 -0
- data/public/{assets/fonts → fonts}/MaterialIcons-Regular.woff +0 -0
- data/public/{assets/fonts → fonts}/MaterialIcons-Regular.woff2 +0 -0
- data/public/{assets/fonts → fonts}/fa-brands-400.eot +0 -0
- data/public/{assets/fonts → fonts}/fa-brands-400.svg +0 -0
- data/public/{assets/fonts → fonts}/fa-brands-400.ttf +0 -0
- data/public/{assets/fonts → fonts}/fa-brands-400.woff +0 -0
- data/public/{assets/fonts → fonts}/fa-brands-400.woff2 +0 -0
- data/public/{assets/fonts → fonts}/fa-regular-400.eot +0 -0
- data/public/{assets/fonts → fonts}/fa-regular-400.svg +0 -0
- data/public/{assets/fonts → fonts}/fa-regular-400.ttf +0 -0
- data/public/{assets/fonts → fonts}/fa-regular-400.woff +0 -0
- data/public/{assets/fonts → fonts}/fa-regular-400.woff2 +0 -0
- data/public/{assets/fonts → fonts}/fa-solid-900.eot +0 -0
- data/public/{assets/fonts → fonts}/fa-solid-900.svg +0 -0
- data/public/{assets/fonts → fonts}/fa-solid-900.ttf +0 -0
- data/public/{assets/fonts → fonts}/fa-solid-900.woff +0 -0
- data/public/{assets/fonts → fonts}/fa-solid-900.woff2 +0 -0
- data/public/{assets/fonts → fonts}/glyphicons-halflings-regular.eot +0 -0
- data/public/{assets/fonts → fonts}/glyphicons-halflings-regular.svg +0 -0
- data/public/{assets/fonts → fonts}/glyphicons-halflings-regular.ttf +0 -0
- data/public/{assets/fonts → fonts}/glyphicons-halflings-regular.woff +0 -0
- data/public/{assets/fonts → fonts}/glyphicons-halflings-regular.woff2 +0 -0
- data/set/abstract/bootswatch_theme.rb +3 -3
- data/set/all/bootstrap/icon.rb +1 -1
- data/set/self/font_awesome.rb +1 -1
- data/set/self/material_icons.rb +1 -1
- data/set/self/script_load_select2.rb +1 -1
- data/set/self/style_bootstrap_colorpicker.rb +1 -1
- data/set/self/style_select2.rb +1 -1
- metadata +64 -43
- data/set/self/script_bootstrap.rb +0 -12
- data/set/self/script_select2.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5eaf16c56c6e49e0b46922ce1c721498aa735b95b093149e5ffa4ff3454ae958
|
4
|
+
data.tar.gz: 584f08cfb82c2a5b720989c3ded048f8dd493e2b25348008a9787ce4bb0c31d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f348fa402eed266b7972c6241b24470f66d5b1f6840625eac616f8760d9c9cbc567ae8e8543a5ef4c1a3ccd6a3eea9604bc03ab1fa6a22d44e848eaef8264c5
|
7
|
+
data.tar.gz: 58b4f843b0496de175aafdeccf8e834e82c947ea5c3ebe72c100399cebbc0fe19f5db0e62c60485d732d2f2acf0e72edcd333dca62a7dba4cb165b38a1b95490
|
File without changes
|
@@ -0,0 +1,18 @@
|
|
1
|
+
bootstrap:
|
2
|
+
minimize: true
|
3
|
+
items:
|
4
|
+
# full version of select2 is needed to support containerCssClass config option
|
5
|
+
# which we need for select2_bootstrap to work properly
|
6
|
+
- ../../vendor/select2/dist/js/select2.full.min.js
|
7
|
+
- ../../vendor/bootstrap/dist/js/bootstrap.bundle.js
|
8
|
+
- bootstrap_modal_decko.js
|
9
|
+
- script_load_select2.js.coffee
|
10
|
+
- ../../vendor/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js
|
11
|
+
- script_colorpicker.js.coffee
|
12
|
+
|
13
|
+
pointer:
|
14
|
+
items:
|
15
|
+
- script_pointer_config.js.coffee
|
16
|
+
- script_pointer_list_editor.js.coffee
|
17
|
+
|
18
|
+
|
File without changes
|
@@ -0,0 +1,80 @@
|
|
1
|
+
$.extend decko.editorContentFunctionMap,
|
2
|
+
'select.pointer-select': ->
|
3
|
+
pointerContent @val()
|
4
|
+
'select.pointer-multiselect': ->
|
5
|
+
pointerContent @val()
|
6
|
+
'.pointer-radio-list': ->
|
7
|
+
pointerContent @find('input:checked').val()
|
8
|
+
'.pointer-list-ul': ->
|
9
|
+
pointerContent @find('input').map( -> $(this).val() )
|
10
|
+
'.pointer-link-list-ul': ->
|
11
|
+
decko.linkListContent @find('.input-group')
|
12
|
+
'._nest-list-ul': ->
|
13
|
+
decko.nestListContent @find('.input-group')
|
14
|
+
'.pointer-checkbox-list': ->
|
15
|
+
pointerContent @find('input:checked').map( -> $(this).val() )
|
16
|
+
'.pointer-select-list': ->
|
17
|
+
pointerContent @find('.pointer-select select').map( -> $(this).val() )
|
18
|
+
'._pointer-filtered-list': ->
|
19
|
+
pointerContent @find('._filtered-list-item').map( -> $(this).data('cardName') )
|
20
|
+
'._pointer-list': ->
|
21
|
+
pointerContent @find('._pointer-item').map( -> $(this).val() )
|
22
|
+
# can't find evidence that the following is in use: #efm
|
23
|
+
# '.pointer-mixed': ->
|
24
|
+
# element = '.pointer-checkbox-sublist input:checked,\
|
25
|
+
# .pointer-sublist-ul input'
|
26
|
+
# pointerContent @find(element).map( -> $(this).val() )
|
27
|
+
# must happen after pointer-list-ul, I think
|
28
|
+
'.perm-editor': -> permissionsContent this
|
29
|
+
|
30
|
+
decko.editorInitFunctionMap['.pointer-list-editor'] = ->
|
31
|
+
@sortable({handle: '.handle', cancel: ''})
|
32
|
+
decko.initPointerList @find('input')
|
33
|
+
|
34
|
+
decko.editorInitFunctionMap['._pointer-filtered-list'] = ->
|
35
|
+
@sortable({handle: '._handle', cancel: ''})
|
36
|
+
|
37
|
+
$.extend decko,
|
38
|
+
initPointerList: (input) ->
|
39
|
+
decko.initAutoCardPlete input
|
40
|
+
|
41
|
+
initAutoCardPlete: (input) ->
|
42
|
+
optionsCard = input.data 'options-card'
|
43
|
+
return unless !!optionsCard
|
44
|
+
path = optionsCard + '.json?view=name_match'
|
45
|
+
input.autocomplete { source: decko.slotPath(path) }
|
46
|
+
|
47
|
+
pointerContent: (vals) ->
|
48
|
+
list = $.map $.makeArray(vals), (v) -> if v then '[[' + v + ']]'
|
49
|
+
$.makeArray(list).join "\n"
|
50
|
+
|
51
|
+
linkListContent: (input_groups) ->
|
52
|
+
vals = input_groups.map( ->
|
53
|
+
v = $(this).find('input._reference').val()
|
54
|
+
title = $(this).find('input._title').val()
|
55
|
+
v += "|#{title}" if title.length > 0
|
56
|
+
v
|
57
|
+
)
|
58
|
+
list = $.map $.makeArray(vals), (v) -> if v then '[[' + v + ']]'
|
59
|
+
$.makeArray(list).join "\n"
|
60
|
+
|
61
|
+
nestListContent: (input_groups) ->
|
62
|
+
vals = input_groups.map( ->
|
63
|
+
v = $(this).find('input._reference').val()
|
64
|
+
options = $(this).find('input._nest-options').val()
|
65
|
+
v += "|#{options}" if options.length > 0
|
66
|
+
v
|
67
|
+
)
|
68
|
+
list = $.map $.makeArray(vals), (v) -> if v then '{{' + v + '}}'
|
69
|
+
$.makeArray(list).join "\n"
|
70
|
+
|
71
|
+
|
72
|
+
pointerContent = (vals) ->
|
73
|
+
decko.pointerContent vals
|
74
|
+
# deprecated. backwards compatibility
|
75
|
+
|
76
|
+
permissionsContent = (ed) ->
|
77
|
+
return '_left' if ed.find('#inherit').is(':checked')
|
78
|
+
groups = ed.find('.perm-group input:checked').map( -> $(this).val() )
|
79
|
+
indivs = ed.find('.perm-indiv input' ).map( -> $(this).val() )
|
80
|
+
pointerContent $.makeArray(groups).concat($.makeArray(indivs))
|
@@ -0,0 +1,67 @@
|
|
1
|
+
$(window).ready ->
|
2
|
+
# add pointer item when clicking on "add another" button
|
3
|
+
$('body').on 'click', '._pointer-item-add', (event)->
|
4
|
+
decko.addPointerItem this
|
5
|
+
event.preventDefault() # Prevent link from following its href
|
6
|
+
|
7
|
+
# add pointer item when you hit enter in an item
|
8
|
+
$('body').on 'keydown', '.pointer-item-text', (event)->
|
9
|
+
if event.key == 'Enter'
|
10
|
+
decko.addPointerItem this
|
11
|
+
event.preventDefault() # was triggering extra item in unrelated pointer
|
12
|
+
|
13
|
+
# enable/disable add
|
14
|
+
$('body').on 'keyup', '.pointer-item-text', (_event)->
|
15
|
+
decko.updateAddItemButton this
|
16
|
+
|
17
|
+
$('body').on 'click', '.pointer-item-delete', ->
|
18
|
+
item = $(this).closest 'li'
|
19
|
+
list = item.closest('ul')
|
20
|
+
if list.find('.pointer-li').length > 1
|
21
|
+
item.remove()
|
22
|
+
else
|
23
|
+
item.find('input').val ''
|
24
|
+
decko.updateAddItemButton(list)
|
25
|
+
|
26
|
+
decko.slotReady (slot) ->
|
27
|
+
slot.find('.pointer-list-editor').each ->
|
28
|
+
decko.updateAddItemButton this
|
29
|
+
|
30
|
+
$.extend decko,
|
31
|
+
addPointerItem: (el) ->
|
32
|
+
slot = $(el).slot()
|
33
|
+
slot.trigger "slotDestroy"
|
34
|
+
# why is this necessary?
|
35
|
+
# this can have a lot of side effects in a multi-card form.
|
36
|
+
|
37
|
+
newInput = decko.nextPointerInput decko.lastPointerItem(el)
|
38
|
+
newInput.val ''
|
39
|
+
|
40
|
+
slot.trigger "slotReady"
|
41
|
+
decko.initializeEditors slot
|
42
|
+
# should be (but is not) handled by slotReady
|
43
|
+
# without this, "add another" was breaking tinymce editors in same slot
|
44
|
+
|
45
|
+
newInput.first().focus()
|
46
|
+
decko.updateAddItemButton el
|
47
|
+
decko.initPointerList newInput
|
48
|
+
|
49
|
+
nextPointerInput: (lastItem)->
|
50
|
+
lastInputs = lastItem.find 'input'
|
51
|
+
all_empty = true
|
52
|
+
for input in lastInputs
|
53
|
+
all_empty = all_empty and $(input).val() == ''
|
54
|
+
return lastInputs if all_empty
|
55
|
+
|
56
|
+
newItem = lastItem.clone()
|
57
|
+
lastItem.after newItem
|
58
|
+
newItem.attr("data-index", parseInt(lastItem.attr("data-index") + 1))
|
59
|
+
newItem.find 'input'
|
60
|
+
|
61
|
+
lastPointerItem: (el)->
|
62
|
+
$(el).closest('.content-editor').find '.pointer-li:last'
|
63
|
+
|
64
|
+
updateAddItemButton: (el)->
|
65
|
+
button = $(el).closest('.content-editor').find '._pointer-item-add'
|
66
|
+
disabled = decko.lastPointerItem(el).find('input').val() == ''
|
67
|
+
button.prop 'disabled', disabled
|