twitter-bootstrap-rails 1.3.1 → 1.4.0

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

Potentially problematic release.


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

@@ -1,77 +1,86 @@
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
-
1
+ /* ===========================================================
2
+ * bootstrap-popover.js v1.4.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
+ "use strict"
24
+
25
+ var Popover = function ( element, options ) {
26
+ this.$element = $(element)
27
+ this.options = options
28
+ this.enabled = true
29
+ this.fixTitle()
30
+ }
31
+
32
+ /* NOTE: POPOVER EXTENDS BOOTSTRAP-TWIPSY.js
33
+ ========================================= */
34
+
35
+ Popover.prototype = $.extend({}, $.fn.twipsy.Twipsy.prototype, {
36
+
37
+ setContent: function () {
38
+ var $tip = this.tip()
39
+ $tip.find('.title')[this.options.html ? 'html' : 'text'](this.getTitle())
40
+ $tip.find('.content p')[this.options.html ? 'html' : 'text'](this.getContent())
41
+ $tip[0].className = 'popover'
42
+ }
43
+
44
+ , hasContent: function () {
45
+ return this.getTitle() || this.getContent()
46
+ }
47
+
48
+ , getContent: function () {
49
+ var content
50
+ , $e = this.$element
51
+ , o = this.options
52
+
53
+ if (typeof this.options.content == 'string') {
54
+ content = this.options.content
55
+ } else if (typeof this.options.content == 'function') {
56
+ content = this.options.content.call(this.$element[0])
57
+ }
58
+ return content
59
+ }
60
+
61
+ , tip: function() {
62
+ if (!this.$tip) {
63
+ this.$tip = $('<div class="popover" />')
64
+ .html(this.options.template)
65
+ }
66
+ return this.$tip
67
+ }
68
+
69
+ })
70
+
71
+
72
+ /* POPOVER PLUGIN DEFINITION
73
+ * ======================= */
74
+
75
+ $.fn.popover = function (options) {
76
+ if (typeof options == 'object') options = $.extend({}, $.fn.popover.defaults, options)
77
+ $.fn.twipsy.initWith.call(this, options, Popover, 'popover')
78
+ return this
79
+ }
80
+
81
+ $.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, {
82
+ placement: 'right'
83
+ , template: '<div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div>'
84
+ })
85
+
77
86
  }( window.jQuery || window.ender );
@@ -1,105 +1,107 @@
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
-
1
+ /* =============================================================
2
+ * bootstrap-scrollspy.js v1.4.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
+ "use strict"
24
+
25
+ var $window = $(window)
26
+
27
+ function ScrollSpy( topbar, selector ) {
28
+ var processScroll = $.proxy(this.processScroll, this)
29
+ this.$topbar = $(topbar)
30
+ this.selector = selector || 'li > a'
31
+ this.refresh()
32
+ this.$topbar.delegate(this.selector, 'click', processScroll)
33
+ $window.scroll(processScroll)
34
+ this.processScroll()
35
+ }
36
+
37
+ ScrollSpy.prototype = {
38
+
39
+ refresh: function () {
40
+ this.targets = this.$topbar.find(this.selector).map(function () {
41
+ var href = $(this).attr('href')
42
+ return /^#\w/.test(href) && $(href).length ? href : null
43
+ })
44
+
45
+ this.offsets = $.map(this.targets, function (id) {
46
+ return $(id).offset().top
47
+ })
48
+ }
49
+
50
+ , processScroll: function () {
51
+ var scrollTop = $window.scrollTop() + 10
52
+ , offsets = this.offsets
53
+ , targets = this.targets
54
+ , activeTarget = this.activeTarget
55
+ , i
56
+
57
+ for (i = offsets.length; i--;) {
58
+ activeTarget != targets[i]
59
+ && scrollTop >= offsets[i]
60
+ && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
61
+ && this.activateButton( targets[i] )
62
+ }
63
+ }
64
+
65
+ , activateButton: function (target) {
66
+ this.activeTarget = target
67
+
68
+ this.$topbar
69
+ .find(this.selector).parent('.active')
70
+ .removeClass('active')
71
+
72
+ this.$topbar
73
+ .find(this.selector + '[href="' + target + '"]')
74
+ .parent('li')
75
+ .addClass('active')
76
+ }
77
+
78
+ }
79
+
80
+ /* SCROLLSPY PLUGIN DEFINITION
81
+ * =========================== */
82
+
83
+ $.fn.scrollSpy = function( options ) {
84
+ var scrollspy = this.data('scrollspy')
85
+
86
+ if (!scrollspy) {
87
+ return this.each(function () {
88
+ $(this).data('scrollspy', new ScrollSpy( this, options ))
89
+ })
90
+ }
91
+
92
+ if ( options === true ) {
93
+ return scrollspy
94
+ }
95
+
96
+ if ( typeof options == 'string' ) {
97
+ scrollspy[options]()
98
+ }
99
+
100
+ return this
101
+ }
102
+
103
+ $(document).ready(function () {
104
+ $('body').scrollSpy('[data-scrollspy] li > a')
105
+ })
106
+
105
107
  }( window.jQuery || window.ender );
@@ -1,62 +1,80 @@
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.find('.active').removeClass('active')
25
- element.addClass('active')
26
- }
27
-
28
- function tab( e ) {
29
- var $this = $(this)
30
- , href = $this.attr('href')
31
- , $ul = $this.closest('ul')
32
- , $controlled
33
-
34
- if (/^#\w+/.test(href)) {
35
- e.preventDefault()
36
-
37
- if ($this.hasClass('active')) {
38
- return
39
- }
40
-
41
- $href = $(href)
42
-
43
- activate($this.parent('li'), $ul)
44
- activate($href, $href.parent())
45
- }
46
- }
47
-
48
-
49
- /* TABS/PILLS PLUGIN DEFINITION
50
- * ============================ */
51
-
52
- $.fn.tabs = $.fn.pills = function ( selector ) {
53
- return this.each(function () {
54
- $(this).delegate(selector || '.tabs li > a, .pills > li > a', 'click', tab)
55
- })
56
- }
57
-
58
- $(document).ready(function () {
59
- $('body').tabs('ul[data-tabs] li > a, ul[data-pills] > li > a')
60
- })
61
-
62
- }( window.jQuery || window.ender );
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 );