rails_admin 0.6.5 → 0.6.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rails_admin might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-affix.js +99 -74
- data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-alert.js +48 -55
- data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-button.js +70 -65
- data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-carousel.js +163 -147
- data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-collapse.js +117 -114
- data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-dropdown.js +89 -107
- data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-modal.js +208 -175
- data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-popover.js +77 -78
- data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-scrollspy.js +137 -129
- data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-tab.js +85 -101
- data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-tooltip.js +364 -268
- data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-transition.js +51 -52
- data/app/assets/javascripts/rails_admin/bootstrap/bootstrap-typeahead.js +1782 -335
- data/app/assets/javascripts/rails_admin/ra.filter-box.js +1 -1
- data/app/assets/javascripts/rails_admin/ra.filtering-multiselect.js +3 -3
- data/app/assets/javascripts/rails_admin/ra.filtering-select.js +1 -1
- data/app/assets/javascripts/rails_admin/ra.remote-form.js +6 -2
- data/app/assets/stylesheets/rails_admin/base/theming.scss +34 -14
- data/app/assets/stylesheets/rails_admin/bootstrap/_alerts.scss +47 -58
- data/app/assets/stylesheets/rails_admin/bootstrap/_badges.scss +57 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/_breadcrumbs.scss +12 -10
- data/app/assets/stylesheets/rails_admin/bootstrap/_button-groups.scss +163 -152
- data/app/assets/stylesheets/rails_admin/bootstrap/_buttons.scss +98 -169
- data/app/assets/stylesheets/rails_admin/bootstrap/_carousel.scss +151 -66
- data/app/assets/stylesheets/rails_admin/bootstrap/_close.scss +11 -8
- data/app/assets/stylesheets/rails_admin/bootstrap/_code.scss +36 -29
- data/app/assets/stylesheets/rails_admin/bootstrap/_component-animations.scss +16 -3
- data/app/assets/stylesheets/rails_admin/bootstrap/_dropdowns.scss +115 -148
- data/app/assets/stylesheets/rails_admin/bootstrap/_forms.scss +396 -547
- data/app/assets/stylesheets/rails_admin/bootstrap/_glyphicons.scss +237 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/_grid.scss +74 -11
- data/app/assets/stylesheets/rails_admin/bootstrap/_input-groups.scss +166 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/_jumbotron.scss +48 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/_labels.scss +66 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/_list-group.scss +131 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/_media.scss +8 -7
- data/app/assets/stylesheets/rails_admin/bootstrap/_mixins.scss +36 -693
- data/app/assets/stylesheets/rails_admin/bootstrap/_modals.scss +108 -53
- data/app/assets/stylesheets/rails_admin/bootstrap/_navbar.scss +545 -383
- data/app/assets/stylesheets/rails_admin/bootstrap/_navs.scss +191 -358
- data/app/assets/stylesheets/rails_admin/bootstrap/_normalize.scss +425 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/_pager.scss +45 -33
- data/app/assets/stylesheets/rails_admin/bootstrap/_pagination.scss +70 -105
- data/app/assets/stylesheets/rails_admin/bootstrap/_panels.scss +243 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/_popovers.scss +61 -61
- data/app/assets/stylesheets/rails_admin/bootstrap/_print.scss +101 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/_progress-bars.scss +56 -73
- data/app/assets/stylesheets/rails_admin/bootstrap/_responsive-embed.scss +34 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/_responsive-utilities.scss +150 -50
- data/app/assets/stylesheets/rails_admin/bootstrap/_scaffolding.scss +120 -23
- data/app/assets/stylesheets/rails_admin/bootstrap/_tables.scss +168 -170
- data/app/assets/stylesheets/rails_admin/bootstrap/_theme.scss +258 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/_thumbnails.scss +27 -42
- data/app/assets/stylesheets/rails_admin/bootstrap/_tooltip.scss +49 -24
- data/app/assets/stylesheets/rails_admin/bootstrap/_type.scss +200 -143
- data/app/assets/stylesheets/rails_admin/bootstrap/_utilities.scss +33 -21
- data/app/assets/stylesheets/rails_admin/bootstrap/_variables.scss +764 -215
- data/app/assets/stylesheets/rails_admin/bootstrap/_wells.scss +7 -7
- data/app/assets/stylesheets/rails_admin/bootstrap/bootstrap.scss +47 -60
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_alerts.scss +14 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_background-variant.scss +11 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_border-radius.scss +18 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_buttons.scss +50 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_center-block.scss +7 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_clearfix.scss +22 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_forms.scss +84 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_gradients.scss +58 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_grid-framework.scss +81 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_grid.scss +122 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_hide-text.scss +21 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_image.scss +34 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_labels.scss +12 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_list-group.scss +31 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_nav-divider.scss +10 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_nav-vertical-align.scss +9 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_opacity.scss +8 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_pagination.scss +23 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_panels.scss +24 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_progress-bar.scss +10 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_reset-filter.scss +8 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_resize.scss +6 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_responsive-visibility.scss +21 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_size.scss +10 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_tab-focus.scss +9 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_table-row.scss +28 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_text-emphasis.scss +11 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_text-overflow.scss +8 -0
- data/app/assets/stylesheets/rails_admin/bootstrap/mixins/_vendor-prefixes.scss +219 -0
- data/app/assets/stylesheets/rails_admin/ra.calendar-additions.scss +17 -0
- data/app/assets/stylesheets/rails_admin/rails_admin.scss.erb +9 -5
- data/app/helpers/rails_admin/application_helper.rb +20 -19
- data/app/helpers/rails_admin/form_builder.rb +14 -11
- data/app/views/kaminari/twitter-bootstrap/_paginator.html.haml +8 -9
- data/app/views/layouts/rails_admin/_navigation.html.haml +5 -5
- data/app/views/layouts/rails_admin/_secondary_navigation.html.haml +1 -1
- data/app/views/layouts/rails_admin/application.html.haml +9 -8
- data/app/views/layouts/rails_admin/pjax.html.haml +4 -3
- data/app/views/rails_admin/main/_form_datetime.html.haml +2 -1
- data/app/views/rails_admin/main/_form_field.html.haml +1 -1
- data/app/views/rails_admin/main/_form_text.html.haml +1 -1
- data/app/views/rails_admin/main/_submit_buttons.html.haml +1 -0
- data/app/views/rails_admin/main/dashboard.html.haml +1 -1
- data/app/views/rails_admin/main/export.html.haml +19 -16
- data/app/views/rails_admin/main/index.html.haml +11 -7
- data/app/views/rails_admin/main/show.html.haml +1 -1
- data/lib/rails_admin/adapters/active_record.rb +2 -2
- data/lib/rails_admin/adapters/mongoid/property.rb +1 -1
- data/lib/rails_admin/config/actions/bulk_delete.rb +0 -1
- data/lib/rails_admin/config/actions/edit.rb +0 -2
- data/lib/rails_admin/config/actions/export.rb +0 -2
- data/lib/rails_admin/config/actions/index.rb +0 -3
- data/lib/rails_admin/config/actions/new.rb +0 -2
- data/lib/rails_admin/config/configurable.rb +1 -1
- data/lib/rails_admin/config/fields/base.rb +9 -0
- data/lib/rails_admin/config/fields/factories/enum.rb +2 -3
- data/lib/rails_admin/config/fields/types/polymorphic_association.rb +4 -0
- data/lib/rails_admin/config/model.rb +2 -1
- data/lib/rails_admin/extensions/paper_trail/auditing_adapter.rb +2 -2
- data/lib/rails_admin/support/csv_converter.rb +22 -42
- data/lib/rails_admin/version.rb +1 -1
- metadata +59 -18
- data/app/assets/stylesheets/rails_admin/bootstrap/_accordion.scss +0 -34
- data/app/assets/stylesheets/rails_admin/bootstrap/_hero-unit.scss +0 -25
- data/app/assets/stylesheets/rails_admin/bootstrap/_labels-badges.scss +0 -83
- data/app/assets/stylesheets/rails_admin/bootstrap/_layouts.scss +0 -16
- data/app/assets/stylesheets/rails_admin/bootstrap/_reset.scss +0 -216
- data/app/assets/stylesheets/rails_admin/bootstrap/_responsive-1200px-min.scss +0 -28
- data/app/assets/stylesheets/rails_admin/bootstrap/_responsive-767px-max.scss +0 -193
- data/app/assets/stylesheets/rails_admin/bootstrap/_responsive-768px-979px.scss +0 -19
- data/app/assets/stylesheets/rails_admin/bootstrap/_responsive-navbar.scss +0 -189
- data/app/assets/stylesheets/rails_admin/bootstrap/_sprites.scss +0 -197
- data/app/assets/stylesheets/rails_admin/bootstrap/responsive.scss +0 -48
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22f6b0bf2715b8343ec12147a678f6af4342fd60
|
4
|
+
data.tar.gz: 06c11b7753f662ea8aee4d5b0c7a41fc4f61902f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5088678be8b3b6e30e545fbbfcdc9331a725341d8c002eb2067c181b349ad5a2a34e7d45d6b7257310858f0e6b35888759a354e8c4581546cbe822a9f6a96892
|
7
|
+
data.tar.gz: 28e6549d5c45bae55ad63564ca5ff4ed81dc9bc25df53b253cb64d783f10d43da61f69bea76acb004725f9e7abf6695fdbe405404f207a49a0ffda863478e58d
|
@@ -1,94 +1,120 @@
|
|
1
|
-
/*
|
2
|
-
*
|
3
|
-
* http://getbootstrap.com/
|
4
|
-
*
|
5
|
-
* Copyright
|
6
|
-
*
|
7
|
-
*
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
* See the License for the specific language governing permissions and
|
17
|
-
* limitations under the License.
|
18
|
-
* ========================================================== */
|
19
|
-
|
20
|
-
|
21
|
-
!function ($) {
|
22
|
-
|
23
|
-
"use strict"; // jshint ;_;
|
24
|
-
|
25
|
-
|
26
|
-
/* AFFIX CLASS DEFINITION
|
27
|
-
* ====================== */
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: affix.js v3.2.0
|
3
|
+
* http://getbootstrap.com/javascript/#affix
|
4
|
+
* ========================================================================
|
5
|
+
* Copyright 2011-2014 Twitter, Inc.
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
|
+
* ======================================================================== */
|
8
|
+
|
9
|
+
|
10
|
+
+function ($) {
|
11
|
+
'use strict';
|
12
|
+
|
13
|
+
// AFFIX CLASS DEFINITION
|
14
|
+
// ======================
|
28
15
|
|
29
16
|
var Affix = function (element, options) {
|
30
|
-
this.options = $.extend({},
|
31
|
-
|
32
|
-
|
33
|
-
.on('
|
34
|
-
|
17
|
+
this.options = $.extend({}, Affix.DEFAULTS, options)
|
18
|
+
|
19
|
+
this.$target = $(this.options.target)
|
20
|
+
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
|
21
|
+
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
|
22
|
+
|
23
|
+
this.$element = $(element)
|
24
|
+
this.affixed =
|
25
|
+
this.unpin =
|
26
|
+
this.pinnedOffset = null
|
27
|
+
|
35
28
|
this.checkPosition()
|
36
29
|
}
|
37
30
|
|
31
|
+
Affix.VERSION = '3.2.0'
|
32
|
+
|
33
|
+
Affix.RESET = 'affix affix-top affix-bottom'
|
34
|
+
|
35
|
+
Affix.DEFAULTS = {
|
36
|
+
offset: 0,
|
37
|
+
target: window
|
38
|
+
}
|
39
|
+
|
40
|
+
Affix.prototype.getPinnedOffset = function () {
|
41
|
+
if (this.pinnedOffset) return this.pinnedOffset
|
42
|
+
this.$element.removeClass(Affix.RESET).addClass('affix')
|
43
|
+
var scrollTop = this.$target.scrollTop()
|
44
|
+
var position = this.$element.offset()
|
45
|
+
return (this.pinnedOffset = position.top - scrollTop)
|
46
|
+
}
|
47
|
+
|
48
|
+
Affix.prototype.checkPositionWithEventLoop = function () {
|
49
|
+
setTimeout($.proxy(this.checkPosition, this), 1)
|
50
|
+
}
|
51
|
+
|
38
52
|
Affix.prototype.checkPosition = function () {
|
39
53
|
if (!this.$element.is(':visible')) return
|
40
54
|
|
41
55
|
var scrollHeight = $(document).height()
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
if (typeof
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
|
56
|
-
'bottom' : offsetTop != null && scrollTop <= offsetTop ?
|
57
|
-
'top' : false
|
56
|
+
var scrollTop = this.$target.scrollTop()
|
57
|
+
var position = this.$element.offset()
|
58
|
+
var offset = this.options.offset
|
59
|
+
var offsetTop = offset.top
|
60
|
+
var offsetBottom = offset.bottom
|
61
|
+
|
62
|
+
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
63
|
+
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
|
64
|
+
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
|
65
|
+
|
66
|
+
var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
|
67
|
+
offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
|
68
|
+
offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
|
58
69
|
|
59
70
|
if (this.affixed === affix) return
|
71
|
+
if (this.unpin != null) this.$element.css('top', '')
|
60
72
|
|
61
|
-
|
62
|
-
|
73
|
+
var affixType = 'affix' + (affix ? '-' + affix : '')
|
74
|
+
var e = $.Event(affixType + '.bs.affix')
|
63
75
|
|
64
|
-
this.$element.
|
65
|
-
}
|
76
|
+
this.$element.trigger(e)
|
66
77
|
|
78
|
+
if (e.isDefaultPrevented()) return
|
67
79
|
|
68
|
-
|
69
|
-
|
80
|
+
this.affixed = affix
|
81
|
+
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
|
82
|
+
|
83
|
+
this.$element
|
84
|
+
.removeClass(Affix.RESET)
|
85
|
+
.addClass(affixType)
|
86
|
+
.trigger($.Event(affixType.replace('affix', 'affixed')))
|
87
|
+
|
88
|
+
if (affix == 'bottom') {
|
89
|
+
this.$element.offset({
|
90
|
+
top: scrollHeight - this.$element.height() - offsetBottom
|
91
|
+
})
|
92
|
+
}
|
93
|
+
}
|
70
94
|
|
71
|
-
var old = $.fn.affix
|
72
95
|
|
73
|
-
|
96
|
+
// AFFIX PLUGIN DEFINITION
|
97
|
+
// =======================
|
98
|
+
|
99
|
+
function Plugin(option) {
|
74
100
|
return this.each(function () {
|
75
|
-
var $this
|
76
|
-
|
77
|
-
|
78
|
-
|
101
|
+
var $this = $(this)
|
102
|
+
var data = $this.data('bs.affix')
|
103
|
+
var options = typeof option == 'object' && option
|
104
|
+
|
105
|
+
if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
|
79
106
|
if (typeof option == 'string') data[option]()
|
80
107
|
})
|
81
108
|
}
|
82
109
|
|
83
|
-
$.fn.affix
|
110
|
+
var old = $.fn.affix
|
84
111
|
|
85
|
-
$.fn.affix
|
86
|
-
|
87
|
-
}
|
112
|
+
$.fn.affix = Plugin
|
113
|
+
$.fn.affix.Constructor = Affix
|
88
114
|
|
89
115
|
|
90
|
-
|
91
|
-
|
116
|
+
// AFFIX NO CONFLICT
|
117
|
+
// =================
|
92
118
|
|
93
119
|
$.fn.affix.noConflict = function () {
|
94
120
|
$.fn.affix = old
|
@@ -96,22 +122,21 @@
|
|
96
122
|
}
|
97
123
|
|
98
124
|
|
99
|
-
|
100
|
-
|
125
|
+
// AFFIX DATA-API
|
126
|
+
// ==============
|
101
127
|
|
102
128
|
$(window).on('load', function () {
|
103
129
|
$('[data-spy="affix"]').each(function () {
|
104
130
|
var $spy = $(this)
|
105
|
-
|
131
|
+
var data = $spy.data()
|
106
132
|
|
107
133
|
data.offset = data.offset || {}
|
108
134
|
|
109
|
-
data.offsetBottom
|
110
|
-
data.offsetTop
|
135
|
+
if (data.offsetBottom) data.offset.bottom = data.offsetBottom
|
136
|
+
if (data.offsetTop) data.offset.top = data.offsetTop
|
111
137
|
|
112
|
-
$spy
|
138
|
+
Plugin.call($spy, data)
|
113
139
|
})
|
114
140
|
})
|
115
141
|
|
116
|
-
|
117
|
-
}(window.jQuery);
|
142
|
+
}(jQuery);
|
@@ -1,89 +1,82 @@
|
|
1
|
-
/*
|
2
|
-
*
|
3
|
-
* http://getbootstrap.com/
|
4
|
-
*
|
5
|
-
* Copyright
|
6
|
-
*
|
7
|
-
*
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
* See the License for the specific language governing permissions and
|
17
|
-
* limitations under the License.
|
18
|
-
* ========================================================== */
|
19
|
-
|
20
|
-
|
21
|
-
!function ($) {
|
22
|
-
|
23
|
-
"use strict"; // jshint ;_;
|
24
|
-
|
25
|
-
|
26
|
-
/* ALERT CLASS DEFINITION
|
27
|
-
* ====================== */
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: alert.js v3.2.0
|
3
|
+
* http://getbootstrap.com/javascript/#alerts
|
4
|
+
* ========================================================================
|
5
|
+
* Copyright 2011-2014 Twitter, Inc.
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
|
+
* ======================================================================== */
|
8
|
+
|
9
|
+
|
10
|
+
+function ($) {
|
11
|
+
'use strict';
|
12
|
+
|
13
|
+
// ALERT CLASS DEFINITION
|
14
|
+
// ======================
|
28
15
|
|
29
16
|
var dismiss = '[data-dismiss="alert"]'
|
30
|
-
|
31
|
-
|
32
|
-
|
17
|
+
var Alert = function (el) {
|
18
|
+
$(el).on('click', dismiss, this.close)
|
19
|
+
}
|
20
|
+
|
21
|
+
Alert.VERSION = '3.2.0'
|
33
22
|
|
34
23
|
Alert.prototype.close = function (e) {
|
35
|
-
var $this
|
36
|
-
|
37
|
-
, $parent
|
24
|
+
var $this = $(this)
|
25
|
+
var selector = $this.attr('data-target')
|
38
26
|
|
39
27
|
if (!selector) {
|
40
28
|
selector = $this.attr('href')
|
41
|
-
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
29
|
+
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
42
30
|
}
|
43
31
|
|
44
|
-
$parent = $(selector)
|
32
|
+
var $parent = $(selector)
|
45
33
|
|
46
|
-
e
|
34
|
+
if (e) e.preventDefault()
|
47
35
|
|
48
|
-
|
36
|
+
if (!$parent.length) {
|
37
|
+
$parent = $this.hasClass('alert') ? $this : $this.parent()
|
38
|
+
}
|
49
39
|
|
50
|
-
$parent.trigger(e = $.Event('close'))
|
40
|
+
$parent.trigger(e = $.Event('close.bs.alert'))
|
51
41
|
|
52
42
|
if (e.isDefaultPrevented()) return
|
53
43
|
|
54
44
|
$parent.removeClass('in')
|
55
45
|
|
56
46
|
function removeElement() {
|
57
|
-
|
58
|
-
|
59
|
-
.remove()
|
47
|
+
// detach from parent, fire event then clean up data
|
48
|
+
$parent.detach().trigger('closed.bs.alert').remove()
|
60
49
|
}
|
61
50
|
|
62
51
|
$.support.transition && $parent.hasClass('fade') ?
|
63
|
-
$parent
|
52
|
+
$parent
|
53
|
+
.one('bsTransitionEnd', removeElement)
|
54
|
+
.emulateTransitionEnd(150) :
|
64
55
|
removeElement()
|
65
56
|
}
|
66
57
|
|
67
58
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
var old = $.fn.alert
|
59
|
+
// ALERT PLUGIN DEFINITION
|
60
|
+
// =======================
|
72
61
|
|
73
|
-
|
62
|
+
function Plugin(option) {
|
74
63
|
return this.each(function () {
|
75
64
|
var $this = $(this)
|
76
|
-
|
77
|
-
|
65
|
+
var data = $this.data('bs.alert')
|
66
|
+
|
67
|
+
if (!data) $this.data('bs.alert', (data = new Alert(this)))
|
78
68
|
if (typeof option == 'string') data[option].call($this)
|
79
69
|
})
|
80
70
|
}
|
81
71
|
|
72
|
+
var old = $.fn.alert
|
73
|
+
|
74
|
+
$.fn.alert = Plugin
|
82
75
|
$.fn.alert.Constructor = Alert
|
83
76
|
|
84
77
|
|
85
|
-
|
86
|
-
|
78
|
+
// ALERT NO CONFLICT
|
79
|
+
// =================
|
87
80
|
|
88
81
|
$.fn.alert.noConflict = function () {
|
89
82
|
$.fn.alert = old
|
@@ -91,9 +84,9 @@
|
|
91
84
|
}
|
92
85
|
|
93
86
|
|
94
|
-
|
95
|
-
|
87
|
+
// ALERT DATA-API
|
88
|
+
// ==============
|
96
89
|
|
97
|
-
$(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
|
90
|
+
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
|
98
91
|
|
99
|
-
}(
|
92
|
+
}(jQuery);
|
@@ -1,91 +1,95 @@
|
|
1
|
-
/*
|
2
|
-
*
|
3
|
-
* http://getbootstrap.com/
|
4
|
-
*
|
5
|
-
* Copyright
|
6
|
-
*
|
7
|
-
*
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
* See the License for the specific language governing permissions and
|
17
|
-
* limitations under the License.
|
18
|
-
* ============================================================ */
|
19
|
-
|
20
|
-
|
21
|
-
!function ($) {
|
22
|
-
|
23
|
-
"use strict"; // jshint ;_;
|
24
|
-
|
25
|
-
|
26
|
-
/* BUTTON PUBLIC CLASS DEFINITION
|
27
|
-
* ============================== */
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: button.js v3.2.0
|
3
|
+
* http://getbootstrap.com/javascript/#buttons
|
4
|
+
* ========================================================================
|
5
|
+
* Copyright 2011-2014 Twitter, Inc.
|
6
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
7
|
+
* ======================================================================== */
|
8
|
+
|
9
|
+
|
10
|
+
+function ($) {
|
11
|
+
'use strict';
|
12
|
+
|
13
|
+
// BUTTON PUBLIC CLASS DEFINITION
|
14
|
+
// ==============================
|
28
15
|
|
29
16
|
var Button = function (element, options) {
|
30
|
-
this.$element
|
31
|
-
this.options
|
17
|
+
this.$element = $(element)
|
18
|
+
this.options = $.extend({}, Button.DEFAULTS, options)
|
19
|
+
this.isLoading = false
|
20
|
+
}
|
21
|
+
|
22
|
+
Button.VERSION = '3.2.0'
|
23
|
+
|
24
|
+
Button.DEFAULTS = {
|
25
|
+
loadingText: 'loading...'
|
32
26
|
}
|
33
27
|
|
34
28
|
Button.prototype.setState = function (state) {
|
35
|
-
var d
|
36
|
-
|
37
|
-
|
38
|
-
|
29
|
+
var d = 'disabled'
|
30
|
+
var $el = this.$element
|
31
|
+
var val = $el.is('input') ? 'val' : 'html'
|
32
|
+
var data = $el.data()
|
39
33
|
|
40
34
|
state = state + 'Text'
|
41
|
-
data.resetText || $el.data('resetText', $el[val]())
|
42
35
|
|
43
|
-
|
36
|
+
if (data.resetText == null) $el.data('resetText', $el[val]())
|
37
|
+
|
38
|
+
$el[val](data[state] == null ? this.options[state] : data[state])
|
44
39
|
|
45
40
|
// push to event loop to allow forms to submit
|
46
|
-
setTimeout(function () {
|
47
|
-
state == 'loadingText'
|
48
|
-
|
41
|
+
setTimeout($.proxy(function () {
|
42
|
+
if (state == 'loadingText') {
|
43
|
+
this.isLoading = true
|
44
|
+
$el.addClass(d).attr(d, d)
|
45
|
+
} else if (this.isLoading) {
|
46
|
+
this.isLoading = false
|
49
47
|
$el.removeClass(d).removeAttr(d)
|
50
|
-
|
48
|
+
}
|
49
|
+
}, this), 0)
|
51
50
|
}
|
52
51
|
|
53
52
|
Button.prototype.toggle = function () {
|
54
|
-
var
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
.
|
59
|
-
|
60
|
-
|
53
|
+
var changed = true
|
54
|
+
var $parent = this.$element.closest('[data-toggle="buttons"]')
|
55
|
+
|
56
|
+
if ($parent.length) {
|
57
|
+
var $input = this.$element.find('input')
|
58
|
+
if ($input.prop('type') == 'radio') {
|
59
|
+
if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
|
60
|
+
else $parent.find('.active').removeClass('active')
|
61
|
+
}
|
62
|
+
if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
|
63
|
+
}
|
64
|
+
|
65
|
+
if (changed) this.$element.toggleClass('active')
|
61
66
|
}
|
62
67
|
|
63
68
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
var old = $.fn.button
|
69
|
+
// BUTTON PLUGIN DEFINITION
|
70
|
+
// ========================
|
68
71
|
|
69
|
-
|
72
|
+
function Plugin(option) {
|
70
73
|
return this.each(function () {
|
71
|
-
var $this
|
72
|
-
|
73
|
-
|
74
|
-
|
74
|
+
var $this = $(this)
|
75
|
+
var data = $this.data('bs.button')
|
76
|
+
var options = typeof option == 'object' && option
|
77
|
+
|
78
|
+
if (!data) $this.data('bs.button', (data = new Button(this, options)))
|
79
|
+
|
75
80
|
if (option == 'toggle') data.toggle()
|
76
81
|
else if (option) data.setState(option)
|
77
82
|
})
|
78
83
|
}
|
79
84
|
|
80
|
-
$.fn.button
|
81
|
-
loadingText: 'loading...'
|
82
|
-
}
|
85
|
+
var old = $.fn.button
|
83
86
|
|
87
|
+
$.fn.button = Plugin
|
84
88
|
$.fn.button.Constructor = Button
|
85
89
|
|
86
90
|
|
87
|
-
|
88
|
-
|
91
|
+
// BUTTON NO CONFLICT
|
92
|
+
// ==================
|
89
93
|
|
90
94
|
$.fn.button.noConflict = function () {
|
91
95
|
$.fn.button = old
|
@@ -93,13 +97,14 @@
|
|
93
97
|
}
|
94
98
|
|
95
99
|
|
96
|
-
|
97
|
-
|
100
|
+
// BUTTON DATA-API
|
101
|
+
// ===============
|
98
102
|
|
99
|
-
$(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
|
103
|
+
$(document).on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
|
100
104
|
var $btn = $(e.target)
|
101
105
|
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
|
102
|
-
$btn
|
106
|
+
Plugin.call($btn, 'toggle')
|
107
|
+
e.preventDefault()
|
103
108
|
})
|
104
109
|
|
105
|
-
}(
|
110
|
+
}(jQuery);
|