card-mod-bootstrap 0.13.0 → 0.13.4

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: aa98639eaf99f76869bd868a19a2b2ec37fc948a37b0c59caff5329d065d2101
4
- data.tar.gz: cd3e6ed171331d7f1d97937e44b7d3f3fb6d0b5d2818bb1c6fc13459bb4c0859
3
+ metadata.gz: 729d52632c15befecc2f1318654b6fe2b67bc83a9f6e00eeabd5455033c1a121
4
+ data.tar.gz: 462459340f302f548ca9c17f7618f3900f48bab05f7e1deb4186ed0ab8438220
5
5
  SHA512:
6
- metadata.gz: ba6da696b95d53a0ceba644bf5c402fc1e80c101aeb8d56a35fe8ab81c7193d8c0b05939ec7b55e651f2e67314cb3673153455e74be706feb4145abeb84bf0cb
7
- data.tar.gz: 95c8ca249544841cbe4c108630d3d0d9463b08162d0498bcf6486cd92b89d547658d4a5396bfe82afcbde926c9e455e7923c46f045193f0c70bbd3c88abeb784
6
+ metadata.gz: 378d02e065f3ae2ec49eef82632636a8dfa840386fbbfbc7922bf6e30ecf3049ae15ffad4e02280d4f306479c864c4d71923ffc656e9f086ad1bf41bdcbefabd
7
+ data.tar.gz: 1d7e33b3a9373c5190b0287ea8e6780425401a8cc9944ebf1cc017229f4b2b1072da24e05479595a1f692a8f3d7067b2d59b74122ca83d595db7d51a31376a0c
@@ -0,0 +1,27 @@
1
+ decko.slotReady(function(slot) {
2
+ slot.find('.modal.fade').on('loaded.bs.modal', function(e) {
3
+ $(this).trigger('slotReady');
4
+ });
5
+ slot.find('[data-toggle=\'modal\']').off("click").on('click', function(e) {
6
+ var $_this, href, modal_selector;
7
+ e.preventDefault();
8
+ e.stopPropagation();
9
+ $_this = $(this);
10
+ href = $_this.attr('href');
11
+ modal_selector = $_this.data('target');
12
+ $(modal_selector).modal('show');
13
+ $.ajax({
14
+ url: href,
15
+ type: 'GET',
16
+ success: function(html) {
17
+ $(modal_selector + ' .modal-content').html(html);
18
+ return $(modal_selector).trigger('loaded.bs.modal');
19
+ },
20
+ error: function(jqXHR, textStatus) {
21
+ $(modal_selector + ' .modal-content').html(jqXHR.responseText);
22
+ return $(modal_selector).trigger('loaded.bs.modal');
23
+ }
24
+ });
25
+ return false;
26
+ });
27
+ });
@@ -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,55 @@
1
+ $.fn.select2.defaults.set("theme", "bootstrap")
2
+
3
+ decko.slotReady (slot) ->
4
+ slot.find('select:not(._no-select2)').each (_i) ->
5
+ decko.initSelect2($(this))
6
+
7
+ decko.slotDestroy (slot) ->
8
+ slot.find('select:not(._no-select2)').each (_i) ->
9
+ $(this).deInitSelect2()
10
+
11
+ $.extend decko,
12
+ initSelect2: (elem) ->
13
+ if elem.length > 1
14
+ decko.initSelect2($(single_el)) for single_el in elem
15
+ else
16
+ opts = { dropdownAutoWidth: "true", containerCssClass: ":all:", width: "auto" }
17
+
18
+ elem.attr "id", decko.uniqSelect2Id(elem.attr("id"))
19
+ if elem.hasClass("tags")
20
+ opts.tags = "true"
21
+ if elem.data("minimum-results-for-search")?
22
+ opts.minimumResultsForSearch = elem.data("minimum-results-for-search")
23
+ elem.select2(opts)
24
+
25
+ uniqSelect2Id: (id) ->
26
+ return id unless $("[data-select2-id=" + id + "]").length > 0
27
+ decko.uniqSelect2Id id + "1"
28
+
29
+
30
+ $(window).ready ->
31
+ $('body').on 'select2:select', '._go-to-selected', ->
32
+ val = $(this).val()
33
+ if val != ''
34
+ window.location = decko.path(escape(val))
35
+
36
+ $('body').on "select2:select", "._submit-on-select", (event) ->
37
+ $(event.target).closest('form').submit()
38
+
39
+ $.fn.extend
40
+ cloneSelect2: (withDataAndEvents, deepWithDataAndEvents) ->
41
+ $old = if this.is('select') then this else this.find('select')
42
+ $old.deInitSelect2()
43
+ $cloned = this.clone(withDataAndEvents, deepWithDataAndEvents)
44
+ decko.initSelect2 $old
45
+ if $cloned.is('select')
46
+ decko.initSelect2 $cloned
47
+ else
48
+ decko.initSelect2 $cloned.find('select')
49
+ $cloned
50
+
51
+ deInitSelect2: ->
52
+ return unless @attr "data-select2-id"
53
+ @select2 "destroy"
54
+ @removeAttr "data-select2-id"
55
+ @find("option").removeAttr "data-select2-id"
@@ -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
data/locales/en.yml ADDED
@@ -0,0 +1,3 @@
1
+ en:
2
+ bootstrap_cannot_source_theme: can't find source for theme %{theme_name}
3
+ bootstrap_not_valid_theme: not a valid theme %{theme_name}
@@ -37,7 +37,7 @@
37
37
  # content which will trigger the updates of other machines that use this card.
