astro 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,170 @@
1
+ //= require jquery
2
+ //= require bootstrap-transition
3
+
4
+ /* =============================================================
5
+ * bootstrap-collapse.js v2.3.2
6
+ * http://twitter.github.com/bootstrap/javascript.html#collapse
7
+ * =============================================================
8
+ * Copyright 2012 Twitter, Inc.
9
+ *
10
+ * Licensed under the Apache License, Version 2.0 (the "License");
11
+ * you may not use this file except in compliance with the License.
12
+ * You may obtain a copy of the License at
13
+ *
14
+ * http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ * ============================================================ */
22
+
23
+
24
+ !function ($) {
25
+
26
+ "use strict"; // jshint ;_;
27
+
28
+
29
+ /* COLLAPSE PUBLIC CLASS DEFINITION
30
+ * ================================ */
31
+
32
+ var Collapse = function (element, options) {
33
+ this.$element = $(element)
34
+ this.options = $.extend({}, $.fn.collapse.defaults, options)
35
+
36
+ if (this.options.parent) {
37
+ this.$parent = $(this.options.parent)
38
+ }
39
+
40
+ this.options.toggle && this.toggle()
41
+ }
42
+
43
+ Collapse.prototype = {
44
+
45
+ constructor: Collapse
46
+
47
+ , dimension: function () {
48
+ var hasWidth = this.$element.hasClass('width')
49
+ return hasWidth ? 'width' : 'height'
50
+ }
51
+
52
+ , show: function () {
53
+ var dimension
54
+ , scroll
55
+ , actives
56
+ , hasData
57
+
58
+ if (this.transitioning || this.$element.hasClass('in')) return
59
+
60
+ dimension = this.dimension()
61
+ scroll = $.camelCase(['scroll', dimension].join('-'))
62
+ actives = this.$parent && this.$parent.find('> .accordion-group > .in')
63
+
64
+ if (actives && actives.length) {
65
+ hasData = actives.data('collapse')
66
+ if (hasData && hasData.transitioning) return
67
+ actives.collapse('hide')
68
+ hasData || actives.data('collapse', null)
69
+ }
70
+
71
+ this.$element[dimension](0)
72
+ this.transition('addClass', $.Event('show'), 'shown')
73
+ $.support.transition && this.$element[dimension](this.$element[0][scroll])
74
+ }
75
+
76
+ , hide: function () {
77
+ var dimension
78
+ if (this.transitioning || !this.$element.hasClass('in')) return
79
+ dimension = this.dimension()
80
+ this.reset(this.$element[dimension]())
81
+ this.transition('removeClass', $.Event('hide'), 'hidden')
82
+ this.$element[dimension](0)
83
+ }
84
+
85
+ , reset: function (size) {
86
+ var dimension = this.dimension()
87
+
88
+ this.$element
89
+ .removeClass('collapse')
90
+ [dimension](size || 'auto')
91
+ [0].offsetWidth
92
+
93
+ this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
94
+
95
+ return this
96
+ }
97
+
98
+ , transition: function (method, startEvent, completeEvent) {
99
+ var that = this
100
+ , complete = function () {
101
+ if (startEvent.type == 'show') that.reset()
102
+ that.transitioning = 0
103
+ that.$element.trigger(completeEvent)
104
+ }
105
+
106
+ this.$element.trigger(startEvent)
107
+
108
+ if (startEvent.isDefaultPrevented()) return
109
+
110
+ this.transitioning = 1
111
+
112
+ this.$element[method]('in')
113
+
114
+ $.support.transition && this.$element.hasClass('collapse') ?
115
+ this.$element.one($.support.transition.end, complete) :
116
+ complete()
117
+ }
118
+
119
+ , toggle: function () {
120
+ this[this.$element.hasClass('in') ? 'hide' : 'show']()
121
+ }
122
+
123
+ }
124
+
125
+
126
+ /* COLLAPSE PLUGIN DEFINITION
127
+ * ========================== */
128
+
129
+ var old = $.fn.collapse
130
+
131
+ $.fn.collapse = function (option) {
132
+ return this.each(function () {
133
+ var $this = $(this)
134
+ , data = $this.data('collapse')
135
+ , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
136
+ if (!data) $this.data('collapse', (data = new Collapse(this, options)))
137
+ if (typeof option == 'string') data[option]()
138
+ })
139
+ }
140
+
141
+ $.fn.collapse.defaults = {
142
+ toggle: true
143
+ }
144
+
145
+ $.fn.collapse.Constructor = Collapse
146
+
147
+
148
+ /* COLLAPSE NO CONFLICT
149
+ * ==================== */
150
+
151
+ $.fn.collapse.noConflict = function () {
152
+ $.fn.collapse = old
153
+ return this
154
+ }
155
+
156
+
157
+ /* COLLAPSE DATA-API
158
+ * ================= */
159
+
160
+ $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
161
+ var $this = $(this), href
162
+ , target = $this.attr('data-target')
163
+ || e.preventDefault()
164
+ || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
165
+ , option = $(target).data('collapse') ? 'toggle' : $this.data()
166
+ $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
167
+ $(target).collapse(option)
168
+ })
169
+
170
+ }(window.jQuery);
@@ -0,0 +1,172 @@
1
+ //= require jquery
2
+ //= require bootstrap-transition
3
+
4
+ /* ============================================================
5
+ * bootstrap-dropdown.js v2.3.2
6
+ * http://twitter.github.com/bootstrap/javascript.html#dropdowns
7
+ * ============================================================
8
+ * Copyright 2012 Twitter, Inc.
9
+ *
10
+ * Licensed under the Apache License, Version 2.0 (the "License");
11
+ * you may not use this file except in compliance with the License.
12
+ * You may obtain a copy of the License at
13
+ *
14
+ * http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ * ============================================================ */
22
+
23
+
24
+ !function ($) {
25
+
26
+ "use strict"; // jshint ;_;
27
+
28
+
29
+ /* DROPDOWN CLASS DEFINITION
30
+ * ========================= */
31
+
32
+ var toggle = '[data-toggle=dropdown]'
33
+ , Dropdown = function (element) {
34
+ var $el = $(element).on('click.dropdown.data-api', this.toggle)
35
+ $('html').on('click.dropdown.data-api', function () {
36
+ $el.parent().removeClass('open')
37
+ })
38
+ }
39
+
40
+ Dropdown.prototype = {
41
+
42
+ constructor: Dropdown
43
+
44
+ , toggle: function (e) {
45
+ var $this = $(this)
46
+ , $parent
47
+ , isActive
48
+
49
+ if ($this.is('.disabled, :disabled')) return
50
+
51
+ $parent = getParent($this)
52
+
53
+ isActive = $parent.hasClass('open')
54
+
55
+ clearMenus()
56
+
57
+ if (!isActive) {
58
+ if ('ontouchstart' in document.documentElement) {
59
+ // if mobile we we use a backdrop because click events don't delegate
60
+ $('<div class="dropdown-backdrop"/>').insertBefore($(this)).on('click', clearMenus)
61
+ }
62
+ $parent.toggleClass('open')
63
+ }
64
+
65
+ $this.focus()
66
+
67
+ return false
68
+ }
69
+
70
+ , keydown: function (e) {
71
+ var $this
72
+ , $items
73
+ , $active
74
+ , $parent
75
+ , isActive
76
+ , index
77
+
78
+ if (!/(38|40|27)/.test(e.keyCode)) return
79
+
80
+ $this = $(this)
81
+
82
+ e.preventDefault()
83
+ e.stopPropagation()
84
+
85
+ if ($this.is('.disabled, :disabled')) return
86
+
87
+ $parent = getParent($this)
88
+
89
+ isActive = $parent.hasClass('open')
90
+
91
+ if (!isActive || (isActive && e.keyCode == 27)) {
92
+ if (e.which == 27) $parent.find(toggle).focus()
93
+ return $this.click()
94
+ }
95
+
96
+ $items = $('[role=menu] li:not(.divider):visible a', $parent)
97
+
98
+ if (!$items.length) return
99
+
100
+ index = $items.index($items.filter(':focus'))
101
+
102
+ if (e.keyCode == 38 && index > 0) index-- // up
103
+ if (e.keyCode == 40 && index < $items.length - 1) index++ // down
104
+ if (!~index) index = 0
105
+
106
+ $items
107
+ .eq(index)
108
+ .focus()
109
+ }
110
+
111
+ }
112
+
113
+ function clearMenus() {
114
+ $('.dropdown-backdrop').remove()
115
+ $(toggle).each(function () {
116
+ getParent($(this)).removeClass('open')
117
+ })
118
+ }
119
+
120
+ function getParent($this) {
121
+ var selector = $this.attr('data-target')
122
+ , $parent
123
+
124
+ if (!selector) {
125
+ selector = $this.attr('href')
126
+ selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
127
+ }
128
+
129
+ $parent = selector && $(selector)
130
+
131
+ if (!$parent || !$parent.length) $parent = $this.parent()
132
+
133
+ return $parent
134
+ }
135
+
136
+
137
+ /* DROPDOWN PLUGIN DEFINITION
138
+ * ========================== */
139
+
140
+ var old = $.fn.dropdown
141
+
142
+ $.fn.dropdown = function (option) {
143
+ return this.each(function () {
144
+ var $this = $(this)
145
+ , data = $this.data('dropdown')
146
+ if (!data) $this.data('dropdown', (data = new Dropdown(this)))
147
+ if (typeof option == 'string') data[option].call($this)
148
+ })
149
+ }
150
+
151
+ $.fn.dropdown.Constructor = Dropdown
152
+
153
+
154
+ /* DROPDOWN NO CONFLICT
155
+ * ==================== */
156
+
157
+ $.fn.dropdown.noConflict = function () {
158
+ $.fn.dropdown = old
159
+ return this
160
+ }
161
+
162
+
163
+ /* APPLY TO STANDARD DROPDOWN ELEMENTS
164
+ * =================================== */
165
+
166
+ $(document)
167
+ .on('click.dropdown.data-api', clearMenus)
168
+ .on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
169
+ .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
170
+ .on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
171
+
172
+ }(window.jQuery);
@@ -0,0 +1,250 @@
1
+ //= require jquery
2
+ //= require bootstrap-transition
3
+
4
+ /* =========================================================
5
+ * bootstrap-modal.js v2.3.2
6
+ * http://twitter.github.com/bootstrap/javascript.html#modals
7
+ * =========================================================
8
+ * Copyright 2012 Twitter, Inc.
9
+ *
10
+ * Licensed under the Apache License, Version 2.0 (the "License");
11
+ * you may not use this file except in compliance with the License.
12
+ * You may obtain a copy of the License at
13
+ *
14
+ * http://www.apache.org/licenses/LICENSE-2.0
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ * ========================================================= */
22
+
23
+
24
+ !function ($) {
25
+
26
+ "use strict"; // jshint ;_;
27
+
28
+
29
+ /* MODAL CLASS DEFINITION
30
+ * ====================== */
31
+
32
+ var Modal = function (element, options) {
33
+ this.options = options
34
+ this.$element = $(element)
35
+ .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
36
+ this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
37
+ }
38
+
39
+ Modal.prototype = {
40
+
41
+ constructor: Modal
42
+
43
+ , toggle: function () {
44
+ return this[!this.isShown ? 'show' : 'hide']()
45
+ }
46
+
47
+ , show: function () {
48
+ var that = this
49
+ , e = $.Event('show')
50
+
51
+ this.$element.trigger(e)
52
+
53
+ if (this.isShown || e.isDefaultPrevented()) return
54
+
55
+ this.isShown = true
56
+
57
+ this.escape()
58
+
59
+ this.backdrop(function () {
60
+ var transition = $.support.transition && that.$element.hasClass('fade')
61
+
62
+ if (!that.$element.parent().length) {
63
+ that.$element.appendTo(document.body) //don't move modals dom position
64
+ }
65
+
66
+ that.$element.show()
67
+
68
+ if (transition) {
69
+ that.$element[0].offsetWidth // force reflow
70
+ }
71
+
72
+ that.$element
73
+ .addClass('in')
74
+ .attr('aria-hidden', false)
75
+
76
+ that.enforceFocus()
77
+
78
+ transition ?
79
+ that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
80
+ that.$element.focus().trigger('shown')
81
+
82
+ })
83
+ }
84
+
85
+ , hide: function (e) {
86
+ e && e.preventDefault()
87
+
88
+ var that = this
89
+
90
+ e = $.Event('hide')
91
+
92
+ this.$element.trigger(e)
93
+
94
+ if (!this.isShown || e.isDefaultPrevented()) return
95
+
96
+ this.isShown = false
97
+
98
+ this.escape()
99
+
100
+ $(document).off('focusin.modal')
101
+
102
+ this.$element
103
+ .removeClass('in')
104
+ .attr('aria-hidden', true)
105
+
106
+ $.support.transition && this.$element.hasClass('fade') ?
107
+ this.hideWithTransition() :
108
+ this.hideModal()
109
+ }
110
+
111
+ , enforceFocus: function () {
112
+ var that = this
113
+ $(document).on('focusin.modal', function (e) {
114
+ if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
115
+ that.$element.focus()
116
+ }
117
+ })
118
+ }
119
+
120
+ , escape: function () {
121
+ var that = this
122
+ if (this.isShown && this.options.keyboard) {
123
+ this.$element.on('keyup.dismiss.modal', function ( e ) {
124
+ e.which == 27 && that.hide()
125
+ })
126
+ } else if (!this.isShown) {
127
+ this.$element.off('keyup.dismiss.modal')
128
+ }
129
+ }
130
+
131
+ , hideWithTransition: function () {
132
+ var that = this
133
+ , timeout = setTimeout(function () {
134
+ that.$element.off($.support.transition.end)
135
+ that.hideModal()
136
+ }, 500)
137
+
138
+ this.$element.one($.support.transition.end, function () {
139
+ clearTimeout(timeout)
140
+ that.hideModal()
141
+ })
142
+ }
143
+
144
+ , hideModal: function () {
145
+ var that = this
146
+ this.$element.hide()
147
+ this.backdrop(function () {
148
+ that.removeBackdrop()
149
+ that.$element.trigger('hidden')
150
+ })
151
+ }
152
+
153
+ , removeBackdrop: function () {
154
+ this.$backdrop && this.$backdrop.remove()
155
+ this.$backdrop = null
156
+ }
157
+
158
+ , backdrop: function (callback) {
159
+ var that = this
160
+ , animate = this.$element.hasClass('fade') ? 'fade' : ''
161
+
162
+ if (this.isShown && this.options.backdrop) {
163
+ var doAnimate = $.support.transition && animate
164
+
165
+ this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
166
+ .appendTo(document.body)
167
+
168
+ this.$backdrop.click(
169
+ this.options.backdrop == 'static' ?
170
+ $.proxy(this.$element[0].focus, this.$element[0])
171
+ : $.proxy(this.hide, this)
172
+ )
173
+
174
+ if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
175
+
176
+ this.$backdrop.addClass('in')
177
+
178
+ if (!callback) return
179
+
180
+ doAnimate ?
181
+ this.$backdrop.one($.support.transition.end, callback) :
182
+ callback()
183
+
184
+ } else if (!this.isShown && this.$backdrop) {
185
+ this.$backdrop.removeClass('in')
186
+
187
+ $.support.transition && this.$element.hasClass('fade')?
188
+ this.$backdrop.one($.support.transition.end, callback) :
189
+ callback()
190
+
191
+ } else if (callback) {
192
+ callback()
193
+ }
194
+ }
195
+ }
196
+
197
+
198
+ /* MODAL PLUGIN DEFINITION
199
+ * ======================= */
200
+
201
+ var old = $.fn.modal
202
+
203
+ $.fn.modal = function (option) {
204
+ return this.each(function () {
205
+ var $this = $(this)
206
+ , data = $this.data('modal')
207
+ , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
208
+ if (!data) $this.data('modal', (data = new Modal(this, options)))
209
+ if (typeof option == 'string') data[option]()
210
+ else if (options.show) data.show()
211
+ })
212
+ }
213
+
214
+ $.fn.modal.defaults = {
215
+ backdrop: true
216
+ , keyboard: true
217
+ , show: true
218
+ }
219
+
220
+ $.fn.modal.Constructor = Modal
221
+
222
+
223
+ /* MODAL NO CONFLICT
224
+ * ================= */
225
+
226
+ $.fn.modal.noConflict = function () {
227
+ $.fn.modal = old
228
+ return this
229
+ }
230
+
231
+
232
+ /* MODAL DATA-API
233
+ * ============== */
234
+
235
+ $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
236
+ var $this = $(this)
237
+ , href = $this.attr('href')
238
+ , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
239
+ , option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
240
+
241
+ e.preventDefault()
242
+
243
+ $target
244
+ .modal(option)
245
+ .one('hide', function () {
246
+ $this.focus()
247
+ })
248
+ })
249
+
250
+ }(window.jQuery);