twitter_bootstrap_builder 0.0.6 → 0.0.7

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.
Files changed (38) hide show
  1. data/.gitignore +18 -18
  2. data/Gemfile +4 -4
  3. data/LICENSE +21 -21
  4. data/README.md +29 -29
  5. data/Rakefile +2 -2
  6. data/app/views/kaminari/twitter_bootstrap/_first_page.html.haml +15 -15
  7. data/app/views/kaminari/twitter_bootstrap/_gap.html.haml +8 -8
  8. data/app/views/kaminari/twitter_bootstrap/_last_page.html.haml +12 -12
  9. data/app/views/kaminari/twitter_bootstrap/_next_page.html.haml +13 -13
  10. data/app/views/kaminari/twitter_bootstrap/_page.html.haml +15 -15
  11. data/app/views/kaminari/twitter_bootstrap/_paginator.html.haml +20 -20
  12. data/app/views/kaminari/twitter_bootstrap/_prev_page.html.haml +13 -13
  13. data/lib/twitter_bootstrap_builder.rb +26 -26
  14. data/lib/twitter_bootstrap_builder/builders/base.rb +19 -19
  15. data/lib/twitter_bootstrap_builder/builders/drop_down_builder.rb +19 -19
  16. data/lib/twitter_bootstrap_builder/builders/drop_down_button_builder.rb +10 -10
  17. data/lib/twitter_bootstrap_builder/builders/drop_down_link_builder.rb +10 -10
  18. data/lib/twitter_bootstrap_builder/builders/fieldset_builder.rb +116 -116
  19. data/lib/twitter_bootstrap_builder/builders/form_builder.rb +10 -10
  20. data/lib/twitter_bootstrap_builder/builders/link_button_builder.rb +14 -14
  21. data/lib/twitter_bootstrap_builder/builders/nav_bar_builder.rb +24 -24
  22. data/lib/twitter_bootstrap_builder/builders/nav_container_builder.rb +38 -38
  23. data/lib/twitter_bootstrap_builder/builders/nav_list_builder.rb +37 -37
  24. data/lib/twitter_bootstrap_builder/builders/submit_button_builder.rb +14 -14
  25. data/lib/twitter_bootstrap_builder/builders/tab_builder.rb +22 -22
  26. data/lib/twitter_bootstrap_builder/builders/table_builder.rb +77 -77
  27. data/lib/twitter_bootstrap_builder/engine.rb +16 -16
  28. data/lib/twitter_bootstrap_builder/extensions/twitter_bootstrap_markup.rb +6 -6
  29. data/lib/twitter_bootstrap_builder/helpers/buttons_helper.rb +50 -50
  30. data/lib/twitter_bootstrap_builder/helpers/commons_helper.rb +148 -114
  31. data/lib/twitter_bootstrap_builder/helpers/dropdowns_helper.rb +32 -32
  32. data/lib/twitter_bootstrap_builder/version.rb +3 -3
  33. data/twitter_bootstrap_builder.gemspec +20 -20
  34. data/vendor/assets/javascripts/bootstrap.js +1737 -1737
  35. data/vendor/assets/javascripts/twitter_bootstrap_builder.js +27 -27
  36. data/vendor/assets/stylesheets/bootstrap.css +4914 -4914
  37. data/vendor/assets/stylesheets/twitter_bootstrap_builder.css +57 -33
  38. metadata +17 -7
@@ -1,115 +1,149 @@
1
- module TwitterBootstrapBuilder
2
- module Helpers
3
- module CommonsHelper
4
-
5
- def page_title(title=nil)
6
- if title
7
- content_for(:page_title, title)
8
- else
9
- content_for?(:page_title) ? content_for(:page_title) : nil
10
- end
11
- end
12
-
13
- def page_header(*args)
14
- if args.any?
15
- content_for(:page_header, TwitterBootstrapMarkup::PageHeader.new(args.shift, args.shift).html_safe)
16
- else
17
- content_for?(:page_header) ? content_for(:page_header) : nil
18
- end
19
- end
20
-
21
- def side_bar(partial=nil, &block)
22
- if partial
23
- content_for(:side_bar) { render "layouts/#{partial}" }
24
- elsif block
25
- content_for(:side_bar, &block)
26
- else
27
- content_for?(:side_bar) ? content_for(:side_bar) : nil
28
- end
29
- end
30
-
31
- def alert_message
32
- unless content_for?(:alert_message)
33
- if flash[:danger]
34
- alert_danger(flash[:danger])
35
- elsif flash[:warning]
36
- alert_warning(flash[:warning])
37
- elsif flash[:success]
38
- alert_success(flash[:success])
39
- elsif flash[:info]
40
- alert_info(flash[:info])
41
- end
42
- end
43
-
44
- content_for?(:alert_message) ? content_for(:alert_message) : nil
45
- end
46
-
47
- def nav_bar(&block)
48
- Builders::NavBarBuilder.new(self, &block).html_safe
49
- end
50
-
51
- def nav_list(&block)
52
- Builders::NavListBuilder.new(self, &block).html_safe
53
- end
54
-
55
- def tab(&block)
56
- Builders::TabBuilder.new(self, &block).html_safe
57
- end
58
-
59
- def well(size=nil, &block)
60
- well = TwitterBootstrapMarkup::Well.new(capture(&block))
61
- well.send(size) if size
62
- well.html_safe
63
- end
64
-
65
- def well_small(&block)
66
- well(:small, &block)
67
- end
68
-
69
- def well_large(&block)
70
- well(:large, &block)
71
- end
72
-
73
- def alert_validations(model)
74
- alert_danger(model.errors.full_messages.join('<br>')) if model.errors.any?
75
- end
76
-
77
- TwitterBootstrapMarkup::Alert::TYPES.each do |type|
78
- define_method "alert_#{type}" do |message|
79
- content_for(:alert_message, TwitterBootstrapMarkup::Alert.new(message).send(type).closable.html_safe)
80
- end
81
- end
82
-
83
- def table_for(collection, model_class=nil, &block)
84
- Builders::TableBuilder.new(self, collection: collection, model_class: model_class, &block).html_safe
85
- end
86
-
87
- def fieldset_horizontal_for(model, &block)
88
- Builders::FieldsetBuilder.new(self, model: model, &block).html_safe
89
- end
90
-
91
- def fieldset_horizontal(&block)
92
- Builders::FieldsetBuilder.new(self, &block).html_safe
93
- end
94
-
95
- def icon(name)
96
- TwitterBootstrapMarkup::Icon.new(name).html_safe
97
- end
98
-
99
- def icon_white(name)
100
- TwitterBootstrapMarkup::Icon.white(name).html_safe
101
- end
102
-
103
- TwitterBootstrapMarkup::LabelBase::TYPES.each do |type|
104
- define_method "label_#{type}" do |text|
105
- TwitterBootstrapMarkup::Label.send(type, text).html_safe
106
- end
107
-
108
- define_method "badge_#{type}" do |text|
109
- TwitterBootstrapMarkup::Badge.send(type, text).html_safe
110
- end
111
- end
112
-
113
- end
114
- end
1
+ module TwitterBootstrapBuilder
2
+ module Helpers
3
+ module CommonsHelper
4
+
5
+ def page_title(title=nil)
6
+ if title
7
+ content_for(:page_title, title)
8
+ else
9
+ content_for?(:page_title) ? content_for(:page_title) : nil
10
+ end
11
+ end
12
+
13
+ def page_header(*args)
14
+ if args.any?
15
+ content_for(:page_header, TwitterBootstrapMarkup::PageHeader.new(args.shift, args.shift).html_safe)
16
+ else
17
+ content_for?(:page_header) ? content_for(:page_header) : nil
18
+ end
19
+ end
20
+
21
+ def side_bar(partial=nil, &block)
22
+ if partial
23
+ content_for(:side_bar) { render "layouts/#{partial}" }
24
+ elsif block
25
+ content_for(:side_bar, &block)
26
+ else
27
+ content_for?(:side_bar) ? content_for(:side_bar) : nil
28
+ end
29
+ end
30
+
31
+ def alert_message
32
+ unless content_for?(:alert_message)
33
+ if flash[:danger]
34
+ alert_danger(flash[:danger])
35
+ elsif flash[:warning]
36
+ alert_warning(flash[:warning])
37
+ elsif flash[:success]
38
+ alert_success(flash[:success])
39
+ elsif flash[:info]
40
+ alert_info(flash[:info])
41
+ end
42
+ end
43
+
44
+ content_for?(:alert_message) ? content_for(:alert_message) : nil
45
+ end
46
+
47
+ def nav_bar(&block)
48
+ Builders::NavBarBuilder.new(self, &block).html_safe
49
+ end
50
+
51
+ def nav_list(&block)
52
+ Builders::NavListBuilder.new(self, &block).html_safe
53
+ end
54
+
55
+ def tab(&block)
56
+ Builders::TabBuilder.new(self, &block).html_safe
57
+ end
58
+
59
+ def well(size=nil, &block)
60
+ well = TwitterBootstrapMarkup::Well.new(capture(&block))
61
+ well.send(size) if size
62
+ well.html_safe
63
+ end
64
+
65
+ def well_small(&block)
66
+ well(:small, &block)
67
+ end
68
+
69
+ def well_large(&block)
70
+ well(:large, &block)
71
+ end
72
+
73
+ def alert_validations(model)
74
+ alert_danger(model.errors.full_messages.join('<br>')) if model.errors.any?
75
+ end
76
+
77
+ TwitterBootstrapMarkup::Alert::TYPES.each do |type|
78
+ define_method "alert_#{type}" do |message|
79
+ content_for(:alert_message, TwitterBootstrapMarkup::Alert.new(message).send(type).closable.html_safe)
80
+ end
81
+ end
82
+
83
+ def table_for(collection, model_class=nil, &block)
84
+ Builders::TableBuilder.new(self, collection: collection, model_class: model_class, &block).html_safe
85
+ end
86
+
87
+ def fieldset_horizontal_for(model, &block)
88
+ Builders::FieldsetBuilder.new(self, model: model, &block).html_safe
89
+ end
90
+
91
+ def fieldset_horizontal(&block)
92
+ Builders::FieldsetBuilder.new(self, &block).html_safe
93
+ end
94
+
95
+ def icon(*args)
96
+ TwitterBootstrapMarkup::Icon.new(*args).html_safe
97
+ end
98
+
99
+ def icon_white(*args)
100
+ TwitterBootstrapMarkup::Icon.white(*args).html_safe
101
+ end
102
+
103
+ def label(*args)
104
+ TwitterBootstrapMarkup::Label.new(*args).html_safe
105
+ end
106
+
107
+ def badge(*args)
108
+ TwitterBootstrapMarkup::Badge.new(*args).html_safe
109
+ end
110
+
111
+ TwitterBootstrapMarkup::LabelBase::TYPES.each do |type|
112
+ define_method "label_#{type}" do |*args|
113
+ TwitterBootstrapMarkup::Label.send(type, *args).html_safe
114
+ end
115
+
116
+ define_method "badge_#{type}" do |*args|
117
+ TwitterBootstrapMarkup::Badge.send(type, *args).html_safe
118
+ end
119
+ end
120
+
121
+ def progress_bar(*args)
122
+ TwitterBootstrapMarkup::ProgressBar.new(*args).html_safe
123
+ end
124
+
125
+ def progress_bar_striped(*args)
126
+ TwitterBootstrapMarkup::ProgressBar.new(*args).striped.html_safe
127
+ end
128
+
129
+ def progress_bar_striped_animated(*args)
130
+ TwitterBootstrapMarkup::ProgressBar.new(*args).striped_animated.html_safe
131
+ end
132
+
133
+ TwitterBootstrapMarkup::ProgressBar::TYPES.each do |type|
134
+ define_method "progress_bar_#{type}" do |*args|
135
+ TwitterBootstrapMarkup::ProgressBar.send(type, *args).html_safe
136
+ end
137
+
138
+ define_method "progress_bar_#{type}_striped" do |*args|
139
+ TwitterBootstrapMarkup::ProgressBar.send("#{type}_striped", *args).html_safe
140
+ end
141
+
142
+ define_method "progress_bar_#{type}_striped_animated" do |*args|
143
+ TwitterBootstrapMarkup::ProgressBar.send("#{type}_striped_animated", *args).html_safe
144
+ end
145
+ end
146
+
147
+ end
148
+ end
115
149
  end
@@ -1,33 +1,33 @@
1
- module TwitterBootstrapBuilder
2
- module Helpers
3
- module DropdownsHelper
4
-
5
- def dropdown_link(text, &block)
6
- Builders::DropDownLinkBuilder.new(self, text: text, &block).html_safe
7
- end
8
-
9
- def dropdown_button(text, &block)
10
- Builders::DropDownButtonBuilder.new(self, text: text, &block).html_safe
11
- end
12
-
13
- TwitterBootstrapMarkup::ButtonBase::TYPES.each do |type|
14
- define_method "dropdown_button_#{type}" do |text, &block|
15
- Builders::DropDownButtonBuilder.new(self, text: text, type: type, &block).html_safe
16
- end
17
-
18
- TwitterBootstrapMarkup::ButtonBase::SIZES.each do |size|
19
- define_method "dropdown_button_#{type}_#{size}" do |text, &block|
20
- Builders::DropDownButtonBuilder.new(self, text: text, type: type, size: size, &block).html_safe
21
- end
22
- end
23
- end
24
-
25
- TwitterBootstrapMarkup::ButtonBase::SIZES.each do |size|
26
- define_method "dropdown_button_#{size}" do |text, &block|
27
- Builders::DropDownButtonBuilder.new(self, text: text, size: size, &block).html_safe
28
- end
29
- end
30
-
31
- end
32
- end
1
+ module TwitterBootstrapBuilder
2
+ module Helpers
3
+ module DropdownsHelper
4
+
5
+ def dropdown_link(text, &block)
6
+ Builders::DropDownLinkBuilder.new(self, text: text, &block).html_safe
7
+ end
8
+
9
+ def dropdown_button(text, &block)
10
+ Builders::DropDownButtonBuilder.new(self, text: text, &block).html_safe
11
+ end
12
+
13
+ TwitterBootstrapMarkup::ButtonBase::TYPES.each do |type|
14
+ define_method "dropdown_button_#{type}" do |text, &block|
15
+ Builders::DropDownButtonBuilder.new(self, text: text, type: type, &block).html_safe
16
+ end
17
+
18
+ TwitterBootstrapMarkup::ButtonBase::SIZES.each do |size|
19
+ define_method "dropdown_button_#{type}_#{size}" do |text, &block|
20
+ Builders::DropDownButtonBuilder.new(self, text: text, type: type, size: size, &block).html_safe
21
+ end
22
+ end
23
+ end
24
+
25
+ TwitterBootstrapMarkup::ButtonBase::SIZES.each do |size|
26
+ define_method "dropdown_button_#{size}" do |text, &block|
27
+ Builders::DropDownButtonBuilder.new(self, text: text, size: size, &block).html_safe
28
+ end
29
+ end
30
+
31
+ end
32
+ end
33
33
  end
