bootstrap_v3 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/bootstrap.thor +13 -13
  3. data/lib/bootstrap/v3/rails/version.rb +1 -1
  4. data/lib/generators/bootstrap/install/install_generator.rb +3 -3
  5. data/lib/generators/bootstrap/install/templates/bootstrap/less.less +40 -0
  6. data/lib/generators/bootstrap/install/templates/bootstrap.js +12 -0
  7. data/vendor/assets/fonts/{bootstrap_v3 → bootstrap}/glyphicons-halflings-regular.eot +0 -0
  8. data/vendor/assets/fonts/{bootstrap_v3 → bootstrap}/glyphicons-halflings-regular.svg +0 -0
  9. data/vendor/assets/fonts/{bootstrap_v3 → bootstrap}/glyphicons-halflings-regular.ttf +0 -0
  10. data/vendor/assets/fonts/{bootstrap_v3 → bootstrap}/glyphicons-halflings-regular.woff +0 -0
  11. data/vendor/assets/javascripts/bootstrap/js/affix.js +126 -0
  12. data/vendor/assets/javascripts/bootstrap/js/alert.js +98 -0
  13. data/vendor/assets/javascripts/bootstrap/js/button.js +109 -0
  14. data/vendor/assets/javascripts/bootstrap/js/carousel.js +217 -0
  15. data/vendor/assets/javascripts/bootstrap/js/collapse.js +179 -0
  16. data/vendor/assets/javascripts/bootstrap/js/dropdown.js +154 -0
  17. data/vendor/assets/javascripts/bootstrap/js/modal.js +246 -0
  18. data/vendor/assets/javascripts/bootstrap/js/popover.js +117 -0
  19. data/vendor/assets/javascripts/bootstrap/js/scrollspy.js +158 -0
  20. data/vendor/assets/javascripts/bootstrap/js/tab.js +135 -0
  21. data/vendor/assets/javascripts/bootstrap/js/tooltip.js +386 -0
  22. data/vendor/assets/javascripts/bootstrap/js/transition.js +56 -0
  23. data/vendor/assets/stylesheets/bootstrap/.less +40 -0
  24. data/vendor/assets/stylesheets/bootstrap/less/.less +40 -0
  25. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/alerts.less +0 -0
  26. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/badges.less +0 -0
  27. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/bootstrap.less +0 -0
  28. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/breadcrumbs.less +0 -0
  29. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/button-groups.less +0 -0
  30. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/buttons.less +0 -0
  31. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/carousel.less +0 -0
  32. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/close.less +0 -0
  33. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/code.less +0 -0
  34. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/component-animations.less +0 -0
  35. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/dropdowns.less +0 -0
  36. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/forms.less +0 -0
  37. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/glyphicons.less +0 -0
  38. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/grid.less +0 -0
  39. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/input-groups.less +0 -0
  40. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/jumbotron.less +0 -0
  41. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/labels.less +0 -0
  42. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/list-group.less +0 -0
  43. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/media.less +0 -0
  44. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/mixins.less +0 -0
  45. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/modals.less +0 -0
  46. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/navbar.less +0 -0
  47. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/navs.less +0 -0
  48. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/normalize.less +0 -0
  49. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/pager.less +0 -0
  50. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/pagination.less +0 -0
  51. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/panels.less +0 -0
  52. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/popovers.less +0 -0
  53. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/print.less +0 -0
  54. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/progress-bars.less +0 -0
  55. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/responsive-utilities.less +0 -0
  56. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/scaffolding.less +0 -0
  57. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/tables.less +0 -0
  58. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/theme.less +0 -0
  59. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/thumbnails.less +0 -0
  60. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/tooltip.less +0 -0
  61. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/type.less +0 -0
  62. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/utilities.less +0 -0
  63. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/variables.less +0 -0
  64. data/vendor/assets/stylesheets/{bootstrap_v3 → bootstrap}/less/wells.less +0 -0
  65. metadata +61 -50
  66. data/lib/generators/bootstrap/install/templates/bootstrap_v3/less.less +0 -40
  67. data/lib/generators/bootstrap/install/templates/bootstrap_v3.js +0 -1
  68. data/vendor/assets/javascripts/bootstrap_v3/modules/bootstrap.js +0 -1999
  69. data/vendor/assets/stylesheets/bootstrap_v3/.less +0 -40
  70. data/vendor/assets/stylesheets/bootstrap_v3/less/.less +0 -40
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 132f7c2f80da16a65611fa19a333f4d9b39ff71f
4
- data.tar.gz: d70df62b8ae2d311f69dae91479ddce716a0bac9
3
+ metadata.gz: ba494e2fb907fcf84c4a86f7e7a7eeb7771f4d79
4
+ data.tar.gz: 1a801df303eb6b642af7d0f3aa68c654faf0e29f
5
5
  SHA512:
