bootstrap-sass 2.3.1.3 → 3.0.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bootstrap-sass might be problematic. Click here for more details.

Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +15 -0
  3. data/.travis.yml +12 -0
  4. data/CHANGELOG.md +104 -0
  5. data/CONTRIBUTING.md +79 -0
  6. data/Gemfile +3 -0
  7. data/README.md +114 -78
  8. data/Rakefile +48 -0
  9. data/bootstrap-sass.gemspec +28 -0
  10. data/lib/bootstrap-sass/engine.rb +4 -2
  11. data/lib/bootstrap-sass/version.rb +4 -0
  12. data/lib/bootstrap-sass.rb +10 -5
  13. data/tasks/converter.rb +829 -0
  14. data/templates/project/_variables.scss.erb +3 -0
  15. data/templates/project/manifest.rb +10 -13
  16. data/templates/project/styles.scss +1 -6
  17. data/test/compass_test.rb +8 -0
  18. data/test/compilation_test.rb +13 -0
  19. data/test/dummy/README.rdoc +3 -0
  20. data/test/dummy/Rakefile +6 -0
  21. data/test/dummy/app/assets/images/.keep +0 -0
  22. data/test/dummy/app/assets/javascripts/application.js +2 -0
  23. data/test/dummy/app/assets/stylesheets/application.css.sass +1 -0
  24. data/test/dummy/app/controllers/application_controller.rb +5 -0
  25. data/test/dummy/app/controllers/pages_controller.rb +4 -0
  26. data/test/dummy/app/helpers/application_helper.rb +2 -0
  27. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  28. data/test/dummy/app/views/pages/root.html.slim +11 -0
  29. data/test/dummy/bin/bundle +3 -0
  30. data/test/dummy/bin/rails +4 -0
  31. data/test/dummy/bin/rake +4 -0
  32. data/test/dummy/config/application.rb +17 -0
  33. data/test/dummy/config/boot.rb +5 -0
  34. data/test/dummy/config/environment.rb +5 -0
  35. data/test/dummy/config/environments/development.rb +26 -0
  36. data/test/dummy/config/environments/production.rb +76 -0
  37. data/test/dummy/config/environments/test.rb +30 -0
  38. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  39. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  40. data/test/dummy/config/initializers/inflections.rb +16 -0
  41. data/test/dummy/config/initializers/mime_types.rb +5 -0
  42. data/test/dummy/config/initializers/secret_token.rb +18 -0
  43. data/test/dummy/config/initializers/session_store.rb +3 -0
  44. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  45. data/test/dummy/config/locales/en.yml +3 -0
  46. data/test/dummy/config/locales/es.yml +3 -0
  47. data/test/dummy/config/routes.rb +3 -0
  48. data/test/dummy/config.ru +4 -0
  49. data/test/dummy/db/test.sqlite3 +0 -0
  50. data/test/dummy/lib/assets/.keep +0 -0
  51. data/test/dummy/log/.keep +0 -0
  52. data/test/dummy/log/development.log +0 -0
  53. data/test/dummy/public/404.html +58 -0
  54. data/test/dummy/public/422.html +58 -0
  55. data/test/dummy/public/500.html +57 -0
  56. data/test/dummy/public/favicon.ico +0 -0
  57. data/test/gemfiles/sass_3_2.gemfile +5 -0
  58. data/test/gemfiles/sass_head.gemfile +6 -0
  59. data/test/pages_test.rb +14 -0
  60. data/test/support/integration_test.rb +29 -0
  61. data/test/test_helper.rb +32 -0
  62. data/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
  63. data/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.svg +228 -0
  64. data/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  65. data/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
  66. data/vendor/assets/javascripts/bootstrap/affix.js +126 -0
  67. data/vendor/assets/javascripts/bootstrap/alert.js +98 -0
  68. data/vendor/assets/javascripts/bootstrap/button.js +109 -0
  69. data/vendor/assets/javascripts/bootstrap/carousel.js +217 -0
  70. data/vendor/assets/javascripts/bootstrap/collapse.js +179 -0
  71. data/vendor/assets/javascripts/bootstrap/dropdown.js +154 -0
  72. data/vendor/assets/javascripts/bootstrap/modal.js +246 -0
  73. data/vendor/assets/javascripts/bootstrap/popover.js +117 -0
  74. data/vendor/assets/javascripts/bootstrap/scrollspy.js +158 -0
  75. data/vendor/assets/javascripts/bootstrap/tab.js +135 -0
  76. data/vendor/assets/javascripts/bootstrap/tooltip.js +386 -0
  77. data/vendor/assets/javascripts/bootstrap/transition.js +56 -0
  78. data/vendor/assets/javascripts/bootstrap.js +12 -13
  79. data/vendor/assets/stylesheets/bootstrap/_alerts.scss +46 -58
  80. data/vendor/assets/stylesheets/bootstrap/_badges.scss +51 -0
  81. data/vendor/assets/stylesheets/bootstrap/_breadcrumbs.scss +8 -9
  82. data/vendor/assets/stylesheets/bootstrap/_button-groups.scss +173 -154
  83. data/vendor/assets/stylesheets/bootstrap/_buttons.scss +97 -165
  84. data/vendor/assets/stylesheets/bootstrap/_carousel.scss +116 -65
  85. data/vendor/assets/stylesheets/bootstrap/_close.scss +11 -8
  86. data/vendor/assets/stylesheets/bootstrap/_code.scss +16 -21
  87. data/vendor/assets/stylesheets/bootstrap/_component-animations.scss +10 -3
  88. data/vendor/assets/stylesheets/bootstrap/_dropdowns.scss +103 -146
  89. data/vendor/assets/stylesheets/bootstrap/_forms.scss +222 -559
  90. data/vendor/assets/stylesheets/bootstrap/_glyphicons.scss +232 -0
  91. data/vendor/assets/stylesheets/bootstrap/_grid.scss +336 -11
  92. data/vendor/assets/stylesheets/bootstrap/_input-groups.scss +127 -0
  93. data/vendor/assets/stylesheets/bootstrap/_jumbotron.scss +40 -0
  94. data/vendor/assets/stylesheets/bootstrap/_labels.scss +58 -0
  95. data/vendor/assets/stylesheets/bootstrap/_list-group.scss +90 -0
  96. data/vendor/assets/stylesheets/bootstrap/_media.scss +8 -7
  97. data/vendor/assets/stylesheets/bootstrap/_mixins.scss +470 -430
  98. data/vendor/assets/stylesheets/bootstrap/_modals.scss +103 -52
  99. data/vendor/assets/stylesheets/bootstrap/_navbar.scss +511 -383
  100. data/vendor/assets/stylesheets/bootstrap/_navs.scss +169 -349
  101. data/vendor/assets/stylesheets/bootstrap/_normalize.scss +396 -0
  102. data/vendor/assets/stylesheets/bootstrap/_pager.scss +45 -33
  103. data/vendor/assets/stylesheets/bootstrap/_pagination.scss +65 -105
  104. data/vendor/assets/stylesheets/bootstrap/_panels.scss +148 -0
  105. data/vendor/assets/stylesheets/bootstrap/_popovers.scss +51 -51
  106. data/vendor/assets/stylesheets/bootstrap/_print.scss +100 -0
  107. data/vendor/assets/stylesheets/bootstrap/_progress-bars.scss +28 -55
  108. data/vendor/assets/stylesheets/bootstrap/_responsive-utilities.scss +180 -45
  109. data/vendor/assets/stylesheets/bootstrap/_scaffolding.scss +101 -24
  110. data/vendor/assets/stylesheets/bootstrap/_tables.scss +169 -168
  111. data/vendor/assets/stylesheets/bootstrap/_theme.scss +232 -0
  112. data/vendor/assets/stylesheets/bootstrap/_thumbnails.scss +11 -33
  113. data/vendor/assets/stylesheets/bootstrap/_tooltip.scss +45 -20
  114. data/vendor/assets/stylesheets/bootstrap/_type.scss +101 -110
  115. data/vendor/assets/stylesheets/bootstrap/_utilities.scss +19 -22
  116. data/vendor/assets/stylesheets/bootstrap/_variables.scss +498 -179
  117. data/vendor/assets/stylesheets/bootstrap/_wells.scss +7 -7
  118. data/vendor/assets/stylesheets/bootstrap/bootstrap.scss +29 -33
  119. metadata +226 -44
  120. data/templates/project/_variables.scss +0 -301
  121. data/vendor/assets/images/glyphicons-halflings-white.png +0 -0
  122. data/vendor/assets/images/glyphicons-halflings.png +0 -0
  123. data/vendor/assets/javascripts/bootstrap-affix.js +0 -117
  124. data/vendor/assets/javascripts/bootstrap-alert.js +0 -99
  125. data/vendor/assets/javascripts/bootstrap-button.js +0 -105
  126. data/vendor/assets/javascripts/bootstrap-carousel.js +0 -207
  127. data/vendor/assets/javascripts/bootstrap-collapse.js +0 -167
  128. data/vendor/assets/javascripts/bootstrap-dropdown.js +0 -165
  129. data/vendor/assets/javascripts/bootstrap-modal.js +0 -247
  130. data/vendor/assets/javascripts/bootstrap-popover.js +0 -114
  131. data/vendor/assets/javascripts/bootstrap-scrollspy.js +0 -162
  132. data/vendor/assets/javascripts/bootstrap-tab.js +0 -144
  133. data/vendor/assets/javascripts/bootstrap-tooltip.js +0 -361
  134. data/vendor/assets/javascripts/bootstrap-transition.js +0 -60
  135. data/vendor/assets/javascripts/bootstrap-typeahead.js +0 -335
  136. data/vendor/assets/stylesheets/bootstrap/_accordion.scss +0 -34
  137. data/vendor/assets/stylesheets/bootstrap/_hero-unit.scss +0 -25
  138. data/vendor/assets/stylesheets/bootstrap/_labels-badges.scss +0 -83
  139. data/vendor/assets/stylesheets/bootstrap/_layouts.scss +0 -16
  140. data/vendor/assets/stylesheets/bootstrap/_reset.scss +0 -216
  141. data/vendor/assets/stylesheets/bootstrap/_responsive-1200px-min.scss +0 -28
  142. data/vendor/assets/stylesheets/bootstrap/_responsive-767px-max.scss +0 -193
  143. data/vendor/assets/stylesheets/bootstrap/_responsive-768px-979px.scss +0 -19
  144. data/vendor/assets/stylesheets/bootstrap/_responsive-navbar.scss +0 -189
  145. data/vendor/assets/stylesheets/bootstrap/_sprites.scss +0 -197
  146. data/vendor/assets/stylesheets/bootstrap/responsive.scss +0 -48
  147. data/vendor/assets/stylesheets/bootstrap-responsive.scss +0 -1
