spiderfw 0.6.39 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG +2 -0
- data/Rakefile +4 -3
- data/VERSION +1 -1
- data/apps/core/admin/public/css/sass/admin.css +61 -12
- data/apps/core/admin/public/sass/admin.scss +51 -0
- data/apps/core/admin/views/login.layout.shtml +1 -1
- data/apps/core/components/assets.rb +34 -2
- data/apps/core/components/po/it/spider_components.po +2 -2
- data/apps/core/components/public/bootstrap/scss/_aggiunte_bootstrap_3.scss +54 -0
- data/apps/core/components/public/bootstrap/scss/_pagination.scss +1 -1
- data/apps/core/components/public/bootstrap/scss/_variables.scss +2 -0
- data/apps/core/components/public/bootstrap/scss/bootstrap.css +48 -2
- data/apps/core/components/public/bootstrap/scss/bootstrap.scss +4 -1
- data/apps/core/components/public/bootstrap_3/img/glyphicons-halflings-regular.eot +0 -0
- data/apps/core/components/public/bootstrap_3/img/glyphicons-halflings-regular.svg +272 -213
- data/apps/core/components/public/bootstrap_3/img/glyphicons-halflings-regular.ttf +0 -0
- data/apps/core/components/public/bootstrap_3/img/glyphicons-halflings-regular.woff +0 -0
- data/apps/core/components/public/bootstrap_3/img/glyphicons-halflings-regular.woff2 +0 -0
- data/apps/core/components/public/bootstrap_3/js/affix.js +48 -26
- data/apps/core/components/public/bootstrap_3/js/alert.js +8 -6
- data/apps/core/components/public/bootstrap_3/js/button.js +27 -17
- data/apps/core/components/public/bootstrap_3/js/carousel.js +66 -39
- data/apps/core/components/public/bootstrap_3/js/collapse.js +73 -42
- data/apps/core/components/public/bootstrap_3/js/dropdown.js +54 -40
- data/apps/core/components/public/bootstrap_3/js/modal.js +102 -42
- data/apps/core/components/public/bootstrap_3/js/popover.js +6 -11
- data/apps/core/components/public/bootstrap_3/js/scrollspy.js +47 -33
- data/apps/core/components/public/bootstrap_3/js/tab.js +48 -21
- data/apps/core/components/public/bootstrap_3/js/tooltip.js +118 -60
- data/apps/core/components/public/bootstrap_3/js/transition.js +15 -4
- data/apps/core/components/public/bootstrap_3/scss/_alerts.scss +8 -2
- data/apps/core/components/public/bootstrap_3/scss/_badges.scss +14 -3
- data/apps/core/components/public/bootstrap_3/scss/_button-groups.scss +23 -19
- data/apps/core/components/public/bootstrap_3/scss/_buttons.scss +22 -13
- data/apps/core/components/public/bootstrap_3/scss/_carousel.scss +28 -2
- data/apps/core/components/public/bootstrap_3/scss/_close.scss +1 -0
- data/apps/core/components/public/bootstrap_3/scss/_code.scss +7 -0
- data/apps/core/components/public/bootstrap_3/scss/_component-animations.scss +3 -1
- data/apps/core/components/public/bootstrap_3/scss/_dropdowns.scss +11 -9
- data/apps/core/components/public/bootstrap_3/scss/_forms.scss +190 -68
- data/apps/core/components/public/bootstrap_3/scss/_glyphicons.scss +83 -13
- data/apps/core/components/public/bootstrap_3/scss/_grid.scss +4 -4
- data/apps/core/components/public/bootstrap_3/scss/_input-groups.scss +1 -0
- data/apps/core/components/public/bootstrap_3/scss/_jumbotron.scss +8 -4
- data/apps/core/components/public/bootstrap_3/scss/_list-group.scss +13 -12
- data/apps/core/components/public/bootstrap_3/scss/_media.scss +40 -30
- data/apps/core/components/public/bootstrap_3/scss/_mixins.scss +1 -0
- data/apps/core/components/public/bootstrap_3/scss/_modals.scss +7 -4
- data/apps/core/components/public/bootstrap_3/scss/_navbar.scss +36 -32
- data/apps/core/components/public/bootstrap_3/scss/_navs.scss +3 -3
- data/apps/core/components/public/bootstrap_3/scss/_normalize.scss +12 -13
- data/apps/core/components/public/bootstrap_3/scss/_pager.scss +2 -3
- data/apps/core/components/public/bootstrap_3/scss/_pagination.scss +4 -3
- data/apps/core/components/public/bootstrap_3/scss/_panels.scss +38 -7
- data/apps/core/components/public/bootstrap_3/scss/_popovers.scss +5 -7
- data/apps/core/components/public/bootstrap_3/scss/_print.scss +96 -96
- data/apps/core/components/public/bootstrap_3/scss/_progress-bars.scss +20 -22
- data/apps/core/components/public/bootstrap_3/scss/_responsive-embed.scss +10 -9
- data/apps/core/components/public/bootstrap_3/scss/_responsive-utilities.scss +8 -3
- data/apps/core/components/public/bootstrap_3/scss/_scaffolding.scss +15 -4
- data/apps/core/components/public/bootstrap_3/scss/_tables.scss +15 -14
- data/apps/core/components/public/bootstrap_3/scss/_theme.scss +57 -13
- data/apps/core/components/public/bootstrap_3/scss/_thumbnails.scss +2 -2
- data/apps/core/components/public/bootstrap_3/scss/_tooltip.scss +13 -7
- data/apps/core/components/public/bootstrap_3/scss/_type.scss +21 -21
- data/apps/core/components/public/bootstrap_3/scss/_utilities.scss +3 -4
- data/apps/core/components/public/bootstrap_3/scss/_variables.scss +54 -32
- data/apps/core/components/public/bootstrap_3/scss/bootstrap.css +8772 -0
- data/apps/core/components/public/bootstrap_3/scss/bootstrap.scss +6 -0
- data/apps/core/components/public/bootstrap_3/scss/mixins/_background-variant.scss +2 -1
- data/apps/core/components/public/bootstrap_3/scss/mixins/_buttons.scss +19 -1
- data/apps/core/components/public/bootstrap_3/scss/mixins/_forms.scss +5 -1
- data/apps/core/components/public/bootstrap_3/scss/mixins/_gradients.scss +1 -1
- data/apps/core/components/public/bootstrap_3/scss/mixins/_grid-framework.scss +4 -10
- data/apps/core/components/public/bootstrap_3/scss/mixins/_grid.scss +7 -7
- data/apps/core/components/public/bootstrap_3/scss/mixins/_hide-text.scss +3 -3
- data/apps/core/components/public/bootstrap_3/scss/mixins/_labels.scss +1 -1
- data/apps/core/components/public/bootstrap_3/scss/mixins/_list-group.scss +3 -2
- data/apps/core/components/public/bootstrap_3/scss/mixins/_opacity.scss +1 -1
- data/apps/core/components/public/bootstrap_3/scss/mixins/_pagination.scss +2 -1
- data/apps/core/components/public/bootstrap_3/scss/mixins/_panels.scss +4 -0
- data/apps/core/components/public/bootstrap_3/scss/mixins/_progress-bar.scss +3 -1
- data/apps/core/components/public/bootstrap_3/scss/mixins/_reset-text.scss +18 -0
- data/apps/core/components/public/bootstrap_3/scss/mixins/_responsive-visibility.scss +1 -1
- data/apps/core/components/public/bootstrap_3/scss/mixins/_text-emphasis.scss +2 -1
- data/apps/core/components/public/bootstrap_3/scss/mixins/_vendor-prefixes.scss +11 -13
- data/apps/core/components/public/css/table_base.css +46 -1
- data/apps/core/components/public/fontawesome_4/fonts/font-awesome/fontawesome-webfont.eot +0 -0
- data/apps/core/components/public/fontawesome_4/fonts/font-awesome/fontawesome-webfont.svg +565 -0
- data/apps/core/components/public/fontawesome_4/fonts/font-awesome/fontawesome-webfont.ttf +0 -0
- data/apps/core/components/public/fontawesome_4/fonts/font-awesome/fontawesome-webfont.woff +0 -0
- data/apps/core/components/public/fontawesome_4/fonts/font-awesome/fontawesome-webfont.woff2 +0 -0
- data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome.css +2893 -0
- data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_animated.scss +34 -0
- data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_bordered-pulled.scss +16 -0
- data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_core.scss +12 -0
- data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_extras.scss +44 -0
- data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_fixed-width.scss +6 -0
- data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_icons.scss +596 -0
- data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_larger.scss +13 -0
- data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_list.scss +19 -0
- data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_mixins.scss +26 -0
- data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_path.scss +14 -0
- data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_rotated-flipped.scss +20 -0
- data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_stacked.scss +20 -0
- data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_variables.scss +608 -0
- data/apps/core/components/public/fontawesome_4/stylesheets/font_awesome.css +2893 -0
- data/apps/core/components/public/fontawesome_4/stylesheets/font_awesome.scss +17 -0
- data/apps/core/components/public/js/paginatore.js +307 -0
- data/apps/core/components/public/js/spin.js +399 -0
- data/apps/core/components/public/mmenu/js/jquery.mmenu.js +133 -0
- data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.borderstyle.scss +33 -0
- data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.effects.scss +199 -0
- data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.fullscreen.scss +24 -0
- data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.iconbar.scss +26 -0
- data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.multiline.scss +15 -0
- data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.pagedim.scss +36 -0
- data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.pageshadow.scss +36 -0
- data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.positioning.scss +87 -0
- data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.themes.scss +76 -0
- data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.tileview.scss +98 -0
- data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.widescreen.scss +61 -0
- data/apps/core/components/public/mmenu/scss/inc/_colors.scss +175 -0
- data/apps/core/components/public/mmenu/scss/inc/_mixins.scss +135 -0
- data/apps/core/components/public/mmenu/scss/inc/_sizing.scss +86 -0
- data/apps/core/components/public/mmenu/scss/inc/_variables.scss +61 -0
- data/apps/core/components/public/mmenu/scss/jquery.mmenu.scss +478 -0
- data/apps/core/components/widgets/table/table.rb +7 -0
- data/apps/core/components/widgets/table/table.shtml +50 -17
- data/apps/core/forms/tags/row.erb +1 -1
- data/lib/spiderfw/cmd/cmd.rb +2 -0
- data/lib/spiderfw/cmd/commands/assets.rb +12 -0
- data/lib/spiderfw/controller/mixins/visual.rb +1 -0
- data/lib/spiderfw/create.rb +0 -1
- data/lib/spiderfw/i18n/gettext.rb +33 -0
- data/lib/spiderfw/i18n/javascript_parser.rb +2 -2
- data/lib/spiderfw/i18n/shtml_parser.rb +2 -2
- data/lib/spiderfw/model/model.rb +2 -1
- data/lib/spiderfw/setup/app_manager.rb +8 -0
- data/lib/spiderfw/spider.rb +9 -1
- data/lib/spiderfw/templates/layout.rb +47 -39
- data/lib/spiderfw/templates/template.rb +12 -4
- metadata +46 -1
@@ -1,8 +1,8 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: collapse.js v3.
|
2
|
+
* Bootstrap: collapse.js v3.3.5
|
3
3
|
* http://getbootstrap.com/javascript/#collapse
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright 2011-
|
5
|
+
* Copyright 2011-2015 Twitter, Inc.
|
6
6
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
7
|
* ======================================================================== */
|
8
8
|
|
@@ -16,13 +16,22 @@
|
|
16
16
|
var Collapse = function (element, options) {
|
17
17
|
this.$element = $(element)
|
18
18
|
this.options = $.extend({}, Collapse.DEFAULTS, options)
|
19
|
+
this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
|
20
|
+
'[data-toggle="collapse"][data-target="#' + element.id + '"]')
|
19
21
|
this.transitioning = null
|
20
22
|
|
21
|
-
if (this.options.parent)
|
23
|
+
if (this.options.parent) {
|
24
|
+
this.$parent = this.getParent()
|
25
|
+
} else {
|
26
|
+
this.addAriaAndCollapsedClass(this.$element, this.$trigger)
|
27
|
+
}
|
28
|
+
|
22
29
|
if (this.options.toggle) this.toggle()
|
23
30
|
}
|
24
31
|
|
25
|
-
Collapse.VERSION = '3.
|
32
|
+
Collapse.VERSION = '3.3.5'
|
33
|
+
|
34
|
+
Collapse.TRANSITION_DURATION = 350
|
26
35
|
|
27
36
|
Collapse.DEFAULTS = {
|
28
37
|
toggle: true
|
@@ -36,17 +45,21 @@
|
|
36
45
|
Collapse.prototype.show = function () {
|
37
46
|
if (this.transitioning || this.$element.hasClass('in')) return
|
38
47
|
|
48
|
+
var activesData
|
49
|
+
var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
|
50
|
+
|
51
|
+
if (actives && actives.length) {
|
52
|
+
activesData = actives.data('bs.collapse')
|
53
|
+
if (activesData && activesData.transitioning) return
|
54
|
+
}
|
55
|
+
|
39
56
|
var startEvent = $.Event('show.bs.collapse')
|
40
57
|
this.$element.trigger(startEvent)
|
41
58
|
if (startEvent.isDefaultPrevented()) return
|
42
59
|
|
43
|
-
var actives = this.$parent && this.$parent.find('> .panel > .in')
|
44
|
-
|
45
60
|
if (actives && actives.length) {
|
46
|
-
var hasData = actives.data('bs.collapse')
|
47
|
-
if (hasData && hasData.transitioning) return
|
48
61
|
Plugin.call(actives, 'hide')
|
49
|
-
|
62
|
+
activesData || actives.data('bs.collapse', null)
|
50
63
|
}
|
51
64
|
|
52
65
|
var dimension = this.dimension()
|
@@ -54,21 +67,20 @@
|
|
54
67
|
this.$element
|
55
68
|
.removeClass('collapse')
|
56
69
|
.addClass('collapsing')[dimension](0)
|
70
|
+
.attr('aria-expanded', true)
|
71
|
+
|
72
|
+
this.$trigger
|
73
|
+
.removeClass('collapsed')
|
74
|
+
.attr('aria-expanded', true)
|
57
75
|
|
58
76
|
this.transitioning = 1
|
59
77
|
|
60
|
-
var complete = function (
|
61
|
-
if (e && e.target != this.$element[0]) {
|
62
|
-
this.$element
|
63
|
-
.one($.support.transition.end, $.proxy(complete, this))
|
64
|
-
return
|
65
|
-
}
|
78
|
+
var complete = function () {
|
66
79
|
this.$element
|
67
80
|
.removeClass('collapsing')
|
68
81
|
.addClass('collapse in')[dimension]('')
|
69
82
|
this.transitioning = 0
|
70
83
|
this.$element
|
71
|
-
.off($.support.transition.end + '.bs.collapse')
|
72
84
|
.trigger('shown.bs.collapse')
|
73
85
|
}
|
74
86
|
|
@@ -77,8 +89,8 @@
|
|
77
89
|
var scrollSize = $.camelCase(['scroll', dimension].join('-'))
|
78
90
|
|
79
91
|
this.$element
|
80
|
-
.
|
81
|
-
.emulateTransitionEnd(
|
92
|
+
.one('bsTransitionEnd', $.proxy(complete, this))
|
93
|
+
.emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
|
82
94
|
}
|
83
95
|
|
84
96
|
Collapse.prototype.hide = function () {
|
@@ -94,36 +106,62 @@
|
|
94
106
|
|
95
107
|
this.$element
|
96
108
|
.addClass('collapsing')
|
97
|
-
.removeClass('collapse')
|
98
|
-
.
|
109
|
+
.removeClass('collapse in')
|
110
|
+
.attr('aria-expanded', false)
|
111
|
+
|
112
|
+
this.$trigger
|
113
|
+
.addClass('collapsed')
|
114
|
+
.attr('aria-expanded', false)
|
99
115
|
|
100
116
|
this.transitioning = 1
|
101
117
|
|
102
|
-
var complete = function (
|
103
|
-
if (e && e.target != this.$element[0]) {
|
104
|
-
this.$element
|
105
|
-
.one($.support.transition.end, $.proxy(complete, this))
|
106
|
-
return
|
107
|
-
}
|
118
|
+
var complete = function () {
|
108
119
|
this.transitioning = 0
|
109
120
|
this.$element
|
110
|
-
.trigger('hidden.bs.collapse')
|
111
121
|
.removeClass('collapsing')
|
112
122
|
.addClass('collapse')
|
123
|
+
.trigger('hidden.bs.collapse')
|
113
124
|
}
|
114
125
|
|
115
126
|
if (!$.support.transition) return complete.call(this)
|
116
127
|
|
117
128
|
this.$element
|
118
129
|
[dimension](0)
|
119
|
-
.one(
|
120
|
-
.emulateTransitionEnd(
|
130
|
+
.one('bsTransitionEnd', $.proxy(complete, this))
|
131
|
+
.emulateTransitionEnd(Collapse.TRANSITION_DURATION)
|
121
132
|
}
|
122
133
|
|
123
134
|
Collapse.prototype.toggle = function () {
|
124
135
|
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
125
136
|
}
|
126
137
|
|
138
|
+
Collapse.prototype.getParent = function () {
|
139
|
+
return $(this.options.parent)
|
140
|
+
.find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
|
141
|
+
.each($.proxy(function (i, element) {
|
142
|
+
var $element = $(element)
|
143
|
+
this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
|
144
|
+
}, this))
|
145
|
+
.end()
|
146
|
+
}
|
147
|
+
|
148
|
+
Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
|
149
|
+
var isOpen = $element.hasClass('in')
|
150
|
+
|
151
|
+
$element.attr('aria-expanded', isOpen)
|
152
|
+
$trigger
|
153
|
+
.toggleClass('collapsed', !isOpen)
|
154
|
+
.attr('aria-expanded', isOpen)
|
155
|
+
}
|
156
|
+
|
157
|
+
function getTargetFromTrigger($trigger) {
|
158
|
+
var href
|
159
|
+
var target = $trigger.attr('data-target')
|
160
|
+
|| (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
|
161
|
+
|
162
|
+
return $(target)
|
163
|
+
}
|
164
|
+
|
127
165
|
|
128
166
|
// COLLAPSE PLUGIN DEFINITION
|
129
167
|
// ==========================
|
@@ -134,7 +172,7 @@
|
|
134
172
|
var data = $this.data('bs.collapse')
|
135
173
|
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
136
174
|
|
137
|
-
if (!data && options.toggle && option
|
175
|
+
if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
|
138
176
|
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
|
139
177
|
if (typeof option == 'string') data[option]()
|
140
178
|
})
|
@@ -159,20 +197,13 @@
|
|
159
197
|
// =================
|
160
198
|
|
161
199
|
$(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
|
162
|
-
var $this = $(this)
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
var $target = $
|
200
|
+
var $this = $(this)
|
201
|
+
|
202
|
+
if (!$this.attr('data-target')) e.preventDefault()
|
203
|
+
|
204
|
+
var $target = getTargetFromTrigger($this)
|
167
205
|
var data = $target.data('bs.collapse')
|
168
206
|
var option = data ? 'toggle' : $this.data()
|
169
|
-
var parent = $this.attr('data-parent')
|
170
|
-
var $parent = parent && $(parent)
|
171
|
-
|
172
|
-
if (!data || !data.transitioning) {
|
173
|
-
if ($parent) $parent.find('[data-toggle="collapse"][data-parent="' + parent + '"]').not($this).addClass('collapsed')
|
174
|
-
$this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
175
|
-
}
|
176
207
|
|
177
208
|
Plugin.call($target, option)
|
178
209
|
})
|
@@ -1,8 +1,8 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: dropdown.js v3.
|
2
|
+
* Bootstrap: dropdown.js v3.3.5
|
3
3
|
* http://getbootstrap.com/javascript/#dropdowns
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright 2011-
|
5
|
+
* Copyright 2011-2015 Twitter, Inc.
|
6
6
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
7
|
* ======================================================================== */
|
8
8
|
|
@@ -19,7 +19,41 @@
|
|
19
19
|
$(element).on('click.bs.dropdown', this.toggle)
|
20
20
|
}
|
21
21
|
|
22
|
-
Dropdown.VERSION = '3.
|
22
|
+
Dropdown.VERSION = '3.3.5'
|
23
|
+
|
24
|
+
function getParent($this) {
|
25
|
+
var selector = $this.attr('data-target')
|
26
|
+
|
27
|
+
if (!selector) {
|
28
|
+
selector = $this.attr('href')
|
29
|
+
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
30
|
+
}
|
31
|
+
|
32
|
+
var $parent = selector && $(selector)
|
33
|
+
|
34
|
+
return $parent && $parent.length ? $parent : $this.parent()
|
35
|
+
}
|
36
|
+
|
37
|
+
function clearMenus(e) {
|
38
|
+
if (e && e.which === 3) return
|
39
|
+
$(backdrop).remove()
|
40
|
+
$(toggle).each(function () {
|
41
|
+
var $this = $(this)
|
42
|
+
var $parent = getParent($this)
|
43
|
+
var relatedTarget = { relatedTarget: this }
|
44
|
+
|
45
|
+
if (!$parent.hasClass('open')) return
|
46
|
+
|
47
|
+
if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
|
48
|
+
|
49
|
+
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
|
50
|
+
|
51
|
+
if (e.isDefaultPrevented()) return
|
52
|
+
|
53
|
+
$this.attr('aria-expanded', 'false')
|
54
|
+
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
|
55
|
+
})
|
56
|
+
}
|
23
57
|
|
24
58
|
Dropdown.prototype.toggle = function (e) {
|
25
59
|
var $this = $(this)
|
@@ -34,7 +68,10 @@
|
|
34
68
|
if (!isActive) {
|
35
69
|
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
|
36
70
|
// if mobile we use a backdrop because click events don't delegate
|
37
|
-
$('
|
71
|
+
$(document.createElement('div'))
|
72
|
+
.addClass('dropdown-backdrop')
|
73
|
+
.insertAfter($(this))
|
74
|
+
.on('click', clearMenus)
|
38
75
|
}
|
39
76
|
|
40
77
|
var relatedTarget = { relatedTarget: this }
|
@@ -42,7 +79,9 @@
|
|
42
79
|
|
43
80
|
if (e.isDefaultPrevented()) return
|
44
81
|
|
45
|
-
$this
|
82
|
+
$this
|
83
|
+
.trigger('focus')
|
84
|
+
.attr('aria-expanded', 'true')
|
46
85
|
|
47
86
|
$parent
|
48
87
|
.toggleClass('open')
|
@@ -53,7 +92,7 @@
|
|
53
92
|
}
|
54
93
|
|
55
94
|
Dropdown.prototype.keydown = function (e) {
|
56
|
-
if (!/(38|40|27)/.test(e.
|
95
|
+
if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
|
57
96
|
|
58
97
|
var $this = $(this)
|
59
98
|
|
@@ -65,51 +104,25 @@
|
|
65
104
|
var $parent = getParent($this)
|
66
105
|
var isActive = $parent.hasClass('open')
|
67
106
|
|
68
|
-
if (!isActive ||
|
107
|
+
if (!isActive && e.which != 27 || isActive && e.which == 27) {
|
69
108
|
if (e.which == 27) $parent.find(toggle).trigger('focus')
|
70
109
|
return $this.trigger('click')
|
71
110
|
}
|
72
111
|
|
73
|
-
var desc = ' li:not(.
|
74
|
-
var $items = $parent.find('
|
112
|
+
var desc = ' li:not(.disabled):visible a'
|
113
|
+
var $items = $parent.find('.dropdown-menu' + desc)
|
75
114
|
|
76
115
|
if (!$items.length) return
|
77
116
|
|
78
|
-
var index = $items.index(
|
117
|
+
var index = $items.index(e.target)
|
79
118
|
|
80
|
-
if (e.
|
81
|
-
if (e.
|
82
|
-
if (!~index)
|
119
|
+
if (e.which == 38 && index > 0) index-- // up
|
120
|
+
if (e.which == 40 && index < $items.length - 1) index++ // down
|
121
|
+
if (!~index) index = 0
|
83
122
|
|
84
123
|
$items.eq(index).trigger('focus')
|
85
124
|
}
|
86
125
|
|
87
|
-
function clearMenus(e) {
|
88
|
-
if (e && e.which === 3) return
|
89
|
-
$(backdrop).remove()
|
90
|
-
$(toggle).each(function () {
|
91
|
-
var $parent = getParent($(this))
|
92
|
-
var relatedTarget = { relatedTarget: this }
|
93
|
-
if (!$parent.hasClass('open')) return
|
94
|
-
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
|
95
|
-
if (e.isDefaultPrevented()) return
|
96
|
-
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
|
97
|
-
})
|
98
|
-
}
|
99
|
-
|
100
|
-
function getParent($this) {
|
101
|
-
var selector = $this.attr('data-target')
|
102
|
-
|
103
|
-
if (!selector) {
|
104
|
-
selector = $this.attr('href')
|
105
|
-
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
106
|
-
}
|
107
|
-
|
108
|
-
var $parent = selector && $(selector)
|
109
|
-
|
110
|
-
return $parent && $parent.length ? $parent : $this.parent()
|
111
|
-
}
|
112
|
-
|
113
126
|
|
114
127
|
// DROPDOWN PLUGIN DEFINITION
|
115
128
|
// ==========================
|
@@ -146,6 +159,7 @@
|
|
146
159
|
.on('click.bs.dropdown.data-api', clearMenus)
|
147
160
|
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
148
161
|
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
149
|
-
.on('keydown.bs.dropdown.data-api', toggle
|
162
|
+
.on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
|
163
|
+
.on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
|
150
164
|
|
151
165
|
}(jQuery);
|
@@ -1,8 +1,8 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: modal.js v3.
|
2
|
+
* Bootstrap: modal.js v3.3.5
|
3
3
|
* http://getbootstrap.com/javascript/#modals
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright 2011-
|
5
|
+
* Copyright 2011-2015 Twitter, Inc.
|
6
6
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
7
|
* ======================================================================== */
|
8
8
|
|
@@ -14,12 +14,15 @@
|
|
14
14
|
// ======================
|
15
15
|
|
16
16
|
var Modal = function (element, options) {
|
17
|
-
this.options
|
18
|
-
this.$body
|
19
|
-
this.$element
|
20
|
-
this.$
|
21
|
-
this
|
22
|
-
this.
|
17
|
+
this.options = options
|
18
|
+
this.$body = $(document.body)
|
19
|
+
this.$element = $(element)
|
20
|
+
this.$dialog = this.$element.find('.modal-dialog')
|
21
|
+
this.$backdrop = null
|
22
|
+
this.isShown = null
|
23
|
+
this.originalBodyPad = null
|
24
|
+
this.scrollbarWidth = 0
|
25
|
+
this.ignoreBackdropClick = false
|
23
26
|
|
24
27
|
if (this.options.remote) {
|
25
28
|
this.$element
|
@@ -30,7 +33,10 @@
|
|
30
33
|
}
|
31
34
|
}
|
32
35
|
|
33
|
-
Modal.VERSION = '3.
|
36
|
+
Modal.VERSION = '3.3.5'
|
37
|
+
|
38
|
+
Modal.TRANSITION_DURATION = 300
|
39
|
+
Modal.BACKDROP_TRANSITION_DURATION = 150
|
34
40
|
|
35
41
|
Modal.DEFAULTS = {
|
36
42
|
backdrop: true,
|
@@ -53,13 +59,20 @@
|
|
53
59
|
this.isShown = true
|
54
60
|
|
55
61
|
this.checkScrollbar()
|
62
|
+
this.setScrollbar()
|
56
63
|
this.$body.addClass('modal-open')
|
57
64
|
|
58
|
-
this.setScrollbar()
|
59
65
|
this.escape()
|
66
|
+
this.resize()
|
60
67
|
|
61
68
|
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
|
62
69
|
|
70
|
+
this.$dialog.on('mousedown.dismiss.bs.modal', function () {
|
71
|
+
that.$element.one('mouseup.dismiss.bs.modal', function (e) {
|
72
|
+
if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
|
73
|
+
})
|
74
|
+
})
|
75
|
+
|
63
76
|
this.backdrop(function () {
|
64
77
|
var transition = $.support.transition && that.$element.hasClass('fade')
|
65
78
|
|
@@ -71,24 +84,24 @@
|
|
71
84
|
.show()
|
72
85
|
.scrollTop(0)
|
73
86
|
|
87
|
+
that.adjustDialog()
|
88
|
+
|
74
89
|
if (transition) {
|
75
90
|
that.$element[0].offsetWidth // force reflow
|
76
91
|
}
|
77
92
|
|
78
|
-
that.$element
|
79
|
-
.addClass('in')
|
80
|
-
.attr('aria-hidden', false)
|
93
|
+
that.$element.addClass('in')
|
81
94
|
|
82
95
|
that.enforceFocus()
|
83
96
|
|
84
97
|
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
|
85
98
|
|
86
99
|
transition ?
|
87
|
-
that.$
|
88
|
-
.one(
|
100
|
+
that.$dialog // wait for modal to slide in
|
101
|
+
.one('bsTransitionEnd', function () {
|
89
102
|
that.$element.trigger('focus').trigger(e)
|
90
103
|
})
|
91
|
-
.emulateTransitionEnd(
|
104
|
+
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
|
92
105
|
that.$element.trigger('focus').trigger(e)
|
93
106
|
})
|
94
107
|
}
|
@@ -104,22 +117,22 @@
|
|
104
117
|
|
105
118
|
this.isShown = false
|
106
119
|
|
107
|
-
this.$body.removeClass('modal-open')
|
108
|
-
|
109
|
-
this.resetScrollbar()
|
110
120
|
this.escape()
|
121
|
+
this.resize()
|
111
122
|
|
112
123
|
$(document).off('focusin.bs.modal')
|
113
124
|
|
114
125
|
this.$element
|
115
126
|
.removeClass('in')
|
116
|
-
.attr('aria-hidden', true)
|
117
127
|
.off('click.dismiss.bs.modal')
|
128
|
+
.off('mouseup.dismiss.bs.modal')
|
129
|
+
|
130
|
+
this.$dialog.off('mousedown.dismiss.bs.modal')
|
118
131
|
|
119
132
|
$.support.transition && this.$element.hasClass('fade') ?
|
120
133
|
this.$element
|
121
|
-
.one(
|
122
|
-
.emulateTransitionEnd(
|
134
|
+
.one('bsTransitionEnd', $.proxy(this.hideModal, this))
|
135
|
+
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
|
123
136
|
this.hideModal()
|
124
137
|
}
|
125
138
|
|
@@ -135,11 +148,19 @@
|
|
135
148
|
|
136
149
|
Modal.prototype.escape = function () {
|
137
150
|
if (this.isShown && this.options.keyboard) {
|
138
|
-
this.$element.on('
|
151
|
+
this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
|
139
152
|
e.which == 27 && this.hide()
|
140
153
|
}, this))
|
141
154
|
} else if (!this.isShown) {
|
142
|
-
this.$element.off('
|
155
|
+
this.$element.off('keydown.dismiss.bs.modal')
|
156
|
+
}
|
157
|
+
}
|
158
|
+
|
159
|
+
Modal.prototype.resize = function () {
|
160
|
+
if (this.isShown) {
|
161
|
+
$(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
|
162
|
+
} else {
|
163
|
+
$(window).off('resize.bs.modal')
|
143
164
|
}
|
144
165
|
}
|
145
166
|
|
@@ -147,6 +168,9 @@
|
|
147
168
|
var that = this
|
148
169
|
this.$element.hide()
|
149
170
|
this.backdrop(function () {
|
171
|
+
that.$body.removeClass('modal-open')
|
172
|
+
that.resetAdjustments()
|
173
|
+
that.resetScrollbar()
|
150
174
|
that.$element.trigger('hidden.bs.modal')
|
151
175
|
})
|
152
176
|
}
|
@@ -163,14 +187,19 @@
|
|
163
187
|
if (this.isShown && this.options.backdrop) {
|
164
188
|
var doAnimate = $.support.transition && animate
|
165
189
|
|
166
|
-
this.$backdrop = $('
|
190
|
+
this.$backdrop = $(document.createElement('div'))
|
191
|
+
.addClass('modal-backdrop ' + animate)
|
167
192
|
.appendTo(this.$body)
|
168
193
|
|
169
194
|
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
|
195
|
+
if (this.ignoreBackdropClick) {
|
196
|
+
this.ignoreBackdropClick = false
|
197
|
+
return
|
198
|
+
}
|
170
199
|
if (e.target !== e.currentTarget) return
|
171
200
|
this.options.backdrop == 'static'
|
172
|
-
? this.$element[0].focus
|
173
|
-
: this.hide
|
201
|
+
? this.$element[0].focus()
|
202
|
+
: this.hide()
|
174
203
|
}, this))
|
175
204
|
|
176
205
|
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
@@ -181,21 +210,21 @@
|
|
181
210
|
|
182
211
|
doAnimate ?
|
183
212
|
this.$backdrop
|
184
|
-
.one(
|
185
|
-
.emulateTransitionEnd(
|
213
|
+
.one('bsTransitionEnd', callback)
|
214
|
+
.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
|
186
215
|
callback()
|
187
216
|
|
188
217
|
} else if (!this.isShown && this.$backdrop) {
|
189
218
|
this.$backdrop.removeClass('in')
|
190
219
|
|
191
|
-
var callbackRemove = function() {
|
220
|
+
var callbackRemove = function () {
|
192
221
|
that.removeBackdrop()
|
193
222
|
callback && callback()
|
194
223
|
}
|
195
224
|
$.support.transition && this.$element.hasClass('fade') ?
|
196
225
|
this.$backdrop
|
197
|
-
.one(
|
198
|
-
.emulateTransitionEnd(
|
226
|
+
.one('bsTransitionEnd', callbackRemove)
|
227
|
+
.emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
|
199
228
|
callbackRemove()
|
200
229
|
|
201
230
|
} else if (callback) {
|
@@ -203,18 +232,46 @@
|
|
203
232
|
}
|
204
233
|
}
|
205
234
|
|
235
|
+
// these following methods are used to handle overflowing modals
|
236
|
+
|
237
|
+
Modal.prototype.handleUpdate = function () {
|
238
|
+
this.adjustDialog()
|
239
|
+
}
|
240
|
+
|
241
|
+
Modal.prototype.adjustDialog = function () {
|
242
|
+
var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
|
243
|
+
|
244
|
+
this.$element.css({
|
245
|
+
paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
|
246
|
+
paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
|
247
|
+
})
|
248
|
+
}
|
249
|
+
|
250
|
+
Modal.prototype.resetAdjustments = function () {
|
251
|
+
this.$element.css({
|
252
|
+
paddingLeft: '',
|
253
|
+
paddingRight: ''
|
254
|
+
})
|
255
|
+
}
|
256
|
+
|
206
257
|
Modal.prototype.checkScrollbar = function () {
|
207
|
-
|
208
|
-
|
258
|
+
var fullWindowWidth = window.innerWidth
|
259
|
+
if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
|
260
|
+
var documentElementRect = document.documentElement.getBoundingClientRect()
|
261
|
+
fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
|
262
|
+
}
|
263
|
+
this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
|
264
|
+
this.scrollbarWidth = this.measureScrollbar()
|
209
265
|
}
|
210
266
|
|
211
|
-
Modal.prototype.setScrollbar =
|
212
|
-
var bodyPad = parseInt(this.$body.css('padding-right') || 0)
|
213
|
-
|
267
|
+
Modal.prototype.setScrollbar = function () {
|
268
|
+
var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
|
269
|
+
this.originalBodyPad = document.body.style.paddingRight || ''
|
270
|
+
if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
|
214
271
|
}
|
215
272
|
|
216
273
|
Modal.prototype.resetScrollbar = function () {
|
217
|
-
this.$body.css('padding-right',
|
274
|
+
this.$body.css('padding-right', this.originalBodyPad)
|
218
275
|
}
|
219
276
|
|
220
277
|
Modal.prototype.measureScrollbar = function () { // thx walsh
|
@@ -263,15 +320,18 @@
|
|
263
320
|
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
|
264
321
|
var $this = $(this)
|
265
322
|
var href = $this.attr('href')
|
266
|
-
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
|
323
|
+
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
|
267
324
|
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
268
325
|
|
269
326
|
if ($this.is('a')) e.preventDefault()
|
270
327
|
|
271
|
-
|
272
|
-
|
273
|
-
$
|
328
|
+
$target.one('show.bs.modal', function (showEvent) {
|
329
|
+
if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
|
330
|
+
$target.one('hidden.bs.modal', function () {
|
331
|
+
$this.is(':visible') && $this.trigger('focus')
|
332
|
+
})
|
274
333
|
})
|
334
|
+
Plugin.call($target, option, this)
|
275
335
|
})
|
276
336
|
|
277
337
|
}(jQuery);
|