6
- metadata.gz: 3917fe63d3fb5f90c5d5ee35f0986fe4a15f449cb948fc64a9cd10ef186fb1d8979a6614ef48706e147ec4485dd70b1be2d53fb78e7a32199baa1b8d775b7a96
7
- data.tar.gz: b01042e4b7b5a53dd33675915a8be8903725b7582e67d5536d7b8a383637aa2068483ac3da27b44cda0d95ed6906573a5a9ea8a429f37d826abf60f7b3058b44
6
+ metadata.gz: 4fd82d0658f2467bacbd307419e060dc253e4fd3cf86bfda4715cb8bb4e1adc4d586fad0efa4c249fce80af0df4a849f8e95a7357344e3a3ec7dcfdc87168ec6
7
+ data.tar.gz: dfcf2cacc6dfa4df9461ec68b33d51bb9ed355025bbf7a63eea6291e350d58a858b782581dc0777c8ff5348920517fc7df486f7dc586b436a924e524d8ce1ce1
data/bootstrap.thor CHANGED
@@ -33,7 +33,7 @@ class Bootstrap < Thor
33
33
  say_status "STEP", "CLONE REPO"
34
34
  Dir.chdir working_dir
35
35
 
36
- git = Git.clone(REPO_URI, 'bootstrap_v3')
36
+ git = Git.clone(REPO_URI, 'bootstrap')
37
37
  end
38
38
 
39
39
  def pull
@@ -58,24 +58,24 @@ class Bootstrap < Thor
58
58
  say_status "STEP", "COPY FILES"
59
59
 
60
60
  # STYLESHEETS
61
- stylesheets_path = "vendor/assets/stylesheets/bootstrap_v3/"
61
+ stylesheets_path = "vendor/assets/stylesheets/bootstrap/"
62
62
  run "rsync -avm --include='*.less' --include='*.css' -f 'hide,! */' #{git_root + 'less/'} #{source_root + stylesheets_path}"
63
63
 
64
64
  # JAVASCRIPTS
65
- javascripts_path = "vendor/assets/javascripts/bootstrap_v3/"
66
- run "rsync -avm --include='*.js' -f 'hide,! */' #{git_root + 'dist/js/'} #{source_root + javascripts_path}"
65
+ javascripts_path = "vendor/assets/javascripts/bootstrap/"
66
+ run "rsync -avm --include='*.js' -f 'hide,! */' #{git_root + 'js/'} #{source_root + javascripts_path}"
67
67
 
68
68
  # FONTS
69
- fonts_path = "vendor/assets/fonts/bootstrap_v3"
70
- run "rsync -avm --include='*.*' -f 'hide,! */' #{git_root + 'dist/fonts/'} #{source_root + fonts_path}"
69
+ fonts_path = "vendor/assets/fonts/bootstrap"
70
+ run "rsync -avm --include='*.*' -f 'hide,! */' #{git_root + 'fonts/'} #{source_root + fonts_path}"
71
71
  end
72
72
 
73
73
  def generate_templates
74
74
  # JAVASCRIPTS
75
75
  say_status "STEP", "GENERATE JAVASCRIPT TEMPLATE"