@@ -0,0 +1,246 @@
1
+ /* ========================================================================
2
+ * Bootstrap: modal.js v3.0.0
3
+ * http://twbs.github.com/bootstrap/javascript.html#modals
4
+ * ========================================================================
5
+ * Copyright 2012 Twitter, Inc.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ * ======================================================================== */
19
+
20
+
21
+ +function ($) { "use strict";
22
+
23
+ // MODAL CLASS DEFINITION
24
+ // ======================
25
+
26
+ var Modal = function (element, options) {
27
+ this.options = options
28
+ this.$element = $(element)
29
+ this.$backdrop =
30
+ this.isShown = null
31
+
32
+ if (this.options.remote) this.$element.load(this.options.remote)
33
+ }
34
+
35
+ Modal.DEFAULTS = {
36
+ backdrop: true
37
+ , keyboard: true
38
+ , show: true
39
+ }
40
+
41
+ Modal.prototype.toggle = function (_relatedTarget) {
42
+ return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
43
+ }
44
+
45
+ Modal.prototype.show = function (_relatedTarget) {
46
+ var that = this
47
+ var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
48
+
49
+ this.$element.trigger(e)
50
+
51
+ if (this.isShown || e.isDefaultPrevented()) return
52
+
53
+ this.isShown = true
54
+
55
+ this.escape()
56
+
57
+ this.$element.on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
58
+
59
+ this.backdrop(function () {
60
+ var transition = $.support.transition && that.$element.hasClass('fade')
61
+
62
+ if (!that.$element.parent().length) {
63
+ that.$element.appendTo(document.body) // don't move modals dom position
64
+ }
65
+
66
+ that.$element.show()
67
+
68
+ if (transition) {
69
+ that.$element[0].offsetWidth // force reflow
70
+ }
71
+
72
+ that.$element
73
+ .addClass('in')
74
+ .attr('aria-hidden', false)
75
+
76
+ that.enforceFocus()
77
+
78
+ var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
79
+
80
+ transition ?
81
+ that.$element.find('.modal-dialog') // wait for modal to slide in
82
+ .one($.support.transition.end, function () {
83
+ that.$element.focus().trigger(e)
84
+ })
85
+ .emulateTransitionEnd(300) :
86
+ that.$element.focus().trigger(e)
87
+ })
88
+ }
89
+
90
+ Modal.prototype.hide = function (e) {
91
+ if (e) e.preventDefault()
92
+
93
+ e = $.Event('hide.bs.modal')
94
+
95
+ this.$element.trigger(e)
96
+
97
+ if (!this.isShown || e.isDefaultPrevented()) return
98
+
99
+ this.isShown = false
100
+
101
+ this.escape()
102
+
103
+ $(document).off('focusin.bs.modal')
104
+
105
+ this.$element
106
+ .removeClass('in')
107
+ .attr('aria-hidden', true)
108
+ .off('click.dismiss.modal')
109
+
110
+ $.support.transition && this.$element.hasClass('fade') ?
111
+ this.$element
112
+ .one($.support.transition.end, $.proxy(this.hideModal, this))
113
+ .emulateTransitionEnd(300) :
114
+ this.hideModal()
115
+ }
116
+
117
+ Modal.prototype.enforceFocus = function () {
118
+ $(document)
119
+ .off('focusin.bs.modal') // guard against infinite focus loop
120
+ .on('focusin.bs.modal', $.proxy(function (e) {
121
+ if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
122
+ this.$element.focus()
123
+ }
124
+ }, this))
125
+ }
126
+
127
+ Modal.prototype.escape = function () {
128
+ if (this.isShown && this.options.keyboard) {
129
+ this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
130
+ e.which == 27 && this.hide()
131
+ }, this))
132
+ } else if (!this.isShown) {
133
+ this.$element.off('keyup.dismiss.bs.modal')
134
+ }
135
+ }
136
+
137
+ Modal.prototype.hideModal = function () {
138
+ var that = this
139
+ this.$element.hide()
140
+ this.backdrop(function () {
141
+ that.removeBackdrop()
142
+ that.$element.trigger('hidden.bs.modal')
143
+ })
144
+ }
145
+
146
+ Modal.prototype.removeBackdrop = function () {
147
+ this.$backdrop && this.$backdrop.remove()
148
+ this.$backdrop = null
149
+ }
150
+
151
+ Modal.prototype.backdrop = function (callback) {
152
+ var that = this
153
+ var animate = this.$element.hasClass('fade') ? 'fade' : ''
154
+
155
+ if (this.isShown && this.options.backdrop) {
156
+ var doAnimate = $.support.transition && animate
157
+
158
+ this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
159
+ .appendTo(document.body)
160
+
161
+ this.$element.on('click.dismiss.modal', $.proxy(function (e) {
162
+ if (e.target !== e.currentTarget) return
163
+ this.options.backdrop == 'static'
164
+ ? this.$element[0].focus.call(this.$element[0])
165
+ : this.hide.call(this)
166
+ }, this))
167
+
168
+ if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
169
+
170
+ this.$backdrop.addClass('in')
171
+
172
+ if (!callback) return
173
+
174
+ doAnimate ?
175
+ this.$backdrop
176
+ .one($.support.transition.end, callback)
177
+ .emulateTransitionEnd(150) :
178
+ callback()
179
+
180
+ } else if (!this.isShown && this.$backdrop) {
181
+ this.$backdrop.removeClass('in')
182
+
183
+ $.support.transition && this.$element.hasClass('fade')?
184
+ this.$backdrop
185
+ .one($.support.transition.end, callback)
186
+ .emulateTransitionEnd(150) :
187
+ callback()
188
+
189
+ } else if (callback) {
190
+ callback()
191
+ }
192
+ }
193
+
194
+
195
+ // MODAL PLUGIN DEFINITION
196
+ // =======================
197
+
198
+ var old = $.fn.modal
199
+
200
+ $.fn.modal = function (option, _relatedTarget) {
201
+ return this.each(function () {
202
+ var $this = $(this)
203
+ var data = $this.data('bs.modal')
204
+ var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
205
+
206
+ if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
207
+ if (typeof option == 'string') data[option](_relatedTarget)
208
+ else if (options.show) data.show(_relatedTarget)
209
+ })
210
+ }
211
+
212
+ $.fn.modal.Constructor = Modal
213
+
214
+
215
+ // MODAL NO CONFLICT
216
+ // =================
217
+
218
+ $.fn.modal.noConflict = function () {
219
+ $.fn.modal = old
220
+ return this
221
+ }
222
+
223
+
224
+ // MODAL DATA-API
225
+ // ==============
226
+
227
+ $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
228
+ var $this = $(this)
229
+ var href = $this.attr('href')
230
+ var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
231
+ var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
232
+
233
+ e.preventDefault()
234
+
235
+ $target
236
+ .modal(option, this)
237
+ .one('hide', function () {
238
+ $this.is(':visible') && $this.focus()
239
+ })
240
+ })
241
+
242
+ $(document)
243
+ .on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
244
+ .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
245
+
246
+ }(window.jQuery);
@@ -0,0 +1,117 @@
1
+ /* ========================================================================
2
+ * Bootstrap: popover.js v3.0.0
3
+ * http://twbs.github.com/bootstrap/javascript.html#popovers
4
+ * ========================================================================
5
+ * Copyright 2012 Twitter, Inc.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ * ======================================================================== */
19
+
20
+
21
+ +function ($) { "use strict";
22
+
23
+ // POPOVER PUBLIC CLASS DEFINITION
24
+ // ===============================
25
+
26
+ var Popover = function (element, options) {
27
+ this.init('popover', element, options)
28
+ }
29
+
30
+ if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
31
+
32
+ Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, {
33
+ placement: 'right'
34
+ , trigger: 'click'
35
+ , content: ''
36
+ , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
37
+ })
38
+
39
+
40
+ // NOTE: POPOVER EXTENDS tooltip.js
41
+ // ================================
42
+
43
+ Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
44
+
45
+ Popover.prototype.constructor = Popover
46
+
47
+ Popover.prototype.getDefaults = function () {
48
+ return Popover.DEFAULTS
49
+ }
50
+
51
+ Popover.prototype.setContent = function () {
52
+ var $tip = this.tip()
53
+ var title = this.getTitle()
54
+ var content = this.getContent()
55
+
56
+ $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
57
+ $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
58
+
59
+ $tip.removeClass('fade top bottom left right in')
60
+
61
+ // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
62
+ // this manually by checking the contents.
63
+ if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
64
+ }
65
+
66
+ Popover.prototype.hasContent = function () {
67
+ return this.getTitle() || this.getContent()
68
+ }
69
+
70
+ Popover.prototype.getContent = function () {
71
+ var $e = this.$element
72
+ var o = this.options
73
+
74
+ return $e.attr('data-content')
75
+ || (typeof o.content == 'function' ?
76
+ o.content.call($e[0]) :
77
+ o.content)
78
+ }
79
+
80
+ Popover.prototype.arrow = function () {
81
+ return this.$arrow = this.$arrow || this.tip().find('.arrow')
82
+ }
83
+
84
+ Popover.prototype.tip = function () {
85
+ if (!this.$tip) this.$tip = $(this.options.template)
86
+ return this.$tip
87
+ }
88
+
89
+
90
+ // POPOVER PLUGIN DEFINITION
91
+ // =========================
92
+
93
+ var old = $.fn.popover
94
+
95
+ $.fn.popover = function (option) {
96
+ return this.each(function () {
97
+ var $this = $(this)
98
+ var data = $this.data('bs.popover')
99
+ var options = typeof option == 'object' && option
100
+
101
+ if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
102
+ if (typeof option == 'string') data[option]()
103
+ })
104
+ }
105
+
106
+ $.fn.popover.Constructor = Popover
107
+
108
+
109
+ // POPOVER NO CONFLICT
110
+ // ===================
111
+
112
+ $.fn.popover.noConflict = function () {
113
+ $.fn.popover = old
114
+ return this
115
+ }
116
+
117
+ }(window.jQuery);
@@ -0,0 +1,158 @@
1
+ /* ========================================================================
2
+ * Bootstrap: scrollspy.js v3.0.0
3
+ * http://twbs.github.com/bootstrap/javascript.html#scrollspy
4
+ * ========================================================================
5
+ * Copyright 2012 Twitter, Inc.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ * ======================================================================== */
19
+
20
+
21
+ +function ($) { "use strict";
22
+
23
+ // SCROLLSPY CLASS DEFINITION
24
+ // ==========================
25
+
26
+ function ScrollSpy(element, options) {
27
+ var href
28
+ var process = $.proxy(this.process, this)
29
+
30
+ this.$element = $(element).is('body') ? $(window) : $(element)
31
+ this.$body = $('body')
32
+ this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
33
+ this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
34
+ this.selector = (this.options.target
35
+ || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
36
+ || '') + ' .nav li > a'
37
+ this.offsets = $([])
38
+ this.targets = $([])
39
+ this.activeTarget = null
40
+
41
+ this.refresh()
42
+ this.process()
43
+ }
44
+
45
+ ScrollSpy.DEFAULTS = {
46
+ offset: 10
47
+ }
48
+
49
+ ScrollSpy.prototype.refresh = function () {
50
+ var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
51
+
52
+ this.offsets = $([])
53
+ this.targets = $([])
54
+
55
+ var self = this
56
+ var $targets = this.$body
57
+ .find(this.selector)
58
+ .map(function () {
59
+ var $el = $(this)
60
+ var href = $el.data('target') || $el.attr('href')
61
+ var $href = /^#\w/.test(href) && $(href)
62
+
63
+ return ($href
64
+ && $href.length
65
+ && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
66
+ })
67
+ .sort(function (a, b) { return a[0] - b[0] })
68
+ .each(function () {
69
+ self.offsets.push(this[0])
70
+ self.targets.push(this[1])
71
+ })
72
+ }
73
+
74
+ ScrollSpy.prototype.process = function () {
75
+ var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
76
+ var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
77
+ var maxScroll = scrollHeight - this.$scrollElement.height()
78
+ var offsets = this.offsets
79
+ var targets = this.targets
80
+ var activeTarget = this.activeTarget
81
+ var i
82
+
83
+ if (scrollTop >= maxScroll) {
84
+ return activeTarget != (i = targets.last()[0]) && this.activate(i)
85
+ }
86
+
87
+ for (i = offsets.length; i--;) {
88
+ activeTarget != targets[i]
89
+ && scrollTop >= offsets[i]
90
+ && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
91
+ && this.activate( targets[i] )
92
+ }
93
+ }
94
+
95
+ ScrollSpy.prototype.activate = function (target) {
96
+ this.activeTarget = target
97
+
98
+ $(this.selector)
99
+ .parents('.active')
100
+ .removeClass('active')
101
+
102
+ var selector = this.selector
103
+ + '[data-target="' + target + '"],'
104
+ + this.selector + '[href="' + target + '"]'
105
+
106
+ var active = $(selector)
107
+ .parents('li')
108
+ .addClass('active')
109
+
110
+ if (active.parent('.dropdown-menu').length) {
111
+ active = active
112
+ .closest('li.dropdown')
113
+ .addClass('active')
114
+ }
115
+
116
+ active.trigger('activate')
117
+ }
118
+
119
+
120
+ // SCROLLSPY PLUGIN DEFINITION
121
+ // ===========================
122
+
123
+ var old = $.fn.scrollspy
124
+
125
+ $.fn.scrollspy = function (option) {
126
+ return this.each(function () {
127
+ var $this = $(this)
128
+ var data = $this.data('bs.scrollspy')
129
+ var options = typeof option == 'object' && option
130
+
131
+ if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
132
+ if (typeof option == 'string') data[option]()
133
+ })
134
+ }
135
+
136
+ $.fn.scrollspy.Constructor = ScrollSpy
137
+
138
+
139
+ // SCROLLSPY NO CONFLICT
140
+ // =====================
141
+
142
+ $.fn.scrollspy.noConflict = function () {
143
+ $.fn.scrollspy = old
144
+ return this
145
+ }
146
+
147
+
148
+ // SCROLLSPY DATA-API
149
+ // ==================
150
+
151
+ $(window).on('load', function () {
152
+ $('[data-spy="scroll"]').each(function () {
153
+ var $spy = $(this)
154
+ $spy.scrollspy($spy.data())
155
+ })
156
+ })
157
+
158
+ }(window.jQuery);
@@ -0,0 +1,135 @@
1
+ /* ========================================================================
2
+ * Bootstrap: tab.js v3.0.0
3
+ * http://twbs.github.com/bootstrap/javascript.html#tabs
4
+ * ========================================================================
5
+ * Copyright 2012 Twitter, Inc.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ * ======================================================================== */
19
+
20
+
21
+ +function ($) { "use strict";
22
+
23
+ // TAB CLASS DEFINITION
24
+ // ====================
25
+
26
+ var Tab = function (element) {
27
+ this.element = $(element)
28
+ }
29
+
30
+ Tab.prototype.show = function () {
31
+ var $this = this.element
32
+ var $ul = $this.closest('ul:not(.dropdown-menu)')
33
+ var selector = $this.attr('data-target')
34
+
35
+ if (!selector) {
36
+ selector = $this.attr('href')
37
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
38
+ }
39
+
40
+ if ($this.parent('li').hasClass('active')) return
41
+
42
+ var previous = $ul.find('.active:last a')[0]
43
+ var e = $.Event('show.bs.tab', {
44
+ relatedTarget: previous
45
+ })
46
+
47
+ $this.trigger(e)
48
+
49
+ if (e.isDefaultPrevented()) return
50
+
51
+ var $target = $(selector)
52
+
53
+ this.activate($this.parent('li'), $ul)
54
+ this.activate($target, $target.parent(), function () {
55
+ $this.trigger({
56
+ type: 'shown.bs.tab'
57
+ , relatedTarget: previous
58
+ })
59
+ })
60
+ }
61
+
62
+ Tab.prototype.activate = function (element, container, callback) {
63
+ var $active = container.find('> .active')
64
+ var transition = callback
65
+ && $.support.transition
66
+ && $active.hasClass('fade')
67
+
68
+ function next() {
69
+ $active
70
+ .removeClass('active')
71
+ .find('> .dropdown-menu > .active')
72
+ .removeClass('active')
73
+
74
+ element.addClass('active')
75
+
76
+ if (transition) {
77
+ element[0].offsetWidth // reflow for transition
78
+ element.addClass('in')
79
+ } else {
80
+ element.removeClass('fade')
81
+ }
82
+
83
+ if (element.parent('.dropdown-menu')) {
84
+ element.closest('li.dropdown').addClass('active')
85
+ }
86
+
87
+ callback && callback()
88
+ }
89
+
90
+ transition ?
91
+ $active
92
+ .one($.support.transition.end, next)
93
+ .emulateTransitionEnd(150) :
94
+ next()
95
+
96
+ $active.removeClass('in')
97
+ }
98
+
99
+
100
+ // TAB PLUGIN DEFINITION
101
+ // =====================
102
+
103
+ var old = $.fn.tab
104
+
105
+ $.fn.tab = function ( option ) {
106
+ return this.each(function () {
107
+ var $this = $(this)
108
+ var data = $this.data('bs.tab')
109
+
110
+ if (!data) $this.data('bs.tab', (data = new Tab(this)))
111
+ if (typeof option == 'string') data[option]()
112
+ })
113
+ }
114
+
115
+ $.fn.tab.Constructor = Tab
116
+
117
+
118
+ // TAB NO CONFLICT
119
+ // ===============
120
+
121
+ $.fn.tab.noConflict = function () {
122
+ $.fn.tab = old
123
+ return this
124
+ }
125
+
126
+
127
+ // TAB DATA-API
128
+ // ============
129
+
130
+ $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
131
+ e.preventDefault()
132
+ $(this).tab('show')
133
+ })
134
+
135
+ }(window.jQuery);