anjlab-bootstrap-rails 1.4.0.14 → 2.0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. data/Rakefile +11 -15
  2. data/bootstrap-rails.gemspec +4 -4
  3. data/lib/bootstrap-rails/version.rb +1 -1
  4. data/vendor/assets/images/glyphicons-halflings-white.png +0 -0
  5. data/vendor/assets/images/glyphicons-halflings.png +0 -0
  6. data/vendor/assets/javascripts/bootstrap-alert.js +91 -0
  7. data/vendor/assets/javascripts/bootstrap-button.js +98 -0
  8. data/vendor/assets/javascripts/bootstrap-carousel.js +154 -0
  9. data/vendor/assets/javascripts/bootstrap-collapse.js +136 -0
  10. data/vendor/assets/javascripts/bootstrap-dropdown.js +58 -21
  11. data/vendor/assets/javascripts/bootstrap-modal.js +63 -114
  12. data/vendor/assets/javascripts/bootstrap-popover.js +38 -33
  13. data/vendor/assets/javascripts/bootstrap-scrollspy.js +62 -44
  14. data/vendor/assets/javascripts/bootstrap-tab.js +130 -0
  15. data/vendor/assets/javascripts/bootstrap-tooltip.js +270 -0
  16. data/vendor/assets/javascripts/bootstrap-transition.js +51 -0
  17. data/vendor/assets/javascripts/bootstrap-typeahead.js +271 -0
  18. data/vendor/assets/javascripts/bootstrap.js +8 -5
  19. data/vendor/assets/stylesheets/accordion.scss +28 -0
  20. data/vendor/assets/stylesheets/alerts.scss +70 -0
  21. data/vendor/assets/stylesheets/bootstrap.scss +44 -8
  22. data/vendor/assets/stylesheets/breadcrumbs.scss +22 -0
  23. data/vendor/assets/stylesheets/button-groups.scss +147 -0
  24. data/vendor/assets/stylesheets/buttons.scss +165 -0
  25. data/vendor/assets/stylesheets/carousel.scss +121 -0
  26. data/vendor/assets/stylesheets/close.scss +18 -0
  27. data/vendor/assets/stylesheets/code.scss +44 -0
  28. data/vendor/assets/stylesheets/component-animations.scss +18 -0
  29. data/vendor/assets/stylesheets/dropdowns.scss +131 -0
  30. data/vendor/assets/stylesheets/forms.scss +337 -287
  31. data/vendor/assets/stylesheets/grid.scss +8 -0
  32. data/vendor/assets/stylesheets/hero-unit.scss +20 -0
  33. data/vendor/assets/stylesheets/labels.scss +16 -0
  34. data/vendor/assets/stylesheets/layouts.scss +17 -0
  35. data/vendor/assets/stylesheets/mixins.scss +375 -111
  36. data/vendor/assets/stylesheets/modals.scss +72 -0
  37. data/vendor/assets/stylesheets/navbar.scss +292 -0
  38. data/vendor/assets/stylesheets/navs.scss +344 -0
  39. data/vendor/assets/stylesheets/pager.scss +30 -0
  40. data/vendor/assets/stylesheets/pagination.scss +55 -0
  41. data/vendor/assets/stylesheets/popovers.scss +49 -0
  42. data/vendor/assets/stylesheets/progress-bars.scss +95 -0
  43. data/vendor/assets/stylesheets/reset.scss +37 -52
  44. data/vendor/assets/stylesheets/responsive.scss +323 -0
  45. data/vendor/assets/stylesheets/scaffolding.scss +13 -96
  46. data/vendor/assets/stylesheets/sprites.scss +158 -0
  47. data/vendor/assets/stylesheets/tables.scss +68 -149
  48. data/vendor/assets/stylesheets/thumbnails.scss +35 -0
  49. data/vendor/assets/stylesheets/tooltip.scss +35 -0
  50. data/vendor/assets/stylesheets/type.scss +100 -70
  51. data/vendor/assets/stylesheets/utilities.scss +23 -0
  52. data/vendor/assets/stylesheets/variables.scss +94 -55
  53. data/vendor/assets/stylesheets/wells.scss +17 -0
  54. metadata +51 -30
  55. data/vendor/assets/javascripts/bootstrap-alerts.js +0 -124
  56. data/vendor/assets/javascripts/bootstrap-buttons.js +0 -64
  57. data/vendor/assets/javascripts/bootstrap-tabs.js +0 -80
  58. data/vendor/assets/javascripts/bootstrap-twipsy.js +0 -321
  59. data/vendor/assets/stylesheets/patterns.scss +0 -1060
