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,179 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: collapse.js v3.0.0
|
3
|
+
* http://twbs.github.com/bootstrap/javascript.html#collapse
|
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
|
+
// COLLAPSE PUBLIC CLASS DEFINITION
|
24
|
+
// ================================
|
25
|
+
|
26
|
+
var Collapse = function (element, options) {
|
27
|
+
this.$element = $(element)
|
28
|
+
this.options = $.extend({}, Collapse.DEFAULTS, options)
|
29
|
+
this.transitioning = null
|
30
|
+
|
31
|
+
if (this.options.parent) this.$parent = $(this.options.parent)
|
32
|
+
if (this.options.toggle) this.toggle()
|
33
|
+
}
|
34
|
+
|
35
|
+
Collapse.DEFAULTS = {
|
36
|
+
toggle: true
|
37
|
+
}
|
38
|
+
|
39
|
+
Collapse.prototype.dimension = function () {
|
40
|
+
var hasWidth = this.$element.hasClass('width')
|
41
|
+
return hasWidth ? 'width' : 'height'
|
42
|
+
}
|
43
|
+
|
44
|
+
Collapse.prototype.show = function () {
|
45
|
+
if (this.transitioning || this.$element.hasClass('in')) return
|
46
|
+
|
47
|
+
var startEvent = $.Event('show.bs.collapse')
|
48
|
+
this.$element.trigger(startEvent)
|
49
|
+
if (startEvent.isDefaultPrevented()) return
|
50
|
+
|
51
|
+
var actives = this.$parent && this.$parent.find('> .panel > .in')
|
52
|
+
|
53
|
+
if (actives && actives.length) {
|
54
|
+
var hasData = actives.data('bs.collapse')
|
55
|
+
if (hasData && hasData.transitioning) return
|
56
|
+
actives.collapse('hide')
|
57
|
+
hasData || actives.data('bs.collapse', null)
|
58
|
+
}
|
59
|
+
|
60
|
+
var dimension = this.dimension()
|
61
|
+
|
62
|
+
this.$element
|
63
|
+
.removeClass('collapse')
|
64
|
+
.addClass('collapsing')
|
65
|
+
[dimension](0)
|
66
|
+
|
67
|
+
this.transitioning = 1
|
68
|
+
|
69
|
+
var complete = function () {
|
70
|
+
this.$element
|
71
|
+
.removeClass('collapsing')
|
72
|
+
.addClass('in')
|
73
|
+
[dimension]('auto')
|
74
|
+
this.transitioning = 0
|
75
|
+
this.$element.trigger('shown.bs.collapse')
|
76
|
+
}
|
77
|
+
|
78
|
+
if (!$.support.transition) return complete.call(this)
|
79
|
+
|
80
|
+
var scrollSize = $.camelCase(['scroll', dimension].join('-'))
|
81
|
+
|
82
|
+
this.$element
|
83
|
+
.one($.support.transition.end, $.proxy(complete, this))
|
84
|
+
.emulateTransitionEnd(350)
|
85
|
+
[dimension](this.$element[0][scrollSize])
|
86
|
+
}
|
87
|
+
|
88
|
+
Collapse.prototype.hide = function () {
|
89
|
+
if (this.transitioning || !this.$element.hasClass('in')) return
|
90
|
+
|
91
|
+
var startEvent = $.Event('hide.bs.collapse')
|
92
|
+
this.$element.trigger(startEvent)
|
93
|
+
if (startEvent.isDefaultPrevented()) return
|
94
|
+
|
95
|
+
var dimension = this.dimension()
|
96
|
+
|
97
|
+
this.$element
|
98
|
+
[dimension](this.$element[dimension]())
|
99
|
+
[0].offsetHeight
|
100
|
+
|
101
|
+
this.$element
|
102
|
+
.addClass('collapsing')
|
103
|
+
.removeClass('collapse')
|
104
|
+
.removeClass('in')
|
105
|
+
|
106
|
+
this.transitioning = 1
|
107
|
+
|
108
|
+
var complete = function () {
|
109
|
+
this.transitioning = 0
|
110
|
+
this.$element
|
111
|
+
.trigger('hidden.bs.collapse')
|
112
|
+
.removeClass('collapsing')
|
113
|
+
.addClass('collapse')
|
114
|
+
}
|
115
|
+
|
116
|
+
if (!$.support.transition) return complete.call(this)
|
117
|
+
|
118
|
+
this.$element
|
119
|
+
[dimension](0)
|
120
|
+
.one($.support.transition.end, $.proxy(complete, this))
|
121
|
+
.emulateTransitionEnd(350)
|
122
|
+
}
|
123
|
+
|
124
|
+
Collapse.prototype.toggle = function () {
|
125
|
+
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
126
|
+
}
|
127
|
+
|
128
|
+
|
129
|
+
// COLLAPSE PLUGIN DEFINITION
|
130
|
+
// ==========================
|
131
|
+
|
132
|
+
var old = $.fn.collapse
|
133
|
+
|
134
|
+
$.fn.collapse = function (option) {
|
135
|
+
return this.each(function () {
|
136
|
+
var $this = $(this)
|
137
|
+
var data = $this.data('bs.collapse')
|
138
|
+
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
139
|
+
|
140
|
+
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
|
141
|
+
if (typeof option == 'string') data[option]()
|
142
|
+
})
|
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.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
|
161
|
+
var $this = $(this), href
|
162
|
+
var target = $this.attr('data-target')
|
163
|
+
|| e.preventDefault()
|
164
|
+
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
165
|
+
var $target = $(target)
|
166
|
+
var data = $target.data('bs.collapse')
|
167
|
+
var option = data ? 'toggle' : $this.data()
|
168
|
+
var parent = $this.attr('data-parent')
|
169
|
+
var $parent = parent && $(parent)
|
170
|
+
|
171
|
+
if (!data || !data.transitioning) {
|
172
|
+
if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
|
173
|
+
$this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
174
|
+
}
|
175
|
+
|
176
|
+
$target.collapse(option)
|
177
|
+
})
|
178
|
+
|
179
|
+
}(window.jQuery);
|
@@ -0,0 +1,154 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: dropdown.js v3.0.0
|
3
|
+
* http://twbs.github.com/bootstrap/javascript.html#dropdowns
|
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
|
+
// DROPDOWN CLASS DEFINITION
|
24
|
+
// =========================
|
25
|
+
|
26
|
+
var backdrop = '.dropdown-backdrop'
|
27
|
+
var toggle = '[data-toggle=dropdown]'
|
28
|
+
var Dropdown = function (element) {
|
29
|
+
var $el = $(element).on('click.bs.dropdown', this.toggle)
|
30
|
+
}
|
31
|
+
|
32
|
+
Dropdown.prototype.toggle = function (e) {
|
33
|
+
var $this = $(this)
|
34
|
+
|
35
|
+
if ($this.is('.disabled, :disabled')) return
|
36
|
+
|
37
|
+
var $parent = getParent($this)
|
38
|
+
var isActive = $parent.hasClass('open')
|
39
|
+
|
40
|
+
clearMenus()
|
41
|
+
|
42
|
+
if (!isActive) {
|
43
|
+
if ('ontouchstart' in document.documentElement) {
|
44
|
+
// if mobile we we use a backdrop because click events don't delegate
|
45
|
+
$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
|
46
|
+
}
|
47
|
+
|
48
|
+
$parent.trigger(e = $.Event('show.bs.dropdown'))
|
49
|
+
|
50
|
+
if (e.isDefaultPrevented()) return
|
51
|
+
|
52
|
+
$parent
|
53
|
+
.toggleClass('open')
|
54
|
+
.trigger('shown.bs.dropdown')
|
55
|
+
}
|
56
|
+
|
57
|
+
$this.focus()
|
58
|
+
|
59
|
+
return false
|
60
|
+
}
|
61
|
+
|
62
|
+
Dropdown.prototype.keydown = function (e) {
|
63
|
+
if (!/(38|40|27)/.test(e.keyCode)) return
|
64
|
+
|
65
|
+
var $this = $(this)
|
66
|
+
|
67
|
+
e.preventDefault()
|
68
|
+
e.stopPropagation()
|
69
|
+
|
70
|
+
if ($this.is('.disabled, :disabled')) return
|
71
|
+
|
72
|
+
var $parent = getParent($this)
|
73
|
+
var isActive = $parent.hasClass('open')
|
74
|
+
|
75
|
+
if (!isActive || (isActive && e.keyCode == 27)) {
|
76
|
+
if (e.which == 27) $parent.find(toggle).focus()
|
77
|
+
return $this.click()
|
78
|
+
}
|
79
|
+
|
80
|
+
var $items = $('[role=menu] li:not(.divider):visible a', $parent)
|
81
|
+
|
82
|
+
if (!$items.length) return
|
83
|
+
|
84
|
+
var index = $items.index($items.filter(':focus'))
|
85
|
+
|
86
|
+
if (e.keyCode == 38 && index > 0) index-- // up
|
87
|
+
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
|
88
|
+
if (!~index) index=0
|
89
|
+
|
90
|
+
$items.eq(index).focus()
|
91
|
+
}
|
92
|
+
|
93
|
+
function clearMenus() {
|
94
|
+
$(backdrop).remove()
|
95
|
+
$(toggle).each(function (e) {
|
96
|
+
var $parent = getParent($(this))
|
97
|
+
if (!$parent.hasClass('open')) return
|
98
|
+
$parent.trigger(e = $.Event('hide.bs.dropdown'))
|
99
|
+
if (e.isDefaultPrevented()) return
|
100
|
+
$parent.removeClass('open').trigger('hidden.bs.dropdown')
|
101
|
+
})
|
102
|
+
}
|
103
|
+
|
104
|
+
function getParent($this) {
|
105
|
+
var selector = $this.attr('data-target')
|
106
|
+
|
107
|
+
if (!selector) {
|
108
|
+
selector = $this.attr('href')
|
109
|
+
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
110
|
+
}
|
111
|
+
|
112
|
+
var $parent = selector && $(selector)
|
113
|
+
|
114
|
+
return $parent && $parent.length ? $parent : $this.parent()
|
115
|
+
}
|
116
|
+
|
117
|
+
|
118
|
+
// DROPDOWN PLUGIN DEFINITION
|
119
|
+
// ==========================
|
120
|
+
|
121
|
+
var old = $.fn.dropdown
|
122
|
+
|
123
|
+
$.fn.dropdown = function (option) {
|
124
|
+
return this.each(function () {
|
125
|
+
var $this = $(this)
|
126
|
+
var data = $this.data('dropdown')
|
127
|
+
|
128
|
+
if (!data) $this.data('dropdown', (data = new Dropdown(this)))
|
129
|
+
if (typeof option == 'string') data[option].call($this)
|
130
|
+
})
|
131
|
+
}
|
132
|
+
|
133
|
+
$.fn.dropdown.Constructor = Dropdown
|
134
|
+
|
135
|
+
|
136
|
+
// DROPDOWN NO CONFLICT
|
137
|
+
// ====================
|
138
|
+
|
139
|
+
$.fn.dropdown.noConflict = function () {
|
140
|
+
$.fn.dropdown = old
|
141
|
+
return this
|
142
|
+
}
|
143
|
+
|
144
|
+
|
145
|
+
// APPLY TO STANDARD DROPDOWN ELEMENTS
|
146
|
+
// ===================================
|
147
|
+
|
148
|
+
$(document)
|
149
|
+
.on('click.bs.dropdown.data-api', clearMenus)
|
150
|
+
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
151
|
+
.on('click.bs.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
152
|
+
.on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
153
|
+
|
154
|
+
}(window.jQuery);
|
@@ -0,0 +1,244 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: modal.js v3.0.0
|
3
|
+
* http://twbs.github.com/bootstrap/javascript.html#modals
|
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
|
+
// MODAL CLASS DEFINITION
|
24
|
+
// ======================
|
25
|
+
|
26
|
+
var Modal = function (element, options) {
|
27
|
+
this.options = options
|
28
|
+
this.$element = $(element).on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
|
29
|
+
this.$backdrop =
|
30
|
+
this.isShown = null
|
31
|
+
|
32
|
+
if (this.options.remote) this.$element.load(this.options.remote)
|
33
|
+
}
|
34
|
+
|
35
|
+
Modal.DEFAULTS = {
|
36
|
+
backdrop: true
|
37
|
+
, keyboard: true
|
38
|
+
, show: true
|
39
|
+
}
|
40
|
+
|
41
|
+
Modal.prototype.toggle = function (_relatedTarget) {
|
42
|
+
return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
|
43
|
+
}
|
44
|
+
|
45
|
+
Modal.prototype.show = function (_relatedTarget) {
|
46
|
+
var that = this
|
47
|
+
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
|
48
|
+
|
49
|
+
this.$element.trigger(e)
|
50
|
+
|
51
|
+
if (this.isShown || e.isDefaultPrevented()) return
|
52
|
+
|
53
|
+
this.isShown = true
|
54
|
+
|
55
|
+
this.escape()
|
56
|
+
|
57
|
+
this.backdrop(function () {
|
58
|
+
var transition = $.support.transition && that.$element.hasClass('fade')
|
59
|
+
|
60
|
+
if (!that.$element.parent().length) {
|
61
|
+
that.$element.appendTo(document.body) // don't move modals dom position
|
62
|
+
}
|
63
|
+
|
64
|
+
that.$element.show()
|
65
|
+
|
66
|
+
if (transition) {
|
67
|
+
that.$element[0].offsetWidth // force reflow
|
68
|
+
}
|
69
|
+
|
70
|
+
that.$element
|
71
|
+
.addClass('in')
|
72
|
+
.attr('aria-hidden', false)
|
73
|
+
|
74
|
+
that.enforceFocus()
|
75
|
+
|
76
|
+
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
|
77
|
+
|
78
|
+
transition ?
|
79
|
+
that.$element
|
80
|
+
.one($.support.transition.end, function () {
|
81
|
+
that.$element.focus().trigger(e)
|
82
|
+
})
|
83
|
+
.emulateTransitionEnd(300) :
|
84
|
+
that.$element.focus().trigger(e)
|
85
|
+
})
|
86
|
+
}
|
87
|
+
|
88
|
+
Modal.prototype.hide = function (e) {
|
89
|
+
if (e) e.preventDefault()
|
90
|
+
|
91
|
+
e = $.Event('hide.bs.modal')
|
92
|
+
|
93
|
+
this.$element.trigger(e)
|
94
|
+
|
95
|
+
if (!this.isShown || e.isDefaultPrevented()) return
|
96
|
+
|
97
|
+
this.isShown = false
|
98
|
+
|
99
|
+
this.escape()
|
100
|
+
|
101
|
+
$(document).off('focusin.bs.modal')
|
102
|
+
|
103
|
+
this.$element
|
104
|
+
.removeClass('in')
|
105
|
+
.attr('aria-hidden', true)
|
106
|
+
.off('click.dismiss.modal')
|
107
|
+
|
108
|
+
$.support.transition && this.$element.hasClass('fade') ?
|
109
|
+
this.$element
|
110
|
+
.one($.support.transition.end, $.proxy(this.hideModal, this))
|
111
|
+
.emulateTransitionEnd(300) :
|
112
|
+
this.hideModal()
|
113
|
+
}
|
114
|
+
|
115
|
+
Modal.prototype.enforceFocus = function () {
|
116
|
+
$(document)
|
117
|
+
.off('focusin.bs.modal') // guard against infinite focus loop
|
118
|
+
.on('focusin.bs.modal', $.proxy(function (e) {
|
119
|
+
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
|
120
|
+
this.$element.focus()
|
121
|
+
}
|
122
|
+
}, this))
|
123
|
+
}
|
124
|
+
|
125
|
+
Modal.prototype.escape = function () {
|
126
|
+
if (this.isShown && this.options.keyboard) {
|
127
|
+
this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
|
128
|
+
e.which == 27 && this.hide()
|
129
|
+
}, this))
|
130
|
+
} else if (!this.isShown) {
|
131
|
+
this.$element.off('keyup.dismiss.bs.modal')
|
132
|
+
}
|
133
|
+
}
|
134
|
+
|
135
|
+
Modal.prototype.hideModal = function () {
|
136
|
+
var that = this
|
137
|
+
this.$element.hide()
|
138
|
+
this.backdrop(function () {
|
139
|
+
that.removeBackdrop()
|
140
|
+
that.$element.trigger('hidden.bs.modal')
|
141
|
+
})
|
142
|
+
}
|
143
|
+
|
144
|
+
Modal.prototype.removeBackdrop = function () {
|
145
|
+
this.$backdrop && this.$backdrop.remove()
|
146
|
+
this.$backdrop = null
|
147
|
+
}
|
148
|
+
|
149
|
+
Modal.prototype.backdrop = function (callback) {
|
150
|
+
var that = this
|
151
|
+
var animate = this.$element.hasClass('fade') ? 'fade' : ''
|
152
|
+
|
153
|
+
if (this.isShown && this.options.backdrop) {
|
154
|
+
var doAnimate = $.support.transition && animate
|
155
|
+
|
156
|
+
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
157
|
+
.appendTo(document.body)
|
158
|
+
|
159
|
+
this.$element.on('click.dismiss.modal', $.proxy(function (e) {
|
160
|
+
if (e.target !== e.currentTarget) return
|
161
|
+
this.options.backdrop == 'static'
|
162
|
+
? this.$element[0].focus.call(this.$element[0])
|
163
|
+
: this.hide.call(this)
|
164
|
+
}, this))
|
165
|
+
|
166
|
+
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
167
|
+
|
168
|
+
this.$backdrop.addClass('in')
|
169
|
+
|
170
|
+
if (!callback) return
|
171
|
+
|
172
|
+
doAnimate ?
|
173
|
+
this.$backdrop
|
174
|
+
.one($.support.transition.end, callback)
|
175
|
+
.emulateTransitionEnd(150) :
|
176
|
+
callback()
|
177
|
+
|
178
|
+
} else if (!this.isShown && this.$backdrop) {
|
179
|
+
this.$backdrop.removeClass('in')
|
180
|
+
|
181
|
+
$.support.transition && this.$element.hasClass('fade')?
|
182
|
+
this.$backdrop
|
183
|
+
.one($.support.transition.end, callback)
|
184
|
+
.emulateTransitionEnd(150) :
|
185
|
+
callback()
|
186
|
+
|
187
|
+
} else if (callback) {
|
188
|
+
callback()
|
189
|
+
}
|
190
|
+
}
|
191
|
+
|
192
|
+
|
193
|
+
// MODAL PLUGIN DEFINITION
|
194
|
+
// =======================
|
195
|
+
|
196
|
+
var old = $.fn.modal
|
197
|
+
|
198
|
+
$.fn.modal = function (option, _relatedTarget) {
|
199
|
+
return this.each(function () {
|
200
|
+
var $this = $(this)
|
201
|
+
var data = $this.data('bs.modal')
|
202
|
+
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
203
|
+
|
204
|
+
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
|
205
|
+
if (typeof option == 'string') data[option](_relatedTarget)
|
206
|
+
else if (options.show) data.show(_relatedTarget)
|
207
|
+
})
|
208
|
+
}
|
209
|
+
|
210
|
+
$.fn.modal.Constructor = Modal
|
211
|
+
|
212
|
+
|
213
|
+
// MODAL NO CONFLICT
|
214
|
+
// =================
|
215
|
+
|
216
|
+
$.fn.modal.noConflict = function () {
|
217
|
+
$.fn.modal = old
|
218
|
+
return this
|
219
|
+
}
|
220
|
+
|
221
|
+
|
222
|
+
// MODAL DATA-API
|
223
|
+
// ==============
|
224
|
+
|
225
|
+
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
|
226
|
+
var $this = $(this)
|
227
|
+
var href = $this.attr('href')
|
228
|
+
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
|
229
|
+
var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
230
|
+
|
231
|
+
e.preventDefault()
|
232
|
+
|
233
|
+
$target
|
234
|
+
.modal(option, this)
|
235
|
+
.one('hide', function () {
|
236
|
+
$this.is(':visible') && $this.focus()
|
237
|
+
})
|
238
|
+
})
|
239
|
+
|
240
|
+
$(document)
|
241
|
+
.on('shown.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
|
242
|
+
.on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
|
243
|
+
|
244
|
+
}(window.jQuery);
|
@@ -0,0 +1,117 @@
|
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: popover.js v3.0.0
|
3
|
+
* http://twbs.github.com/bootstrap/javascript.html#popovers
|
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
|
+
// POPOVER PUBLIC CLASS DEFINITION
|
24
|
+
// ===============================
|
25
|
+
|
26
|
+
var Popover = function (element, options) {
|
27
|
+
this.init('popover', element, options)
|
28
|
+
}
|
29
|
+
|
30
|
+
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
|
31
|
+
|
32
|
+
Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, {
|
33
|
+
placement: 'right'
|
34
|
+
, trigger: 'click'
|
35
|
+
, content: ''
|
36
|
+
, template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
|
37
|
+
})
|
38
|
+
|
39
|
+
|
40
|
+
// NOTE: POPOVER EXTENDS tooltip.js
|
41
|
+
// ================================
|
42
|
+
|
43
|
+
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
|
44
|
+
|
45
|
+
Popover.prototype.constructor = Popover
|
46
|
+
|
47
|
+
Popover.prototype.getDefaults = function () {
|
48
|
+
return Popover.DEFAULTS
|
49
|
+
}
|
50
|
+
|
51
|
+
Popover.prototype.setContent = function () {
|
52
|
+
var $tip = this.tip()
|
53
|
+
var title = this.getTitle()
|
54
|
+
var content = this.getContent()
|
55
|
+
|
56
|
+
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
|
57
|
+
$tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
|
58
|
+
|
59
|
+
$tip.removeClass('fade top bottom left right in')
|
60
|
+
|
61
|
+
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
|
62
|
+
// this manually by checking the contents.
|
63
|
+
if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
|
64
|
+
}
|
65
|
+
|
66
|
+
Popover.prototype.hasContent = function () {
|
67
|
+
return this.getTitle() || this.getContent()
|
68
|
+
}
|
69
|
+
|
70
|
+
Popover.prototype.getContent = function () {
|
71
|
+
var $e = this.$element
|
72
|
+
var o = this.options
|
73
|
+
|
74
|
+
return $e.attr('data-content')
|
75
|
+
|| (typeof o.content == 'function' ?
|
76
|
+
o.content.call($e[0]) :
|
77
|
+
o.content)
|
78
|
+
}
|
79
|
+
|
80
|
+
Popover.prototype.arrow = function () {
|
81
|
+
return this.$arrow = this.$arrow || this.tip().find('.arrow')
|
82
|
+
}
|
83
|
+
|
84
|
+
Popover.prototype.tip = function () {
|
85
|
+
if (!this.$tip) this.$tip = $(this.options.template)
|
86
|
+
return this.$tip
|
87
|
+
}
|
88
|
+
|
89
|
+
|
90
|
+
// POPOVER PLUGIN DEFINITION
|
91
|
+
// =========================
|
92
|
+
|
93
|
+
var old = $.fn.popover
|
94
|
+
|
95
|
+
$.fn.popover = function (option) {
|
96
|
+
return this.each(function () {
|
97
|
+
var $this = $(this)
|
98
|
+
var data = $this.data('bs.popover')
|
99
|
+
var options = typeof option == 'object' && option
|
100
|
+
|
101
|
+
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
|
102
|
+
if (typeof option == 'string') data[option]()
|
103
|
+
})
|
104
|
+
}
|
105
|
+
|
106
|
+
$.fn.popover.Constructor = Popover
|
107
|
+
|
108
|
+
|
109
|
+
// POPOVER NO CONFLICT
|
110
|
+
// ===================
|
111
|
+
|
112
|
+
$.fn.popover.noConflict = function () {
|
113
|
+
$.fn.popover = old
|
114
|
+
return this
|
115
|
+
}
|
116
|
+
|
117
|
+
}(window.jQuery);
|