card-mod-bootstrap 0.11.5 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- 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/card/bootstrap.rb +17 -0
- data/lib/card/bootstrap/basic_tags.rb +26 -0
- data/lib/card/bootstrap/component.rb +110 -0
- data/lib/card/bootstrap/component/carousel.rb +78 -0
- data/lib/card/bootstrap/component/form.rb +67 -0
- data/lib/card/bootstrap/component/horizontal_form.rb +65 -0
- data/lib/card/bootstrap/component/layout.rb +107 -0
- data/lib/card/bootstrap/component/panel.rb +11 -0
- data/lib/{bootstrap/component/component_class.rb → card/bootstrap/component_klass.rb} +5 -4
- data/lib/card/bootstrap/component_loader.rb +30 -0
- data/lib/card/bootstrap/content.rb +42 -0
- data/lib/card/bootstrap/delegate.rb +18 -0
- data/lib/card/bootstrap/old_component.rb +108 -0
- data/lib/card/bootstrap/tag_method.rb +56 -0
- data/lib/card/bootstrapper.rb +17 -0
- data/lib/card/tab.rb +8 -1
- data/lib/stylesheets/font_awesome.css +6 -6
- data/lib/stylesheets/material_icons.css +4 -4
- 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 +2 -2
- data/set/all/bootstrap/icon.rb +3 -1
- metadata +72 -58
- data/lib/bootstrap.rb +0 -18
- data/lib/bootstrap/basic_tags.rb +0 -26
- data/lib/bootstrap/component.rb +0 -108
- data/lib/bootstrap/component/carousel.rb +0 -76
- data/lib/bootstrap/component/form.rb +0 -65
- data/lib/bootstrap/component/horizontal_form.rb +0 -63
- data/lib/bootstrap/component/layout.rb +0 -105
- data/lib/bootstrap/component/panel.rb +0 -9
- data/lib/bootstrap/component_loader.rb +0 -28
- data/lib/bootstrap/content.rb +0 -40
- data/lib/bootstrap/delegate.rb +0 -16
- data/lib/bootstrap/old_component.rb +0 -103
- data/lib/bootstrap/tag_method.rb +0 -54
- data/lib/bootstrapper.rb +0 -16
- data/lib/javascript/bootstrap_modal_decko.js +0 -27
- data/lib/javascript/script_load_select2.js.coffee +0 -55
- data/set/self/script_bootstrap.rb +0 -12
- data/set/self/script_select2.rb +0 -12
@@ -1,28 +0,0 @@
|
|
1
|
-
class Bootstrap
|
2
|
-
module ComponentLoader
|
3
|
-
def load_components
|
4
|
-
components.each do |component|
|
5
|
-
require_relative "component/#{component}"
|
6
|
-
include_component component
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
def include_component component
|
11
|
-
component_class = to_const component.camelcase
|
12
|
-
define_method component do |*args, &block|
|
13
|
-
component_class.render self, *args, &block
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def components
|
18
|
-
path = File.expand_path "component/*.rb", __dir__
|
19
|
-
Dir.glob(path).map do |file|
|
20
|
-
File.basename file, ".rb"
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def to_const name
|
25
|
-
self.class.const_get "::Bootstrap::Component::#{name.camelcase}"
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
data/lib/bootstrap/content.rb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
class Bootstrap
|
2
|
-
# shared methods for OldComponent and TagMethod
|
3
|
-
module Content
|
4
|
-
private
|
5
|
-
|
6
|
-
def process_collected_content tag_name, opts
|
7
|
-
collected_content = @content.pop
|
8
|
-
tag_name = opts.delete(:tag) if tag_name == :yield
|
9
|
-
add_content content_tag(tag_name, collected_content, opts, false)
|
10
|
-
end
|
11
|
-
|
12
|
-
def process_content &content_block
|
13
|
-
content, opts = yield
|
14
|
-
wrappers = @wrap.pop
|
15
|
-
if wrappers.present?
|
16
|
-
process_wrappers wrappers, content, &content_block
|
17
|
-
else
|
18
|
-
add_content content
|
19
|
-
end
|
20
|
-
opts
|
21
|
-
end
|
22
|
-
|
23
|
-
def process_append
|
24
|
-
@append.pop.each do |block|
|
25
|
-
add_content instance_exec(&block)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def process_wrappers wrappers, content, &content_block
|
30
|
-
while wrappers.present?
|
31
|
-
wrapper = wrappers.shift
|
32
|
-
if wrapper.is_a? Symbol
|
33
|
-
send wrapper, &content_block
|
34
|
-
else
|
35
|
-
instance_exec content, &wrappers.shift
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
data/lib/bootstrap/delegate.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
class Bootstrap
|
2
|
-
module Delegate
|
3
|
-
def method_missing method_name, *args, &block
|
4
|
-
# return super unless @context.respond_to? method_name
|
5
|
-
if block_given?
|
6
|
-
@context.send(method_name, *args, &block)
|
7
|
-
else
|
8
|
-
@context.send(method_name, *args)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
def respond_to_missing? method_name, _include_private=false
|
13
|
-
@context.respond_to? method_name
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,103 +0,0 @@
|
|
1
|
-
class Bootstrap
|
2
|
-
# not-yet-obviated component handling
|
3
|
-
class OldComponent < Component
|
4
|
-
include Content
|
5
|
-
|
6
|
-
def initialize context, *args, &block
|
7
|
-
@context = context
|
8
|
-
@content = ["".html_safe]
|
9
|
-
@args = args
|
10
|
-
@child_args = []
|
11
|
-
@append = []
|
12
|
-
@wrap = []
|
13
|
-
@build_block = block
|
14
|
-
end
|
15
|
-
|
16
|
-
class << self
|
17
|
-
def render format, *args, &block
|
18
|
-
new(format, *args, &block).render
|
19
|
-
end
|
20
|
-
|
21
|
-
# Like add_tag_method but always generates a div tag
|
22
|
-
# The tag option is not available
|
23
|
-
def add_div_method name, html_class, opts={}, &tag_block
|
24
|
-
add_tag_method name, html_class, opts.merge(tag: :div), &tag_block
|
25
|
-
end
|
26
|
-
|
27
|
-
# Defines a method that generates a html tag
|
28
|
-
# @param name [Symbol, String] the name of the method. If no :tag option in tag_opts is defined then the name is also the name of the tag that the method generates
|
29
|
-
# @param html_class [String] a html class that is added to tag. Use nil if you don't want a html_class
|
30
|
-
# @param tag_opts [Hash] additional argument that will be added to the tag
|
31
|
-
# @option tag_opts [Symbol, String] tag the name of the tag
|
32
|
-
# @example
|
33
|
-
# add_tag_method :link, "known-link", tag: :a, id: "uniq-link"
|
34
|
-
# link # => <a class="known-link" id="uniq-link"></a>
|
35
|
-
def add_tag_method name, html_class, tag_opts={}, &tag_block
|
36
|
-
define_method name do |*args, &block|
|
37
|
-
process_tag tag_opts[:tag] || name do
|
38
|
-
content, opts, new_child_args = standardize_args args, &tag_block
|
39
|
-
add_classes opts, html_class, tag_opts.delete(:optional_classes)
|
40
|
-
if (attributes = tag_opts.delete(:attributes))
|
41
|
-
opts.merge! attributes
|
42
|
-
end
|
43
|
-
|
44
|
-
content = with_child_args new_child_args do
|
45
|
-
generate_content content,
|
46
|
-
tag_opts[:content_processor],
|
47
|
-
&block
|
48
|
-
end
|
49
|
-
|
50
|
-
[content, opts]
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
alias_method :def_div_method, :add_div_method
|
56
|
-
alias_method :def_tag_method, :add_tag_method
|
57
|
-
end
|
58
|
-
|
59
|
-
def render
|
60
|
-
@rendered = begin
|
61
|
-
render_content
|
62
|
-
@content[-1]
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
private
|
67
|
-
|
68
|
-
def process_tag tag_name, &content_block
|
69
|
-
@content.push "".html_safe
|
70
|
-
@append << []
|
71
|
-
@wrap << []
|
72
|
-
|
73
|
-
opts = process_content(&content_block)
|
74
|
-
process_collected_content tag_name, opts
|
75
|
-
process_append
|
76
|
-
""
|
77
|
-
end
|
78
|
-
|
79
|
-
# include BasicTags
|
80
|
-
def html content
|
81
|
-
add_content String(content).html_safe
|
82
|
-
""
|
83
|
-
end
|
84
|
-
|
85
|
-
add_div_method :div, nil do |opts, extra_args|
|
86
|
-
prepend_class opts, extra_args.first if extra_args.present?
|
87
|
-
opts
|
88
|
-
end
|
89
|
-
|
90
|
-
add_div_method :span, nil do |opts, extra_args|
|
91
|
-
prepend_class opts, extra_args.first if extra_args.present?
|
92
|
-
opts
|
93
|
-
end
|
94
|
-
|
95
|
-
add_tag_method :tag, nil, tag: :yield do |opts, extra_args|
|
96
|
-
prepend_class opts, extra_args[1] if extra_args[1].present?
|
97
|
-
opts[:tag] = extra_args[0]
|
98
|
-
opts
|
99
|
-
end
|
100
|
-
|
101
|
-
include Delegate
|
102
|
-
end
|
103
|
-
end
|
data/lib/bootstrap/tag_method.rb
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
class Bootstrap
|
2
|
-
# support html tag generation
|
3
|
-
class TagMethod
|
4
|
-
include Content
|
5
|
-
|
6
|
-
def initialize component, name, html_class, tag_opts={}, &tag_block
|
7
|
-
@component = component
|
8
|
-
@name = name
|
9
|
-
@html_class = html_class
|
10
|
-
@tag_opts = tag_opts
|
11
|
-
@tag_block = tag_block
|
12
|
-
@append = []
|
13
|
-
@wrap = []
|
14
|
-
@xm = Builder::XmlMarkup.new
|
15
|
-
end
|
16
|
-
|
17
|
-
def call *_args, &content_block
|
18
|
-
component.content.push "".html_safe
|
19
|
-
|
20
|
-
opts = process_content(&content_block)
|
21
|
-
process_collected_content tag_name, opts
|
22
|
-
process_append
|
23
|
-
""
|
24
|
-
end
|
25
|
-
|
26
|
-
def method_missing method, *args, &block
|
27
|
-
return super unless respond_to_missing? method
|
28
|
-
|
29
|
-
@component.send method, *args, &block
|
30
|
-
end
|
31
|
-
|
32
|
-
def respond_to_missing? method, _include_private=false
|
33
|
-
@component.respond_to? method
|
34
|
-
end
|
35
|
-
|
36
|
-
def prepend &block
|
37
|
-
tmp = @content.pop
|
38
|
-
instance_exec(&block)
|
39
|
-
@content << tmp
|
40
|
-
end
|
41
|
-
|
42
|
-
def wrap &block
|
43
|
-
instance_exec(&block)
|
44
|
-
end
|
45
|
-
|
46
|
-
def append &block
|
47
|
-
@append[-1] << block
|
48
|
-
end
|
49
|
-
|
50
|
-
def wrapInner tag=nil, &block
|
51
|
-
@wrap[-1] << (block_given? ? block : tag)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
data/lib/bootstrapper.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require "bootstrap"
|
2
|
-
module Bootstrapper
|
3
|
-
extend Bootstrap::ComponentLoader
|
4
|
-
|
5
|
-
def bootstrap
|
6
|
-
@bootstrap ||= ::Bootstrap.new(self)
|
7
|
-
end
|
8
|
-
|
9
|
-
def bs *args, &block
|
10
|
-
bootstrap.render(*args, &block)
|
11
|
-
end
|
12
|
-
|
13
|
-
components.each do |component|
|
14
|
-
delegate component, to: :bootstrap, prefix: :bs
|
15
|
-
end
|
16
|
-
end
|
@@ -1,27 +0,0 @@
|
|
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
|
-
});
|
@@ -1,55 +0,0 @@
|
|
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"
|
@@ -1,12 +0,0 @@
|
|
1
|
-
include_set Abstract::CodeFile
|
2
|
-
Self::ScriptLibraries.add_item :script_bootstrap
|
3
|
-
|
4
|
-
def source_dir
|
5
|
-
""
|
6
|
-
end
|
7
|
-
|
8
|
-
def source_files
|
9
|
-
%w[vendor/bootstrap/dist/js/bootstrap.bundle.js
|
10
|
-
lib/javascript/bootstrap_modal_decko.js
|
11
|
-
vendor/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js]
|
12
|
-
end
|
data/set/self/script_select2.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
include_set Abstract::CodeFile
|
2
|
-
Self::ScriptLibraries.add_item :script_select2
|
3
|
-
|
4
|
-
def source_files
|
5
|
-
# full version of select2 is needed to support containerCssClass config option
|
6
|
-
# which we need for select2_bootstrap to work properly
|
7
|
-
"vendor/select2/dist/js/select2.full.min.js"
|
8
|
-
end
|
9
|
-
|
10
|
-
def source_dir
|
11
|
-
""
|
12
|
-
end
|