@@ -0,0 +1,17 @@
1
+ // WELLS
2
+ // -----
3
+
4
+ .well {
5
+ min-height: 20px;
6
+ padding: 19px;
7
+ margin-bottom: 20px;
8
+ background-color: #f5f5f5;
9
+ border: 1px solid #eee;
10
+ border: 1px solid rgba(0,0,0,.05);
11
+ @include border-radius(4px);
12
+ @include box-shadow(inset 0 1px 1px rgba(0,0,0,.05));
13
+ blockquote {
14
+ border-color: #ddd;
15
+ border-color: rgba(0,0,0,.15);
16
+ }
17
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anjlab-bootstrap-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0.14
4
+ version: 2.0.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,33 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-26 00:00:00.000000000 Z
12
+ date: 2012-02-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
16
- requirement: &70264415474780 !ruby/object:Gem::Requirement
16
+ requirement: &70113559046980 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ~>
19
+ - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
21
  version: '3.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70264415474780
25
- - !ruby/object:Gem::Dependency
26
- name: thor
27
- requirement: &70264425252660 !ruby/object:Gem::Requirement
28
- none: false
29
- requirements:
30
- - - ~>
31
- - !ruby/object:Gem::Version
32
- version: '0.14'
33
- type: :runtime
34
- prerelease: false
35
- version_requirements: *70264425252660
24
+ version_requirements: *70113559046980
36
25
  - !ruby/object:Gem::Dependency
37
26
  name: sass
38
- requirement: &70264425251280 !ruby/object:Gem::Requirement
27
+ requirement: &70113559046520 !ruby/object:Gem::Requirement
39
28
  none: false
40
29
  requirements:
41
30
  - - ! '>='
@@ -43,29 +32,29 @@ dependencies:
43
32
  version: '0'
44
33
  type: :runtime
45
34
  prerelease: false
46
- version_requirements: *70264425251280
35
+ version_requirements: *70113559046520
47
36
  - !ruby/object:Gem::Dependency
48
37
  name: bundler
49
- requirement: &70264425250100 !ruby/object:Gem::Requirement
38
+ requirement: &70113559045820 !ruby/object:Gem::Requirement
50
39
  none: false
51
40
  requirements:
52
41
  - - ! '>='
53
42
  - !ruby/object:Gem::Version
54
- version: 1.0.0
43
+ version: '1.0'
55
44
  type: :development
56
45
  prerelease: false
57
- version_requirements: *70264425250100
46
+ version_requirements: *70113559045820
58
47
  - !ruby/object:Gem::Dependency
59
48
  name: rails
60
- requirement: &70264425248980 !ruby/object:Gem::Requirement
49
+ requirement: &70113559045200 !ruby/object:Gem::Requirement
61
50
  none: false
62
51
  requirements:
63
- - - ~>
52
+ - - ! '>='
64
53
  - !ruby/object:Gem::Version
65
- version: '3.0'
54
+ version: '3.1'
66
55
  type: :development
67
56
  prerelease: false
68
- version_requirements: *70264425248980
57
+ version_requirements: *70113559045200
69
58
  description: Twitter Bootstrap CSS (with SASS flavour) and JS toolkits for Rails 3
70
59
  projects
71
60
  email:
@@ -86,24 +75,56 @@ files:
86
75
  - lib/bootstrap-rails/version.rb
87
76
  - test/ie_hex_str_test.rb
88
77
  - test/test_helper.rb
89
- - vendor/assets/javascripts/bootstrap-alerts.js
90
- - vendor/assets/javascripts/bootstrap-buttons.js
78
+ - vendor/assets/images/glyphicons-halflings-white.png
79
+ - vendor/assets/images/glyphicons-halflings.png
80
+ - vendor/assets/javascripts/bootstrap-alert.js
81
+ - vendor/assets/javascripts/bootstrap-button.js
82
+ - vendor/assets/javascripts/bootstrap-carousel.js
83
+ - vendor/assets/javascripts/bootstrap-collapse.js
91
84
  - vendor/assets/javascripts/bootstrap-dropdown.js
92
85
  - vendor/assets/javascripts/bootstrap-modal.js
93
86
  - vendor/assets/javascripts/bootstrap-popover.js
94
87
  - vendor/assets/javascripts/bootstrap-scrollspy.js
95
- - vendor/assets/javascripts/bootstrap-tabs.js
96
- - vendor/assets/javascripts/bootstrap-twipsy.js
88
+ - vendor/assets/javascripts/bootstrap-tab.js
89
+ - vendor/assets/javascripts/bootstrap-tooltip.js
90
+ - vendor/assets/javascripts/bootstrap-transition.js
91
+ - vendor/assets/javascripts/bootstrap-typeahead.js
97
92
  - vendor/assets/javascripts/bootstrap.js
93
+ - vendor/assets/stylesheets/accordion.scss
94
+ - vendor/assets/stylesheets/alerts.scss
98
95
  - vendor/assets/stylesheets/bootstrap.scss
96
+ - vendor/assets/stylesheets/breadcrumbs.scss
97
+ - vendor/assets/stylesheets/button-groups.scss
98
+ - vendor/assets/stylesheets/buttons.scss
99
+ - vendor/assets/stylesheets/carousel.scss
100
+ - vendor/assets/stylesheets/close.scss
101
+ - vendor/assets/stylesheets/code.scss
102
+ - vendor/assets/stylesheets/component-animations.scss
103
+ - vendor/assets/stylesheets/dropdowns.scss
99
104
  - vendor/assets/stylesheets/forms.scss
105
+ - vendor/assets/stylesheets/grid.scss
106
+ - vendor/assets/stylesheets/hero-unit.scss
107
+ - vendor/assets/stylesheets/labels.scss
108
+ - vendor/assets/stylesheets/layouts.scss
100
109
  - vendor/assets/stylesheets/mixins.scss
101
- - vendor/assets/stylesheets/patterns.scss
110
+ - vendor/assets/stylesheets/modals.scss
111
+ - vendor/assets/stylesheets/navbar.scss
112
+ - vendor/assets/stylesheets/navs.scss
113
+ - vendor/assets/stylesheets/pager.scss
114
+ - vendor/assets/stylesheets/pagination.scss
115
+ - vendor/assets/stylesheets/popovers.scss
116
+ - vendor/assets/stylesheets/progress-bars.scss
102
117
  - vendor/assets/stylesheets/reset.scss
118
+ - vendor/assets/stylesheets/responsive.scss
103
119
  - vendor/assets/stylesheets/scaffolding.scss
120
+ - vendor/assets/stylesheets/sprites.scss
104
121
  - vendor/assets/stylesheets/tables.scss
122
+ - vendor/assets/stylesheets/thumbnails.scss
123
+ - vendor/assets/stylesheets/tooltip.scss
105
124
  - vendor/assets/stylesheets/type.scss
125
+ - vendor/assets/stylesheets/utilities.scss
106
126
  - vendor/assets/stylesheets/variables.scss
127
+ - vendor/assets/stylesheets/wells.scss
107
128
  homepage: https://github.com/anjlab/bootstrap-rails
108
129
  licenses: []
109
130
  post_install_message:
@@ -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 );