bootstrap-sass-rails 1.4.0.3 → 2.0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. data/lib/bootstrap/sass/rails/version.rb +1 -1
  2. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
  3. data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
  4. data/vendor/assets/javascripts/twitter/bootstrap.js +12 -8
  5. data/vendor/assets/javascripts/twitter/bootstrap/alert.js +91 -0
  6. data/vendor/assets/javascripts/twitter/bootstrap/button.js +98 -0
  7. data/vendor/assets/javascripts/twitter/bootstrap/carousel.js +154 -0
  8. data/vendor/assets/javascripts/twitter/bootstrap/collapse.js +136 -0
  9. data/vendor/assets/javascripts/twitter/bootstrap/dropdown.js +58 -21
  10. data/vendor/assets/javascripts/twitter/bootstrap/modal.js +63 -114
  11. data/vendor/assets/javascripts/twitter/bootstrap/popover.js +38 -33
  12. data/vendor/assets/javascripts/twitter/bootstrap/scrollspy.js +62 -44
  13. data/vendor/assets/javascripts/twitter/bootstrap/tab.js +130 -0
  14. data/vendor/assets/javascripts/twitter/bootstrap/tooltip.js +270 -0
  15. data/vendor/assets/javascripts/twitter/bootstrap/transition.js +51 -0
  16. data/vendor/assets/javascripts/twitter/bootstrap/typeahead.js +271 -0
  17. data/vendor/assets/stylesheets/twitter/bootstrap.css.scss +50 -14
  18. data/vendor/assets/stylesheets/twitter/bootstrap/_accordion.scss +28 -0
  19. data/vendor/assets/stylesheets/twitter/bootstrap/_alerts.scss +70 -0
  20. data/vendor/assets/stylesheets/twitter/bootstrap/_breadcrumbs.scss +22 -0
  21. data/vendor/assets/stylesheets/twitter/bootstrap/_button-groups.scss +147 -0
  22. data/vendor/assets/stylesheets/twitter/bootstrap/_buttons.scss +165 -0
  23. data/vendor/assets/stylesheets/twitter/bootstrap/_carousel.scss +121 -0
  24. data/vendor/assets/stylesheets/twitter/bootstrap/_close.scss +18 -0
  25. data/vendor/assets/stylesheets/twitter/bootstrap/_code.scss +44 -0
  26. data/vendor/assets/stylesheets/twitter/bootstrap/_component-animations.scss +18 -0
  27. data/vendor/assets/stylesheets/twitter/bootstrap/_dropdowns.scss +131 -0
  28. data/vendor/assets/stylesheets/twitter/bootstrap/_forms.scss +335 -299
  29. data/vendor/assets/stylesheets/twitter/bootstrap/_grid.scss +8 -0
  30. data/vendor/assets/stylesheets/twitter/bootstrap/_hero-unit.scss +20 -0
  31. data/vendor/assets/stylesheets/twitter/bootstrap/_labels.scss +16 -0
  32. data/vendor/assets/stylesheets/twitter/bootstrap/_layouts.scss +17 -0
  33. data/vendor/assets/stylesheets/twitter/bootstrap/_mixins.scss +429 -124
  34. data/vendor/assets/stylesheets/twitter/bootstrap/_modals.scss +72 -0
  35. data/vendor/assets/stylesheets/twitter/bootstrap/_navbar.scss +292 -0
  36. data/vendor/assets/stylesheets/twitter/bootstrap/_navs.scss +343 -0
  37. data/vendor/assets/stylesheets/twitter/bootstrap/_pager.scss +30 -0
  38. data/vendor/assets/stylesheets/twitter/bootstrap/_pagination.scss +55 -0
  39. data/vendor/assets/stylesheets/twitter/bootstrap/_patterns.scss +5 -1051
  40. data/vendor/assets/stylesheets/twitter/bootstrap/_popovers.scss +49 -0
  41. data/vendor/assets/stylesheets/twitter/bootstrap/_print.scss +18 -0
  42. data/vendor/assets/stylesheets/twitter/bootstrap/_progress-bars.scss +95 -0
  43. data/vendor/assets/stylesheets/twitter/bootstrap/_reset.scss +36 -51
  44. data/vendor/assets/stylesheets/twitter/bootstrap/_responsive.scss +323 -0
  45. data/vendor/assets/stylesheets/twitter/bootstrap/_scaffolding.scss +13 -123
  46. data/vendor/assets/stylesheets/twitter/bootstrap/_sprites.scss +156 -0
  47. data/vendor/assets/stylesheets/twitter/bootstrap/_tables.scss +75 -160
  48. data/vendor/assets/stylesheets/twitter/bootstrap/_thumbnails.scss +35 -0
  49. data/vendor/assets/stylesheets/twitter/bootstrap/_tooltip.scss +35 -0
  50. data/vendor/assets/stylesheets/twitter/bootstrap/_type.scss +100 -70
  51. data/vendor/assets/stylesheets/twitter/bootstrap/_utilities.scss +23 -0
  52. data/vendor/assets/stylesheets/twitter/bootstrap/_variables.scss +94 -55
  53. data/vendor/assets/stylesheets/twitter/bootstrap/_wells.scss +17 -0
  54. metadata +51 -75
  55. data/test/dummy/log/test.log +0 -462
  56. data/test/dummy/tmp/cache/assets/C29/E80/sprockets%2F8f076727207424919c7170c7157bbe37 +0 -1102
  57. data/test/dummy/tmp/cache/assets/D3F/FA0/sprockets%2F22c8366fdbaaa2872b202dfe7376629f +0 -0
  58. data/test/dummy/tmp/cache/assets/E5F/300/sprockets%2F243a2fff0dbb8aeec3dd579b4ff7c81b +0 -1048
  59. data/test/dummy/tmp/cache/sass/367107abe8cc7204b7df467455e0644864892d9f/_forms.scssc +0 -0
  60. data/test/dummy/tmp/cache/sass/367107abe8cc7204b7df467455e0644864892d9f/_mixins.scssc +0 -0
  61. data/test/dummy/tmp/cache/sass/367107abe8cc7204b7df467455e0644864892d9f/_patterns.scssc +0 -0
  62. data/test/dummy/tmp/cache/sass/367107abe8cc7204b7df467455e0644864892d9f/_reset.scssc +0 -0
  63. data/test/dummy/tmp/cache/sass/367107abe8cc7204b7df467455e0644864892d9f/_scaffolding.scssc +0 -0
  64. data/test/dummy/tmp/cache/sass/367107abe8cc7204b7df467455e0644864892d9f/_tables.scssc +0 -0
  65. data/test/dummy/tmp/cache/sass/367107abe8cc7204b7df467455e0644864892d9f/_type.scssc +0 -0
  66. data/test/dummy/tmp/cache/sass/367107abe8cc7204b7df467455e0644864892d9f/_variables.scssc +0 -0
  67. data/test/dummy/tmp/cache/sass/766526f7d87ffdf0401dde0ec8d49f976470392d/_bootstrap.scssc +0 -0
  68. data/test/dummy/tmp/cache/sass/766526f7d87ffdf0401dde0ec8d49f976470392d/bootstrap.css.scssc +0 -0
  69. data/test/dummy/tmp/cache/sass/766526f7d87ffdf0401dde0ec8d49f976470392d/bootstrap.cssc +0 -0
  70. data/test/dummy/tmp/cache/sass/8f44dddc3cc4868f43c2a4153ce3876663527256/_bootstrap.scssc +0 -0
  71. data/test/dummy/tmp/cache/sass/8f44dddc3cc4868f43c2a4153ce3876663527256/bootstrap.css.scssc +0 -0
  72. data/test/dummy/tmp/cache/sass/95eca8acb76bbb914a4c6988012b73e61e9bcc23/application.css.scssc +0 -0
  73. data/test/dummy/tmp/cache/sass/95eca8acb76bbb914a4c6988012b73e61e9bcc23/individual.css.scssc +0 -0
  74. data/test/dummy/tmp/cache/sass/cd2e949d41af4ab87fc8c5c6e94e4e802032bd18/_forms.scssc +0 -0
  75. data/test/dummy/tmp/cache/sass/cd2e949d41af4ab87fc8c5c6e94e4e802032bd18/_mixins.scssc +0 -0
  76. data/test/dummy/tmp/cache/sass/cd2e949d41af4ab87fc8c5c6e94e4e802032bd18/_patterns.scssc +0 -0
  77. data/test/dummy/tmp/cache/sass/cd2e949d41af4ab87fc8c5c6e94e4e802032bd18/_reset.scssc +0 -0
  78. data/test/dummy/tmp/cache/sass/cd2e949d41af4ab87fc8c5c6e94e4e802032bd18/_scaffolding.scssc +0 -0
  79. data/test/dummy/tmp/cache/sass/cd2e949d41af4ab87fc8c5c6e94e4e802032bd18/_tables.scssc +0 -0
  80. data/test/dummy/tmp/cache/sass/cd2e949d41af4ab87fc8c5c6e94e4e802032bd18/_type.scssc +0 -0
  81. data/test/dummy/tmp/cache/sass/cd2e949d41af4ab87fc8c5c6e94e4e802032bd18/_variables.scssc +0 -0
  82. data/test/dummy/tmp/cache/sass/cd2e949d41af4ab87fc8c5c6e94e4e802032bd18/mixins.scssc +0 -0
  83. data/test/dummy/tmp/cache/sass/cd2e949d41af4ab87fc8c5c6e94e4e802032bd18/variables.css.scssc +0 -0
  84. data/vendor/assets/javascripts/twitter/bootstrap/alerts.js +0 -124
  85. data/vendor/assets/javascripts/twitter/bootstrap/buttons.js +0 -64
  86. data/vendor/assets/javascripts/twitter/bootstrap/tabs.js +0 -80
  87. data/vendor/assets/javascripts/twitter/bootstrap/twipsy.js +0 -321