38
38
 
39
39
  include_set Abstract::Machine
40
- include_set Type::Scss
40
+ include_set Abstract::Scss
41
41
  include_set Abstract::CodeFile
42
42
  include_set Abstract::SkinBox
43
43
 
@@ -30,7 +30,7 @@ format :html do
30
30
  pushpin: "thumb-tack",
31
31
  globe: :globe,
32
32
  zoom_out: "search-minus",
33
- close: :remove,
33
+ close: :times,
34
34
  check_circle: "check-circle",
35
35
  reorder: "align-justify",
36
36
  commenting: :comments
@@ -1,2 +1,2 @@
1
1
  include_set Abstract::CodeFile
2
- Self::StyleLibraries.add_item :font_awesome
2
+ basket[:style_libraries] << :font_awesome
@@ -1,2 +1,2 @@
1
1
  include_set Abstract::CodeFile
2
- Self::StyleLibraries.add_item :material_icons
2
+ basket[:style_libraries] << :material_icons
@@ -1,2 +1,2 @@
1
1
  include_set Abstract::CodeFile
2
- Self::ScriptMods.add_item :script_load_select2
2
+ basket[:script_mods] << :script_load_select2
@@ -1,5 +1,5 @@
1
1
  include_set Abstract::BootstrapCodeFile
2
- Self::StyleLibraries.add_item :style_bootstrap_colorpicker
2
+ basket[:style_libraries] << :style_bootstrap_colorpicker
3
3
 
4
4
  def load_stylesheets
5
5
  add_stylesheet_file "vendor/bootstrap-colorpicker/src/sass/_colorpicker.scss"
@@ -1,5 +1,5 @@
1
1
  include_set Abstract::CodeFile
2
- Self::StyleLibraries.add_item :style_select2
2
+ basket[:style_libraries] << :style_select2
3
3
 
4
4
  def source_files
5
5
  ["vendor/select2/dist/css/select2.css", "lib/stylesheets/style_select2_bootstrap.scss"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.13.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-08-06 00:00:00.000000000 Z
13
+ date: 2021-09-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,84 +18,84 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.103.0
21
+ version: 1.103.4
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 1.103.0
28
+ version: 1.103.4
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: card-mod-assets
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.13.0
35
+ version: 0.13.4
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.13.0
42
+ version: 0.13.4
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: card-mod-edit
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 0.13.0
49
+ version: 0.13.4
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 0.13.0
56
+ version: 0.13.4
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: card-mod-bar_and_box
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: 0.13.0
63
+ version: 0.13.4
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - '='
69
69
  - !ruby/object:Gem::Version
70
- version: 0.13.0
70
+ version: 0.13.4
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: card-mod-style
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - '='
76
76
  - !ruby/object:Gem::Version
77
- version: 0.13.0
77
+ version: 0.13.4
78
78
  type: :runtime
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
82
  - - '='
83
83
  - !ruby/object:Gem::Version
84
- version: 0.13.0
84
+ version: 0.13.4
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: card-mod-script
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - '='
90
90
  - !ruby/object:Gem::Version
91
- version: 0.13.0
91
+ version: 0.13.4
92
92
  type: :runtime
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - '='
97
97
  - !ruby/object:Gem::Version
98
- version: 0.13.0
98
+ version: 0.13.4
99
99
  description: ''
100
100
  email:
101
101
  - info@decko.org
@@ -103,6 +103,12 @@ executables: []
103
103
  extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
106
+ - assets/script/bootstrap_modal_decko.js
107
+ - assets/script/manifest.yml
108
+ - assets/script/script_colorpicker.js.coffee
109
+ - assets/script/script_load_select2.js.coffee
110
+ - assets/script/script_pointer_config.js.coffee
111
+ - assets/script/script_pointer_list_editor.js.coffee
106
112
  - db/migrate_core_cards/20170719163733_update_bootswatch_themes_to_4_beta.rb
107
113
  - db/migrate_core_cards/20170726111053_add_bootstrap_mixins.rb
108
114
  - db/migrate_core_cards/20170726145012_select2.rb
@@ -267,6 +273,7 @@ files:
267
273
  - lib/stylesheets/smartmenu.css
268
274
  - lib/stylesheets/style_bootstrap_cards.scss
269
275
  - lib/stylesheets/style_select2_bootstrap.scss
276
+ - locales/en.yml
270
277
  - public/fonts/MaterialIcons-Regular.eot
271
278
  - public/fonts/MaterialIcons-Regular.ijmap
272
279
  - public/fonts/MaterialIcons-Regular.svg