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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/{lib/javascript → assets/script}/bootstrap_modal_decko.js +0 -0
  3. data/assets/script/manifest.yml +18 -0
  4. data/assets/script/script_colorpicker.js.coffee +3 -0
  5. data/{lib/javascript → assets/script}/script_load_select2.js.coffee +0 -0
  6. data/assets/script/script_pointer_config.js.coffee +80 -0
  7. data/assets/script/script_pointer_list_editor.js.coffee +67 -0
  8. data/db/migrate_core_cards/20180423160231_migrate_customized_bootstrap_skin.rb +1 -1
  9. data/db/migrate_core_cards/20200809112346_add_mod_card.rb +7 -0
  10. data/db/migrate_core_cards/20201129140917_remove_script_cards.rb +9 -0
  11. data/file/mod_bootstrap_script_bootstrap_machine_output/file.js +25 -0
  12. data/file/mod_bootstrap_script_pointer_machine_output/file.js +223 -0
  13. data/lib/stylesheets/font_awesome.css +6 -6
  14. data/lib/stylesheets/material_icons.css +4 -4
  15. data/locales/en.yml +3 -0
  16. data/public/{assets/fonts → fonts}/MaterialIcons-Regular.eot +0 -0
  17. data/public/{assets/fonts → fonts}/MaterialIcons-Regular.ijmap +0 -0
  18. data/public/{assets/fonts → fonts}/MaterialIcons-Regular.svg +0 -0
  19. data/public/{assets/fonts → fonts}/MaterialIcons-Regular.ttf +0 -0
  20. data/public/{assets/fonts → fonts}/MaterialIcons-Regular.woff +0 -0
  21. data/public/{assets/fonts → fonts}/MaterialIcons-Regular.woff2 +0 -0
  22. data/public/{assets/fonts → fonts}/fa-brands-400.eot +0 -0
  23. data/public/{assets/fonts → fonts}/fa-brands-400.svg +0 -0
  24. data/public/{assets/fonts → fonts}/fa-brands-400.ttf +0 -0
  25. data/public/{assets/fonts → fonts}/fa-brands-400.woff +0 -0
  26. data/public/{assets/fonts → fonts}/fa-brands-400.woff2 +0 -0
  27. data/public/{assets/fonts → fonts}/fa-regular-400.eot +0 -0
  28. data/public/{assets/fonts → fonts}/fa-regular-400.svg +0 -0
  29. data/public/{assets/fonts → fonts}/fa-regular-400.ttf +0 -0
  30. data/public/{assets/fonts → fonts}/fa-regular-400.woff +0 -0
  31. data/public/{assets/fonts → fonts}/fa-regular-400.woff2 +0 -0
  32. data/public/{assets/fonts → fonts}/fa-solid-900.eot +0 -0
  33. data/public/{assets/fonts → fonts}/fa-solid-900.svg +0 -0
  34. data/public/{assets/fonts → fonts}/fa-solid-900.ttf +0 -0
  35. data/public/{assets/fonts → fonts}/fa-solid-900.woff +0 -0
  36. data/public/{assets/fonts → fonts}/fa-solid-900.woff2 +0 -0
  37. data/public/{assets/fonts → fonts}/glyphicons-halflings-regular.eot +0 -0
  38. data/public/{assets/fonts → fonts}/glyphicons-halflings-regular.svg +0 -0
  39. data/public/{assets/fonts → fonts}/glyphicons-halflings-regular.ttf +0 -0
  40. data/public/{assets/fonts → fonts}/glyphicons-halflings-regular.woff +0 -0
  41. data/public/{assets/fonts → fonts}/glyphicons-halflings-regular.woff2 +0 -0
  42. data/set/abstract/bootswatch_theme.rb +3 -3
  43. data/set/all/bootstrap/icon.rb +1 -1
  44. data/set/self/font_awesome.rb +1 -1
  45. data/set/self/material_icons.rb +1 -1
  46. data/set/self/script_load_select2.rb +1 -1
  47. data/set/self/style_bootstrap_colorpicker.rb +1 -1
  48. data/set/self/style_select2.rb +1 -1
  49. metadata +64 -43
  50. data/set/self/script_bootstrap.rb +0 -12
  51. data/set/self/script_select2.rb +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c958ede5306d8ad27fc2eabd5b52081202d49ebdfbc2581f23a6196adeeaa18c
4
- data.tar.gz: 6fb46afc92a6fede6948991c58e20501f4e09ecdf4e0477a4d78d418c71c6ecd
3
+ metadata.gz: 5eaf16c56c6e49e0b46922ce1c721498aa735b95b093149e5ffa4ff3454ae958
4
+ data.tar.gz: 584f08cfb82c2a5b720989c3ded048f8dd493e2b25348008a9787ce4bb0c31d1
5
5
  SHA512:
6
- metadata.gz: 695eaca2a8e8caf883a135bba58d1c401286531be65d764a6e0cd4a998335ccd703a26a539774e2d97777fffe5dc68ab1495ed195dee9ca1224df2a98121f910
7
- data.tar.gz: c539996dc2e5b04c639b5f13083b6f8e3cf9d80b5744c87ac6704748b6e7b249cde10b0a9d9b8a80166d64845a6869231f9184c9e12e7e0019fb98f74daca279
6
+ metadata.gz: 7f348fa402eed266b7972c6241b24470f66d5b1f6840625eac616f8760d9c9cbc567ae8e8543a5ef4c1a3ccd6a3eea9604bc03ab1fa6a22d44e848eaef8264c5
7
+ data.tar.gz: 58b4f843b0496de175aafdeccf8e834e82c947ea5c3ebe72c100399cebbc0fe19f5db0e62c60485d732d2f2acf0e72edcd333dca62a7dba4cb165b38a1b95490
@@ -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
+
@@ -0,0 +1,3 @@
1
+ decko.slotReady (slot) ->
2
+ $('[data-toggle="popover"]').popover(html: true)
3
+ $('.colorpicker-component').colorpicker()
@@ -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
@@ -45,7 +45,7 @@ class MigrateCustomizedBootstrapSkin < Cardio::Migration::Core
45
45
 
46
46
  migrate_customizable_bootstrap_skin
47
47
 
48
- # Card.reset_all_machines
48
+ # Card::Machine.reset_all
49
49
  end
50
50
 
51
51
  def migrate_customizable_bootstrap_skin
@@ -0,0 +1,7 @@
1
+ # -*- encoding : utf-8 -*-
2
+
3
+ class AddModCard < Cardio::Migration::Core
4
+ def up
5
+ ensure_code_card "mod: bootstrap", type_id: Card::ModID
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+
2
+ class RemoveScriptCards < Cardio::Migration::Core
3
+ def up
4
+ delete_code_card :script_select2
5
+ delete_code_card :script_bootstrap
6
+ delete_code_card :script_jquery_helper
7
+ delete_code_card :script_jquery
8
+ end
9
+ end