@@ -1,124 +0,0 @@
1
- /* ==========================================================
2
- * bootstrap-alerts.js v1.4.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
- "use strict"
24
-
25
- /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
26
- * ======================================================= */
27
-
28
- var transitionEnd
29
-
30
- $(document).ready(function () {
31
-
32
- $.support.transition = (function () {
33
- var thisBody = document.body || document.documentElement
34
- , thisStyle = thisBody.style
35
- , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
36
- return support
37
- })()
38
-
39
- // set CSS transition event type
40
- if ( $.support.transition ) {
41
- transitionEnd = "TransitionEnd"
42
- if ( $.browser.webkit ) {
43
- transitionEnd = "webkitTransitionEnd"
44
- } else if ( $.browser.mozilla ) {
45
- transitionEnd = "transitionend"
46
- } else if ( $.browser.opera ) {
47
- transitionEnd = "oTransitionEnd"
48
- }
49
- }
50
-
51
- })
52
-
53
- /* ALERT CLASS DEFINITION
54
- * ====================== */
55
-
56
- var Alert = function ( content, options ) {
57
- if (options == 'close') return this.close.call(content)
58
- this.settings = $.extend({}, $.fn.alert.defaults, options)
59
- this.$element = $(content)
60
- .delegate(this.settings.selector, 'click', this.close)
61
- }
62
-
63
- Alert.prototype = {
64
-
65
- close: function (e) {
66
- var $element = $(this)
67
- , className = 'alert-message'
68
-
69
- $element = $element.hasClass(className) ? $element : $element.parent()
70
-
71
- e && e.preventDefault()
72
- $element.removeClass('in')
73
-
74
- function removeElement () {
75
- $element.remove()
76
- }
77
-
78
- $.support.transition && $element.hasClass('fade') ?
79
- $element.bind(transitionEnd, removeElement) :
80
- removeElement()
81
- }
82
-
83
- }
84
-
85
-
86
- /* ALERT PLUGIN DEFINITION
87
- * ======================= */
88
-
89
- $.fn.alert = function ( options ) {
90
-
91
- if ( options === true ) {
92
- return this.data('alert')
93
- }
94
-
95
- return this.each(function () {
96
- var $this = $(this)
97
- , data
98
-
99
- if ( typeof options == 'string' ) {
100
-
101
- data = $this.data('alert')
102
-
103
- if (typeof data == 'object') {
104
- return data[options].call( $this )
105
- }
106
-
107
- }
108
-
109
- $(this).data('alert', new Alert( this, options ))
110
-
111
- })
112
- }
113
-
114
- $.fn.alert.defaults = {
115
- selector: '.close'
116
- }
117
-
118
- $(document).ready(function () {
119
- new Alert($('body'), {
120
- selector: '.alert-message[data-alert] .close'
121
- })
122
- })
123
-
124
- }( window.jQuery || window.ender );
@@ -1,64 +0,0 @@
1
- /* ============================================================
2
- * bootstrap-buttons.js v1.4.0
3
- * http://twitter.github.com/bootstrap/javascript.html#buttons
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
- !function( $ ){
21
-
22
- "use strict"
23
-
24
- function setState(el, state) {
25
- var d = 'disabled'
26
- , $el = $(el)
27
- , data = $el.data()
28
-
29
- state = state + 'Text'
30
- data.resetText || $el.data('resetText', $el.html())
31
-
32
- $el.html( data[state] || $.fn.button.defaults[state] )
33
-
34
- setTimeout(function () {
35
- state == 'loadingText' ?
36
- $el.addClass(d).attr(d, d) :
37
- $el.removeClass(d).removeAttr(d)
38
- }, 0)
39
- }
40
-
41
- function toggle(el) {
42
- $(el).toggleClass('active')
43
- }
44
-
45
- $.fn.button = function(options) {
46
- return this.each(function () {
47
- if (options == 'toggle') {
48
- return toggle(this)
49
- }
50
- options && setState(this, options)
51
- })
52
- }
53
-
54
- $.fn.button.defaults = {
55
- loadingText: 'loading...'
56
- }
57
-
58
- $(function () {
59
- $('body').delegate('.btn[data-toggle]', 'click', function () {
60
- $(this).button('toggle')
61
- })
62
- })
63
-
64
- }( window.jQuery || window.ender );
@@ -1,80 +0,0 @@
1
- /* ========================================================
2
- * bootstrap-tabs.js v1.4.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
- "use strict"
24
-
25
- function activate ( element, container ) {
26
- container
27
- .find('> .active')
28
- .removeClass('active')
29
- .find('> .dropdown-menu > .active')
30
- .removeClass('active')
31
-
32
- element.addClass('active')
33
-
34
- if ( element.parent('.dropdown-menu') ) {
35
- element.closest('li.dropdown').addClass('active')
36
- }
37
- }
38
-
39
- function tab( e ) {
40
- var $this = $(this)
41
- , $ul = $this.closest('ul:not(.dropdown-menu)')
42
- , href = $this.attr('href')
43
- , previous
44
- , $href
45
-
46
- if ( /^#\w+/.test(href) ) {
47
- e.preventDefault()
48
-
49
- if ( $this.parent('li').hasClass('active') ) {
50
- return
51
- }
52
-
53
- previous = $ul.find('.active a').last()[0]
54
- $href = $(href)
55
-
56
- activate($this.parent('li'), $ul)
57
- activate($href, $href.parent())
58
-
59
- $this.trigger({
60
- type: 'change'
61
- , relatedTarget: previous
62
- })
63
- }
64
- }
65
-
66
-
67
- /* TABS/PILLS PLUGIN DEFINITION
68
- * ============================ */
69
-
70
- $.fn.tabs = $.fn.pills = function ( selector ) {
71
- return this.each(function () {
72
- $(this).delegate(selector || '.tabs li > a, .pills > li > a', 'click', tab)
73
- })
74
- }
75
-
76
- $(document).ready(function () {
77
- $('body').tabs('ul[data-tabs] li > a, ul[data-pills] > li > a')
78
- })
79
-
80
- }( window.jQuery || window.ender );
@@ -1,321 +0,0 @@
1
- /* ==========================================================
2
- * bootstrap-twipsy.js v1.4.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
- "use strict"
25
-
26
- /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
27
- * ======================================================= */
28
-
29
- var transitionEnd
30
-
31
- $(document).ready(function () {
32
-
33
- $.support.transition = (function () {
34
- var thisBody = document.body || document.documentElement
35
- , thisStyle = thisBody.style
36
- , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
37
- return support
38
- })()
39
-
40
- // set CSS transition event type
41
- if ( $.support.transition ) {
42
- transitionEnd = "TransitionEnd"
43
- if ( $.browser.webkit ) {
44
- transitionEnd = "webkitTransitionEnd"
45
- } else if ( $.browser.mozilla ) {
46
- transitionEnd = "transitionend"
47
- } else if ( $.browser.opera ) {
48
- transitionEnd = "oTransitionEnd"
49
- }
50
- }
51
-
52
- })
53
-
54
-
55
- /* TWIPSY PUBLIC CLASS DEFINITION
56
- * ============================== */
57
-
58
- var Twipsy = function ( element, options ) {
59
- this.$element = $(element)
60
- this.options = options
61
- this.enabled = true
62
- this.fixTitle()
63
- }
64
-
65
- Twipsy.prototype = {
66
-
67
- show: function() {
68
- var pos
69
- , actualWidth
70
- , actualHeight
71
- , placement
72
- , $tip
73
- , tp
74
-
75
- if (this.hasContent() && this.enabled) {
76
- $tip = this.tip()
77
- this.setContent()
78
-
79
- if (this.options.animate) {
80
- $tip.addClass('fade')
81
- }
82
-
83
- $tip
84
- .remove()
85
- .css({ top: 0, left: 0, display: 'block' })
86
- .prependTo(document.body)
87
-
88
- pos = $.extend({}, this.$element.offset(), {
89
- width: this.$element[0].offsetWidth
90
- , height: this.$element[0].offsetHeight
91
- })
92
-
93
- actualWidth = $tip[0].offsetWidth
94
- actualHeight = $tip[0].offsetHeight
95
-
96
- placement = maybeCall(this.options.placement, this, [ $tip[0], this.$element[0] ])
97
-
98
- switch (placement) {
99
- case 'below':
100
- tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}
101
- break
102
- case 'above':
103
- tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}
104
- break
105
- case 'left':
106
- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset}
107
- break
108
- case 'right':
109
- tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset}
110
- break
111
- }
112
-
113
- $tip
114
- .css(tp)
115
- .addClass(placement)
116
- .addClass('in')
117
- }
118
- }
119
-
120
- , setContent: function () {
121
- var $tip = this.tip()
122
- $tip.find('.twipsy-inner')[this.options.html ? 'html' : 'text'](this.getTitle())
123
- $tip[0].className = 'twipsy'
124
- }
125
-
126
- , hide: function() {
127
- var that = this
128
- , $tip = this.tip()
129
-
130
- $tip.removeClass('in')
131
-
132
- function removeElement () {
133
- $tip.remove()
134
- }
135
-
136
- $.support.transition && this.$tip.hasClass('fade') ?
137
- $tip.bind(transitionEnd, removeElement) :
138
- removeElement()
139
- }
140
-
141
- , fixTitle: function() {
142
- var $e = this.$element
143
- if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
144
- $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
145
- }
146
- }
147
-
148
- , hasContent: function () {
149
- return this.getTitle()
150
- }
151
-
152
- , getTitle: function() {
153
- var title
154
- , $e = this.$element
155
- , o = this.options
156
-
157
- this.fixTitle()
158
-
159
- if (typeof o.title == 'string') {
160
- title = $e.attr(o.title == 'title' ? 'data-original-title' : o.title)
161
- } else if (typeof o.title == 'function') {
162
- title = o.title.call($e[0])
163
- }
164
-
165
- title = ('' + title).replace(/(^\s*|\s*$)/, "")
166
-
167
- return title || o.fallback
168
- }
169
-
170
- , tip: function() {
171
- return this.$tip = this.$tip || $('<div class="twipsy" />').html(this.options.template)
172
- }
173
-
174
- , validate: function() {
175
- if (!this.$element[0].parentNode) {
176
- this.hide()
177
- this.$element = null
178
- this.options = null
179
- }
180
- }
181
-
182
- , enable: function() {
183
- this.enabled = true
184
- }
185
-
186
- , disable: function() {
187
- this.enabled = false
188
- }
189
-
190
- , toggleEnabled: function() {
191
- this.enabled = !this.enabled
192
- }
193
-
194
- , toggle: function () {
195
- this[this.tip().hasClass('in') ? 'hide' : 'show']()
196
- }
197
-
198
- }
199
-
200
-
201
- /* TWIPSY PRIVATE METHODS
202
- * ====================== */
203
-
204
- function maybeCall ( thing, ctx, args ) {
205
- return typeof thing == 'function' ? thing.apply(ctx, args) : thing
206
- }
207
-
208
- /* TWIPSY PLUGIN DEFINITION
209
- * ======================== */
210
-
211
- $.fn.twipsy = function (options) {
212
- $.fn.twipsy.initWith.call(this, options, Twipsy, 'twipsy')
213
- return this
214
- }
215
-
216
- $.fn.twipsy.initWith = function (options, Constructor, name) {
217
- var twipsy
218
- , binder
219
- , eventIn
220
- , eventOut
221
-
222
- if (options === true) {
223
- return this.data(name)
224
- } else if (typeof options == 'string') {
225
- twipsy = this.data(name)
226
- if (twipsy) {
227
- twipsy[options]()
228
- }
229
- return this
230
- }
231
-
232
- options = $.extend({}, $.fn[name].defaults, options)
233
-
234
- function get(ele) {
235
- var twipsy = $.data(ele, name)
236
-
237
- if (!twipsy) {
238
- twipsy = new Constructor(ele, $.fn.twipsy.elementOptions(ele, options))
239
- $.data(ele, name, twipsy)
240
- }
241
-
242
- return twipsy
243
- }
244
-
245
- function enter() {
246
- var twipsy = get(this)
247
- twipsy.hoverState = 'in'
248
-
249
- if (options.delayIn == 0) {
250
- twipsy.show()
251
- } else {
252
- twipsy.fixTitle()
253
- setTimeout(function() {
254
- if (twipsy.hoverState == 'in') {
255
- twipsy.show()
256
- }
257
- }, options.delayIn)
258
- }
259
- }
260
-
261
- function leave() {
262
- var twipsy = get(this)
263
- twipsy.hoverState = 'out'
264
- if (options.delayOut == 0) {
265
- twipsy.hide()
266
- } else {
267
- setTimeout(function() {
268
- if (twipsy.hoverState == 'out') {
269
- twipsy.hide()
270
- }
271
- }, options.delayOut)
272
- }
273
- }
274
-
275
- if (!options.live) {
276
- this.each(function() {
277
- get(this)
278
- })
279
- }
280
-
281
- if (options.trigger != 'manual') {
282
- binder = options.live ? 'live' : 'bind'
283
- eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus'
284
- eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur'
285
- this[binder](eventIn, enter)[binder](eventOut, leave)
286
- }
287
-
288
- return this
289
- }
290
-
291
- $.fn.twipsy.Twipsy = Twipsy
292
-
293
- $.fn.twipsy.defaults = {
294
- animate: true
295
- , delayIn: 0
296
- , delayOut: 0
297
- , fallback: ''
298
- , placement: 'above'
299
- , html: false
300
- , live: false
301
- , offset: 0
302
- , title: 'title'
303
- , trigger: 'hover'
304
- , template: '<div class="twipsy-arrow"></div><div class="twipsy-inner"></div>'
305
- }
306
-
307
- $.fn.twipsy.rejectAttrOptions = [ 'title' ]
308
-
309
- $.fn.twipsy.elementOptions = function(ele, options) {
310
- var data = $(ele).data()
311
- , rejects = $.fn.twipsy.rejectAttrOptions
312
- , i = rejects.length
313
-
314
- while (i--) {
315
- delete data[rejects[i]]
316
- }
317
-
318
- return $.extend({}, options, data)
319
- }
320
-
321
- }( window.jQuery || window.ender );