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,120 @@
1
+ //= require jquery
2
+ //= require bootstrap-transition
3
+
4
+ /* ==========================================================
5
+ * bootstrap-affix.js v2.3.2
6
+ * http://twitter.github.com/bootstrap/javascript.html#affix
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
+ /* AFFIX CLASS DEFINITION
30
+ * ====================== */
31
+
32
+ var Affix = function (element, options) {
33
+ this.options = $.extend({}, $.fn.affix.defaults, options)
34
+ this.$window = $(window)
35
+ .on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
36
+ .on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
37
+ this.$element = $(element)
38
+ this.checkPosition()
39
+ }
40
+
41
+ Affix.prototype.checkPosition = function () {
42
+ if (!this.$element.is(':visible')) return
43
+
44
+ var scrollHeight = $(document).height()
45
+ , scrollTop = this.$window.scrollTop()
46
+ , position = this.$element.offset()
47
+ , offset = this.options.offset
48
+ , offsetBottom = offset.bottom
49
+ , offsetTop = offset.top
50
+ , reset = 'affix affix-top affix-bottom'
51
+ , affix
52
+
53
+ if (typeof offset != 'object') offsetBottom = offsetTop = offset
54
+ if (typeof offsetTop == 'function') offsetTop = offset.top()
55
+ if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
56
+
57
+ affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
58
+ false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
59
+ 'bottom' : offsetTop != null && scrollTop <= offsetTop ?
60
+ 'top' : false
61
+
62
+ if (this.affixed === affix) return
63
+
64
+ this.affixed = affix
65
+ this.unpin = affix == 'bottom' ? position.top - scrollTop : null
66
+
67
+ this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
68
+ }
69
+
70
+
71
+ /* AFFIX PLUGIN DEFINITION
72
+ * ======================= */
73
+
74
+ var old = $.fn.affix
75
+
76
+ $.fn.affix = function (option) {
77
+ return this.each(function () {
78
+ var $this = $(this)
79
+ , data = $this.data('affix')
80
+ , options = typeof option == 'object' && option
81
+ if (!data) $this.data('affix', (data = new Affix(this, options)))
82
+ if (typeof option == 'string') data[option]()
83
+ })
84
+ }
85
+
86
+ $.fn.affix.Constructor = Affix
87
+
88
+ $.fn.affix.defaults = {
89
+ offset: 0
90
+ }
91
+
92
+
93
+ /* AFFIX NO CONFLICT
94
+ * ================= */
95
+
96
+ $.fn.affix.noConflict = function () {
97
+ $.fn.affix = old
98
+ return this
99
+ }
100
+
101
+
102
+ /* AFFIX DATA-API
103
+ * ============== */
104
+
105
+ $(window).on('load', function () {
106
+ $('[data-spy="affix"]').each(function () {
107
+ var $spy = $(this)
108
+ , data = $spy.data()
109
+
110
+ data.offset = data.offset || {}
111
+
112
+ data.offsetBottom && (data.offset.bottom = data.offsetBottom)
113
+ data.offsetTop && (data.offset.top = data.offsetTop)
114
+
115
+ $spy.affix(data)
116
+ })
117
+ })
118
+
119
+
120
+ }(window.jQuery);
@@ -0,0 +1,102 @@
1
+ //= require jquery
2
+ //= require bootstrap-transition
3
+
4
+ /* ==========================================================
5
+ * bootstrap-alert.js v2.3.2
6
+ * http://twitter.github.com/bootstrap/javascript.html#alerts
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
+ /* ALERT CLASS DEFINITION
30
+ * ====================== */
31
+
32
+ var dismiss = '[data-dismiss="alert"]'
33
+ , Alert = function (el) {
34
+ $(el).on('click', dismiss, this.close)
35
+ }
36
+
37
+ Alert.prototype.close = function (e) {
38
+ var $this = $(this)
39
+ , selector = $this.attr('data-target')
40
+ , $parent
41
+
42
+ if (!selector) {
43
+ selector = $this.attr('href')
44
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
45
+ }
46
+
47
+ $parent = $(selector)
48
+
49
+ e && e.preventDefault()
50
+
51
+ $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
52
+
53
+ $parent.trigger(e = $.Event('close'))
54
+
55
+ if (e.isDefaultPrevented()) return
56
+
57
+ $parent.removeClass('in')
58
+
59
+ function removeElement() {
60
+ $parent
61
+ .trigger('closed')
62
+ .remove()
63
+ }
64
+
65
+ $.support.transition && $parent.hasClass('fade') ?
66
+ $parent.on($.support.transition.end, removeElement) :
67
+ removeElement()
68
+ }
69
+
70
+
71
+ /* ALERT PLUGIN DEFINITION
72
+ * ======================= */
73
+
74
+ var old = $.fn.alert
75
+
76
+ $.fn.alert = function (option) {
77
+ return this.each(function () {
78
+ var $this = $(this)
79
+ , data = $this.data('alert')
80
+ if (!data) $this.data('alert', (data = new Alert(this)))
81
+ if (typeof option == 'string') data[option].call($this)
82
+ })
83
+ }
84
+
85
+ $.fn.alert.Constructor = Alert
86
+
87
+
88
+ /* ALERT NO CONFLICT
89
+ * ================= */
90
+
91
+ $.fn.alert.noConflict = function () {
92
+ $.fn.alert = old
93
+ return this
94
+ }
95
+
96
+
97
+ /* ALERT DATA-API
98
+ * ============== */
99
+
100
+ $(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
101
+
102
+ }(window.jQuery);
@@ -0,0 +1,108 @@
1
+ //= require jquery
2
+ //= require bootstrap-transition
3
+
4
+ /* ============================================================
5
+ * bootstrap-button.js v2.3.2
6
+ * http://twitter.github.com/bootstrap/javascript.html#buttons
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
+ /* BUTTON PUBLIC CLASS DEFINITION
30
+ * ============================== */
31
+
32
+ var Button = function (element, options) {
33
+ this.$element = $(element)
34
+ this.options = $.extend({}, $.fn.button.defaults, options)
35
+ }
36
+
37
+ Button.prototype.setState = function (state) {
38
+ var d = 'disabled'
39
+ , $el = this.$element
40
+ , data = $el.data()
41
+ , val = $el.is('input') ? 'val' : 'html'
42
+
43
+ state = state + 'Text'
44
+ data.resetText || $el.data('resetText', $el[val]())
45
+
46
+ $el[val](data[state] || this.options[state])
47
+
48
+ // push to event loop to allow forms to submit
49
+ setTimeout(function () {
50
+ state == 'loadingText' ?
51
+ $el.addClass(d).attr(d, d) :
52
+ $el.removeClass(d).removeAttr(d)
53
+ }, 0)
54
+ }
55
+
56
+ Button.prototype.toggle = function () {
57
+ var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
58
+
59
+ $parent && $parent
60
+ .find('.active')
61
+ .removeClass('active')
62
+
63
+ this.$element.toggleClass('active')
64
+ }
65
+
66
+
67
+ /* BUTTON PLUGIN DEFINITION
68
+ * ======================== */
69
+
70
+ var old = $.fn.button
71
+
72
+ $.fn.button = function (option) {
73
+ return this.each(function () {
74
+ var $this = $(this)
75
+ , data = $this.data('button')
76
+ , options = typeof option == 'object' && option
77
+ if (!data) $this.data('button', (data = new Button(this, options)))
78
+ if (option == 'toggle') data.toggle()
79
+ else if (option) data.setState(option)
80
+ })
81
+ }
82
+
83
+ $.fn.button.defaults = {
84
+ loadingText: 'loading...'
85
+ }
86
+
87
+ $.fn.button.Constructor = Button
88
+
89
+
90
+ /* BUTTON NO CONFLICT
91
+ * ================== */
92
+
93
+ $.fn.button.noConflict = function () {
94
+ $.fn.button = old
95
+ return this
96
+ }
97
+
98
+
99
+ /* BUTTON DATA-API
100
+ * =============== */
101
+
102
+ $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
103
+ var $btn = $(e.target)
104
+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
105
+ $btn.button('toggle')
106
+ })
107
+
108
+ }(window.jQuery);
@@ -0,0 +1,210 @@
1
+ //= require jquery
2
+ //= require bootstrap-transition
3
+
4
+ /* ==========================================================
5
+ * bootstrap-carousel.js v2.3.2
6
+ * http://twitter.github.com/bootstrap/javascript.html#carousel
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
+ /* CAROUSEL CLASS DEFINITION
30
+ * ========================= */
31
+
32
+ var Carousel = function (element, options) {
33
+ this.$element = $(element)
34
+ this.$indicators = this.$element.find('.carousel-indicators')
35
+ this.options = options
36
+ this.options.pause == 'hover' && this.$element
37
+ .on('mouseenter', $.proxy(this.pause, this))
38
+ .on('mouseleave', $.proxy(this.cycle, this))
39
+ }
40
+
41
+ Carousel.prototype = {
42
+
43
+ cycle: function (e) {
44
+ if (!e) this.paused = false
45
+ if (this.interval) clearInterval(this.interval);
46
+ this.options.interval
47
+ && !this.paused
48
+ && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
49
+ return this
50
+ }
51
+
52
+ , getActiveIndex: function () {
53
+ this.$active = this.$element.find('.item.active')
54
+ this.$items = this.$active.parent().children()
55
+ return this.$items.index(this.$active)
56
+ }
57
+
58
+ , to: function (pos) {
59
+ var activeIndex = this.getActiveIndex()
60
+ , that = this
61
+
62
+ if (pos > (this.$items.length - 1) || pos < 0) return
63
+
64
+ if (this.sliding) {
65
+ return this.$element.one('slid', function () {
66
+ that.to(pos)
67
+ })
68
+ }
69
+
70
+ if (activeIndex == pos) {
71
+ return this.pause().cycle()
72
+ }
73
+
74
+ return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
75
+ }
76
+
77
+ , pause: function (e) {
78
+ if (!e) this.paused = true
79
+ if (this.$element.find('.next, .prev').length && $.support.transition.end) {
80
+ this.$element.trigger($.support.transition.end)
81
+ this.cycle(true)
82
+ }
83
+ clearInterval(this.interval)
84
+ this.interval = null
85
+ return this
86
+ }
87
+
88
+ , next: function () {
89
+ if (this.sliding) return
90
+ return this.slide('next')
91
+ }
92
+
93
+ , prev: function () {
94
+ if (this.sliding) return
95
+ return this.slide('prev')
96
+ }
97
+
98
+ , slide: function (type, next) {
99
+ var $active = this.$element.find('.item.active')
100
+ , $next = next || $active[type]()
101
+ , isCycling = this.interval
102
+ , direction = type == 'next' ? 'left' : 'right'
103
+ , fallback = type == 'next' ? 'first' : 'last'
104
+ , that = this
105
+ , e
106
+
107
+ this.sliding = true
108
+
109
+ isCycling && this.pause()
110
+
111
+ $next = $next.length ? $next : this.$element.find('.item')[fallback]()
112
+
113
+ e = $.Event('slide', {
114
+ relatedTarget: $next[0]
115
+ , direction: direction
116
+ })
117
+
118
+ if ($next.hasClass('active')) return
119
+
120
+ if (this.$indicators.length) {
121
+ this.$indicators.find('.active').removeClass('active')
122
+ this.$element.one('slid', function () {
123
+ var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
124
+ $nextIndicator && $nextIndicator.addClass('active')
125
+ })
126
+ }
127
+
128
+ if ($.support.transition && this.$element.hasClass('slide')) {
129
+ this.$element.trigger(e)
130
+ if (e.isDefaultPrevented()) return
131
+ $next.addClass(type)
132
+ $next[0].offsetWidth // force reflow
133
+ $active.addClass(direction)
134
+ $next.addClass(direction)
135
+ this.$element.one($.support.transition.end, function () {
136
+ $next.removeClass([type, direction].join(' ')).addClass('active')
137
+ $active.removeClass(['active', direction].join(' '))
138
+ that.sliding = false
139
+ setTimeout(function () { that.$element.trigger('slid') }, 0)
140
+ })
141
+ } else {
142
+ this.$element.trigger(e)
143
+ if (e.isDefaultPrevented()) return
144
+ $active.removeClass('active')
145
+ $next.addClass('active')
146
+ this.sliding = false
147
+ this.$element.trigger('slid')
148
+ }
149
+
150
+ isCycling && this.cycle()
151
+
152
+ return this
153
+ }
154
+
155
+ }
156
+
157
+
158
+ /* CAROUSEL PLUGIN DEFINITION
159
+ * ========================== */
160
+
161
+ var old = $.fn.carousel
162
+
163
+ $.fn.carousel = function (option) {
164
+ return this.each(function () {
165
+ var $this = $(this)
166
+ , data = $this.data('carousel')
167
+ , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
168
+ , action = typeof option == 'string' ? option : options.slide
169
+ if (!data) $this.data('carousel', (data = new Carousel(this, options)))
170
+ if (typeof option == 'number') data.to(option)
171
+ else if (action) data[action]()
172
+ else if (options.interval) data.pause().cycle()
173
+ })
174
+ }
175
+
176
+ $.fn.carousel.defaults = {
177
+ interval: 5000
178
+ , pause: 'hover'
179
+ }
180
+
181
+ $.fn.carousel.Constructor = Carousel
182
+
183
+
184
+ /* CAROUSEL NO CONFLICT
185
+ * ==================== */
186
+
187
+ $.fn.carousel.noConflict = function () {
188
+ $.fn.carousel = old
189
+ return this
190
+ }
191
+
192
+ /* CAROUSEL DATA-API
193
+ * ================= */
194
+
195
+ $(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
196
+ var $this = $(this), href
197
+ , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
198
+ , options = $.extend({}, $target.data(), $this.data())
199
+ , slideIndex
200
+
201
+ $target.carousel(options)
202
+
203
+ if (slideIndex = $this.attr('data-slide-to')) {
204
+ $target.data('carousel').pause().to(slideIndex).cycle()
205
+ }
206
+
207
+ e.preventDefault()
208
+ })
209
+
210
+ }(window.jQuery);