css-bootstrap-rails 0.0.4 → 0.0.5

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.
data/README.md CHANGED
@@ -4,7 +4,7 @@ It includes base CSS and HTML for typography, forms, buttons, tables, grids, nav
4
4
  css-bootstrap-rails project integrates Bootstrap CSS toolkit for Rails 3 projects
5
5
 
6
6
  ## Rails 3.1
7
- Include Bootstrap in Gemfile,
7
+ Include Bootstrap in Gemfile,
8
8
 
9
9
  gem 'css-bootstrap-rails'
10
10
 
@@ -12,6 +12,16 @@ and add bootstrap in manifest file css file. Add into application.css
12
12
 
13
13
  *= require bootstrap
14
14
 
15
+ to use the bootstrap javascript add the ones you want to application.js
16
+
17
+ //= require bootstrap/alerts
18
+ //= require bootstrap/dropdown
19
+ //= require bootstrap/modal
20
+ //= require bootstrap/popover
21
+ //= require bootstrap/scrollspy
22
+ //= require bootstrap/tabs
23
+ //= require bootstrap/twipsy
24
+
15
25
  ## Thanks
16
26
  Thanks Twitter for Bootstrap
17
27
  http://twitter.github.com/bootstrap
@@ -1,8 +1,8 @@
1
1
  module Css
2
2
  module Bootstrap
3
3
  module Rails
4
- VERSION = "0.0.4"
4
+ VERSION = "0.0.5"
5
5
  TWITTER_BOOTSTRAP = "1.3.0"
6
6
  end
7
7
  end