@@ -1,3 +1,3 @@
1
- module TwitterBootstrapBuilder
2
- VERSION = '0.0.6'
3
- end
1
+ module TwitterBootstrapBuilder
2
+ VERSION = '0.0.7'
3
+ end
@@ -1,20 +1,20 @@
1
- # -*- encoding: utf-8 -*-
2
- require File.expand_path('../lib/twitter_bootstrap_builder/version', __FILE__)
3
-
4
- Gem::Specification.new do |gem|
5
- gem.authors = ["Gabriel Naiman"]
6
- gem.email = ["gabynaiman@gmail.com"]
7
- gem.description = 'Set of helpers to extend Rails for implement Twitter Bootstrap markup'
8
- gem.summary = 'Set of helpers to extend Rails for implement Twitter Bootstrap markup'
9
- gem.homepage = "https://github.com/gabynaiman/twitter_bootstrap_builder"
10
-
11
- gem.files = `git ls-files`.split($\)
12
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
- gem.name = "twitter_bootstrap_builder"
15
- gem.require_paths = ["lib"]
16
- gem.version = TwitterBootstrapBuilder::VERSION
17
-
18
- gem.add_dependency 'twitter_bootstrap_markup'
19
- gem.add_dependency 'kaminari'
20
- end
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/twitter_bootstrap_builder/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Gabriel Naiman"]
6
+ gem.email = ["gabynaiman@gmail.com"]
7
+ gem.description = 'Set of helpers to extend Rails for implement Twitter Bootstrap markup'
8
+ gem.summary = 'Set of helpers to extend Rails for implement Twitter Bootstrap markup'
9
+ gem.homepage = "https://github.com/gabynaiman/twitter_bootstrap_builder"
10
+
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
+ gem.name = "twitter_bootstrap_builder"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = TwitterBootstrapBuilder::VERSION
17
+
18
+ gem.add_dependency 'twitter_bootstrap_markup'
19
+ gem.add_dependency 'kaminari'
20
+ end
@@ -1,1738 +1,1738 @@
1
- /* ===================================================
2
- * bootstrap-transition.js v2.0.4
3
- * http://twitter.github.com/bootstrap/javascript.html#transitions
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 ($) {
22
-
23
- $(function () {
24
-
25
- "use strict"; // jshint ;_;
26
-
27
-
28
- /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
29
- * ======================================================= */
30
-
31
- $.support.transition = (function () {
32
-
33
- var transitionEnd = (function () {
34
-
35
- var el = document.createElement('bootstrap')
36
- , transEndEventNames = {
37
- 'WebkitTransition':'webkitTransitionEnd', 'MozTransition':'transitionend', 'OTransition':'oTransitionEnd', 'msTransition':'MSTransitionEnd', 'transition':'transitionend'
38
- }
39
- , name
40
-
41
- for (name in transEndEventNames) {
42
- if (el.style[name] !== undefined) {
43
- return transEndEventNames[name]
44
- }
45
- }
46
-
47
- }())
48
-
49
- return transitionEnd && {
50
- end:transitionEnd
51
- }
52
-
53
- })()
54
-
55
- })
56
-
57
- }(window.jQuery);
58
- /* =========================================================
59
- * bootstrap-modal.js v2.0.4
60
- * http://twitter.github.com/bootstrap/javascript.html#modals
61
- * =========================================================
62
- * Copyright 2012 Twitter, Inc.
63
- *
64
- * Licensed under the Apache License, Version 2.0 (the "License");
65
- * you may not use this file except in compliance with the License.
66
- * You may obtain a copy of the License at
67
- *
68
- * http://www.apache.org/licenses/LICENSE-2.0
69
- *
70
- * Unless required by applicable law or agreed to in writing, software
71
- * distributed under the License is distributed on an "AS IS" BASIS,
72
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
73
- * See the License for the specific language governing permissions and
74
- * limitations under the License.
75
- * ========================================================= */
76
-
77
-
78
- !function ($) {
79
-
80
- "use strict"; // jshint ;_;
81
-
82
-
83
- /* MODAL CLASS DEFINITION
84
- * ====================== */
85
-
86
- var Modal = function (content, options) {
87
- this.options = options
88
- this.$element = $(content)
89
- .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
90
- }
91
-
92
- Modal.prototype = {
93
-
94
- constructor:Modal, toggle:function () {
95
- return this[!this.isShown ? 'show' : 'hide']()
96
- }, show:function () {
97
- var that = this
98
- , e = $.Event('show')
99
-
100
- this.$element.trigger(e)
101
-
102
- if (this.isShown || e.isDefaultPrevented()) return
103
-
104
- $('body').addClass('modal-open')
105
-
106
- this.isShown = true
107
-
108
- escape.call(this)
109
- backdrop.call(this, function () {
110
- var transition = $.support.transition && that.$element.hasClass('fade')
111
-
112
- if (!that.$element.parent().length) {
113
- that.$element.appendTo(document.body) //don't move modals dom position
114
- }
115
-
116
- that.$element
117
- .show()
118
-
119
- if (transition) {
120
- that.$element[0].offsetWidth // force reflow
121
- }
122
-
123
- that.$element.addClass('in')
124
-
125
- transition ?
126
- that.$element.one($.support.transition.end, function () {
127
- that.$element.trigger('shown')
128
- }) :
129
- that.$element.trigger('shown')
130
-
131
- })
132
- }, hide:function (e) {
133
- e && e.preventDefault()
134
-
135
- var that = this
136
-
137
- e = $.Event('hide')
138
-
139
- this.$element.trigger(e)
140
-
141
- if (!this.isShown || e.isDefaultPrevented()) return
142
-
143
- this.isShown = false
144
-
145
- $('body').removeClass('modal-open')
146
-
147
- escape.call(this)
148
-
149
- this.$element.removeClass('in')
150
-
151
- $.support.transition && this.$element.hasClass('fade') ?
152
- hideWithTransition.call(this) :
153
- hideModal.call(this)
154
- }
155
-
156
- }
157
-
158
-
159
- /* MODAL PRIVATE METHODS
160
- * ===================== */
161
-
162
- function hideWithTransition() {
163
- var that = this
164
- , timeout = setTimeout(function () {
165
- that.$element.off($.support.transition.end)
166
- hideModal.call(that)
167
- }, 500)
168
-
169
- this.$element.one($.support.transition.end, function () {
170
- clearTimeout(timeout)
171
- hideModal.call(that)
172
- })
173
- }
174
-
175
- function hideModal(that) {
176
- this.$element
177
- .hide()
178
- .trigger('hidden')
179
-
180
- backdrop.call(this)
181
- }
182
-
183
- function backdrop(callback) {
184
- var that = this
185
- , animate = this.$element.hasClass('fade') ? 'fade' : ''
186
-
187
- if (this.isShown && this.options.backdrop) {
188
- var doAnimate = $.support.transition && animate
189
-
190
- this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
191
- .appendTo(document.body)
192
-
193
- if (this.options.backdrop != 'static') {
194
- this.$backdrop.click($.proxy(this.hide, this))
195
- }
196
-
197
- if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
198
-
199
- this.$backdrop.addClass('in')
200
-
201
- doAnimate ?
202
- this.$backdrop.one($.support.transition.end, callback) :
203
- callback()
204
-
205
- } else if (!this.isShown && this.$backdrop) {
206
- this.$backdrop.removeClass('in')
207
-
208
- $.support.transition && this.$element.hasClass('fade') ?
209
- this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
210
- removeBackdrop.call(this)
211
-
212
- } else if (callback) {
213
- callback()
214
- }
215
- }
216
-
217
- function removeBackdrop() {
218
- this.$backdrop.remove()
219
- this.$backdrop = null
220
- }
221
-
222
- function escape() {
223
- var that = this
224
- if (this.isShown && this.options.keyboard) {
225
- $(document).on('keyup.dismiss.modal', function (e) {
226
- e.which == 27 && that.hide()
227
- })
228
- } else if (!this.isShown) {
229
- $(document).off('keyup.dismiss.modal')
230
- }
231
- }
232
-
233
-
234
- /* MODAL PLUGIN DEFINITION
235
- * ======================= */
236
-
237
- $.fn.modal = function (option) {
238
- return this.each(function () {
239
- var $this = $(this)
240
- , data = $this.data('modal')
241
- , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
242
- if (!data) $this.data('modal', (data = new Modal(this, options)))
243
- if (typeof option == 'string') data[option]()
244
- else if (options.show) data.show()
245
- })
246
- }
247
-
248
- $.fn.modal.defaults = {
249
- backdrop:true, keyboard:true, show:true
250
- }
251
-
252
- $.fn.modal.Constructor = Modal
253
-
254
-
255
- /* MODAL DATA-API
256
- * ============== */
257
-
258
- $(function () {
259
- $('body').on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
260
- var $this = $(this), href
261
- , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
262
- , option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
263
-
264
- e.preventDefault()
265
- $target.modal(option)
266
- })
267
- })
268
-
269
- }(window.jQuery);
270
- /* ============================================================
271
- * bootstrap-dropdown.js v2.0.4
272
- * http://twitter.github.com/bootstrap/javascript.html#dropdowns
273
- * ============================================================
274
- * Copyright 2012 Twitter, Inc.
275
- *
276
- * Licensed under the Apache License, Version 2.0 (the "License");
277
- * you may not use this file except in compliance with the License.
278
- * You may obtain a copy of the License at
279
- *
280
- * http://www.apache.org/licenses/LICENSE-2.0
281
- *
282
- * Unless required by applicable law or agreed to in writing, software
283
- * distributed under the License is distributed on an "AS IS" BASIS,
284
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
285
- * See the License for the specific language governing permissions and
286
- * limitations under the License.
287
- * ============================================================ */
288
-
289
-
290
- !function ($) {
291
-
292
- "use strict"; // jshint ;_;
293
-
294
-
295
- /* DROPDOWN CLASS DEFINITION
296
- * ========================= */
297
-
298
- var toggle = '[data-toggle="dropdown"]'
299
- , Dropdown = function (element) {
300
- var $el = $(element).on('click.dropdown.data-api', this.toggle)
301
- $('html').on('click.dropdown.data-api', function () {
302
- $el.parent().removeClass('open')
303
- })
304
- }
305
-
306
- Dropdown.prototype = {
307
-
308
- constructor:Dropdown, toggle:function (e) {
309
- var $this = $(this)
310
- , $parent
311
- , selector
312
- , isActive
313
-
314
- if ($this.is('.disabled, :disabled')) return
315
-
316
- selector = $this.attr('data-target')
317
-
318
- if (!selector) {
319
- selector = $this.attr('href')
320
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
321
- }
322
-
323
- $parent = $(selector)
324
- $parent.length || ($parent = $this.parent())
325
-
326
- isActive = $parent.hasClass('open')
327
-
328
- clearMenus()
329
-
330
- if (!isActive) $parent.toggleClass('open')
331
-
332
- return false
333
- }
334
-
335
- }
336
-
337
- function clearMenus() {
338
- $(toggle).parent().removeClass('open')
339
- }
340
-
341
-
342
- /* DROPDOWN PLUGIN DEFINITION
343
- * ========================== */
344
-
345
- $.fn.dropdown = function (option) {
346
- return this.each(function () {
347
- var $this = $(this)
348
- , data = $this.data('dropdown')
349
- if (!data) $this.data('dropdown', (data = new Dropdown(this)))
350
- if (typeof option == 'string') data[option].call($this)
351
- })
352
- }
353
-
354
- $.fn.dropdown.Constructor = Dropdown
355
-
356
-
357
- /* APPLY TO STANDARD DROPDOWN ELEMENTS
358
- * =================================== */
359
-
360
- $(function () {
361
- $('html').on('click.dropdown.data-api', clearMenus)
362
- $('body')
363
- .on('click.dropdown', '.dropdown form', function (e) {
364
- e.stopPropagation()
365
- })
366
- .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
367
- })
368
-
369
- }(window.jQuery);
370
- /* =============================================================
371
- * bootstrap-scrollspy.js v2.0.4
372
- * http://twitter.github.com/bootstrap/javascript.html#scrollspy
373
- * =============================================================
374
- * Copyright 2012 Twitter, Inc.
375
- *
376
- * Licensed under the Apache License, Version 2.0 (the "License");
377
- * you may not use this file except in compliance with the License.
378
- * You may obtain a copy of the License at
379
- *
380
- * http://www.apache.org/licenses/LICENSE-2.0
381
- *
382
- * Unless required by applicable law or agreed to in writing, software
383
- * distributed under the License is distributed on an "AS IS" BASIS,
384
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
385
- * See the License for the specific language governing permissions and
386
- * limitations under the License.
387
- * ============================================================== */
388
-
389
-
390
- !function ($) {
391
-
392
- "use strict"; // jshint ;_;
393
-
394
-
395
- /* SCROLLSPY CLASS DEFINITION
396
- * ========================== */
397
-
398
- function ScrollSpy(element, options) {
399
- var process = $.proxy(this.process, this)
400
- , $element = $(element).is('body') ? $(window) : $(element)
401
- , href
402
- this.options = $.extend({}, $.fn.scrollspy.defaults, options)
403
- this.$scrollElement = $element.on('scroll.scroll.data-api', process)
404
- this.selector = (this.options.target
405
- || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
406
- || '') + ' .nav li > a'
407
- this.$body = $('body')
408
- this.refresh()
409
- this.process()
410
- }
411
-
412
- ScrollSpy.prototype = {
413
-
414
- constructor:ScrollSpy, refresh:function () {
415
- var self = this
416
- , $targets
417
-
418
- this.offsets = $([])
419
- this.targets = $([])
420
-
421
- $targets = this.$body
422
- .find(this.selector)
423
- .map(function () {
424
- var $el = $(this)
425
- , href = $el.data('target') || $el.attr('href')
426
- , $href = /^#\w/.test(href) && $(href)
427
- return ( $href
428
- && href.length
429
- && [
430
- [ $href.position().top, href ]
431
- ] ) || null
432
- })
433
- .sort(function (a, b) {
434
- return a[0] - b[0]
435
- })
436
- .each(function () {
437
- self.offsets.push(this[0])
438
- self.targets.push(this[1])
439
- })
440
- }, process:function () {
441
- var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
442
- , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
443
- , maxScroll = scrollHeight - this.$scrollElement.height()
444
- , offsets = this.offsets
445
- , targets = this.targets
446
- , activeTarget = this.activeTarget
447
- , i
448
-
449
- if (scrollTop >= maxScroll) {
450
- return activeTarget != (i = targets.last()[0])
451
- && this.activate(i)
452
- }
453
-
454
- for (i = offsets.length; i--;) {
455
- activeTarget != targets[i]
456
- && scrollTop >= offsets[i]
457
- && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
458
- && this.activate(targets[i])
459
- }
460
- }, activate:function (target) {
461
- var active
462
- , selector
463
-
464
- this.activeTarget = target
465
-
466
- $(this.selector)
467
- .parent('.active')
468
- .removeClass('active')
469
-
470
- selector = this.selector
471
- + '[data-target="' + target + '"],'
472
- + this.selector + '[href="' + target + '"]'
473
-
474
- active = $(selector)
475
- .parent('li')
476
- .addClass('active')
477
-
478
- if (active.parent('.dropdown-menu')) {
479
- active = active.closest('li.dropdown').addClass('active')
480
- }
481
-
482
- active.trigger('activate')
483
- }
484
-
485
- }
486
-
487
-
488
- /* SCROLLSPY PLUGIN DEFINITION
489
- * =========================== */
490
-
491
- $.fn.scrollspy = function (option) {
492
- return this.each(function () {
493
- var $this = $(this)
494
- , data = $this.data('scrollspy')
495
- , options = typeof option == 'object' && option
496
- if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
497
- if (typeof option == 'string') data[option]()
498
- })
499
- }
500
-
501
- $.fn.scrollspy.Constructor = ScrollSpy
502
-
503
- $.fn.scrollspy.defaults = {
504
- offset:10
505
- }
506
-
507
-
508
- /* SCROLLSPY DATA-API
509
- * ================== */
510
-
511
- $(function () {
512
- $('[data-spy="scroll"]').each(function () {
513
- var $spy = $(this)
514
- $spy.scrollspy($spy.data())
515
- })
516
- })
517
-
518
- }(window.jQuery);
519
- /* ========================================================
520
- * bootstrap-tab.js v2.0.4
521
- * http://twitter.github.com/bootstrap/javascript.html#tabs
522
- * ========================================================
523
- * Copyright 2012 Twitter, Inc.
524
- *
525
- * Licensed under the Apache License, Version 2.0 (the "License");
526
- * you may not use this file except in compliance with the License.
527
- * You may obtain a copy of the License at
528
- *
529
- * http://www.apache.org/licenses/LICENSE-2.0
530
- *
531
- * Unless required by applicable law or agreed to in writing, software
532
- * distributed under the License is distributed on an "AS IS" BASIS,
533
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
534
- * See the License for the specific language governing permissions and
535
- * limitations under the License.
536
- * ======================================================== */
537
-
538
-
539
- !function ($) {
540
-
541
- "use strict"; // jshint ;_;
542
-
543
-
544
- /* TAB CLASS DEFINITION
545
- * ==================== */
546
-
547
- var Tab = function (element) {
548
- this.element = $(element)
549
- }
550
-
551
- Tab.prototype = {
552
-
553
- constructor:Tab, show:function () {
554
- var $this = this.element
555
- , $ul = $this.closest('ul:not(.dropdown-menu)')
556
- , selector = $this.attr('data-target')
557
- , previous
558
- , $target
559
- , e
560
-
561
- if (!selector) {
562
- selector = $this.attr('href')
563
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
564
- }
565
-
566
- if ($this.parent('li').hasClass('active')) return
567
-
568
- previous = $ul.find('.active a').last()[0]
569
-
570
- e = $.Event('show', {
571
- relatedTarget:previous
572
- })
573
-
574
- $this.trigger(e)
575
-
576
- if (e.isDefaultPrevented()) return
577
-
578
- $target = $(selector)
579
-
580
- this.activate($this.parent('li'), $ul)
581
- this.activate($target, $target.parent(), function () {
582
- $this.trigger({
583
- type:'shown', relatedTarget:previous
584
- })
585
- })
586
- }, activate:function (element, container, callback) {
587
- var $active = container.find('> .active')
588
- , transition = callback
589
- && $.support.transition
590
- && $active.hasClass('fade')
591
-
592
- function next() {
593
- $active
594
- .removeClass('active')
595
- .find('> .dropdown-menu > .active')
596
- .removeClass('active')
597
-
598
- element.addClass('active')
599
-
600
- if (transition) {
601
- element[0].offsetWidth // reflow for transition
602
- element.addClass('in')
603
- } else {
604
- element.removeClass('fade')
605
- }
606
-
607
- if (element.parent('.dropdown-menu')) {
608
- element.closest('li.dropdown').addClass('active')
609
- }
610
-
611
- callback && callback()
612
- }
613
-
614
- transition ?
615
- $active.one($.support.transition.end, next) :
616
- next()
617
-
618
- $active.removeClass('in')
619
- }
620
- }
621
-
622
-
623
- /* TAB PLUGIN DEFINITION
624
- * ===================== */
625
-
626
- $.fn.tab = function (option) {
627
- return this.each(function () {
628
- var $this = $(this)
629
- , data = $this.data('tab')
630
- if (!data) $this.data('tab', (data = new Tab(this)))
631
- if (typeof option == 'string') data[option]()
632
- })
633
- }
634
-
635
- $.fn.tab.Constructor = Tab
636
-
637
-
638
- /* TAB DATA-API
639
- * ============ */
640
-
641
- $(function () {
642
- $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
643
- e.preventDefault()
644
- $(this).tab('show')
645
- })
646
- })
647
-
648
- }(window.jQuery);
649
- /* ===========================================================
650
- * bootstrap-tooltip.js v2.0.4
651
- * http://twitter.github.com/bootstrap/javascript.html#tooltips
652
- * Inspired by the original jQuery.tipsy by Jason Frame
653
- * ===========================================================
654
- * Copyright 2012 Twitter, Inc.
655
- *
656
- * Licensed under the Apache License, Version 2.0 (the "License");
657
- * you may not use this file except in compliance with the License.
658
- * You may obtain a copy of the License at
659
- *
660
- * http://www.apache.org/licenses/LICENSE-2.0
661
- *
662
- * Unless required by applicable law or agreed to in writing, software
663
- * distributed under the License is distributed on an "AS IS" BASIS,
664
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
665
- * See the License for the specific language governing permissions and
666
- * limitations under the License.
667
- * ========================================================== */
668
-
669
-
670
- !function ($) {
671
-
672
- "use strict"; // jshint ;_;
673
-
674
-
675
- /* TOOLTIP PUBLIC CLASS DEFINITION
676
- * =============================== */
677
-
678
- var Tooltip = function (element, options) {
679
- this.init('tooltip', element, options)
680
- }
681
-
682
- Tooltip.prototype = {
683
-
684
- constructor:Tooltip, init:function (type, element, options) {
685
- var eventIn
686
- , eventOut
687
-
688
- this.type = type
689
- this.$element = $(element)
690
- this.options = this.getOptions(options)
691
- this.enabled = true
692
-
693
- if (this.options.trigger != 'manual') {
694
- eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
695
- eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
696
- this.$element.on(eventIn, this.options.selector, $.proxy(this.enter, this))
697
- this.$element.on(eventOut, this.options.selector, $.proxy(this.leave, this))
698
- }
699
-
700
- this.options.selector ?
701
- (this._options = $.extend({}, this.options, { trigger:'manual', selector:'' })) :
702
- this.fixTitle()
703
- }, getOptions:function (options) {
704
- options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
705
-
706
- if (options.delay && typeof options.delay == 'number') {
707
- options.delay = {
708
- show:options.delay, hide:options.delay
709
- }
710
- }
711
-
712
- return options
713
- }, enter:function (e) {
714
- var self = $(e.currentTarget)[this.type](this._options).data(this.type)
715
-
716
- if (!self.options.delay || !self.options.delay.show) return self.show()
717
-
718
- clearTimeout(this.timeout)
719
- self.hoverState = 'in'
720
- this.timeout = setTimeout(function () {
721
- if (self.hoverState == 'in') self.show()
722
- }, self.options.delay.show)
723
- }, leave:function (e) {
724
- var self = $(e.currentTarget)[this.type](this._options).data(this.type)
725
-
726
- if (this.timeout) clearTimeout(this.timeout)
727
- if (!self.options.delay || !self.options.delay.hide) return self.hide()
728
-
729
- self.hoverState = 'out'
730
- this.timeout = setTimeout(function () {
731
- if (self.hoverState == 'out') self.hide()
732
- }, self.options.delay.hide)
733
- }, show:function () {
734
- var $tip
735
- , inside
736
- , pos
737
- , actualWidth
738
- , actualHeight
739
- , placement
740
- , tp
741
-
742
- if (this.hasContent() && this.enabled) {
743
- $tip = this.tip()
744
- this.setContent()
745
-
746
- if (this.options.animation) {
747
- $tip.addClass('fade')
748
- }
749
-
750
- placement = typeof this.options.placement == 'function' ?
751
- this.options.placement.call(this, $tip[0], this.$element[0]) :
752
- this.options.placement
753
-
754
- inside = /in/.test(placement)
755
-
756
- $tip
757
- .remove()
758
- .css({ top:0, left:0, display:'block' })
759
- .appendTo(inside ? this.$element : document.body)
760
-
761
- pos = this.getPosition(inside)
762
-
763
- actualWidth = $tip[0].offsetWidth
764
- actualHeight = $tip[0].offsetHeight
765
-
766
- switch (inside ? placement.split(' ')[1] : placement) {
767
- case 'bottom':
768
- tp = {top:pos.top + pos.height, left:pos.left + pos.width / 2 - actualWidth / 2}
769
- break
770
- case 'top':
771
- tp = {top:pos.top - actualHeight, left:pos.left + pos.width / 2 - actualWidth / 2}
772
- break
773
- case 'left':
774
- tp = {top:pos.top + pos.height / 2 - actualHeight / 2, left:pos.left - actualWidth}
775
- break
776
- case 'right':
777
- tp = {top:pos.top + pos.height / 2 - actualHeight / 2, left:pos.left + pos.width}
778
- break
779
- }
780
-
781
- $tip
782
- .css(tp)
783
- .addClass(placement)
784
- .addClass('in')
785
- }
786
- }, isHTML:function (text) {
787
- // html string detection logic adapted from jQuery
788
- return typeof text != 'string'
789
- || ( text.charAt(0) === "<"
790
- && text.charAt(text.length - 1) === ">"
791
- && text.length >= 3
792
- ) || /^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(text)
793
- }, setContent:function () {
794
- var $tip = this.tip()
795
- , title = this.getTitle()
796
-
797
- $tip.find('.tooltip-inner')[this.isHTML(title) ? 'html' : 'text'](title)
798
- $tip.removeClass('fade in top bottom left right')
799
- }, hide:function () {
800
- var that = this
801
- , $tip = this.tip()
802
-
803
- $tip.removeClass('in')
804
-
805
- function removeWithAnimation() {
806
- var timeout = setTimeout(function () {
807
- $tip.off($.support.transition.end).remove()
808
- }, 500)
809
-
810
- $tip.one($.support.transition.end, function () {
811
- clearTimeout(timeout)
812
- $tip.remove()
813
- })
814
- }
815
-
816
- $.support.transition && this.$tip.hasClass('fade') ?
817
- removeWithAnimation() :
818
- $tip.remove()
819
- }, fixTitle:function () {
820
- var $e = this.$element
821
- if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
822
- $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
823
- }
824
- }, hasContent:function () {
825
- return this.getTitle()
826
- }, getPosition:function (inside) {
827
- return $.extend({}, (inside ? {top:0, left:0} : this.$element.offset()), {
828
- width:this.$element[0].offsetWidth, height:this.$element[0].offsetHeight
829
- })
830
- }, getTitle:function () {
831
- var title
832
- , $e = this.$element
833
- , o = this.options
834
-
835
- title = $e.attr('data-original-title')
836
- || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
837
-
838
- return title
839
- }, tip:function () {
840
- return this.$tip = this.$tip || $(this.options.template)
841
- }, validate:function () {
842
- if (!this.$element[0].parentNode) {
843
- this.hide()
844
- this.$element = null
845
- this.options = null
846
- }
847
- }, enable:function () {
848
- this.enabled = true
849
- }, disable:function () {
850
- this.enabled = false
851
- }, toggleEnabled:function () {
852
- this.enabled = !this.enabled
853
- }, toggle:function () {
854
- this[this.tip().hasClass('in') ? 'hide' : 'show']()
855
- }
856
-
857
- }
858
-
859
-
860
- /* TOOLTIP PLUGIN DEFINITION
861
- * ========================= */
862
-
863
- $.fn.tooltip = function (option) {
864
- return this.each(function () {
865
- var $this = $(this)
866
- , data = $this.data('tooltip')
867
- , options = typeof option == 'object' && option
868
- if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
869
- if (typeof option == 'string') data[option]()
870
- })
871
- }
872
-
873
- $.fn.tooltip.Constructor = Tooltip
874
-
875
- $.fn.tooltip.defaults = {
876
- animation:true, placement:'top', selector:false, template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', trigger:'hover', title:'', delay:0
877
- }
878
-
879
- }(window.jQuery);
880
-
881
- /* ===========================================================
882
- * bootstrap-popover.js v2.0.4
883
- * http://twitter.github.com/bootstrap/javascript.html#popovers
884
- * ===========================================================
885
- * Copyright 2012 Twitter, Inc.
886
- *
887
- * Licensed under the Apache License, Version 2.0 (the "License");
888
- * you may not use this file except in compliance with the License.
889
- * You may obtain a copy of the License at
890
- *
891
- * http://www.apache.org/licenses/LICENSE-2.0
892
- *
893
- * Unless required by applicable law or agreed to in writing, software
894
- * distributed under the License is distributed on an "AS IS" BASIS,
895
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
896
- * See the License for the specific language governing permissions and
897
- * limitations under the License.
898
- * =========================================================== */
899
-
900
-
901
- !function ($) {
902
-
903
- "use strict"; // jshint ;_;
904
-
905
-
906
- /* POPOVER PUBLIC CLASS DEFINITION
907
- * =============================== */
908
-
909
- var Popover = function (element, options) {
910
- this.init('popover', element, options)
911
- }
912
-
913
-
914
- /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
915
- ========================================== */
916
-
917
- Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
918
-
919
- constructor:Popover, setContent:function () {
920
- var $tip = this.tip()
921
- , title = this.getTitle()
922
- , content = this.getContent()
923
-
924
- $tip.find('.popover-title')[this.isHTML(title) ? 'html' : 'text'](title)
925
- $tip.find('.popover-content > *')[this.isHTML(content) ? 'html' : 'text'](content)
926
-
927
- $tip.removeClass('fade top bottom left right in')
928
- }, hasContent:function () {
929
- return this.getTitle() || this.getContent()
930
- }, getContent:function () {
931
- var content
932
- , $e = this.$element
933
- , o = this.options
934
-
935
- content = $e.attr('data-content')
936
- || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
937
-
938
- return content
939
- }, tip:function () {
940
- if (!this.$tip) {
941
- this.$tip = $(this.options.template)
942
- }
943
- return this.$tip
944
- }
945
-
946
- })
947
-
948
-
949
- /* POPOVER PLUGIN DEFINITION
950
- * ======================= */
951
-
952
- $.fn.popover = function (option) {
953
- return this.each(function () {
954
- var $this = $(this)
955
- , data = $this.data('popover')
956
- , options = typeof option == 'object' && option
957
- if (!data) $this.data('popover', (data = new Popover(this, options)))
958
- if (typeof option == 'string') data[option]()
959
- })
960
- }
961
-
962
- $.fn.popover.Constructor = Popover
963
-
964
- $.fn.popover.defaults = $.extend({}, $.fn.tooltip.defaults, {
965
- placement:'right', content:'', template:'<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
966
- })
967
-
968
- }(window.jQuery);
969
- /* ==========================================================
970
- * bootstrap-alert.js v2.0.4
971
- * http://twitter.github.com/bootstrap/javascript.html#alerts
972
- * ==========================================================
973
- * Copyright 2012 Twitter, Inc.
974
- *
975
- * Licensed under the Apache License, Version 2.0 (the "License");
976
- * you may not use this file except in compliance with the License.
977
- * You may obtain a copy of the License at
978
- *
979
- * http://www.apache.org/licenses/LICENSE-2.0
980
- *
981
- * Unless required by applicable law or agreed to in writing, software
982
- * distributed under the License is distributed on an "AS IS" BASIS,
983
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
984
- * See the License for the specific language governing permissions and
985
- * limitations under the License.
986
- * ========================================================== */
987
-
988
-
989
- !function ($) {
990
-
991
- "use strict"; // jshint ;_;
992
-
993
-
994
- /* ALERT CLASS DEFINITION
995
- * ====================== */
996
-
997
- var dismiss = '[data-dismiss="alert"]'
998
- , Alert = function (el) {
999
- $(el).on('click', dismiss, this.close)
1000
- }
1001
-
1002
- Alert.prototype.close = function (e) {
1003
- var $this = $(this)
1004
- , selector = $this.attr('data-target')
1005
- , $parent
1006
-
1007
- if (!selector) {
1008
- selector = $this.attr('href')
1009
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
1010
- }
1011
-
1012
- $parent = $(selector)
1013
-
1014
- e && e.preventDefault()
1015
-
1016
- $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
1017
-
1018
- $parent.trigger(e = $.Event('close'))
1019
-
1020
- if (e.isDefaultPrevented()) return
1021
-
1022
- $parent.removeClass('in')
1023
-
1024
- function removeElement() {
1025
- $parent
1026
- .trigger('closed')
1027
- .remove()
1028
- }
1029
-
1030
- $.support.transition && $parent.hasClass('fade') ?
1031
- $parent.on($.support.transition.end, removeElement) :
1032
- removeElement()
1033
- }
1034
-
1035
-
1036
- /* ALERT PLUGIN DEFINITION
1037
- * ======================= */
1038
-
1039
- $.fn.alert = function (option) {
1040
- return this.each(function () {
1041
- var $this = $(this)
1042
- , data = $this.data('alert')
1043
- if (!data) $this.data('alert', (data = new Alert(this)))
1044
- if (typeof option == 'string') data[option].call($this)
1045
- })
1046
- }
1047
-
1048
- $.fn.alert.Constructor = Alert
1049
-
1050
-
1051
- /* ALERT DATA-API
1052
- * ============== */
1053
-
1054
- $(function () {
1055
- $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
1056
- })
1057
-
1058
- }(window.jQuery);
1059
- /* ============================================================
1060
- * bootstrap-button.js v2.0.4
1061
- * http://twitter.github.com/bootstrap/javascript.html#buttons
1062
- * ============================================================
1063
- * Copyright 2012 Twitter, Inc.
1064
- *
1065
- * Licensed under the Apache License, Version 2.0 (the "License");
1066
- * you may not use this file except in compliance with the License.
1067
- * You may obtain a copy of the License at
1068
- *
1069
- * http://www.apache.org/licenses/LICENSE-2.0
1070
- *
1071
- * Unless required by applicable law or agreed to in writing, software
1072
- * distributed under the License is distributed on an "AS IS" BASIS,
1073
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1074
- * See the License for the specific language governing permissions and
1075
- * limitations under the License.
1076
- * ============================================================ */
1077
-
1078
-
1079
- !function ($) {
1080
-
1081
- "use strict"; // jshint ;_;
1082
-
1083
-
1084
- /* BUTTON PUBLIC CLASS DEFINITION
1085
- * ============================== */
1086
-
1087
- var Button = function (element, options) {
1088
- this.$element = $(element)
1089
- this.options = $.extend({}, $.fn.button.defaults, options)
1090
- }
1091
-
1092
- Button.prototype.setState = function (state) {
1093
- var d = 'disabled'
1094
- , $el = this.$element
1095
- , data = $el.data()
1096
- , val = $el.is('input') ? 'val' : 'html'
1097
-
1098
- state = state + 'Text'
1099
- data.resetText || $el.data('resetText', $el[val]())
1100
-
1101
- $el[val](data[state] || this.options[state])
1102
-
1103
- // push to event loop to allow forms to submit
1104
- setTimeout(function () {
1105
- state == 'loadingText' ?
1106
- $el.addClass(d).attr(d, d) :
1107
- $el.removeClass(d).removeAttr(d)
1108
- }, 0)
1109
- }
1110
-
1111
- Button.prototype.toggle = function () {
1112
- var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
1113
-
1114
- $parent && $parent
1115
- .find('.active')
1116
- .removeClass('active')
1117
-
1118
- this.$element.toggleClass('active')
1119
- }
1120
-
1121
-
1122
- /* BUTTON PLUGIN DEFINITION
1123
- * ======================== */
1124
-
1125
- $.fn.button = function (option) {
1126
- return this.each(function () {
1127
- var $this = $(this)
1128
- , data = $this.data('button')
1129
- , options = typeof option == 'object' && option
1130
- if (!data) $this.data('button', (data = new Button(this, options)))
1131
- if (option == 'toggle') data.toggle()
1132
- else if (option) data.setState(option)
1133
- })
1134
- }
1135
-
1136
- $.fn.button.defaults = {
1137
- loadingText:'loading...'
1138
- }
1139
-
1140
- $.fn.button.Constructor = Button
1141
-
1142
-
1143
- /* BUTTON DATA-API
1144
- * =============== */
1145
-
1146
- $(function () {
1147
- $('body').on('click.button.data-api', '[data-toggle^=button]', function (e) {
1148
- var $btn = $(e.target)
1149
- if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
1150
- $btn.button('toggle')
1151
- })
1152
- })
1153
-
1154
- }(window.jQuery);
1155
- /* =============================================================
1156
- * bootstrap-collapse.js v2.0.4
1157
- * http://twitter.github.com/bootstrap/javascript.html#collapse
1158
- * =============================================================
1159
- * Copyright 2012 Twitter, Inc.
1160
- *
1161
- * Licensed under the Apache License, Version 2.0 (the "License");
1162
- * you may not use this file except in compliance with the License.
1163
- * You may obtain a copy of the License at
1164
- *
1165
- * http://www.apache.org/licenses/LICENSE-2.0
1166
- *
1167
- * Unless required by applicable law or agreed to in writing, software
1168
- * distributed under the License is distributed on an "AS IS" BASIS,
1169
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1170
- * See the License for the specific language governing permissions and
1171
- * limitations under the License.
1172
- * ============================================================ */
1173
-
1174
-
1175
- !function ($) {
1176
-
1177
- "use strict"; // jshint ;_;
1178
-
1179
-
1180
- /* COLLAPSE PUBLIC CLASS DEFINITION
1181
- * ================================ */
1182
-
1183
- var Collapse = function (element, options) {
1184
- this.$element = $(element)
1185
- this.options = $.extend({}, $.fn.collapse.defaults, options)
1186
-
1187
- if (this.options.parent) {
1188
- this.$parent = $(this.options.parent)
1189
- }
1190
-
1191
- this.options.toggle && this.toggle()
1192
- }
1193
-
1194
- Collapse.prototype = {
1195
-
1196
- constructor:Collapse, dimension:function () {
1197
- var hasWidth = this.$element.hasClass('width')
1198
- return hasWidth ? 'width' : 'height'
1199
- }, show:function () {
1200
- var dimension
1201
- , scroll
1202
- , actives
1203
- , hasData
1204
-
1205
- if (this.transitioning) return
1206
-
1207
- dimension = this.dimension()
1208
- scroll = $.camelCase(['scroll', dimension].join('-'))
1209
- actives = this.$parent && this.$parent.find('> .accordion-group > .in')
1210
-
1211
- if (actives && actives.length) {
1212
- hasData = actives.data('collapse')
1213
- if (hasData && hasData.transitioning) return
1214
- actives.collapse('hide')
1215
- hasData || actives.data('collapse', null)
1216
- }
1217
-
1218
- this.$element[dimension](0)
1219
- this.transition('addClass', $.Event('show'), 'shown')
1220
- this.$element[dimension](this.$element[0][scroll])
1221
- }, hide:function () {
1222
- var dimension
1223
- if (this.transitioning) return
1224
- dimension = this.dimension()
1225
- this.reset(this.$element[dimension]())
1226
- this.transition('removeClass', $.Event('hide'), 'hidden')
1227
- this.$element[dimension](0)
1228
- }, reset:function (size) {
1229
- var dimension = this.dimension()
1230
-
1231
- this.$element
1232
- .removeClass('collapse')
1233
- [dimension](size || 'auto')
1234
- [0].offsetWidth
1235
-
1236
- this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
1237
-
1238
- return this
1239
- }, transition:function (method, startEvent, completeEvent) {
1240
- var that = this
1241
- , complete = function () {
1242
- if (startEvent.type == 'show') that.reset()
1243
- that.transitioning = 0
1244
- that.$element.trigger(completeEvent)
1245
- }
1246
-
1247
- this.$element.trigger(startEvent)
1248
-
1249
- if (startEvent.isDefaultPrevented()) return
1250
-
1251
- this.transitioning = 1
1252
-
1253
- this.$element[method]('in')
1254
-
1255
- $.support.transition && this.$element.hasClass('collapse') ?
1256
- this.$element.one($.support.transition.end, complete) :
1257
- complete()
1258
- }, toggle:function () {
1259
- this[this.$element.hasClass('in') ? 'hide' : 'show']()
1260
- }
1261
-
1262
- }
1263
-
1264
-
1265
- /* COLLAPSIBLE PLUGIN DEFINITION
1266
- * ============================== */
1267
-
1268
- $.fn.collapse = function (option) {
1269
- return this.each(function () {
1270
- var $this = $(this)
1271
- , data = $this.data('collapse')
1272
- , options = typeof option == 'object' && option
1273
- if (!data) $this.data('collapse', (data = new Collapse(this, options)))
1274
- if (typeof option == 'string') data[option]()
1275
- })
1276
- }
1277
-
1278
- $.fn.collapse.defaults = {
1279
- toggle:true
1280
- }
1281
-
1282
- $.fn.collapse.Constructor = Collapse
1283
-
1284
-
1285
- /* COLLAPSIBLE DATA-API
1286
- * ==================== */
1287
-
1288
- $(function () {
1289
- $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
1290
- var $this = $(this), href
1291
- , target = $this.attr('data-target')
1292
- || e.preventDefault()
1293
- || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
1294
- , option = $(target).data('collapse') ? 'toggle' : $this.data()
1295
- $(target).collapse(option)
1296
- })
1297
- })
1298
-
1299
- }(window.jQuery);
1300
- /* ==========================================================
1301
- * bootstrap-carousel.js v2.0.4
1302
- * http://twitter.github.com/bootstrap/javascript.html#carousel
1303
- * ==========================================================
1304
- * Copyright 2012 Twitter, Inc.
1305
- *
1306
- * Licensed under the Apache License, Version 2.0 (the "License");
1307
- * you may not use this file except in compliance with the License.
1308
- * You may obtain a copy of the License at
1309
- *
1310
- * http://www.apache.org/licenses/LICENSE-2.0
1311
- *
1312
- * Unless required by applicable law or agreed to in writing, software
1313
- * distributed under the License is distributed on an "AS IS" BASIS,
1314
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1315
- * See the License for the specific language governing permissions and
1316
- * limitations under the License.
1317
- * ========================================================== */
1318
-
1319
-
1320
- !function ($) {
1321
-
1322
- "use strict"; // jshint ;_;
1323
-
1324
-
1325
- /* CAROUSEL CLASS DEFINITION
1326
- * ========================= */
1327
-
1328
- var Carousel = function (element, options) {
1329
- this.$element = $(element)
1330
- this.options = options
1331
- this.options.slide && this.slide(this.options.slide)
1332
- this.options.pause == 'hover' && this.$element
1333
- .on('mouseenter', $.proxy(this.pause, this))
1334
- .on('mouseleave', $.proxy(this.cycle, this))
1335
- }
1336
-
1337
- Carousel.prototype = {
1338
-
1339
- cycle:function (e) {
1340
- if (!e) this.paused = false
1341
- this.options.interval
1342
- && !this.paused
1343
- && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
1344
- return this
1345
- }, to:function (pos) {
1346
- var $active = this.$element.find('.active')
1347
- , children = $active.parent().children()
1348
- , activePos = children.index($active)
1349
- , that = this
1350
-
1351
- if (pos > (children.length - 1) || pos < 0) return
1352
-
1353
- if (this.sliding) {
1354
- return this.$element.one('slid', function () {
1355
- that.to(pos)
1356
- })
1357
- }
1358
-
1359
- if (activePos == pos) {
1360
- return this.pause().cycle()
1361
- }
1362
-
1363
- return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
1364
- }, pause:function (e) {
1365
- if (!e) this.paused = true
1366
- clearInterval(this.interval)
1367
- this.interval = null
1368
- return this
1369
- }, next:function () {
1370
- if (this.sliding) return
1371
- return this.slide('next')
1372
- }, prev:function () {
1373
- if (this.sliding) return
1374
- return this.slide('prev')
1375
- }, slide:function (type, next) {
1376
- var $active = this.$element.find('.active')
1377
- , $next = next || $active[type]()
1378
- , isCycling = this.interval
1379
- , direction = type == 'next' ? 'left' : 'right'
1380
- , fallback = type == 'next' ? 'first' : 'last'
1381
- , that = this
1382
- , e = $.Event('slide')
1383
-
1384
- this.sliding = true
1385
-
1386
- isCycling && this.pause()
1387
-
1388
- $next = $next.length ? $next : this.$element.find('.item')[fallback]()
1389
-
1390
- if ($next.hasClass('active')) return
1391
-
1392
- if ($.support.transition && this.$element.hasClass('slide')) {
1393
- this.$element.trigger(e)
1394
- if (e.isDefaultPrevented()) return
1395
- $next.addClass(type)
1396
- $next[0].offsetWidth // force reflow
1397
- $active.addClass(direction)
1398
- $next.addClass(direction)
1399
- this.$element.one($.support.transition.end, function () {
1400
- $next.removeClass([type, direction].join(' ')).addClass('active')
1401
- $active.removeClass(['active', direction].join(' '))
1402
- that.sliding = false
1403
- setTimeout(function () {
1404
- that.$element.trigger('slid')
1405
- }, 0)
1406
- })
1407
- } else {
1408
- this.$element.trigger(e)
1409
- if (e.isDefaultPrevented()) return
1410
- $active.removeClass('active')
1411
- $next.addClass('active')
1412
- this.sliding = false
1413
- this.$element.trigger('slid')
1414
- }
1415
-
1416
- isCycling && this.cycle()
1417
-
1418
- return this
1419
- }
1420
-
1421
- }
1422
-
1423
-
1424
- /* CAROUSEL PLUGIN DEFINITION
1425
- * ========================== */
1426
-
1427
- $.fn.carousel = function (option) {
1428
- return this.each(function () {
1429
- var $this = $(this)
1430
- , data = $this.data('carousel')
1431
- , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
1432
- if (!data) $this.data('carousel', (data = new Carousel(this, options)))
1433
- if (typeof option == 'number') data.to(option)
1434
- else if (typeof option == 'string' || (option = options.slide)) data[option]()
1435
- else if (options.interval) data.cycle()
1436
- })
1437
- }
1438
-
1439
- $.fn.carousel.defaults = {
1440
- interval:5000, pause:'hover'
1441
- }
1442
-
1443
- $.fn.carousel.Constructor = Carousel
1444
-
1445
-
1446
- /* CAROUSEL DATA-API
1447
- * ================= */
1448
-
1449
- $(function () {
1450
- $('body').on('click.carousel.data-api', '[data-slide]', function (e) {
1451
- var $this = $(this), href
1452
- , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
1453
- , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
1454
- $target.carousel(options)
1455
- e.preventDefault()
1456
- })
1457
- })
1458
-
1459
- }(window.jQuery);
1460
- /* =============================================================
1461
- * bootstrap-typeahead.js v2.0.4
1462
- * http://twitter.github.com/bootstrap/javascript.html#typeahead
1463
- * =============================================================
1464
- * Copyright 2012 Twitter, Inc.
1465
- *
1466
- * Licensed under the Apache License, Version 2.0 (the "License");
1467
- * you may not use this file except in compliance with the License.
1468
- * You may obtain a copy of the License at
1469
- *
1470
- * http://www.apache.org/licenses/LICENSE-2.0
1471
- *
1472
- * Unless required by applicable law or agreed to in writing, software
1473
- * distributed under the License is distributed on an "AS IS" BASIS,
1474
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1475
- * See the License for the specific language governing permissions and
1476
- * limitations under the License.
1477
- * ============================================================ */
1478
-
1479
-
1480
- !function ($) {
1481
-
1482
- "use strict"
1483
-
1484
- var Typeahead = function (element, options) {
1485
- this.$element = $(element)
1486
- this.options = $.extend({}, $.fn.typeahead.defaults, options)
1487
- this.assigner = this.options.assigner || this.assigner
1488
- this.matcher = this.options.matcher || this.matcher
1489
- this.sorter = this.options.sorter || this.sorter
1490
- this.highlighter = this.options.highlighter || this.highlighter
1491
- this.$menu = $(this.options.menu).appendTo('body')
1492
- this.source = this.options.source
1493
- this.onselect = this.options.onselect
1494
- this.strings = true
1495
- this.shown = false
1496
- this.listen()
1497
- }
1498
-
1499
- Typeahead.prototype = {
1500
-
1501
- constructor:Typeahead, select:function () {
1502
- var val = JSON.parse(this.$menu.find('.active').attr('data-value'))
1503
- , text
1504
-
1505
- if (!this.strings) text = val[this.options.property]
1506
- else text = val
1507
-
1508
- this.assigner(text, val)
1509
-
1510
- if (typeof this.onselect == "function")
1511
- this.onselect(val)
1512
-
1513
- return this.hide()
1514
- }, assigner:function (text) {
1515
- this.$element.val(text)
1516
- }, show:function () {
1517
- var pos = $.extend({}, this.$element.offset(), {
1518
- height:this.$element[0].offsetHeight
1519
- })
1520
-
1521
- this.$menu.css({
1522
- top:pos.top + pos.height, left:pos.left
1523
- })
1524
-
1525
- this.$menu.show()
1526
- this.shown = true
1527
- return this
1528
- }, hide:function () {
1529
- this.$menu.hide()
1530
- this.shown = false
1531
- return this
1532
- }, lookup:function (event) {
1533
- var that = this
1534
- , items
1535
- , q
1536
- , value
1537
-
1538
- this.query = this.$element.val()
1539
-
1540
- if (typeof this.source == "function") {
1541
- value = this.source(this, this.query, event)
1542
- if (value) this.process(value)
1543
- } else {
1544
- this.process(this.source)
1545
- }
1546
- }, process:function (results) {
1547
- var that = this
1548
- , items
1549
- , q
1550
-
1551
- if (results.length && typeof results[0] != "string")
1552
- this.strings = false
1553
-
1554
- this.query = this.$element.val()
1555
-
1556
- if (!this.query) {
1557
- return this.shown ? this.hide() : this
1558
- }
1559
-
1560
- items = $.grep(results, function (item) {
1561
- if (!that.strings)
1562
- item = item[that.options.property]
1563
- if (that.matcher(item)) return item
1564
- })
1565
-
1566
- items = this.sorter(items)
1567
-
1568
- if (!items.length) {
1569
- return this.shown ? this.hide() : this
1570
- }
1571
-
1572
- return this.render(items.slice(0, this.options.items)).show()
1573
- }, matcher:function (item) {
1574
- return ~item.toLowerCase().indexOf(this.query.toLowerCase())
1575
- }, sorter:function (items) {
1576
- var beginswith = []
1577
- , caseSensitive = []
1578
- , caseInsensitive = []
1579
- , item
1580
- , sortby
1581
-
1582
- while (item = items.shift()) {
1583
- if (this.strings) sortby = item
1584
- else sortby = item[this.options.property]
1585
-
1586
- if (!sortby.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
1587
- else if (~sortby.indexOf(this.query)) caseSensitive.push(item)
1588
- else caseInsensitive.push(item)
1589
- }
1590
-
1591
- return beginswith.concat(caseSensitive, caseInsensitive)
1592
- }, highlighter:function (item) {
1593
- return item.replace(('(' + this.query + ')').toRegExp('ig'), function ($1, match) {
1594
- return '<strong>' + match + '</strong>'
1595
- })
1596
- }, render:function (items) {
1597
- var that = this
1598
-
1599
- items = $(items).map(function (i, item) {
1600
- i = $(that.options.item).attr('data-value', JSON.stringify(item))
1601
- if (!that.strings)
1602
- item = item[that.options.property]
1603
- i.find('a').html(that.highlighter(item))
1604
- return i[0]
1605
- })
1606
-
1607
- items.first().addClass('active')
1608
- this.$menu.html(items)
1609
- return this
1610
- }, next:function (event) {
1611
- var active = this.$menu.find('.active').removeClass('active')
1612
- , next = active.next()
1613
-
1614
- if (!next.length) {
1615
- next = $(this.$menu.find('li')[0])
1616
- }
1617
-
1618
- next.addClass('active')
1619
- }, prev:function (event) {
1620
- var active = this.$menu.find('.active').removeClass('active')
1621
- , prev = active.prev()
1622
-
1623
- if (!prev.length) {
1624
- prev = this.$menu.find('li').last()
1625
- }
1626
-
1627
- prev.addClass('active')
1628
- }, listen:function () {
1629
- this.$element
1630
- .on('blur', $.proxy(this.blur, this))
1631
- .on('keypress', $.proxy(this.keypress, this))
1632
- .on('keyup', $.proxy(this.keyup, this))
1633
-
1634
- if ($.browser.webkit || $.browser.msie) {
1635
- this.$element.on('keydown', $.proxy(this.keypress, this))
1636
- }
1637
-
1638
- this.$menu
1639
- .on('click', $.proxy(this.click, this))
1640
- .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
1641
- }, keyup:function (e) {
1642
- e.stopPropagation()
1643
- e.preventDefault()
1644
-
1645
- switch (e.keyCode) {
1646
- case 40: // down arrow
1647
- case 38: // up arrow
1648
- break
1649
-
1650
- case 9: // tab
1651
- case 13: // enter
1652
- if (!this.shown) return
1653
- this.select()
1654
- break
1655
-
1656
- case 27: // escape
1657
- this.hide()
1658
- break
1659
-
1660
- default:
1661
- this.lookup(e)
1662
- }
1663
-
1664
- }, keypress:function (e) {
1665
- e.stopPropagation()
1666
- if (!this.shown) return
1667
-
1668
- switch (e.keyCode) {
1669
- case 9: // tab
1670
- case 13: // enter
1671
- case 27: // escape
1672
- e.preventDefault()
1673
- break
1674
-
1675
- case 38: // up arrow
1676
- e.preventDefault()
1677
- this.prev()
1678
- break
1679
-
1680
- case 40: // down arrow
1681
- e.preventDefault()
1682
- this.next()
1683
- break
1684
- }
1685
- }, blur:function (e) {
1686
- var that = this
1687
- e.stopPropagation()
1688
- e.preventDefault()
1689
- setTimeout(function () {
1690
- that.hide()
1691
- }, 150)
1692
- }, click:function (e) {
1693
- e.stopPropagation()
1694
- e.preventDefault()
1695
- this.select()
1696
- }, mouseenter:function (e) {
1697
- this.$menu.find('.active').removeClass('active')
1698
- $(e.currentTarget).addClass('active')
1699
- }
1700
-
1701
- }
1702
-
1703
-
1704
- /* TYPEAHEAD PLUGIN DEFINITION
1705
- * =========================== */
1706
-
1707
- $.fn.typeahead = function (option) {
1708
- return this.each(function () {
1709
- var $this = $(this)
1710
- , data = $this.data('typeahead')
1711
- , options = typeof option == 'object' && option
1712
- if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
1713
- if (typeof option == 'string') data[option]()
1714
- //FIX: hide browser default autocomplete
1715
- $this.attr('autocomplete', 'off')
1716
- })
1717
- }
1718
-
1719
- $.fn.typeahead.defaults = {
1720
- source:[], items:8, menu:'<ul class="typeahead dropdown-menu"></ul>', item:'<li><a href="#"></a></li>', onselect:null, property:'value'
1721
- }
1722
-
1723
- $.fn.typeahead.Constructor = Typeahead
1724
-
1725
-
1726
- /* TYPEAHEAD DATA-API
1727
- * ================== */
1728
-
1729
- $(function () {
1730
- $('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
1731
- var $this = $(this)
1732
- if ($this.data('typeahead')) return
1733
- e.preventDefault()
1734
- $this.typeahead($this.data())
1735
- })
1736
- })
1737
-
1
+ /* ===================================================
2
+ * bootstrap-transition.js v2.0.4
3
+ * http://twitter.github.com/bootstrap/javascript.html#transitions
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 ($) {
22
+
23
+ $(function () {
24
+
25
+ "use strict"; // jshint ;_;
26
+
27
+
28
+ /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
29
+ * ======================================================= */
30
+
31
+ $.support.transition = (function () {
32
+
33
+ var transitionEnd = (function () {
34
+
35
+ var el = document.createElement('bootstrap')
36
+ , transEndEventNames = {
37
+ 'WebkitTransition':'webkitTransitionEnd', 'MozTransition':'transitionend', 'OTransition':'oTransitionEnd', 'msTransition':'MSTransitionEnd', 'transition':'transitionend'
38
+ }
39
+ , name
40
+
41
+ for (name in transEndEventNames) {
42
+ if (el.style[name] !== undefined) {
43
+ return transEndEventNames[name]
44
+ }
45
+ }
46
+
47
+ }())
48
+
49
+ return transitionEnd && {
50
+ end:transitionEnd
51
+ }
52
+
53
+ })()
54
+
55
+ })
56
+
57
+ }(window.jQuery);
58
+ /* =========================================================
59
+ * bootstrap-modal.js v2.0.4
60
+ * http://twitter.github.com/bootstrap/javascript.html#modals
61
+ * =========================================================
62
+ * Copyright 2012 Twitter, Inc.
63
+ *
64
+ * Licensed under the Apache License, Version 2.0 (the "License");
65
+ * you may not use this file except in compliance with the License.
66
+ * You may obtain a copy of the License at
67
+ *
68
+ * http://www.apache.org/licenses/LICENSE-2.0
69
+ *
70
+ * Unless required by applicable law or agreed to in writing, software
71
+ * distributed under the License is distributed on an "AS IS" BASIS,
72
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
73
+ * See the License for the specific language governing permissions and
74
+ * limitations under the License.
75
+ * ========================================================= */
76
+
77
+
78
+ !function ($) {
79
+
80
+ "use strict"; // jshint ;_;
81
+
82
+
83
+ /* MODAL CLASS DEFINITION
84
+ * ====================== */
85
+
86
+ var Modal = function (content, options) {
87
+ this.options = options
88
+ this.$element = $(content)
89
+ .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
90
+ }
91
+
92
+ Modal.prototype = {
93
+
94
+ constructor:Modal, toggle:function () {
95
+ return this[!this.isShown ? 'show' : 'hide']()
96
+ }, show:function () {
97
+ var that = this
98
+ , e = $.Event('show')
99
+
100
+ this.$element.trigger(e)
101
+
102
+ if (this.isShown || e.isDefaultPrevented()) return
103
+
104
+ $('body').addClass('modal-open')
105
+
106
+ this.isShown = true
107
+
108
+ escape.call(this)
109
+ backdrop.call(this, function () {
110
+ var transition = $.support.transition && that.$element.hasClass('fade')
111
+
112
+ if (!that.$element.parent().length) {
113
+ that.$element.appendTo(document.body) //don't move modals dom position
114
+ }
115
+
116
+ that.$element
117
+ .show()
118
+
119
+ if (transition) {
120
+ that.$element[0].offsetWidth // force reflow
121
+ }
122
+
123
+ that.$element.addClass('in')
124
+
125
+ transition ?
126
+ that.$element.one($.support.transition.end, function () {
127
+ that.$element.trigger('shown')
128
+ }) :
129
+ that.$element.trigger('shown')
130
+
131
+ })
132
+ }, hide:function (e) {
133
+ e && e.preventDefault()
134
+
135
+ var that = this
136
+
137
+ e = $.Event('hide')
138
+
139
+ this.$element.trigger(e)
140
+
141
+ if (!this.isShown || e.isDefaultPrevented()) return
142
+
143
+ this.isShown = false
144
+
145
+ $('body').removeClass('modal-open')
146
+
147
+ escape.call(this)
148
+
149
+ this.$element.removeClass('in')
150
+
151
+ $.support.transition && this.$element.hasClass('fade') ?
152
+ hideWithTransition.call(this) :
153
+ hideModal.call(this)
154
+ }
155
+
156
+ }
157
+
158
+
159
+ /* MODAL PRIVATE METHODS
160
+ * ===================== */
161
+
162
+ function hideWithTransition() {
163
+ var that = this
164
+ , timeout = setTimeout(function () {
165
+ that.$element.off($.support.transition.end)
166
+ hideModal.call(that)
167
+ }, 500)
168
+
169
+ this.$element.one($.support.transition.end, function () {
170
+ clearTimeout(timeout)
171
+ hideModal.call(that)
172
+ })
173
+ }
174
+
175
+ function hideModal(that) {
176
+ this.$element
177
+ .hide()
178
+ .trigger('hidden')
179
+
180
+ backdrop.call(this)
181
+ }
182
+
183
+ function backdrop(callback) {
184
+ var that = this
185
+ , animate = this.$element.hasClass('fade') ? 'fade' : ''
186
+
187
+ if (this.isShown && this.options.backdrop) {
188
+ var doAnimate = $.support.transition && animate
189
+
190
+ this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
191
+ .appendTo(document.body)
192
+
193
+ if (this.options.backdrop != 'static') {
194
+ this.$backdrop.click($.proxy(this.hide, this))
195
+ }
196
+
197
+ if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
198
+
199
+ this.$backdrop.addClass('in')
200
+
201
+ doAnimate ?
202
+ this.$backdrop.one($.support.transition.end, callback) :
203
+ callback()
204
+
205
+ } else if (!this.isShown && this.$backdrop) {
206
+ this.$backdrop.removeClass('in')
207
+
208
+ $.support.transition && this.$element.hasClass('fade') ?
209
+ this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
210
+ removeBackdrop.call(this)
211
+
212
+ } else if (callback) {
213
+ callback()
214
+ }
215
+ }
216
+
217
+ function removeBackdrop() {
218
+ this.$backdrop.remove()
219
+ this.$backdrop = null
220
+ }
221
+
222
+ function escape() {
223
+ var that = this
224
+ if (this.isShown && this.options.keyboard) {
225
+ $(document).on('keyup.dismiss.modal', function (e) {
226
+ e.which == 27 && that.hide()
227
+ })
228
+ } else if (!this.isShown) {
229
+ $(document).off('keyup.dismiss.modal')
230
+ }
231
+ }
232
+
233
+
234
+ /* MODAL PLUGIN DEFINITION
235
+ * ======================= */
236
+
237
+ $.fn.modal = function (option) {
238
+ return this.each(function () {
239
+ var $this = $(this)
240
+ , data = $this.data('modal')
241
+ , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
242
+ if (!data) $this.data('modal', (data = new Modal(this, options)))
243
+ if (typeof option == 'string') data[option]()
244
+ else if (options.show) data.show()
245
+ })
246
+ }
247
+
248
+ $.fn.modal.defaults = {
249
+ backdrop:true, keyboard:true, show:true
250
+ }
251
+
252
+ $.fn.modal.Constructor = Modal
253
+
254
+
255
+ /* MODAL DATA-API
256
+ * ============== */
257
+
258
+ $(function () {
259
+ $('body').on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
260
+ var $this = $(this), href
261
+ , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
262
+ , option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
263
+
264
+ e.preventDefault()
265
+ $target.modal(option)
266
+ })
267
+ })
268
+
269
+ }(window.jQuery);
270
+ /* ============================================================
271
+ * bootstrap-dropdown.js v2.0.4
272
+ * http://twitter.github.com/bootstrap/javascript.html#dropdowns
273
+ * ============================================================
274
+ * Copyright 2012 Twitter, Inc.
275
+ *
276
+ * Licensed under the Apache License, Version 2.0 (the "License");
277
+ * you may not use this file except in compliance with the License.
278
+ * You may obtain a copy of the License at
279
+ *
280
+ * http://www.apache.org/licenses/LICENSE-2.0
281
+ *
282
+ * Unless required by applicable law or agreed to in writing, software
283
+ * distributed under the License is distributed on an "AS IS" BASIS,
284
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
285
+ * See the License for the specific language governing permissions and
286
+ * limitations under the License.
287
+ * ============================================================ */
288
+
289
+
290
+ !function ($) {
291
+
292
+ "use strict"; // jshint ;_;
293
+
294
+
295
+ /* DROPDOWN CLASS DEFINITION
296
+ * ========================= */
297
+
298
+ var toggle = '[data-toggle="dropdown"]'
299
+ , Dropdown = function (element) {
300
+ var $el = $(element).on('click.dropdown.data-api', this.toggle)
301
+ $('html').on('click.dropdown.data-api', function () {
302
+ $el.parent().removeClass('open')
303
+ })
304
+ }
305
+
306
+ Dropdown.prototype = {
307
+
308
+ constructor:Dropdown, toggle:function (e) {
309
+ var $this = $(this)
310
+ , $parent
311
+ , selector
312
+ , isActive
313
+
314
+ if ($this.is('.disabled, :disabled')) return
315
+
316
+ selector = $this.attr('data-target')
317
+
318
+ if (!selector) {
319
+ selector = $this.attr('href')
320
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
321
+ }
322
+
323
+ $parent = $(selector)
324
+ $parent.length || ($parent = $this.parent())
325
+
326
+ isActive = $parent.hasClass('open')
327
+
328
+ clearMenus()
329
+
330
+ if (!isActive) $parent.toggleClass('open')
331
+
332
+ return false
333
+ }
334
+
335
+ }
336
+
337
+ function clearMenus() {
338
+ $(toggle).parent().removeClass('open')
339
+ }
340
+
341
+
342
+ /* DROPDOWN PLUGIN DEFINITION
343
+ * ========================== */
344
+
345
+ $.fn.dropdown = function (option) {
346
+ return this.each(function () {
347
+ var $this = $(this)
348
+ , data = $this.data('dropdown')
349
+ if (!data) $this.data('dropdown', (data = new Dropdown(this)))
350
+ if (typeof option == 'string') data[option].call($this)
351
+ })
352
+ }
353
+
354
+ $.fn.dropdown.Constructor = Dropdown
355
+
356
+
357
+ /* APPLY TO STANDARD DROPDOWN ELEMENTS
358
+ * =================================== */
359
+
360
+ $(function () {
361
+ $('html').on('click.dropdown.data-api', clearMenus)
362
+ $('body')
363
+ .on('click.dropdown', '.dropdown form', function (e) {
364
+ e.stopPropagation()
365
+ })
366
+ .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
367
+ })
368
+
369
+ }(window.jQuery);
370
+ /* =============================================================
371
+ * bootstrap-scrollspy.js v2.0.4
372
+ * http://twitter.github.com/bootstrap/javascript.html#scrollspy
373
+ * =============================================================
374
+ * Copyright 2012 Twitter, Inc.
375
+ *
376
+ * Licensed under the Apache License, Version 2.0 (the "License");
377
+ * you may not use this file except in compliance with the License.
378
+ * You may obtain a copy of the License at
379
+ *
380
+ * http://www.apache.org/licenses/LICENSE-2.0
381
+ *
382
+ * Unless required by applicable law or agreed to in writing, software
383
+ * distributed under the License is distributed on an "AS IS" BASIS,
384
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
385
+ * See the License for the specific language governing permissions and
386
+ * limitations under the License.
387
+ * ============================================================== */
388
+
389
+
390
+ !function ($) {
391
+
392
+ "use strict"; // jshint ;_;
393
+
394
+
395
+ /* SCROLLSPY CLASS DEFINITION
396
+ * ========================== */
397
+
398
+ function ScrollSpy(element, options) {
399
+ var process = $.proxy(this.process, this)
400
+ , $element = $(element).is('body') ? $(window) : $(element)
401
+ , href
402
+ this.options = $.extend({}, $.fn.scrollspy.defaults, options)
403
+ this.$scrollElement = $element.on('scroll.scroll.data-api', process)
404
+ this.selector = (this.options.target
405
+ || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
406
+ || '') + ' .nav li > a'
407
+ this.$body = $('body')
408
+ this.refresh()
409
+ this.process()
410
+ }
411
+
412
+ ScrollSpy.prototype = {
413
+
414
+ constructor:ScrollSpy, refresh:function () {
415
+ var self = this
416
+ , $targets
417
+
418
+ this.offsets = $([])
419
+ this.targets = $([])
420
+
421
+ $targets = this.$body
422
+ .find(this.selector)
423
+ .map(function () {
424
+ var $el = $(this)
425
+ , href = $el.data('target') || $el.attr('href')
426
+ , $href = /^#\w/.test(href) && $(href)
427
+ return ( $href
428
+ && href.length
429
+ && [
430
+ [ $href.position().top, href ]
431
+ ] ) || null
432
+ })
433
+ .sort(function (a, b) {
434
+ return a[0] - b[0]
435
+ })
436
+ .each(function () {
437
+ self.offsets.push(this[0])
438
+ self.targets.push(this[1])
439
+ })
440
+ }, process:function () {
441
+ var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
442
+ , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
443
+ , maxScroll = scrollHeight - this.$scrollElement.height()
444
+ , offsets = this.offsets
445
+ , targets = this.targets
446
+ , activeTarget = this.activeTarget
447
+ , i
448
+
449
+ if (scrollTop >= maxScroll) {
450
+ return activeTarget != (i = targets.last()[0])
451
+ && this.activate(i)
452
+ }
453
+
454
+ for (i = offsets.length; i--;) {
455
+ activeTarget != targets[i]
456
+ && scrollTop >= offsets[i]
457
+ && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
458
+ && this.activate(targets[i])
459
+ }
460
+ }, activate:function (target) {
461
+ var active
462
+ , selector
463
+
464
+ this.activeTarget = target
465
+
466
+ $(this.selector)
467
+ .parent('.active')
468
+ .removeClass('active')
469
+
470
+ selector = this.selector
471
+ + '[data-target="' + target + '"],'
472
+ + this.selector + '[href="' + target + '"]'
473
+
474
+ active = $(selector)
475
+ .parent('li')
476
+ .addClass('active')
477
+
478
+ if (active.parent('.dropdown-menu')) {
479
+ active = active.closest('li.dropdown').addClass('active')
480
+ }
481
+
482
+ active.trigger('activate')
483
+ }
484
+
485
+ }
486
+
487
+
488
+ /* SCROLLSPY PLUGIN DEFINITION
489
+ * =========================== */
490
+
491
+ $.fn.scrollspy = function (option) {
492
+ return this.each(function () {
493
+ var $this = $(this)
494
+ , data = $this.data('scrollspy')
495
+ , options = typeof option == 'object' && option
496
+ if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
497
+ if (typeof option == 'string') data[option]()
498
+ })
499
+ }
500
+
501
+ $.fn.scrollspy.Constructor = ScrollSpy
502
+
503
+ $.fn.scrollspy.defaults = {
504
+ offset:10
505
+ }
506
+
507
+
508
+ /* SCROLLSPY DATA-API
509
+ * ================== */
510
+
511
+ $(function () {
512
+ $('[data-spy="scroll"]').each(function () {
513
+ var $spy = $(this)
514
+ $spy.scrollspy($spy.data())
515
+ })
516
+ })
517
+
518
+ }(window.jQuery);
519
+ /* ========================================================
520
+ * bootstrap-tab.js v2.0.4
521
+ * http://twitter.github.com/bootstrap/javascript.html#tabs
522
+ * ========================================================
523
+ * Copyright 2012 Twitter, Inc.
524
+ *
525
+ * Licensed under the Apache License, Version 2.0 (the "License");
526
+ * you may not use this file except in compliance with the License.
527
+ * You may obtain a copy of the License at
528
+ *
529
+ * http://www.apache.org/licenses/LICENSE-2.0
530
+ *
531
+ * Unless required by applicable law or agreed to in writing, software
532
+ * distributed under the License is distributed on an "AS IS" BASIS,
533
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
534
+ * See the License for the specific language governing permissions and
535
+ * limitations under the License.
536
+ * ======================================================== */
537
+
538
+
539
+ !function ($) {
540
+
541
+ "use strict"; // jshint ;_;
542
+
543
+
544
+ /* TAB CLASS DEFINITION
545
+ * ==================== */
546
+
547
+ var Tab = function (element) {
548
+ this.element = $(element)
549
+ }
550
+
551
+ Tab.prototype = {
552
+
553
+ constructor:Tab, show:function () {
554
+ var $this = this.element
555
+ , $ul = $this.closest('ul:not(.dropdown-menu)')
556
+ , selector = $this.attr('data-target')
557
+ , previous
558
+ , $target
559
+ , e
560
+
561
+ if (!selector) {
562
+ selector = $this.attr('href')
563
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
564
+ }
565
+
566
+ if ($this.parent('li').hasClass('active')) return
567
+
568
+ previous = $ul.find('.active a').last()[0]
569
+
570
+ e = $.Event('show', {
571
+ relatedTarget:previous
572
+ })
573
+
574
+ $this.trigger(e)
575
+
576
+ if (e.isDefaultPrevented()) return
577
+
578
+ $target = $(selector)
579
+
580
+ this.activate($this.parent('li'), $ul)
581
+ this.activate($target, $target.parent(), function () {
582
+ $this.trigger({
583
+ type:'shown', relatedTarget:previous
584
+ })
585
+ })
586
+ }, activate:function (element, container, callback) {
587
+ var $active = container.find('> .active')
588
+ , transition = callback
589
+ && $.support.transition
590
+ && $active.hasClass('fade')
591
+
592
+ function next() {
593
+ $active
594
+ .removeClass('active')
595
+ .find('> .dropdown-menu > .active')
596
+ .removeClass('active')
597
+
598
+ element.addClass('active')
599
+
600
+ if (transition) {
601
+ element[0].offsetWidth // reflow for transition
602
+ element.addClass('in')
603
+ } else {
604
+ element.removeClass('fade')
605
+ }
606
+
607
+ if (element.parent('.dropdown-menu')) {
608
+ element.closest('li.dropdown').addClass('active')
609
+ }
610
+
611
+ callback && callback()
612
+ }
613
+
614
+ transition ?
615
+ $active.one($.support.transition.end, next) :
616
+ next()
617
+
618
+ $active.removeClass('in')
619
+ }
620
+ }
621
+
622
+
623
+ /* TAB PLUGIN DEFINITION
624
+ * ===================== */
625
+
626
+ $.fn.tab = function (option) {
627
+ return this.each(function () {
628
+ var $this = $(this)
629
+ , data = $this.data('tab')
630
+ if (!data) $this.data('tab', (data = new Tab(this)))
631
+ if (typeof option == 'string') data[option]()
632
+ })
633
+ }
634
+
635
+ $.fn.tab.Constructor = Tab
636
+
637
+
638
+ /* TAB DATA-API
639
+ * ============ */
640
+
641
+ $(function () {
642
+ $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
643
+ e.preventDefault()
644
+ $(this).tab('show')
645
+ })
646
+ })
647
+
648
+ }(window.jQuery);
649
+ /* ===========================================================
650
+ * bootstrap-tooltip.js v2.0.4
651
+ * http://twitter.github.com/bootstrap/javascript.html#tooltips
652
+ * Inspired by the original jQuery.tipsy by Jason Frame
653
+ * ===========================================================
654
+ * Copyright 2012 Twitter, Inc.
655
+ *
656
+ * Licensed under the Apache License, Version 2.0 (the "License");
657
+ * you may not use this file except in compliance with the License.
658
+ * You may obtain a copy of the License at
659
+ *
660
+ * http://www.apache.org/licenses/LICENSE-2.0
661
+ *
662
+ * Unless required by applicable law or agreed to in writing, software
663
+ * distributed under the License is distributed on an "AS IS" BASIS,
664
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
665
+ * See the License for the specific language governing permissions and
666
+ * limitations under the License.
667
+ * ========================================================== */
668
+
669
+
670
+ !function ($) {
671
+
672
+ "use strict"; // jshint ;_;
673
+
674
+
675
+ /* TOOLTIP PUBLIC CLASS DEFINITION
676
+ * =============================== */
677
+
678
+ var Tooltip = function (element, options) {
679
+ this.init('tooltip', element, options)
680
+ }
681
+
682
+ Tooltip.prototype = {
683
+
684
+ constructor:Tooltip, init:function (type, element, options) {
685
+ var eventIn
686
+ , eventOut
687
+
688
+ this.type = type
689
+ this.$element = $(element)
690
+ this.options = this.getOptions(options)
691
+ this.enabled = true
692
+
693
+ if (this.options.trigger != 'manual') {
694
+ eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
695
+ eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
696
+ this.$element.on(eventIn, this.options.selector, $.proxy(this.enter, this))
697
+ this.$element.on(eventOut, this.options.selector, $.proxy(this.leave, this))
698
+ }
699
+
700
+ this.options.selector ?
701
+ (this._options = $.extend({}, this.options, { trigger:'manual', selector:'' })) :
702
+ this.fixTitle()
703
+ }, getOptions:function (options) {
704
+ options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
705
+
706
+ if (options.delay && typeof options.delay == 'number') {
707
+ options.delay = {
708
+ show:options.delay, hide:options.delay
709
+ }
710
+ }
711
+
712
+ return options
713
+ }, enter:function (e) {
714
+ var self = $(e.currentTarget)[this.type](this._options).data(this.type)
715
+
716
+ if (!self.options.delay || !self.options.delay.show) return self.show()
717
+
718
+ clearTimeout(this.timeout)
719
+ self.hoverState = 'in'
720
+ this.timeout = setTimeout(function () {
721
+ if (self.hoverState == 'in') self.show()
722
+ }, self.options.delay.show)
723
+ }, leave:function (e) {
724
+ var self = $(e.currentTarget)[this.type](this._options).data(this.type)
725
+
726
+ if (this.timeout) clearTimeout(this.timeout)
727
+ if (!self.options.delay || !self.options.delay.hide) return self.hide()
728
+
729
+ self.hoverState = 'out'
730
+ this.timeout = setTimeout(function () {
731
+ if (self.hoverState == 'out') self.hide()
732
+ }, self.options.delay.hide)
733
+ }, show:function () {
734
+ var $tip
735
+ , inside
736
+ , pos
737
+ , actualWidth
738
+ , actualHeight
739
+ , placement
740
+ , tp
741
+
742
+ if (this.hasContent() && this.enabled) {
743
+ $tip = this.tip()
744
+ this.setContent()
745
+
746
+ if (this.options.animation) {
747
+ $tip.addClass('fade')
748
+ }
749
+
750
+ placement = typeof this.options.placement == 'function' ?
751
+ this.options.placement.call(this, $tip[0], this.$element[0]) :
752
+ this.options.placement
753
+
754
+ inside = /in/.test(placement)
755
+
756
+ $tip
757
+ .remove()
758
+ .css({ top:0, left:0, display:'block' })
759
+ .appendTo(inside ? this.$element : document.body)
760
+
761
+ pos = this.getPosition(inside)
762
+
763
+ actualWidth = $tip[0].offsetWidth
764
+ actualHeight = $tip[0].offsetHeight
765
+
766
+ switch (inside ? placement.split(' ')[1] : placement) {
767
+ case 'bottom':
768
+ tp = {top:pos.top + pos.height, left:pos.left + pos.width / 2 - actualWidth / 2}
769
+ break
770
+ case 'top':
771
+ tp = {top:pos.top - actualHeight, left:pos.left + pos.width / 2 - actualWidth / 2}
772
+ break
773
+ case 'left':
774
+ tp = {top:pos.top + pos.height / 2 - actualHeight / 2, left:pos.left - actualWidth}
775
+ break
776
+ case 'right':
777
+ tp = {top:pos.top + pos.height / 2 - actualHeight / 2, left:pos.left + pos.width}
778
+ break
779
+ }
780
+
781
+ $tip
782
+ .css(tp)
783
+ .addClass(placement)
784
+ .addClass('in')
785
+ }
786
+ }, isHTML:function (text) {
787
+ // html string detection logic adapted from jQuery
788
+ return typeof text != 'string'
789
+ || ( text.charAt(0) === "<"
790
+ && text.charAt(text.length - 1) === ">"
791
+ && text.length >= 3
792
+ ) || /^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(text)
793
+ }, setContent:function () {
794
+ var $tip = this.tip()
795
+ , title = this.getTitle()
796
+
797
+ $tip.find('.tooltip-inner')[this.isHTML(title) ? 'html' : 'text'](title)
798
+ $tip.removeClass('fade in top bottom left right')
799
+ }, hide:function () {
800
+ var that = this
801
+ , $tip = this.tip()
802
+
803
+ $tip.removeClass('in')
804
+
805
+ function removeWithAnimation() {
806
+ var timeout = setTimeout(function () {
807
+ $tip.off($.support.transition.end).remove()
808
+ }, 500)
809
+
810
+ $tip.one($.support.transition.end, function () {
811
+ clearTimeout(timeout)
812
+ $tip.remove()
813
+ })
814
+ }
815
+
816
+ $.support.transition && this.$tip.hasClass('fade') ?
817
+ removeWithAnimation() :
818
+ $tip.remove()
819
+ }, fixTitle:function () {
820
+ var $e = this.$element
821
+ if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
822
+ $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
823
+ }
824
+ }, hasContent:function () {
825
+ return this.getTitle()
826
+ }, getPosition:function (inside) {
827
+ return $.extend({}, (inside ? {top:0, left:0} : this.$element.offset()), {
828
+ width:this.$element[0].offsetWidth, height:this.$element[0].offsetHeight
829
+ })
830
+ }, getTitle:function () {
831
+ var title
832
+ , $e = this.$element
833
+ , o = this.options
834
+
835
+ title = $e.attr('data-original-title')
836
+ || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
837
+
838
+ return title
839
+ }, tip:function () {
840
+ return this.$tip = this.$tip || $(this.options.template)
841
+ }, validate:function () {
842
+ if (!this.$element[0].parentNode) {
843
+ this.hide()
844
+ this.$element = null
845
+ this.options = null
846
+ }
847
+ }, enable:function () {
848
+ this.enabled = true
849
+ }, disable:function () {
850
+ this.enabled = false
851
+ }, toggleEnabled:function () {
852
+ this.enabled = !this.enabled
853
+ }, toggle:function () {
854
+ this[this.tip().hasClass('in') ? 'hide' : 'show']()
855
+ }
856
+
857
+ }
858
+
859
+
860
+ /* TOOLTIP PLUGIN DEFINITION
861
+ * ========================= */
862
+
863
+ $.fn.tooltip = function (option) {
864
+ return this.each(function () {
865
+ var $this = $(this)
866
+ , data = $this.data('tooltip')
867
+ , options = typeof option == 'object' && option
868
+ if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
869
+ if (typeof option == 'string') data[option]()
870
+ })
871
+ }
872
+
873
+ $.fn.tooltip.Constructor = Tooltip
874
+
875
+ $.fn.tooltip.defaults = {
876
+ animation:true, placement:'top', selector:false, template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', trigger:'hover', title:'', delay:0
877
+ }
878
+
879
+ }(window.jQuery);
880
+
881
+ /* ===========================================================
882
+ * bootstrap-popover.js v2.0.4
883
+ * http://twitter.github.com/bootstrap/javascript.html#popovers
884
+ * ===========================================================
885
+ * Copyright 2012 Twitter, Inc.
886
+ *
887
+ * Licensed under the Apache License, Version 2.0 (the "License");
888
+ * you may not use this file except in compliance with the License.
889
+ * You may obtain a copy of the License at
890
+ *
891
+ * http://www.apache.org/licenses/LICENSE-2.0
892
+ *
893
+ * Unless required by applicable law or agreed to in writing, software
894
+ * distributed under the License is distributed on an "AS IS" BASIS,
895
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
896
+ * See the License for the specific language governing permissions and
897
+ * limitations under the License.
898
+ * =========================================================== */
899
+
900
+
901
+ !function ($) {
902
+
903
+ "use strict"; // jshint ;_;
904
+
905
+
906
+ /* POPOVER PUBLIC CLASS DEFINITION
907
+ * =============================== */
908
+
909
+ var Popover = function (element, options) {
910
+ this.init('popover', element, options)
911
+ }
912
+
913
+
914
+ /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
915
+ ========================================== */
916
+
917
+ Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
918
+
919
+ constructor:Popover, setContent:function () {
920
+ var $tip = this.tip()
921
+ , title = this.getTitle()
922
+ , content = this.getContent()
923
+
924
+ $tip.find('.popover-title')[this.isHTML(title) ? 'html' : 'text'](title)
925
+ $tip.find('.popover-content > *')[this.isHTML(content) ? 'html' : 'text'](content)
926
+
927
+ $tip.removeClass('fade top bottom left right in')
928
+ }, hasContent:function () {
929
+ return this.getTitle() || this.getContent()
930
+ }, getContent:function () {
931
+ var content
932
+ , $e = this.$element
933
+ , o = this.options
934
+
935
+ content = $e.attr('data-content')
936
+ || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
937
+
938
+ return content
939
+ }, tip:function () {
940
+ if (!this.$tip) {
941
+ this.$tip = $(this.options.template)
942
+ }
943
+ return this.$tip
944
+ }
945
+
946
+ })
947
+
948
+
949
+ /* POPOVER PLUGIN DEFINITION
950
+ * ======================= */
951
+
952
+ $.fn.popover = function (option) {
953
+ return this.each(function () {
954
+ var $this = $(this)
955
+ , data = $this.data('popover')
956
+ , options = typeof option == 'object' && option
957
+ if (!data) $this.data('popover', (data = new Popover(this, options)))
958
+ if (typeof option == 'string') data[option]()
959
+ })
960
+ }
961
+
962
+ $.fn.popover.Constructor = Popover
963
+
964
+ $.fn.popover.defaults = $.extend({}, $.fn.tooltip.defaults, {
965
+ placement:'right', content:'', template:'<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
966
+ })
967
+
968
+ }(window.jQuery);
969
+ /* ==========================================================
970
+ * bootstrap-alert.js v2.0.4
971
+ * http://twitter.github.com/bootstrap/javascript.html#alerts
972
+ * ==========================================================
973
+ * Copyright 2012 Twitter, Inc.
974
+ *
975
+ * Licensed under the Apache License, Version 2.0 (the "License");
976
+ * you may not use this file except in compliance with the License.
977
+ * You may obtain a copy of the License at
978
+ *
979
+ * http://www.apache.org/licenses/LICENSE-2.0
980
+ *
981
+ * Unless required by applicable law or agreed to in writing, software
982
+ * distributed under the License is distributed on an "AS IS" BASIS,
983
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
984
+ * See the License for the specific language governing permissions and
985
+ * limitations under the License.
986
+ * ========================================================== */
987
+
988
+
989
+ !function ($) {
990
+
991
+ "use strict"; // jshint ;_;
992
+
993
+
994
+ /* ALERT CLASS DEFINITION
995
+ * ====================== */
996
+
997
+ var dismiss = '[data-dismiss="alert"]'
998
+ , Alert = function (el) {
999
+ $(el).on('click', dismiss, this.close)
1000
+ }
1001
+
1002
+ Alert.prototype.close = function (e) {
1003
+ var $this = $(this)
1004
+ , selector = $this.attr('data-target')
1005
+ , $parent
1006
+
1007
+ if (!selector) {
1008
+ selector = $this.attr('href')
1009
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
1010
+ }
1011
+
1012
+ $parent = $(selector)
1013
+
1014
+ e && e.preventDefault()
1015
+
1016
+ $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
1017
+
1018
+ $parent.trigger(e = $.Event('close'))
1019
+
1020
+ if (e.isDefaultPrevented()) return
1021
+
1022
+ $parent.removeClass('in')
1023
+
1024
+ function removeElement() {
1025
+ $parent
1026
+ .trigger('closed')
1027
+ .remove()
1028
+ }
1029
+
1030
+ $.support.transition && $parent.hasClass('fade') ?
1031
+ $parent.on($.support.transition.end, removeElement) :
1032
+ removeElement()
1033
+ }
1034
+
1035
+
1036
+ /* ALERT PLUGIN DEFINITION
1037
+ * ======================= */
1038
+
1039
+ $.fn.alert = function (option) {
1040
+ return this.each(function () {
1041
+ var $this = $(this)
1042
+ , data = $this.data('alert')
1043
+ if (!data) $this.data('alert', (data = new Alert(this)))
1044
+ if (typeof option == 'string') data[option].call($this)
1045
+ })
1046
+ }
1047
+
1048
+ $.fn.alert.Constructor = Alert
1049
+
1050
+
1051
+ /* ALERT DATA-API
1052
+ * ============== */
1053
+
1054
+ $(function () {
1055
+ $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
1056
+ })
1057
+
1058
+ }(window.jQuery);
1059
+ /* ============================================================
1060
+ * bootstrap-button.js v2.0.4
1061
+ * http://twitter.github.com/bootstrap/javascript.html#buttons
1062
+ * ============================================================
1063
+ * Copyright 2012 Twitter, Inc.
1064
+ *
1065
+ * Licensed under the Apache License, Version 2.0 (the "License");
1066
+ * you may not use this file except in compliance with the License.
1067
+ * You may obtain a copy of the License at
1068
+ *
1069
+ * http://www.apache.org/licenses/LICENSE-2.0
1070
+ *
1071
+ * Unless required by applicable law or agreed to in writing, software
1072
+ * distributed under the License is distributed on an "AS IS" BASIS,
1073
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1074
+ * See the License for the specific language governing permissions and
1075
+ * limitations under the License.
1076
+ * ============================================================ */
1077
+
1078
+
1079
+ !function ($) {
1080
+
1081
+ "use strict"; // jshint ;_;
1082
+
1083
+
1084
+ /* BUTTON PUBLIC CLASS DEFINITION
1085
+ * ============================== */
1086
+
1087
+ var Button = function (element, options) {
1088
+ this.$element = $(element)
1089
+ this.options = $.extend({}, $.fn.button.defaults, options)
1090
+ }
1091
+
1092
+ Button.prototype.setState = function (state) {
1093
+ var d = 'disabled'
1094
+ , $el = this.$element
1095
+ , data = $el.data()
1096
+ , val = $el.is('input') ? 'val' : 'html'
1097
+
1098
+ state = state + 'Text'
1099
+ data.resetText || $el.data('resetText', $el[val]())
1100
+
1101
+ $el[val](data[state] || this.options[state])
1102
+
1103
+ // push to event loop to allow forms to submit
1104
+ setTimeout(function () {
1105
+ state == 'loadingText' ?
1106
+ $el.addClass(d).attr(d, d) :
1107
+ $el.removeClass(d).removeAttr(d)
1108
+ }, 0)
1109
+ }
1110
+
1111
+ Button.prototype.toggle = function () {
1112
+ var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
1113
+
1114
+ $parent && $parent
1115
+ .find('.active')
1116
+ .removeClass('active')
1117
+
1118
+ this.$element.toggleClass('active')
1119
+ }
1120
+
1121
+
1122
+ /* BUTTON PLUGIN DEFINITION
1123
+ * ======================== */
1124
+
1125
+ $.fn.button = function (option) {
1126
+ return this.each(function () {
1127
+ var $this = $(this)
1128
+ , data = $this.data('button')
1129
+ , options = typeof option == 'object' && option
1130
+ if (!data) $this.data('button', (data = new Button(this, options)))
1131
+ if (option == 'toggle') data.toggle()
1132
+ else if (option) data.setState(option)
1133
+ })
1134
+ }
1135
+
1136
+ $.fn.button.defaults = {
1137
+ loadingText:'loading...'
1138
+ }
1139
+
1140
+ $.fn.button.Constructor = Button
1141
+
1142
+
1143
+ /* BUTTON DATA-API
1144
+ * =============== */
1145
+
1146
+ $(function () {
1147
+ $('body').on('click.button.data-api', '[data-toggle^=button]', function (e) {
1148
+ var $btn = $(e.target)
1149
+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
1150
+ $btn.button('toggle')
1151
+ })
1152
+ })
1153
+
1154
+ }(window.jQuery);
1155
+ /* =============================================================
1156
+ * bootstrap-collapse.js v2.0.4
1157
+ * http://twitter.github.com/bootstrap/javascript.html#collapse
1158
+ * =============================================================
1159
+ * Copyright 2012 Twitter, Inc.
1160
+ *
1161
+ * Licensed under the Apache License, Version 2.0 (the "License");
1162
+ * you may not use this file except in compliance with the License.
1163
+ * You may obtain a copy of the License at
1164
+ *
1165
+ * http://www.apache.org/licenses/LICENSE-2.0
1166
+ *
1167
+ * Unless required by applicable law or agreed to in writing, software
1168
+ * distributed under the License is distributed on an "AS IS" BASIS,
1169
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1170
+ * See the License for the specific language governing permissions and
1171
+ * limitations under the License.
1172
+ * ============================================================ */
1173
+
1174
+
1175
+ !function ($) {
1176
+
1177
+ "use strict"; // jshint ;_;
1178
+
1179
+
1180
+ /* COLLAPSE PUBLIC CLASS DEFINITION
1181
+ * ================================ */
1182
+
1183
+ var Collapse = function (element, options) {
1184
+ this.$element = $(element)
1185
+ this.options = $.extend({}, $.fn.collapse.defaults, options)
1186
+
1187
+ if (this.options.parent) {
1188
+ this.$parent = $(this.options.parent)
1189
+ }
1190
+
1191
+ this.options.toggle && this.toggle()
1192
+ }
1193
+
1194
+ Collapse.prototype = {
1195
+
1196
+ constructor:Collapse, dimension:function () {
1197
+ var hasWidth = this.$element.hasClass('width')
1198
+ return hasWidth ? 'width' : 'height'
1199
+ }, show:function () {
1200
+ var dimension
1201
+ , scroll
1202
+ , actives
1203
+ , hasData
1204
+
1205
+ if (this.transitioning) return
1206
+
1207
+ dimension = this.dimension()
1208
+ scroll = $.camelCase(['scroll', dimension].join('-'))
1209
+ actives = this.$parent && this.$parent.find('> .accordion-group > .in')
1210
+
1211
+ if (actives && actives.length) {
1212
+ hasData = actives.data('collapse')
1213
+ if (hasData && hasData.transitioning) return
1214
+ actives.collapse('hide')
1215
+ hasData || actives.data('collapse', null)
1216
+ }
1217
+
1218
+ this.$element[dimension](0)
1219
+ this.transition('addClass', $.Event('show'), 'shown')
1220
+ this.$element[dimension](this.$element[0][scroll])
1221
+ }, hide:function () {
1222
+ var dimension
1223
+ if (this.transitioning) return
1224
+ dimension = this.dimension()
1225
+ this.reset(this.$element[dimension]())
1226
+ this.transition('removeClass', $.Event('hide'), 'hidden')
1227
+ this.$element[dimension](0)
1228
+ }, reset:function (size) {
1229
+ var dimension = this.dimension()
1230
+
1231
+ this.$element
1232
+ .removeClass('collapse')
1233
+ [dimension](size || 'auto')
1234
+ [0].offsetWidth
1235
+
1236
+ this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
1237
+
1238
+ return this
1239
+ }, transition:function (method, startEvent, completeEvent) {
1240
+ var that = this
1241
+ , complete = function () {
1242
+ if (startEvent.type == 'show') that.reset()
1243
+ that.transitioning = 0
1244
+ that.$element.trigger(completeEvent)
1245
+ }
1246
+
1247
+ this.$element.trigger(startEvent)
1248
+
1249
+ if (startEvent.isDefaultPrevented()) return
1250
+
1251
+ this.transitioning = 1
1252
+
1253
+ this.$element[method]('in')
1254
+
1255
+ $.support.transition && this.$element.hasClass('collapse') ?
1256
+ this.$element.one($.support.transition.end, complete) :
1257
+ complete()
1258
+ }, toggle:function () {
1259
+ this[this.$element.hasClass('in') ? 'hide' : 'show']()
1260
+ }
1261
+
1262
+ }
1263
+
1264
+
1265
+ /* COLLAPSIBLE PLUGIN DEFINITION
1266
+ * ============================== */
1267
+
1268
+ $.fn.collapse = function (option) {
1269
+ return this.each(function () {
1270
+ var $this = $(this)
1271
+ , data = $this.data('collapse')
1272
+ , options = typeof option == 'object' && option
1273
+ if (!data) $this.data('collapse', (data = new Collapse(this, options)))
1274
+ if (typeof option == 'string') data[option]()
1275
+ })
1276
+ }
1277
+
1278
+ $.fn.collapse.defaults = {
1279
+ toggle:true
1280
+ }
1281
+
1282
+ $.fn.collapse.Constructor = Collapse
1283
+
1284
+
1285
+ /* COLLAPSIBLE DATA-API
1286
+ * ==================== */
1287
+
1288
+ $(function () {
1289
+ $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
1290
+ var $this = $(this), href
1291
+ , target = $this.attr('data-target')
1292
+ || e.preventDefault()
1293
+ || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
1294
+ , option = $(target).data('collapse') ? 'toggle' : $this.data()
1295
+ $(target).collapse(option)
1296
+ })
1297
+ })
1298
+
1299
+ }(window.jQuery);
1300
+ /* ==========================================================
1301
+ * bootstrap-carousel.js v2.0.4
1302
+ * http://twitter.github.com/bootstrap/javascript.html#carousel
1303
+ * ==========================================================
1304
+ * Copyright 2012 Twitter, Inc.
1305
+ *
1306
+ * Licensed under the Apache License, Version 2.0 (the "License");
1307
+ * you may not use this file except in compliance with the License.
1308
+ * You may obtain a copy of the License at
1309
+ *
1310
+ * http://www.apache.org/licenses/LICENSE-2.0
1311
+ *
1312
+ * Unless required by applicable law or agreed to in writing, software
1313
+ * distributed under the License is distributed on an "AS IS" BASIS,
1314
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1315
+ * See the License for the specific language governing permissions and
1316
+ * limitations under the License.
1317
+ * ========================================================== */
1318
+
1319
+
1320
+ !function ($) {
1321
+
1322
+ "use strict"; // jshint ;_;
1323
+
1324
+
1325
+ /* CAROUSEL CLASS DEFINITION
1326
+ * ========================= */
1327
+
1328
+ var Carousel = function (element, options) {
1329
+ this.$element = $(element)
1330
+ this.options = options
1331
+ this.options.slide && this.slide(this.options.slide)
1332
+ this.options.pause == 'hover' && this.$element
1333
+ .on('mouseenter', $.proxy(this.pause, this))
1334
+ .on('mouseleave', $.proxy(this.cycle, this))
1335
+ }
1336
+
1337
+ Carousel.prototype = {
1338
+
1339
+ cycle:function (e) {
1340
+ if (!e) this.paused = false
1341
+ this.options.interval
1342
+ && !this.paused
1343
+ && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
1344
+ return this
1345
+ }, to:function (pos) {
1346
+ var $active = this.$element.find('.active')
1347
+ , children = $active.parent().children()
1348
+ , activePos = children.index($active)
1349
+ , that = this
1350
+
1351
+ if (pos > (children.length - 1) || pos < 0) return
1352
+
1353
+ if (this.sliding) {
1354
+ return this.$element.one('slid', function () {
1355
+ that.to(pos)
1356
+ })
1357
+ }
1358
+
1359
+ if (activePos == pos) {
1360
+ return this.pause().cycle()
1361
+ }
1362
+
1363
+ return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
1364
+ }, pause:function (e) {
1365
+ if (!e) this.paused = true
1366
+ clearInterval(this.interval)
1367
+ this.interval = null
1368
+ return this
1369
+ }, next:function () {
1370
+ if (this.sliding) return
1371
+ return this.slide('next')
1372
+ }, prev:function () {
1373
+ if (this.sliding) return
1374
+ return this.slide('prev')
1375
+ }, slide:function (type, next) {
1376
+ var $active = this.$element.find('.active')
1377
+ , $next = next || $active[type]()
1378
+ , isCycling = this.interval
1379
+ , direction = type == 'next' ? 'left' : 'right'
1380
+ , fallback = type == 'next' ? 'first' : 'last'
1381
+ , that = this
1382
+ , e = $.Event('slide')
1383
+
1384
+ this.sliding = true
1385
+
1386
+ isCycling && this.pause()
1387
+
1388
+ $next = $next.length ? $next : this.$element.find('.item')[fallback]()
1389
+
1390
+ if ($next.hasClass('active')) return
1391
+
1392
+ if ($.support.transition && this.$element.hasClass('slide')) {
1393
+ this.$element.trigger(e)
1394
+ if (e.isDefaultPrevented()) return
1395
+ $next.addClass(type)
1396
+ $next[0].offsetWidth // force reflow
1397
+ $active.addClass(direction)
1398
+ $next.addClass(direction)
1399
+ this.$element.one($.support.transition.end, function () {
1400
+ $next.removeClass([type, direction].join(' ')).addClass('active')
1401
+ $active.removeClass(['active', direction].join(' '))
1402
+ that.sliding = false
1403
+ setTimeout(function () {
1404
+ that.$element.trigger('slid')
1405
+ }, 0)
1406
+ })
1407
+ } else {
1408
+ this.$element.trigger(e)
1409
+ if (e.isDefaultPrevented()) return
1410
+ $active.removeClass('active')
1411
+ $next.addClass('active')
1412
+ this.sliding = false
1413
+ this.$element.trigger('slid')
1414
+ }
1415
+
1416
+ isCycling && this.cycle()
1417
+
1418
+ return this
1419
+ }
1420
+
1421
+ }
1422
+
1423
+
1424
+ /* CAROUSEL PLUGIN DEFINITION
1425
+ * ========================== */
1426
+
1427
+ $.fn.carousel = function (option) {
1428
+ return this.each(function () {
1429
+ var $this = $(this)
1430
+ , data = $this.data('carousel')
1431
+ , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
1432
+ if (!data) $this.data('carousel', (data = new Carousel(this, options)))
1433
+ if (typeof option == 'number') data.to(option)
1434
+ else if (typeof option == 'string' || (option = options.slide)) data[option]()
1435
+ else if (options.interval) data.cycle()
1436
+ })
1437
+ }
1438
+
1439
+ $.fn.carousel.defaults = {
1440
+ interval:5000, pause:'hover'
1441
+ }
1442
+
1443
+ $.fn.carousel.Constructor = Carousel
1444
+
1445
+
1446
+ /* CAROUSEL DATA-API
1447
+ * ================= */
1448
+
1449
+ $(function () {
1450
+ $('body').on('click.carousel.data-api', '[data-slide]', function (e) {
1451
+ var $this = $(this), href
1452
+ , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
1453
+ , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
1454
+ $target.carousel(options)
1455
+ e.preventDefault()
1456
+ })
1457
+ })
1458
+
1459
+ }(window.jQuery);
1460
+ /* =============================================================
1461
+ * bootstrap-typeahead.js v2.0.4
1462
+ * http://twitter.github.com/bootstrap/javascript.html#typeahead
1463
+ * =============================================================
1464
+ * Copyright 2012 Twitter, Inc.
1465
+ *
1466
+ * Licensed under the Apache License, Version 2.0 (the "License");
1467
+ * you may not use this file except in compliance with the License.
1468
+ * You may obtain a copy of the License at
1469
+ *
1470
+ * http://www.apache.org/licenses/LICENSE-2.0
1471
+ *
1472
+ * Unless required by applicable law or agreed to in writing, software
1473
+ * distributed under the License is distributed on an "AS IS" BASIS,
1474
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1475
+ * See the License for the specific language governing permissions and
1476
+ * limitations under the License.
1477
+ * ============================================================ */
1478
+
1479
+
1480
+ !function ($) {
1481
+
1482
+ "use strict"
1483
+
1484
+ var Typeahead = function (element, options) {
1485
+ this.$element = $(element)
1486
+ this.options = $.extend({}, $.fn.typeahead.defaults, options)
1487
+ this.assigner = this.options.assigner || this.assigner
1488
+ this.matcher = this.options.matcher || this.matcher
1489
+ this.sorter = this.options.sorter || this.sorter
1490
+ this.highlighter = this.options.highlighter || this.highlighter
1491
+ this.$menu = $(this.options.menu).appendTo('body')
1492
+ this.source = this.options.source
1493
+ this.onselect = this.options.onselect
1494
+ this.strings = true
1495
+ this.shown = false
1496
+ this.listen()
1497
+ }
1498
+
1499
+ Typeahead.prototype = {
1500
+
1501
+ constructor:Typeahead, select:function () {
1502
+ var val = JSON.parse(this.$menu.find('.active').attr('data-value'))
1503
+ , text
1504
+
1505
+ if (!this.strings) text = val[this.options.property]
1506
+ else text = val
1507
+
1508
+ this.assigner(text, val)
1509
+
1510
+ if (typeof this.onselect == "function")
1511
+ this.onselect(val)
1512
+
1513
+ return this.hide()
1514
+ }, assigner:function (text) {
1515
+ this.$element.val(text)
1516
+ }, show:function () {
1517
+ var pos = $.extend({}, this.$element.offset(), {
1518
+ height:this.$element[0].offsetHeight
1519
+ })
1520
+
1521
+ this.$menu.css({
1522
+ top:pos.top + pos.height, left:pos.left
1523
+ })
1524
+
1525
+ this.$menu.show()
1526
+ this.shown = true
1527
+ return this
1528
+ }, hide:function () {
1529
+ this.$menu.hide()
1530
+ this.shown = false
1531
+ return this
1532
+ }, lookup:function (event) {
1533
+ var that = this
1534
+ , items
1535
+ , q
1536
+ , value
1537
+
1538
+ this.query = this.$element.val()
1539
+
1540
+ if (typeof this.source == "function") {
1541
+ value = this.source(this, this.query, event)
1542
+ if (value) this.process(value)
1543
+ } else {
1544
+ this.process(this.source)
1545
+ }
1546
+ }, process:function (results) {
1547
+ var that = this
1548
+ , items
1549
+ , q
1550
+
1551
+ if (results.length && typeof results[0] != "string")
1552
+ this.strings = false
1553
+
1554
+ this.query = this.$element.val()
1555
+
1556
+ if (!this.query) {
1557
+ return this.shown ? this.hide() : this
1558
+ }
1559
+
1560
+ items = $.grep(results, function (item) {
1561
+ if (!that.strings)
1562
+ item = item[that.options.property]
1563
+ if (that.matcher(item)) return item
1564
+ })
1565
+
1566
+ items = this.sorter(items)
1567
+
1568
+ if (!items.length) {
1569
+ return this.shown ? this.hide() : this
1570
+ }
1571
+
1572
+ return this.render(items.slice(0, this.options.items)).show()
1573
+ }, matcher:function (item) {
1574
+ return ~item.toLowerCase().indexOf(this.query.toLowerCase())
1575
+ }, sorter:function (items) {
1576
+ var beginswith = []
1577
+ , caseSensitive = []
1578
+ , caseInsensitive = []
1579
+ , item
1580
+ , sortby
1581
+
1582
+ while (item = items.shift()) {
1583
+ if (this.strings) sortby = item
1584
+ else sortby = item[this.options.property]
1585
+
1586
+ if (!sortby.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
1587
+ else if (~sortby.indexOf(this.query)) caseSensitive.push(item)
1588
+ else caseInsensitive.push(item)
1589
+ }
1590
+
1591
+ return beginswith.concat(caseSensitive, caseInsensitive)
1592
+ }, highlighter:function (item) {
1593
+ return item.replace(('(' + this.query + ')').toRegExp('ig'), function ($1, match) {
1594
+ return '<strong>' + match + '</strong>'
1595
+ })
1596
+ }, render:function (items) {
1597
+ var that = this
1598
+
1599
+ items = $(items).map(function (i, item) {
1600
+ i = $(that.options.item).attr('data-value', JSON.stringify(item))
1601
+ if (!that.strings)
1602
+ item = item[that.options.property]
1603
+ i.find('a').html(that.highlighter(item))
1604
+ return i[0]
1605
+ })
1606
+
1607
+ items.first().addClass('active')
1608
+ this.$menu.html(items)
1609
+ return this
1610
+ }, next:function (event) {
1611
+ var active = this.$menu.find('.active').removeClass('active')
1612
+ , next = active.next()
1613
+
1614
+ if (!next.length) {
1615
+ next = $(this.$menu.find('li')[0])
1616
+ }
1617
+
1618
+ next.addClass('active')
1619
+ }, prev:function (event) {
1620
+ var active = this.$menu.find('.active').removeClass('active')
1621
+ , prev = active.prev()
1622
+
1623
+ if (!prev.length) {
1624
+ prev = this.$menu.find('li').last()
1625
+ }
1626
+
1627
+ prev.addClass('active')
1628
+ }, listen:function () {
1629
+ this.$element
1630
+ .on('blur', $.proxy(this.blur, this))
1631
+ .on('keypress', $.proxy(this.keypress, this))
1632
+ .on('keyup', $.proxy(this.keyup, this))
1633
+
1634
+ if ($.browser.webkit || $.browser.msie) {
1635
+ this.$element.on('keydown', $.proxy(this.keypress, this))
1636
+ }
1637
+
1638
+ this.$menu
1639
+ .on('click', $.proxy(this.click, this))
1640
+ .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
1641
+ }, keyup:function (e) {
1642
+ e.stopPropagation()
1643
+ e.preventDefault()
1644
+
1645
+ switch (e.keyCode) {
1646
+ case 40: // down arrow
1647
+ case 38: // up arrow
1648
+ break
1649
+
1650
+ case 9: // tab
1651
+ case 13: // enter
1652
+ if (!this.shown) return
1653
+ this.select()
1654
+ break
1655
+
1656
+ case 27: // escape
1657
+ this.hide()
1658
+ break
1659
+
1660
+ default:
1661
+ this.lookup(e)
1662
+ }
1663
+
1664
+ }, keypress:function (e) {
1665
+ e.stopPropagation()
1666
+ if (!this.shown) return
1667
+
1668
+ switch (e.keyCode) {
1669
+ case 9: // tab
1670
+ case 13: // enter
1671
+ case 27: // escape
1672
+ e.preventDefault()
1673
+ break
1674
+
1675
+ case 38: // up arrow
1676
+ e.preventDefault()
1677
+ this.prev()
1678
+ break
1679
+
1680
+ case 40: // down arrow
1681
+ e.preventDefault()
1682
+ this.next()
1683
+ break
1684
+ }
1685
+ }, blur:function (e) {
1686
+ var that = this
1687
+ e.stopPropagation()
1688
+ e.preventDefault()
1689
+ setTimeout(function () {
1690
+ that.hide()
1691
+ }, 150)
1692
+ }, click:function (e) {
1693
+ e.stopPropagation()
1694
+ e.preventDefault()
1695
+ this.select()
1696
+ }, mouseenter:function (e) {
1697
+ this.$menu.find('.active').removeClass('active')
1698
+ $(e.currentTarget).addClass('active')
1699
+ }
1700
+
1701
+ }
1702
+
1703
+
1704
+ /* TYPEAHEAD PLUGIN DEFINITION
1705
+ * =========================== */
1706
+
1707
+ $.fn.typeahead = function (option) {
1708
+ return this.each(function () {
1709
+ var $this = $(this)
1710
+ , data = $this.data('typeahead')
1711
+ , options = typeof option == 'object' && option
1712
+ if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
1713
+ if (typeof option == 'string') data[option]()
1714
+ //FIX: hide browser default autocomplete
1715
+ $this.attr('autocomplete', 'off')
1716
+ })
1717
+ }
1718
+
1719
+ $.fn.typeahead.defaults = {
1720
+ source:[], items:8, menu:'<ul class="typeahead dropdown-menu"></ul>', item:'<li><a href="#"></a></li>', onselect:null, property:'value'
1721
+ }
1722
+
1723
+ $.fn.typeahead.Constructor = Typeahead
1724
+
1725
+
1726
+ /* TYPEAHEAD DATA-API
1727
+ * ================== */
1728
+
1729
+ $(function () {
1730
+ $('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
1731
+ var $this = $(this)
1732
+ if ($this.data('typeahead')) return
1733
+ e.preventDefault()
1734
+ $this.typeahead($this.data())
1735
+ })
1736
+ })
1737
+
1738
1738
  }(window.jQuery);