twigg-app 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/data/quips.yml +45 -0
- data/lib/twigg-app/app/quips.rb +13 -0
- data/lib/twigg-app/app/routes.rb +43 -0
- data/lib/twigg-app/app/server.rb +146 -0
- data/lib/twigg-app/app/version.rb +5 -0
- data/lib/twigg-app/app.rb +14 -0
- data/lib/twigg-app.rb +5 -0
- data/public/application.js +106 -0
- data/public/favicon.ico +0 -0
- data/public/favicon.png +0 -0
- data/public/vendor/bootstrap/CNAME +1 -0
- data/public/vendor/bootstrap/CONTRIBUTING.md +66 -0
- data/public/vendor/bootstrap/Gruntfile.js +195 -0
- data/public/vendor/bootstrap/LICENSE +176 -0
- data/public/vendor/bootstrap/README.md +139 -0
- data/public/vendor/bootstrap/_config.yml +28 -0
- data/public/vendor/bootstrap/_includes/ads.html +1 -0
- data/public/vendor/bootstrap/_includes/footer.html +33 -0
- data/public/vendor/bootstrap/_includes/header.html +43 -0
- data/public/vendor/bootstrap/_includes/nav-components.html +135 -0
- data/public/vendor/bootstrap/_includes/nav-css.html +77 -0
- data/public/vendor/bootstrap/_includes/nav-customize.html +40 -0
- data/public/vendor/bootstrap/_includes/nav-getting-started.html +28 -0
- data/public/vendor/bootstrap/_includes/nav-javascript.html +88 -0
- data/public/vendor/bootstrap/_includes/nav-main.html +32 -0
- data/public/vendor/bootstrap/_includes/old-bs-docs.html +8 -0
- data/public/vendor/bootstrap/_includes/social-buttons.html +16 -0
- data/public/vendor/bootstrap/_layouts/customize.html +52 -0
- data/public/vendor/bootstrap/_layouts/default.html +72 -0
- data/public/vendor/bootstrap/_layouts/home.html +43 -0
- data/public/vendor/bootstrap/assets/css/docs.css +896 -0
- data/public/vendor/bootstrap/assets/css/pygments-manni.css +66 -0
- data/public/vendor/bootstrap/assets/ico/apple-touch-icon-114-precomposed.png +0 -0
- data/public/vendor/bootstrap/assets/ico/apple-touch-icon-144-precomposed.png +0 -0
- data/public/vendor/bootstrap/assets/ico/apple-touch-icon-57-precomposed.png +0 -0
- data/public/vendor/bootstrap/assets/ico/apple-touch-icon-72-precomposed.png +0 -0
- data/public/vendor/bootstrap/assets/ico/favicon.png +0 -0
- data/public/vendor/bootstrap/assets/js/application.js +82 -0
- data/public/vendor/bootstrap/assets/js/customizer.js +175 -0
- data/public/vendor/bootstrap/assets/js/holder.js +419 -0
- data/public/vendor/bootstrap/assets/js/html5shiv.js +8 -0
- data/public/vendor/bootstrap/assets/js/jquery.bbq.min.js +1287 -0
- data/public/vendor/bootstrap/assets/js/jquery.js +5 -0
- data/public/vendor/bootstrap/assets/js/jszip.js +1425 -0
- data/public/vendor/bootstrap/assets/js/less.js +9 -0
- data/public/vendor/bootstrap/assets/js/respond.min.js +6 -0
- data/public/vendor/bootstrap/assets/js/uglify.js +14 -0
- data/public/vendor/bootstrap/bower.json +11 -0
- data/public/vendor/bootstrap/browserstack.json +37 -0
- data/public/vendor/bootstrap/components.html +2555 -0
- data/public/vendor/bootstrap/composer.json +20 -0
- data/public/vendor/bootstrap/css.html +2276 -0
- data/public/vendor/bootstrap/customize.html +1480 -0
- data/public/vendor/bootstrap/dist/css/bootstrap.css +5579 -0
- data/public/vendor/bootstrap/dist/css/bootstrap.min.css +9 -0
- data/public/vendor/bootstrap/dist/js/bootstrap.js +1993 -0
- data/public/vendor/bootstrap/dist/js/bootstrap.min.js +6 -0
- data/public/vendor/bootstrap/getting-started.html +375 -0
- data/public/vendor/bootstrap/index.html +16 -0
- data/public/vendor/bootstrap/javascript.html +1904 -0
- data/public/vendor/bootstrap/js/affix.js +126 -0
- data/public/vendor/bootstrap/js/alert.js +98 -0
- data/public/vendor/bootstrap/js/button.js +109 -0
- data/public/vendor/bootstrap/js/carousel.js +217 -0
- data/public/vendor/bootstrap/js/collapse.js +179 -0
- data/public/vendor/bootstrap/js/dropdown.js +154 -0
- data/public/vendor/bootstrap/js/modal.js +244 -0
- data/public/vendor/bootstrap/js/popover.js +117 -0
- data/public/vendor/bootstrap/js/scrollspy.js +158 -0
- data/public/vendor/bootstrap/js/tab.js +135 -0
- data/public/vendor/bootstrap/js/tests/index.html +52 -0
- data/public/vendor/bootstrap/js/tests/phantom.js +63 -0
- data/public/vendor/bootstrap/js/tests/server.js +14 -0
- data/public/vendor/bootstrap/js/tests/unit/affix.js +25 -0
- data/public/vendor/bootstrap/js/tests/unit/alert.js +62 -0
- data/public/vendor/bootstrap/js/tests/unit/button.js +116 -0
- data/public/vendor/bootstrap/js/tests/unit/carousel.js +87 -0
- data/public/vendor/bootstrap/js/tests/unit/collapse.js +164 -0
- data/public/vendor/bootstrap/js/tests/unit/dropdown.js +219 -0
- data/public/vendor/bootstrap/js/tests/unit/modal.js +177 -0
- data/public/vendor/bootstrap/js/tests/unit/phantom.js +69 -0
- data/public/vendor/bootstrap/js/tests/unit/popover.js +133 -0
- data/public/vendor/bootstrap/js/tests/unit/scrollspy.js +37 -0
- data/public/vendor/bootstrap/js/tests/unit/tab.js +86 -0
- data/public/vendor/bootstrap/js/tests/unit/tooltip.js +437 -0
- data/public/vendor/bootstrap/js/tests/unit/transition.js +13 -0
- data/public/vendor/bootstrap/js/tests/vendor/jquery.js +5 -0
- data/public/vendor/bootstrap/js/tests/vendor/qunit.css +232 -0
- data/public/vendor/bootstrap/js/tests/vendor/qunit.js +1510 -0
- data/public/vendor/bootstrap/js/tooltip.js +382 -0
- data/public/vendor/bootstrap/js/transition.js +56 -0
- data/public/vendor/bootstrap/less/alerts.less +71 -0
- data/public/vendor/bootstrap/less/badges.less +51 -0
- data/public/vendor/bootstrap/less/bootstrap.less +63 -0
- data/public/vendor/bootstrap/less/breadcrumbs.less +23 -0
- data/public/vendor/bootstrap/less/button-groups.less +244 -0
- data/public/vendor/bootstrap/less/buttons.less +159 -0
- data/public/vendor/bootstrap/less/carousel.less +204 -0
- data/public/vendor/bootstrap/less/close.less +33 -0
- data/public/vendor/bootstrap/less/code.less +56 -0
- data/public/vendor/bootstrap/less/component-animations.less +29 -0
- data/public/vendor/bootstrap/less/dropdowns.less +176 -0
- data/public/vendor/bootstrap/less/forms.less +332 -0
- data/public/vendor/bootstrap/less/grid.less +340 -0
- data/public/vendor/bootstrap/less/input-groups.less +127 -0
- data/public/vendor/bootstrap/less/jumbotron.less +29 -0
- data/public/vendor/bootstrap/less/labels.less +54 -0
- data/public/vendor/bootstrap/less/list-group.less +88 -0
- data/public/vendor/bootstrap/less/media.less +56 -0
- data/public/vendor/bootstrap/less/mixins.less +693 -0
- data/public/vendor/bootstrap/less/modals.less +133 -0
- data/public/vendor/bootstrap/less/navbar.less +559 -0
- data/public/vendor/bootstrap/less/navs.less +228 -0
- data/public/vendor/bootstrap/less/normalize.less +396 -0
- data/public/vendor/bootstrap/less/pager.less +55 -0
- data/public/vendor/bootstrap/less/pagination.less +72 -0
- data/public/vendor/bootstrap/less/panels.less +128 -0
- data/public/vendor/bootstrap/less/popovers.less +133 -0
- data/public/vendor/bootstrap/less/print.less +100 -0
- data/public/vendor/bootstrap/less/progress-bars.less +99 -0
- data/public/vendor/bootstrap/less/responsive-utilities.less +149 -0
- data/public/vendor/bootstrap/less/scaffolding.less +111 -0
- data/public/vendor/bootstrap/less/tables.less +211 -0
- data/public/vendor/bootstrap/less/thumbnails.less +42 -0
- data/public/vendor/bootstrap/less/tooltip.less +95 -0
- data/public/vendor/bootstrap/less/type.less +238 -0
- data/public/vendor/bootstrap/less/utilities.less +42 -0
- data/public/vendor/bootstrap/less/variables.less +607 -0
- data/public/vendor/bootstrap/less/wells.less +29 -0
- data/public/vendor/bootstrap/package.json +33 -0
- data/public/vendor/bootstrap-glyphicons/CHANGELOG.md +3 -0
- data/public/vendor/bootstrap-glyphicons/CNAME +1 -0
- data/public/vendor/bootstrap-glyphicons/CONTRIBUTING.md +54 -0
- data/public/vendor/bootstrap-glyphicons/LICENSE +19 -0
- data/public/vendor/bootstrap-glyphicons/README.md +61 -0
- data/public/vendor/bootstrap-glyphicons/_config.yml +12 -0
- data/public/vendor/bootstrap-glyphicons/composer.json +9 -0
- data/public/vendor/bootstrap-glyphicons/css/bootstrap-glyphicons.css +2 -0
- data/public/vendor/bootstrap-glyphicons/css/bootstrap.css +9 -0
- data/public/vendor/bootstrap-glyphicons/css/docs.css +160 -0
- data/public/vendor/bootstrap-glyphicons/fonts/glyphiconshalflings-regular.eot +0 -0
- data/public/vendor/bootstrap-glyphicons/fonts/glyphiconshalflings-regular.otf +0 -0
- data/public/vendor/bootstrap-glyphicons/fonts/glyphiconshalflings-regular.svg +175 -0
- data/public/vendor/bootstrap-glyphicons/fonts/glyphiconshalflings-regular.ttf +0 -0
- data/public/vendor/bootstrap-glyphicons/fonts/glyphiconshalflings-regular.woff +0 -0
- data/public/vendor/bootstrap-glyphicons/index.html +255 -0
- data/public/vendor/bootstrap-glyphicons/less/bootstrap-glyphicons.less +201 -0
- data/public/vendor/bootstrap-glyphicons/package.json +18 -0
- data/public/vendor/d3/LICENSE +26 -0
- data/public/vendor/d3/README.md +7 -0
- data/public/vendor/d3/bower.json +25 -0
- data/public/vendor/d3/d3.js +8810 -0
- data/public/vendor/d3/d3.min.js +5 -0
- data/public/vendor/jquery/README.md +11 -0
- data/public/vendor/jquery/bower.json +11 -0
- data/public/vendor/jquery/component.json +15 -0
- data/public/vendor/jquery/composer.json +35 -0
- data/public/vendor/jquery/jquery-migrate.js +511 -0
- data/public/vendor/jquery/jquery-migrate.min.js +3 -0
- data/public/vendor/jquery/jquery.js +8829 -0
- data/public/vendor/jquery/jquery.min.js +6 -0
- data/public/vendor/jquery/jquery.min.map +1 -0
- data/public/vendor/jquery/package.json +7 -0
- data/public/vendor/replacejs/CHANGELOG.md +3 -0
- data/public/vendor/replacejs/MIT-LICENSE.txt +20 -0
- data/public/vendor/replacejs/README.md +123 -0
- data/public/vendor/replacejs/bower.json +24 -0
- data/public/vendor/replacejs/primer.js +17 -0
- data/public/vendor/replacejs/primer.min.js +1 -0
- data/public/vendor/replacejs/replace.js +182 -0
- data/public/vendor/stupidtable.js +158 -0
- data/views/dashboard.haml +17 -0
- data/views/layout.haml +60 -0
- metadata +330 -0
@@ -0,0 +1,126 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: affix.js v3.0.0
|
3
|
+
* http://twbs.github.com/bootstrap/javascript.html#affix
|
4
|
+
* ========================================================================
|
5
|
+
* Copyright 2012 Twitter, Inc.
|
6
|
+
*
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
10
|
+
*
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
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 ($) { "use strict";
|
22
|
+
|
23
|
+
// AFFIX CLASS DEFINITION
|
24
|
+
// ======================
|
25
|
+
|
26
|
+
var Affix = function (element, options) {
|
27
|
+
this.options = $.extend({}, Affix.DEFAULTS, options)
|
28
|
+
this.$window = $(window)
|
29
|
+
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
|
30
|
+
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
|
31
|
+
|
32
|
+
this.$element = $(element)
|
33
|
+
this.affixed =
|
34
|
+
this.unpin = null
|
35
|
+
|
36
|
+
this.checkPosition()
|
37
|
+
}
|
38
|
+
|
39
|
+
Affix.RESET = 'affix affix-top affix-bottom'
|
40
|
+
|
41
|
+
Affix.DEFAULTS = {
|
42
|
+
offset: 0
|
43
|
+
}
|
44
|
+
|
45
|
+
Affix.prototype.checkPositionWithEventLoop = function () {
|
46
|
+
setTimeout($.proxy(this.checkPosition, this), 1)
|
47
|
+
}
|
48
|
+
|
49
|
+
Affix.prototype.checkPosition = function () {
|
50
|
+
if (!this.$element.is(':visible')) return
|
51
|
+
|
52
|
+
var scrollHeight = $(document).height()
|
53
|
+
var scrollTop = this.$window.scrollTop()
|
54
|
+
var position = this.$element.offset()
|
55
|
+
var offset = this.options.offset
|
56
|
+
var offsetTop = offset.top
|
57
|
+
var offsetBottom = offset.bottom
|
58
|
+
|
59
|
+
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
60
|
+
if (typeof offsetTop == 'function') offsetTop = offset.top()
|
61
|
+
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
|
62
|
+
|
63
|
+
var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
|
64
|
+
offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
|
65
|
+
offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
|
66
|
+
|
67
|
+
if (this.affixed === affix) return
|
68
|
+
if (this.unpin) this.$element.css('top', '')
|
69
|
+
|
70
|
+
this.affixed = affix
|
71
|
+
this.unpin = affix == 'bottom' ? position.top - scrollTop : null
|
72
|
+
|
73
|
+
this.$element.removeClass(Affix.RESET).addClass('affix' + (affix ? '-' + affix : ''))
|
74
|
+
|
75
|
+
if (affix == 'bottom') {
|
76
|
+
this.$element.offset({ top: document.body.offsetHeight - offsetBottom - this.$element.height() })
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
|
81
|
+
// AFFIX PLUGIN DEFINITION
|
82
|
+
// =======================
|
83
|
+
|
84
|
+
var old = $.fn.affix
|
85
|
+
|
86
|
+
$.fn.affix = function (option) {
|
87
|
+
return this.each(function () {
|
88
|
+
var $this = $(this)
|
89
|
+
var data = $this.data('bs.affix')
|
90
|
+
var options = typeof option == 'object' && option
|
91
|
+
|
92
|
+
if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
|
93
|
+
if (typeof option == 'string') data[option]()
|
94
|
+
})
|
95
|
+
}
|
96
|
+
|
97
|
+
$.fn.affix.Constructor = Affix
|
98
|
+
|
99
|
+
|
100
|
+
// AFFIX NO CONFLICT
|
101
|
+
// =================
|
102
|
+
|
103
|
+
$.fn.affix.noConflict = function () {
|
104
|
+
$.fn.affix = old
|
105
|
+
return this
|
106
|
+
}
|
107
|
+
|
108
|
+
|
109
|
+
// AFFIX DATA-API
|
110
|
+
// ==============
|
111
|
+
|
112
|
+
$(window).on('load', function () {
|
113
|
+
$('[data-spy="affix"]').each(function () {
|
114
|
+
var $spy = $(this)
|
115
|
+
var data = $spy.data()
|
116
|
+
|
117
|
+
data.offset = data.offset || {}
|
118
|
+
|
119
|
+
if (data.offsetBottom) data.offset.bottom = data.offsetBottom
|
120
|
+
if (data.offsetTop) data.offset.top = data.offsetTop
|
121
|
+
|
122
|
+
$spy.affix(data)
|
123
|
+
})
|
124
|
+
})
|
125
|
+
|
126
|
+
}(window.jQuery);
|
@@ -0,0 +1,98 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: alert.js v3.0.0
|
3
|
+
* http://twbs.github.com/bootstrap/javascript.html#alerts
|
4
|
+
* ========================================================================
|
5
|
+
* Copyright 2013 Twitter, Inc.
|
6
|
+
*
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
10
|
+
*
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
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 ($) { "use strict";
|
22
|
+
|
23
|
+
// ALERT CLASS DEFINITION
|
24
|
+
// ======================
|
25
|
+
|
26
|
+
var dismiss = '[data-dismiss="alert"]'
|
27
|
+
var Alert = function (el) {
|
28
|
+
$(el).on('click', dismiss, this.close)
|
29
|
+
}
|
30
|
+
|
31
|
+
Alert.prototype.close = function (e) {
|
32
|
+
var $this = $(this)
|
33
|
+
var selector = $this.attr('data-target')
|
34
|
+
|
35
|
+
if (!selector) {
|
36
|
+
selector = $this.attr('href')
|
37
|
+
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
38
|
+
}
|
39
|
+
|
40
|
+
var $parent = $(selector)
|
41
|
+
|
42
|
+
if (e) e.preventDefault()
|
43
|
+
|
44
|
+
if (!$parent.length) {
|
45
|
+
$parent = $this.hasClass('alert') ? $this : $this.parent()
|
46
|
+
}
|
47
|
+
|
48
|
+
$parent.trigger(e = $.Event('close.bs.alert'))
|
49
|
+
|
50
|
+
if (e.isDefaultPrevented()) return
|
51
|
+
|
52
|
+
$parent.removeClass('in')
|
53
|
+
|
54
|
+
function removeElement() {
|
55
|
+
$parent.trigger('closed.bs.alert').remove()
|
56
|
+
}
|
57
|
+
|
58
|
+
$.support.transition && $parent.hasClass('fade') ?
|
59
|
+
$parent
|
60
|
+
.one($.support.transition.end, removeElement)
|
61
|
+
.emulateTransitionEnd(150) :
|
62
|
+
removeElement()
|
63
|
+
}
|
64
|
+
|
65
|
+
|
66
|
+
// ALERT PLUGIN DEFINITION
|
67
|
+
// =======================
|
68
|
+
|
69
|
+
var old = $.fn.alert
|
70
|
+
|
71
|
+
$.fn.alert = function (option) {
|
72
|
+
return this.each(function () {
|
73
|
+
var $this = $(this)
|
74
|
+
var data = $this.data('bs.alert')
|
75
|
+
|
76
|
+
if (!data) $this.data('bs.alert', (data = new Alert(this)))
|
77
|
+
if (typeof option == 'string') data[option].call($this)
|
78
|
+
})
|
79
|
+
}
|
80
|
+
|
81
|
+
$.fn.alert.Constructor = Alert
|
82
|
+
|
83
|
+
|
84
|
+
// ALERT NO CONFLICT
|
85
|
+
// =================
|
86
|
+
|
87
|
+
$.fn.alert.noConflict = function () {
|
88
|
+
$.fn.alert = old
|
89
|
+
return this
|
90
|
+
}
|
91
|
+
|
92
|
+
|
93
|
+
// ALERT DATA-API
|
94
|
+
// ==============
|
95
|
+
|
96
|
+
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
|
97
|
+
|
98
|
+
}(window.jQuery);
|
@@ -0,0 +1,109 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: button.js v3.0.0
|
3
|
+
* http://twbs.github.com/bootstrap/javascript.html#buttons
|
4
|
+
* ========================================================================
|
5
|
+
* Copyright 2013 Twitter, Inc.
|
6
|
+
*
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
10
|
+
*
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
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 ($) { "use strict";
|
22
|
+
|
23
|
+
// BUTTON PUBLIC CLASS DEFINITION
|
24
|
+
// ==============================
|
25
|
+
|
26
|
+
var Button = function (element, options) {
|
27
|
+
this.$element = $(element)
|
28
|
+
this.options = $.extend({}, Button.DEFAULTS, options)
|
29
|
+
}
|
30
|
+
|
31
|
+
Button.DEFAULTS = {
|
32
|
+
loadingText: 'loading...'
|
33
|
+
}
|
34
|
+
|
35
|
+
Button.prototype.setState = function (state) {
|
36
|
+
var d = 'disabled'
|
37
|
+
var $el = this.$element
|
38
|
+
var val = $el.is('input') ? 'val' : 'html'
|
39
|
+
var data = $el.data()
|
40
|
+
|
41
|
+
state = state + 'Text'
|
42
|
+
|
43
|
+
if (!data.resetText) $el.data('resetText', $el[val]())
|
44
|
+
|
45
|
+
$el[val](data[state] || this.options[state])
|
46
|
+
|
47
|
+
// push to event loop to allow forms to submit
|
48
|
+
setTimeout(function () {
|
49
|
+
state == 'loadingText' ?
|
50
|
+
$el.addClass(d).attr(d, d) :
|
51
|
+
$el.removeClass(d).removeAttr(d);
|
52
|
+
}, 0)
|
53
|
+
}
|
54
|
+
|
55
|
+
Button.prototype.toggle = function () {
|
56
|
+
var $parent = this.$element.closest('[data-toggle="buttons"]')
|
57
|
+
|
58
|
+
if ($parent.length) {
|
59
|
+
var $input = this.$element.find('input')
|
60
|
+
.prop('checked', !this.$element.hasClass('active'))
|
61
|
+
.trigger('change')
|
62
|
+
if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active')
|
63
|
+
}
|
64
|
+
|
65
|
+
this.$element.toggleClass('active')
|
66
|
+
}
|
67
|
+
|
68
|
+
|
69
|
+
// BUTTON PLUGIN DEFINITION
|
70
|
+
// ========================
|
71
|
+
|
72
|
+
var old = $.fn.button
|
73
|
+
|
74
|
+
$.fn.button = function (option) {
|
75
|
+
return this.each(function () {
|
76
|
+
var $this = $(this)
|
77
|
+
var data = $this.data('bs.button')
|
78
|
+
var options = typeof option == 'object' && option
|
79
|
+
|
80
|
+
if (!data) $this.data('bs.button', (data = new Button(this, options)))
|
81
|
+
|
82
|
+
if (option == 'toggle') data.toggle()
|
83
|
+
else if (option) data.setState(option)
|
84
|
+
})
|
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.bs.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
|
+
e.preventDefault()
|
107
|
+
})
|
108
|
+
|
109
|
+
}(window.jQuery);
|
@@ -0,0 +1,217 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: carousel.js v3.0.0
|
3
|
+
* http://twbs.github.com/bootstrap/javascript.html#carousel
|
4
|
+
* ========================================================================
|
5
|
+
* Copyright 2012 Twitter, Inc.
|
6
|
+
*
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
* you may not use this file except in compliance with the License.
|
9
|
+
* You may obtain a copy of the License at
|
10
|
+
*
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
*
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
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 ($) { "use strict";
|
22
|
+
|
23
|
+
// CAROUSEL CLASS DEFINITION
|
24
|
+
// =========================
|
25
|
+
|
26
|
+
var Carousel = function (element, options) {
|
27
|
+
this.$element = $(element)
|
28
|
+
this.$indicators = this.$element.find('.carousel-indicators')
|
29
|
+
this.options = options
|
30
|
+
this.paused =
|
31
|
+
this.sliding =
|
32
|
+
this.interval =
|
33
|
+
this.$active =
|
34
|
+
this.$items = null
|
35
|
+
|
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.DEFAULTS = {
|
42
|
+
interval: 5000
|
43
|
+
, pause: 'hover'
|
44
|
+
, wrap: true
|
45
|
+
}
|
46
|
+
|
47
|
+
Carousel.prototype.cycle = function (e) {
|
48
|
+
e || (this.paused = false)
|
49
|
+
|
50
|
+
this.interval && clearInterval(this.interval)
|
51
|
+
|
52
|
+
this.options.interval
|
53
|
+
&& !this.paused
|
54
|
+
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
|
55
|
+
|
56
|
+
return this
|
57
|
+
}
|
58
|
+
|
59
|
+
Carousel.prototype.getActiveIndex = function () {
|
60
|
+
this.$active = this.$element.find('.item.active')
|
61
|
+
this.$items = this.$active.parent().children()
|
62
|
+
|
63
|
+
return this.$items.index(this.$active)
|
64
|
+
}
|
65
|
+
|
66
|
+
Carousel.prototype.to = function (pos) {
|
67
|
+
var that = this
|
68
|
+
var activeIndex = this.getActiveIndex()
|
69
|
+
|
70
|
+
if (pos > (this.$items.length - 1) || pos < 0) return
|
71
|
+
|
72
|
+
if (this.sliding) return this.$element.one('slid', function () { that.to(pos) })
|
73
|
+
if (activeIndex == pos) return this.pause().cycle()
|
74
|
+
|
75
|
+
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
76
|
+
}
|
77
|
+
|
78
|
+
Carousel.prototype.pause = function (e) {
|
79
|
+
e || (this.paused = true)
|
80
|
+
|
81
|
+
if (this.$element.find('.next, .prev').length && $.support.transition.end) {
|
82
|
+
this.$element.trigger($.support.transition.end)
|
83
|
+
this.cycle(true)
|
84
|
+
}
|
85
|
+
|
86
|
+
this.interval = clearInterval(this.interval)
|
87
|
+
|
88
|
+
return this
|
89
|
+
}
|
90
|
+
|
91
|
+
Carousel.prototype.next = function () {
|
92
|
+
if (this.sliding) return
|
93
|
+
return this.slide('next')
|
94
|
+
}
|
95
|
+
|
96
|
+
Carousel.prototype.prev = function () {
|
97
|
+
if (this.sliding) return
|
98
|
+
return this.slide('prev')
|
99
|
+
}
|
100
|
+
|
101
|
+
Carousel.prototype.slide = function (type, next) {
|
102
|
+
var $active = this.$element.find('.item.active')
|
103
|
+
var $next = next || $active[type]()
|
104
|
+
var isCycling = this.interval
|
105
|
+
var direction = type == 'next' ? 'left' : 'right'
|
106
|
+
var fallback = type == 'next' ? 'first' : 'last'
|
107
|
+
var that = this
|
108
|
+
|
109
|
+
if (!$next.length) {
|
110
|
+
if (!this.options.wrap) return
|
111
|
+
$next = this.$element.find('.item')[fallback]()
|
112
|
+
}
|
113
|
+
|
114
|
+
this.sliding = true
|
115
|
+
|
116
|
+
isCycling && this.pause()
|
117
|
+
|
118
|
+
var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
|
119
|
+
|
120
|
+
if ($next.hasClass('active')) return
|
121
|
+
|
122
|
+
if (this.$indicators.length) {
|
123
|
+
this.$indicators.find('.active').removeClass('active')
|
124
|
+
this.$element.one('slid', function () {
|
125
|
+
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
|
126
|
+
$nextIndicator && $nextIndicator.addClass('active')
|
127
|
+
})
|
128
|
+
}
|
129
|
+
|
130
|
+
if ($.support.transition && this.$element.hasClass('slide')) {
|
131
|
+
this.$element.trigger(e)
|
132
|
+
if (e.isDefaultPrevented()) return
|
133
|
+
$next.addClass(type)
|
134
|
+
$next[0].offsetWidth // force reflow
|
135
|
+
$active.addClass(direction)
|
136
|
+
$next.addClass(direction)
|
137
|
+
$active
|
138
|
+
.one($.support.transition.end, function () {
|
139
|
+
$next.removeClass([type, direction].join(' ')).addClass('active')
|
140
|
+
$active.removeClass(['active', direction].join(' '))
|
141
|
+
that.sliding = false
|
142
|
+
setTimeout(function () { that.$element.trigger('slid') }, 0)
|
143
|
+
})
|
144
|
+
.emulateTransitionEnd(600)
|
145
|
+
} else {
|
146
|
+
this.$element.trigger(e)
|
147
|
+
if (e.isDefaultPrevented()) return
|
148
|
+
$active.removeClass('active')
|
149
|
+
$next.addClass('active')
|
150
|
+
this.sliding = false
|
151
|
+
this.$element.trigger('slid')
|
152
|
+
}
|
153
|
+
|
154
|
+
isCycling && this.cycle()
|
155
|
+
|
156
|
+
return this
|
157
|
+
}
|
158
|
+
|
159
|
+
|
160
|
+
// CAROUSEL PLUGIN DEFINITION
|
161
|
+
// ==========================
|
162
|
+
|
163
|
+
var old = $.fn.carousel
|
164
|
+
|
165
|
+
$.fn.carousel = function (option) {
|
166
|
+
return this.each(function () {
|
167
|
+
var $this = $(this)
|
168
|
+
var data = $this.data('bs.carousel')
|
169
|
+
var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
170
|
+
var action = typeof option == 'string' ? option : options.slide
|
171
|
+
|
172
|
+
if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
|
173
|
+
if (typeof option == 'number') data.to(option)
|
174
|
+
else if (action) data[action]()
|
175
|
+
else if (options.interval) data.pause().cycle()
|
176
|
+
})
|
177
|
+
}
|
178
|
+
|
179
|
+
$.fn.carousel.Constructor = Carousel
|
180
|
+
|
181
|
+
|
182
|
+
// CAROUSEL NO CONFLICT
|
183
|
+
// ====================
|
184
|
+
|
185
|
+
$.fn.carousel.noConflict = function () {
|
186
|
+
$.fn.carousel = old
|
187
|
+
return this
|
188
|
+
}
|
189
|
+
|
190
|
+
|
191
|
+
// CAROUSEL DATA-API
|
192
|
+
// =================
|
193
|
+
|
194
|
+
$(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
|
195
|
+
var $this = $(this), href
|
196
|
+
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
197
|
+
var options = $.extend({}, $target.data(), $this.data())
|
198
|
+
var slideIndex = $this.attr('data-slide-to')
|
199
|
+
if (slideIndex) options.interval = false
|
200
|
+
|
201
|
+
$target.carousel(options)
|
202
|
+
|
203
|
+
if (slideIndex = $this.attr('data-slide-to')) {
|
204
|
+
$target.data('bs.carousel').to(slideIndex)
|
205
|
+
}
|
206
|
+
|
207
|
+
e.preventDefault()
|
208
|
+
})
|
209
|
+
|
210
|
+
$(window).on('load', function () {
|
211
|
+
$('[data-ride="carousel"]').each(function () {
|
212
|
+
var $carousel = $(this)
|
213
|
+
$carousel.carousel($carousel.data())
|
214
|
+
})
|
215
|
+
})
|
216
|
+
|
217
|
+
}(window.jQuery);
|