76
- js_template_path = source_root + "lib/generators/bootstrap/install/templates/bootstrap_v3.js"
76
+ js_template_path = source_root + "lib/generators/bootstrap/install/templates/bootstrap.js"
77
77
 
78
- javascripts_path = Pathname.new(source_root + "vendor/assets/javascripts/bootstrap_v3")
78
+ javascripts_path = Pathname.new(source_root + "vendor/assets/javascripts/bootstrap")
79
79
 
80
80
  FileUtils.rm js_template_path
81
81
 
@@ -87,15 +87,15 @@ class Bootstrap < Thor
87
87
 
88
88
  relative_path = filepath.relative_path_from(javascripts_path)
89
89
 
90
- template.write "//= require bootstrap_v3/#{relative_path} \n"
90
+ template.write "//= require bootstrap/#{relative_path} \n"
91
91
  end
92
92
  end
93
93
 
94
94
  # STYLESHEETS
95
95
  say_status "STEP", "GENERATE STYLESHEETS TEMPLATES"
96
- css_template_path = source_root + "lib/generators/bootstrap/install/templates/bootstrap_v3/"
96
+ css_template_path = source_root + "lib/generators/bootstrap/install/templates/bootstrap/"
97
97
 
98
- stylesheets_path = Pathname.new(source_root + "vendor/assets/stylesheets/bootstrap_v3")
98
+ stylesheets_path = Pathname.new(source_root + "vendor/assets/stylesheets/bootstrap")
99
99
 
100
100
  FileUtils.rm_rf Dir.glob css_template_path + "*.*"
101
101
 
@@ -109,7 +109,7 @@ class Bootstrap < Thor
109
109
 
110
110
  relative_path = filepath.relative_path_from(stylesheets_path)
111
111
 
112
- template.write "@import 'bootstrap_v3/#{relative_path}'; \n"
112
+ template.write "@import 'bootstrap/#{relative_path}'; \n"
113
113
  end
114
114
  end
115
115
  end
@@ -134,7 +134,7 @@ class Bootstrap < Thor
134
134
  end
135
135
 
136
136
  def git_root
137
- working_dir + 'bootstrap_v3'
137
+ working_dir + 'bootstrap'
138
138
  end
139
139
 
140
140
  def working_dir
@@ -1,7 +1,7 @@
1
1
  module Bootstrap
2
2
  module V3
3
3
  module Rails
4
- VERSION = "0.0.7"
4
+ VERSION = "0.0.8"
5
5
  end
6
6
  end
7
7
  end
@@ -16,11 +16,11 @@ module Bootstrap
16
16
  #{js_manifest} exist; skipping
17
17
  EOM
18
18
  else
19
- copy_file "bootstrap_v3.js", "app/assets/javascripts/bootstrap.js"
19
+ copy_file "bootstrap.js", "app/assets/javascripts/bootstrap.js"
20
20
  end
21
21
 
22
22
  # copy less manifests
23
- css_manifests = 'app/assets/stylesheets/bootstrap_v3'
23
+ css_manifests = 'app/assets/stylesheets/bootstrap'
24
24
 
25
25
  if File.directory?(css_manifests)
26
26
  puts <<-EOM
@@ -28,7 +28,7 @@ module Bootstrap
28
28
  #{css_manifests} exist; skipping
29
29
  EOM
30
30
  else
31
- directory "bootstrap_v3", css_manifests, :recursive => true
31
+ directory "bootstrap", css_manifests, :recursive => true
32
32
  end
33
33
 
34
34
  end