8
- end
8
+ end
@@ -0,0 +1,111 @@
1
+ /* ==========================================================
2
+ * bootstrap-alerts.js v1.3.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#alerts
4
+ * ==========================================================
5
+ * Copyright 2011 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
+ /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
24
+ * ======================================================= */
25
+
26
+ var transitionEnd
27
+
28
+ $(document).ready(function () {
29
+
30
+ $.support.transition = (function () {
31
+ var thisBody = document.body || document.documentElement
32
+ , thisStyle = thisBody.style
33
+ , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
34
+ return support
35
+ })()
36
+
37
+ // set CSS transition event type
38
+ if ( $.support.transition ) {
39
+ transitionEnd = "TransitionEnd"
40
+ if ( $.browser.webkit ) {
41
+ transitionEnd = "webkitTransitionEnd"
42
+ } else if ( $.browser.mozilla ) {
43
+ transitionEnd = "transitionend"
44
+ } else if ( $.browser.opera ) {
45
+ transitionEnd = "oTransitionEnd"
46
+ }
47
+ }
48
+
49
+ })
50
+
51
+ /* ALERT CLASS DEFINITION
52
+ * ====================== */
53
+
54
+ var Alert = function ( content, options ) {
55
+ this.settings = $.extend({}, $.fn.alert.defaults, options)
56
+ this.$element = $(content)
57
+ .delegate(this.settings.selector, 'click', this.close)
58
+ }
59
+
60
+ Alert.prototype = {
61
+
62
+ close: function (e) {
63
+ var $element = $(this).parent('.alert-message')
64
+
65
+ e && e.preventDefault()
66
+ $element.removeClass('in')
67
+
68
+ function removeElement () {
69
+ $element.remove()
70
+ }
71
+
72
+ $.support.transition && $element.hasClass('fade') ?
73
+ $element.bind(transitionEnd, removeElement) :
74
+ removeElement()
75
+ }
76
+
77
+ }
78
+
79
+
80
+ /* ALERT PLUGIN DEFINITION
81
+ * ======================= */
82
+
83
+ $.fn.alert = function ( options ) {
84
+
85
+ if ( options === true ) {
86
+ return this.data('alert')
87
+ }
88
+
89
+ return this.each(function () {
90
+ var $this = $(this)
91
+
92
+ if ( typeof options == 'string' ) {
93
+ return $this.data('alert')[options]()
94
+ }
95
+
96
+ $(this).data('alert', new Alert( this, options ))
97
+
98
+ })
99
+ }
100
+
101
+ $.fn.alert.defaults = {
102
+ selector: '.close'
103
+ }
104
+
105
+ $(document).ready(function () {
106
+ new Alert($('body'), {
107
+ selector: '.alert-message[data-alert] .close'
108
+ })
109
+ })
110
+
111
+ }( window.jQuery || window.ender );
@@ -0,0 +1,53 @@
1
+ /* ============================================================
2
+ * bootstrap-dropdown.js v1.3.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#dropdown
4
+ * ============================================================
5
+ * Copyright 2011 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
+ /* DROPDOWN PLUGIN DEFINITION
24
+ * ========================== */
25
+
26
+ $.fn.dropdown = function ( selector ) {
27
+ return this.each(function () {
28
+ $(this).delegate(selector || d, 'click', function (e) {
29
+ var li = $(this).parent('li')
30
+ , isActive = li.hasClass('open')
31
+
32
+ clearMenus()
33
+ !isActive && li.toggleClass('open')
34
+ return false
35
+ })
36
+ })
37
+ }
38
+
39
+ /* APPLY TO STANDARD DROPDOWN ELEMENTS
40
+ * =================================== */
41
+
42
+ var d = 'a.menu, .dropdown-toggle'
43
+
44
+ function clearMenus() {
45
+ $(d).parent('li').removeClass('open')
46
+ }
47
+
48
+ $(function () {
49
+ $('html').bind("click", clearMenus)
50
+ $('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' )
51
+ })
52
+
53
+ }( window.jQuery || window.ender );
@@ -0,0 +1,244 @@
1
+ /* =========================================================
2
+ * bootstrap-modal.js v1.3.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#modal
4
+ * =========================================================
5
+ * Copyright 2011 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
+ /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
24
+ * ======================================================= */
25
+
26
+ var transitionEnd
27
+
28
+ $(document).ready(function () {
29
+
30
+ $.support.transition = (function () {
31
+ var thisBody = document.body || document.documentElement
32
+ , thisStyle = thisBody.style
33
+ , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
34
+ return support
35
+ })()
36
+
37
+ // set CSS transition event type
38
+ if ( $.support.transition ) {
39
+ transitionEnd = "TransitionEnd"
40
+ if ( $.browser.webkit ) {
41
+ transitionEnd = "webkitTransitionEnd"
42
+ } else if ( $.browser.mozilla ) {
43
+ transitionEnd = "transitionend"
44
+ } else if ( $.browser.opera ) {
45
+ transitionEnd = "oTransitionEnd"
46
+ }
47
+ }
48
+
49
+ })
50
+
51
+
52
+ /* MODAL PUBLIC CLASS DEFINITION
53
+ * ============================= */
54
+
55
+ var Modal = function ( content, options ) {
56
+ this.settings = $.extend({}, $.fn.modal.defaults, options)
57
+ this.$element = $(content)
58
+ .delegate('.close', 'click.modal', $.proxy(this.hide, this))
59
+
60
+ if ( this.settings.show ) {
61
+ this.show()
62
+ }
63
+
64
+ return this
65
+ }
66
+
67
+ Modal.prototype = {
68
+
69
+ toggle: function () {
70
+ return this[!this.isShown ? 'show' : 'hide']()
71
+ }
72
+
73
+ , show: function () {
74
+ var that = this
75
+ this.isShown = true
76
+ this.$element.trigger('show')
77
+
78
+ escape.call(this)
79
+ backdrop.call(this, function () {
80
+ var transition = $.support.transition && that.$element.hasClass('fade')
81
+
82
+ that.$element
83
+ .appendTo(document.body)
84
+ .show()
85
+
86
+ if (transition) {
87
+ that.$element[0].offsetWidth // force reflow
88
+ }
89
+
90
+ that.$element
91
+ .addClass('in')
92
+
93
+ transition ?
94
+ that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) :
95
+ that.$element.trigger('shown')
96
+
97
+ })
98
+
99
+ return this
100
+ }
101
+
102
+ , hide: function (e) {
103
+ e && e.preventDefault()
104
+
105
+ if ( !this.isShown ) {
106
+ return this
107
+ }
108
+
109
+ var that = this
110
+ this.isShown = false
111
+
112
+ escape.call(this)
113
+
114
+ this.$element
115
+ .trigger('hide')
116
+ .removeClass('in')
117
+
118
+ function removeElement () {
119
+ that.$element
120
+ .hide()
121
+ .trigger('hidden')
122
+
123
+ backdrop.call(that)
124
+ }
125
+
126
+ $.support.transition && this.$element.hasClass('fade') ?
127
+ this.$element.one(transitionEnd, removeElement) :
128
+ removeElement()
129
+
130
+ return this
131
+ }
132
+
133
+ }
134
+
135
+
136
+ /* MODAL PRIVATE METHODS
137
+ * ===================== */
138
+
139
+ function backdrop ( callback ) {
140
+ var that = this
141
+ , animate = this.$element.hasClass('fade') ? 'fade' : ''
142
+ if ( this.isShown && this.settings.backdrop ) {
143
+ var doAnimate = $.support.transition && animate
144
+
145
+ this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
146
+ .appendTo(document.body)
147
+
148
+ if ( this.settings.backdrop != 'static' ) {
149
+ this.$backdrop.click($.proxy(this.hide, this))
150
+ }
151
+
152
+ if ( doAnimate ) {
153
+ this.$backdrop[0].offsetWidth // force reflow
154
+ }
155
+
156
+ this.$backdrop.addClass('in')
157
+
158
+ doAnimate ?
159
+ this.$backdrop.one(transitionEnd, callback) :
160
+ callback()
161
+
162
+ } else if ( !this.isShown && this.$backdrop ) {
163
+ this.$backdrop.removeClass('in')
164
+
165
+ function removeElement() {
166
+ that.$backdrop.remove()
167
+ that.$backdrop = null
168
+ }
169
+
170
+ $.support.transition && this.$element.hasClass('fade')?
171
+ this.$backdrop.one(transitionEnd, removeElement) :
172
+ removeElement()
173
+ } else if ( callback ) {
174
+ callback()
175
+ }
176
+ }
177
+
178
+ function escape() {
179
+ var that = this
180
+ if ( this.isShown && this.settings.keyboard ) {
181
+ $(document).bind('keyup.modal', function ( e ) {
182
+ if ( e.which == 27 ) {
183
+ that.hide()
184
+ }
185
+ })
186
+ } else if ( !this.isShown ) {
187
+ $(document).unbind('keyup.modal')
188
+ }
189
+ }
190
+
191
+
192
+ /* MODAL PLUGIN DEFINITION
193
+ * ======================= */
194
+
195
+ $.fn.modal = function ( options ) {
196
+ var modal = this.data('modal')
197
+
198
+ if (!modal) {
199
+
200
+ if (typeof options == 'string') {
201
+ options = {
202
+ show: /show|toggle/.test(options)
203
+ }
204
+ }
205
+
206
+ return this.each(function () {
207
+ $(this).data('modal', new Modal(this, options))
208
+ })
209
+ }
210
+
211
+ if ( options === true ) {
212
+ return modal
213
+ }
214
+
215
+ if ( typeof options == 'string' ) {
216
+ modal[options]()
217
+ } else if ( modal ) {
218
+ modal.toggle()
219
+ }
220
+
221
+ return this
222
+ }
223
+
224
+ $.fn.modal.Modal = Modal
225
+
226
+ $.fn.modal.defaults = {
227
+ backdrop: false
228
+ , keyboard: false
229
+ , show: false
230
+ }
231
+
232
+
233
+ /* MODAL DATA- IMPLEMENTATION
234
+ * ========================== */
235
+
236
+ $(document).ready(function () {
237
+ $('body').delegate('[data-controls-modal]', 'click', function (e) {
238
+ e.preventDefault()
239
+ var $this = $(this).data('show', true)
240
+ $('#' + $this.attr('data-controls-modal')).modal( $this.data() )
241
+ })
242
+ })
243
+
244
+ }( window.jQuery || window.ender );
@@ -0,0 +1,77 @@
1
+ /* ===========================================================
2
+ * bootstrap-popover.js v1.3.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#popover
4
+ * ===========================================================
5
+ * Copyright 2011 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
+ var Popover = function ( element, options ) {
24
+ this.$element = $(element)
25
+ this.options = options
26
+ this.enabled = true
27
+ this.fixTitle()
28
+ }
29
+
30
+ /* NOTE: POPOVER EXTENDS BOOTSTRAP-TWIPSY.js
31
+ ========================================= */
32
+
33
+ Popover.prototype = $.extend({}, $.fn.twipsy.Twipsy.prototype, {
34
+
35
+ setContent: function () {
36
+ var $tip = this.tip()
37
+ $tip.find('.title')[this.options.html ? 'html' : 'text'](this.getTitle())
38
+ $tip.find('.content p')[this.options.html ? 'html' : 'text'](this.getContent())
39
+ $tip[0].className = 'popover'
40
+ }
41
+
42
+ , getContent: function () {
43
+ var content
44
+ , $e = this.$element
45
+ , o = this.options
46
+
47
+ if (typeof this.options.content == 'string') {
48
+ content = $e.attr(o.content)
49
+ } else if (typeof this.options.content == 'function') {
50
+ content = this.options.content.call(this.$element[0])
51
+ }
52
+ return content
53
+ }
54
+
55
+ , tip: function() {
56
+ if (!this.$tip) {
57
+ this.$tip = $('<div class="popover" />')
58
+ .html('<div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div>')
59
+ }
60
+ return this.$tip
61
+ }
62
+
63
+ })
64
+
65
+
66
+ /* POPOVER PLUGIN DEFINITION
67
+ * ======================= */
68
+
69
+ $.fn.popover = function (options) {
70
+ if (typeof options == 'object') options = $.extend({}, $.fn.popover.defaults, options)
71
+ $.fn.twipsy.initWith.call(this, options, Popover, 'popover')
72
+ return this
73
+ }
74
+
75
+ $.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, { content: 'data-content', placement: 'right'})
76
+
77
+ }( window.jQuery || window.ender );
@@ -0,0 +1,105 @@
1
+ /* =============================================================
2
+ * bootstrap-scrollspy.js v1.3.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#scrollspy
4
+ * =============================================================
5
+ * Copyright 2011 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
+ var $window = $(window)
24
+
25
+ function ScrollSpy( topbar, selector ) {
26
+ var processScroll = $.proxy(this.processScroll, this)
27
+ this.$topbar = $(topbar)
28
+ this.selector = selector || 'li > a'
29
+ this.refresh()
30
+ this.$topbar.delegate(this.selector, 'click', processScroll)
31
+ $window.scroll(processScroll)
32
+ this.processScroll()
33
+ }
34
+
35
+ ScrollSpy.prototype = {
36
+
37
+ refresh: function () {
38
+ this.targets = this.$topbar.find(this.selector).map(function () {
39
+ var href = $(this).attr('href')
40
+ return /^#\w/.test(href) && $(href).length ? href : null
41
+ })
42
+
43
+ this.offsets = $.map(this.targets, function (id) {
44
+ return $(id).offset().top
45
+ })
46
+ }
47
+
48
+ , processScroll: function () {
49
+ var scrollTop = $window.scrollTop() + 10
50
+ , offsets = this.offsets
51
+ , targets = this.targets
52
+ , activeTarget = this.activeTarget
53
+ , i
54
+
55
+ for (i = offsets.length; i--;) {
56
+ activeTarget != targets[i]
57
+ && scrollTop >= offsets[i]
58
+ && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
59
+ && this.activateButton( targets[i] )
60
+ }
61
+ }
62
+
63
+ , activateButton: function (target) {
64
+ this.activeTarget = target
65
+
66
+ this.$topbar
67
+ .find(this.selector).parent('.active')
68
+ .removeClass('active')
69
+
70
+ this.$topbar
71
+ .find(this.selector + '[href="' + target + '"]')
72
+ .parent('li')
73
+ .addClass('active')
74
+ }
75
+
76
+ }
77
+
78
+ /* SCROLLSPY PLUGIN DEFINITION
79
+ * =========================== */
80
+
81
+ $.fn.scrollSpy = function( options ) {
82
+ var scrollspy = this.data('scrollspy')
83
+
84
+ if (!scrollspy) {
85
+ return this.each(function () {
86
+ $(this).data('scrollspy', new ScrollSpy( this, options ))
87
+ })
88
+ }
89
+
90
+ if ( options === true ) {
91
+ return scrollspy
92
+ }
93
+
94
+ if ( typeof options == 'string' ) {
95
+ scrollspy[options]()
96
+ }
97
+
98
+ return this
99
+ }
100
+
101
+ $(document).ready(function () {
102
+ $('body').scrollSpy('[data-scrollspy] li > a')
103
+ })
104
+
105
+ }( window.jQuery || window.ender );
@@ -0,0 +1,77 @@
1
+ /* ========================================================
2
+ * bootstrap-tabs.js v1.3.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#tabs
4
+ * ========================================================
5
+ * Copyright 2011 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 activate ( element, container ) {
24
+ container
25
+ .find('> .active')
26
+ .removeClass('active')
27
+ .find('> .dropdown-menu > .active')
28
+ .removeClass('active')
29
+
30
+ element.addClass('active')
31
+
32
+ if ( element.parent('.dropdown-menu') ) {
33
+ element.closest('li.dropdown').addClass('active')
34
+ }
35
+ }
36
+
37
+ function tab( e ) {
38
+ var $this = $(this)
39
+ , $ul = $this.closest('ul:not(.dropdown-menu)')
40
+ , href = $this.attr('href')
41
+ , previous
42
+
43
+ if ( /^#\w+/.test(href) ) {
44
+ e.preventDefault()
45
+
46
+ if ( $this.parent('li').hasClass('active') ) {
47
+ return
48
+ }
49
+
50
+ previous = $ul.find('.active a').last()[0]
51
+ $href = $(href)
52
+
53
+ activate($this.parent('li'), $ul)
54
+ activate($href, $href.parent())
55
+
56
+ $this.trigger({
57
+ type: 'change'
58
+ , relatedTarget: previous
59
+ })
60
+ }
61
+ }
62
+
63
+
64
+ /* TABS/PILLS PLUGIN DEFINITION
65
+ * ============================ */
66
+
67
+ $.fn.tabs = $.fn.pills = function ( selector ) {
68
+ return this.each(function () {
69
+ $(this).delegate(selector || '.tabs li > a, .pills > li > a', 'click', tab)
70
+ })
71
+ }
72
+
73
+ $(document).ready(function () {
74
+ $('body').tabs('ul[data-tabs] li > a, ul[data-pills] > li > a')
75
+ })
76
+
77
+ }( window.jQuery || window.ender );
@@ -0,0 +1,303 @@
1
+ /* ==========================================================
2
+ * bootstrap-twipsy.js v1.3.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#twipsy
4
+ * Adapted from the original jQuery.tipsy by Jason Frame
5
+ * ==========================================================
6
+ * Copyright 2011 Twitter, Inc.
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ * ========================================================== */
20
+
21
+
22
+ !function( $ ) {
23
+
24
+ /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
25
+ * ======================================================= */
26
+
27
+ var transitionEnd
28
+
29
+ $(document).ready(function () {
30
+
31
+ $.support.transition = (function () {
32
+ var thisBody = document.body || document.documentElement
33
+ , thisStyle = thisBody.style
34
+ , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
35
+ return support
36
+ })()
37
+
38
+ // set CSS transition event type
39
+ if ( $.support.transition ) {
40
+ transitionEnd = "TransitionEnd"
41
+ if ( $.browser.webkit ) {
42
+ transitionEnd = "webkitTransitionEnd"
43
+ } else if ( $.browser.mozilla ) {
44
+ transitionEnd = "transitionend"
45
+ } else if ( $.browser.opera ) {
46
+ transitionEnd = "oTransitionEnd"
47
+ }
48
+ }
49
+
50
+ })
51
+
52
+
53
+ /* TWIPSY PUBLIC CLASS DEFINITION
54
+ * ============================== */
55
+
56
+ var Twipsy = function ( element, options ) {
57
+ this.$element = $(element)
58
+ this.options = options
59
+ this.enabled = true
60
+ this.fixTitle()
61
+ }
62
+
63
+ Twipsy.prototype = {
64
+
65
+ show: function() {
66
+ var pos
67
+ , actualWidth
68
+ , actualHeight
69
+ , placement
70
+ , $tip
71
+ , tp
72
+
73
+ if (this.getTitle() && this.enabled) {
74
+ $tip = this.tip()
75
+ this.setContent()
76
+
77
+ if (this.options.animate) {
78
+ $tip.addClass('fade')
79
+ }
80
+
81
+ $tip
82
+ .remove()
83
+ .css({ top: 0, left: 0, display: 'block' })
84
+ .prependTo(document.body)
85
+
86
+ pos = $.extend({}, this.$element.offset(), {
87
+ width: this.$element[0].offsetWidth
88
+ , height: this.$element[0].offsetHeight
89
+ })
90
+
91
+ actualWidth = $tip[0].offsetWidth
92
+ actualHeight = $tip[0].offsetHeight
93
+
94
+ placement = maybeCall(this.options.placement, this, [ $tip[0], this.$element[0] ])
95
+
96
+ switch (placement) {
97
+ case 'below':
98
+ tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}
99
+ break
100
+ case 'above':
101
+ tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}
102
+ break
103
+ case 'left':
104
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset}
105
+ break
106
+ case 'right':
107
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset}
108
+ break
109
+ }
110
+
111
+ $tip
112
+ .css(tp)
113
+ .addClass(placement)
114
+ .addClass('in')
115
+ }
116
+ }
117
+
118
+ , setContent: function () {
119
+ var $tip = this.tip()
120
+ $tip.find('.twipsy-inner')[this.options.html ? 'html' : 'text'](this.getTitle())
121
+ $tip[0].className = 'twipsy'
122
+ }
123
+
124
+ , hide: function() {
125
+ var that = this
126
+ , $tip = this.tip()
127
+
128
+ $tip.removeClass('in')
129
+
130
+ function removeElement () {
131
+ $tip.remove()
132
+ }
133
+
134
+ $.support.transition && this.$tip.hasClass('fade') ?
135
+ $tip.bind(transitionEnd, removeElement) :
136
+ removeElement()
137
+ }
138
+
139
+ , fixTitle: function() {
140
+ var $e = this.$element
141
+ if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
142
+ $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
143
+ }
144
+ }
145
+
146
+ , getTitle: function() {
147
+ var title
148
+ , $e = this.$element
149
+ , o = this.options
150
+
151
+ this.fixTitle()
152
+
153
+ if (typeof o.title == 'string') {
154
+ title = $e.attr(o.title == 'title' ? 'data-original-title' : o.title)
155
+ } else if (typeof o.title == 'function') {
156
+ title = o.title.call($e[0])
157
+ }
158
+
159
+ title = ('' + title).replace(/(^\s*|\s*$)/, "")
160
+
161
+ return title || o.fallback
162
+ }
163
+
164
+ , tip: function() {
165
+ if (!this.$tip) {
166
+ this.$tip = $('<div class="twipsy" />').html('<div class="twipsy-arrow"></div><div class="twipsy-inner"></div>')
167
+ }
168
+ return this.$tip
169
+ }
170
+
171
+ , validate: function() {
172
+ if (!this.$element[0].parentNode) {
173
+ this.hide()
174
+ this.$element = null
175
+ this.options = null
176
+ }
177
+ }
178
+
179
+ , enable: function() {
180
+ this.enabled = true
181
+ }
182
+
183
+ , disable: function() {
184
+ this.enabled = false
185
+ }
186
+
187
+ , toggleEnabled: function() {
188
+ this.enabled = !this.enabled
189
+ }
190
+
191
+ }
192
+
193
+
194
+ /* TWIPSY PRIVATE METHODS
195
+ * ====================== */
196
+
197
+ function maybeCall ( thing, ctx, args ) {
198
+ return typeof thing == 'function' ? thing.apply(ctx, args) : thing
199
+ }
200
+
201
+ /* TWIPSY PLUGIN DEFINITION
202
+ * ======================== */
203
+
204
+ $.fn.twipsy = function (options) {
205
+ $.fn.twipsy.initWith.call(this, options, Twipsy, 'twipsy')
206
+ return this
207
+ }
208
+
209
+ $.fn.twipsy.initWith = function (options, Constructor, name) {
210
+ var twipsy
211
+ , binder
212
+ , eventIn
213
+ , eventOut
214
+
215
+ if (options === true) {
216
+ return this.data(name)
217
+ } else if (typeof options == 'string') {
218
+ twipsy = this.data(name)
219
+ if (twipsy) {
220
+ twipsy[options]()
221
+ }
222
+ return this
223
+ }
224
+
225
+ options = $.extend({}, $.fn[name].defaults, options)
226
+
227
+ function get(ele) {
228
+ var twipsy = $.data(ele, name)
229
+
230
+ if (!twipsy) {
231
+ twipsy = new Constructor(ele, $.fn.twipsy.elementOptions(ele, options))
232
+ $.data(ele, name, twipsy)
233
+ }
234
+
235
+ return twipsy
236
+ }
237
+
238
+ function enter() {
239
+ var twipsy = get(this)
240
+ twipsy.hoverState = 'in'
241
+
242
+ if (options.delayIn == 0) {
243
+ twipsy.show()
244
+ } else {
245
+ twipsy.fixTitle()
246
+ setTimeout(function() {
247
+ if (twipsy.hoverState == 'in') {
248
+ twipsy.show()
249
+ }
250
+ }, options.delayIn)
251
+ }
252
+ }
253
+
254
+ function leave() {
255
+ var twipsy = get(this)
256
+ twipsy.hoverState = 'out'
257
+ if (options.delayOut == 0) {
258
+ twipsy.hide()
259
+ } else {
260
+ setTimeout(function() {
261
+ if (twipsy.hoverState == 'out') {
262
+ twipsy.hide()
263
+ }
264
+ }, options.delayOut)
265
+ }
266
+ }
267
+
268
+ if (!options.live) {
269
+ this.each(function() {
270
+ get(this)
271
+ })
272
+ }
273
+
274
+ if (options.trigger != 'manual') {
275
+ binder = options.live ? 'live' : 'bind'
276
+ eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus'
277
+ eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur'
278
+ this[binder](eventIn, enter)[binder](eventOut, leave)
279
+ }
280
+
281
+ return this
282
+ }
283
+
284
+ $.fn.twipsy.Twipsy = Twipsy
285
+
286
+ $.fn.twipsy.defaults = {
287
+ animate: true
288
+ , delayIn: 0
289
+ , delayOut: 0
290
+ , fallback: ''
291
+ , placement: 'above'
292
+ , html: false
293
+ , live: false
294
+ , offset: 0
295
+ , title: 'title'
296
+ , trigger: 'hover'
297
+ }
298
+
299
+ $.fn.twipsy.elementOptions = function(ele, options) {
300
+ return $.metadata ? $.extend({}, options, $(ele).metadata()) : options
301
+ }
302
+
303
+ }( window.jQuery || window.ender );
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: css-bootstrap-rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Arun Agrawal
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-04 00:00:00 Z
18
+ date: 2011-11-02 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  type: :runtime
@@ -97,6 +97,13 @@ files:
97
97
  - lib/css-bootstrap-rails/engine.rb
98
98
  - lib/css-bootstrap-rails/railtie.rb
99
99
  - lib/css-bootstrap-rails/version.rb
100
+ - vendor/assets/javascripts/bootstrap/alerts.js
101
+ - vendor/assets/javascripts/bootstrap/dropdown.js
102
+ - vendor/assets/javascripts/bootstrap/modal.js
103
+ - vendor/assets/javascripts/bootstrap/popover.js
104
+ - vendor/assets/javascripts/bootstrap/scrollspy.js
105
+ - vendor/assets/javascripts/bootstrap/tabs.js
106
+ - vendor/assets/javascripts/bootstrap/twipsy.js
100
107
  - vendor/assets/stylesheets/bootstrap.css
101
108
  - vendor/assets/stylesheets/bootstrap.min.css
102
109
  homepage: https://github.com/arunagw/css-bootstrap-rails