@@ -0,0 +1,40 @@
1
+ @import 'bootstrap/less/alerts.less';
2
+ @import 'bootstrap/less/badges.less';
3
+ @import 'bootstrap/less/bootstrap.less';
4
+ @import 'bootstrap/less/breadcrumbs.less';
5
+ @import 'bootstrap/less/button-groups.less';
6
+ @import 'bootstrap/less/buttons.less';
7
+ @import 'bootstrap/less/carousel.less';
8
+ @import 'bootstrap/less/close.less';
9
+ @import 'bootstrap/less/code.less';
10
+ @import 'bootstrap/less/component-animation.less';
11
+ @import 'bootstrap/less/dropdowns.less';
12
+ @import 'bootstrap/less/forms.less';
13
+ @import 'bootstrap/less/glyphicons.less';
14
+ @import 'bootstrap/less/grid.less';
15
+ @import 'bootstrap/less/input-groups.less';
16
+ @import 'bootstrap/less/jumbotron.less';
17
+ @import 'bootstrap/less/labels.less';
18
+ @import 'bootstrap/less/list-group.less';
19
+ @import 'bootstrap/less/media.less';
20
+ @import 'bootstrap/less/mixins.less';
21
+ @import 'bootstrap/less/modals.less';
22
+ @import 'bootstrap/less/navbar.less';
23
+ @import 'bootstrap/less/navs.less';
24
+ @import 'bootstrap/less/normalize.less';
25
+ @import 'bootstrap/less/pager.less';
26
+ @import 'bootstrap/less/pagination.less';
27
+ @import 'bootstrap/less/panels.less';
28
+ @import 'bootstrap/less/popovers.less';
29
+ @import 'bootstrap/less/print.less';
30
+ @import 'bootstrap/less/progress-bars.less';
31
+ @import 'bootstrap/less/responsive-utilities.less';
32
+ @import 'bootstrap/less/scaffolding.less';
33
+ @import 'bootstrap/less/tables.less';
34
+ @import 'bootstrap/less/theme.less';
35
+ @import 'bootstrap/less/thumbnails.less';
36
+ @import 'bootstrap/less/tooltip.less';
37
+ @import 'bootstrap/less/type.less';
38
+ @import 'bootstrap/less/utilities.less';
39
+ @import 'bootstrap/less/variables.less';
40
+ @import 'bootstrap/less/wells.less';
@@ -0,0 +1,12 @@
1
+ //= require bootstrap/js/affix.js
2
+ //= require bootstrap/js/alert.js
3
+ //= require bootstrap/js/button.js
4
+ //= require bootstrap/js/carousel.js
5
+ //= require bootstrap/js/collapse.js
6
+ //= require bootstrap/js/dropdown.js
7
+ //= require bootstrap/js/modal.js
8
+ //= require bootstrap/js/popover.js
9
+ //= require bootstrap/js/scrollspy.js
10
+ //= require bootstrap/js/tab.js
11
+ //= require bootstrap/js/tooltip.js
12
+ //= require bootstrap/js/transition.js
@@ -0,0 +1,126 @@
1
+ /* ========================================================================
2
+ * Bootstrap: affix.js v3.0.0
3
+ * http://twbs.github.com/bootstrap/javascript.html#affix
4
+ * ========================================================================
5
+ * Copyright 2012 Twitter, Inc.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ * ======================================================================== */
19
+
20
+
21
+ +function ($) { "use strict";
22
+
23
+ // AFFIX CLASS DEFINITION
24
+ // ======================
25
+
26
+ var Affix = function (element, options) {
27
+ this.options = $.extend({}, Affix.DEFAULTS, options)
28
+ this.$window = $(window)
29
+ .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
30
+ .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
31
+
32
+ this.$element = $(element)
33
+ this.affixed =
34
+ this.unpin = null
35
+
36
+ this.checkPosition()
37
+ }
38
+
39
+ Affix.RESET = 'affix affix-top affix-bottom'
40
+
41
+ Affix.DEFAULTS = {
42
+ offset: 0
43
+ }
44
+
45
+ Affix.prototype.checkPositionWithEventLoop = function () {
46
+ setTimeout($.proxy(this.checkPosition, this), 1)
47
+ }
48
+
49
+ Affix.prototype.checkPosition = function () {
50
+ if (!this.$element.is(':visible')) return
51
+
52
+ var scrollHeight = $(document).height()
53
+ var scrollTop = this.$window.scrollTop()
54
+ var position = this.$element.offset()
55
+ var offset = this.options.offset
56
+ var offsetTop = offset.top
57
+ var offsetBottom = offset.bottom
58
+
59
+ if (typeof offset != 'object') offsetBottom = offsetTop = offset
60
+ if (typeof offsetTop == 'function') offsetTop = offset.top()
61
+ if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
62
+
63
+ var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
64
+ offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
65
+ offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
66
+
67
+ if (this.affixed === affix) return
68
+ if (this.unpin) this.$element.css('top', '')
69
+
70
+ this.affixed = affix
71
+ this.unpin = affix == 'bottom' ? position.top - scrollTop : null
72
+
73
+ this.$element.removeClass(Affix.RESET).addClass('affix' + (affix ? '-' + affix : ''))
74
+
75
+ if (affix == 'bottom') {
76
+ this.$element.offset({ top: document.body.offsetHeight - offsetBottom - this.$element.height() })
77
+ }
78
+ }
79
+
80
+
81
+ // AFFIX PLUGIN DEFINITION
82
+ // =======================
83
+
84
+ var old = $.fn.affix
85
+
86
+ $.fn.affix = function (option) {
87
+ return this.each(function () {
88
+ var $this = $(this)
89
+ var data = $this.data('bs.affix')
90
+ var options = typeof option == 'object' && option
91
+
92
+ if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
93
+ if (typeof option == 'string') data[option]()
94
+ })
95
+ }
96
+
97
+ $.fn.affix.Constructor = Affix
98
+
99
+
100
+ // AFFIX NO CONFLICT
101
+ // =================
102
+
103
+ $.fn.affix.noConflict = function () {
104
+ $.fn.affix = old
105
+ return this
106
+ }
107
+
108
+
109
+ // AFFIX DATA-API
110
+ // ==============
111
+
112
+ $(window).on('load', function () {
113
+ $('[data-spy="affix"]').each(function () {
114
+ var $spy = $(this)
115
+ var data = $spy.data()
116
+
117
+ data.offset = data.offset || {}
118
+
119
+ if (data.offsetBottom) data.offset.bottom = data.offsetBottom
120
+ if (data.offsetTop) data.offset.top = data.offsetTop
121
+
122
+ $spy.affix(data)
123
+ })
124
+ })
125
+
126
+ }(window.jQuery);
@@ -0,0 +1,98 @@
1
+ /* ========================================================================
2
+ * Bootstrap: alert.js v3.0.0
3
+ * http://twbs.github.com/bootstrap/javascript.html#alerts
4
+ * ========================================================================
5
+ * Copyright 2013 Twitter, Inc.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ * ======================================================================== */
19
+
20
+
21
+ +function ($) { "use strict";
22
+
23
+ // ALERT CLASS DEFINITION
24
+ // ======================
25
+
26
+ var dismiss = '[data-dismiss="alert"]'
27
+ var Alert = function (el) {
28
+ $(el).on('click', dismiss, this.close)
29
+ }
30
+
31
+ Alert.prototype.close = function (e) {
32
+ var $this = $(this)
33
+ var selector = $this.attr('data-target')
34
+
35
+ if (!selector) {
36
+ selector = $this.attr('href')
37
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
38
+ }
39
+
40
+ var $parent = $(selector)
41
+
42
+ if (e) e.preventDefault()
43
+
44
+ if (!$parent.length) {
45
+ $parent = $this.hasClass('alert') ? $this : $this.parent()
46
+ }
47
+
48
+ $parent.trigger(e = $.Event('close.bs.alert'))
49
+
50
+ if (e.isDefaultPrevented()) return
51
+
52
+ $parent.removeClass('in')
53
+
54
+ function removeElement() {
55
+ $parent.trigger('closed.bs.alert').remove()
56
+ }
57
+
58
+ $.support.transition && $parent.hasClass('fade') ?
59
+ $parent
60
+ .one($.support.transition.end, removeElement)
61
+ .emulateTransitionEnd(150) :
62
+ removeElement()
63
+ }
64
+
65
+
66
+ // ALERT PLUGIN DEFINITION
67
+ // =======================
68
+
69
+ var old = $.fn.alert
70
+
71
+ $.fn.alert = function (option) {
72
+ return this.each(function () {
73
+ var $this = $(this)
74
+ var data = $this.data('bs.alert')
75
+
76
+ if (!data) $this.data('bs.alert', (data = new Alert(this)))
77
+ if (typeof option == 'string') data[option].call($this)
78
+ })
79
+ }
80
+
81
+ $.fn.alert.Constructor = Alert
82
+
83
+
84
+ // ALERT NO CONFLICT
85
+ // =================
86
+
87
+ $.fn.alert.noConflict = function () {
88
+ $.fn.alert = old
89
+ return this
90
+ }
91
+
92
+
93
+ // ALERT DATA-API
94
+ // ==============
95
+
96
+ $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
97
+
98
+ }(window.jQuery);
@@ -0,0 +1,109 @@
1
+ /* ========================================================================
2
+ * Bootstrap: button.js v3.0.0
3
+ * http://twbs.github.com/bootstrap/javascript.html#buttons
4
+ * ========================================================================
5
+ * Copyright 2013 Twitter, Inc.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ * ======================================================================== */
19
+
20
+
21
+ +function ($) { "use strict";
22
+
23
+ // BUTTON PUBLIC CLASS DEFINITION
24
+ // ==============================
25
+
26
+ var Button = function (element, options) {
27
+ this.$element = $(element)
28
+ this.options = $.extend({}, Button.DEFAULTS, options)
29
+ }
30
+
31
+ Button.DEFAULTS = {
32
+ loadingText: 'loading...'
33
+ }
34
+
35
+ Button.prototype.setState = function (state) {
36
+ var d = 'disabled'
37
+ var $el = this.$element
38
+ var val = $el.is('input') ? 'val' : 'html'
39
+ var data = $el.data()
40
+
41
+ state = state + 'Text'
42
+
43
+ if (!data.resetText) $el.data('resetText', $el[val]())
44
+
45
+ $el[val](data[state] || this.options[state])
46
+
47
+ // push to event loop to allow forms to submit
48
+ setTimeout(function () {
49
+ state == 'loadingText' ?
50
+ $el.addClass(d).attr(d, d) :
51
+ $el.removeClass(d).removeAttr(d);
52
+ }, 0)
53
+ }
54
+
55
+ Button.prototype.toggle = function () {
56
+ var $parent = this.$element.closest('[data-toggle="buttons"]')
57
+
58
+ if ($parent.length) {
59
+ var $input = this.$element.find('input')
60
+ .prop('checked', !this.$element.hasClass('active'))
61
+ .trigger('change')
62
+ if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active')
63
+ }
64
+
65
+ this.$element.toggleClass('active')
66
+ }
67
+
68
+
69
+ // BUTTON PLUGIN DEFINITION
70
+ // ========================
71
+
72
+ var old = $.fn.button
73
+
74
+ $.fn.button = function (option) {
75
+ return this.each(function () {
76
+ var $this = $(this)
77
+ var data = $this.data('bs.button')
78
+ var options = typeof option == 'object' && option
79
+
80
+ if (!data) $this.data('bs.button', (data = new Button(this, options)))
81
+
82
+ if (option == 'toggle') data.toggle()
83
+ else if (option) data.setState(option)
84
+ })
85
+ }
86
+
87
+ $.fn.button.Constructor = Button
88
+
89
+
90
+ // BUTTON NO CONFLICT
91
+ // ==================
92
+
93
+ $.fn.button.noConflict = function () {
94
+ $.fn.button = old
95
+ return this
96
+ }
97
+
98
+
99
+ // BUTTON DATA-API
100
+ // ===============
101
+
102
+ $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
103
+ var $btn = $(e.target)
104
+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
105
+ $btn.button('toggle')
106
+ e.preventDefault()
107
+ })
108
+
109
+ }(window.jQuery);