| author | Vincent Tondellier <tonton+hg@team1664.org> |
| Tue, 20 Nov 2012 15:06:13 +0100 | |
| changeset 13 | b5d8f0f977aa |
| parent 1 | c3726f733704 |
| child 28 | 0df70b8735e3 |
| permissions | -rw-r--r-- |
| 0 | 1 |
/* =================================================== |
2 |
* bootstrap-transition.js v2.0.3 |
|
3 |
* http://twitter.github.com/bootstrap/javascript.html#transitions |
|
4 |
* =================================================== |
|
5 |
* Copyright 2012 Twitter, Inc. |
|
6 |
* |
|
7 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
8 |
* you may not use this file except in compliance with the License. |
|
9 |
* You may obtain a copy of the License at |
|
10 |
* |
|
11 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
12 |
* |
|
13 |
* Unless required by applicable law or agreed to in writing, software |
|
14 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
15 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
16 |
* See the License for the specific language governing permissions and |
|
17 |
* limitations under the License. |
|
18 |
* ========================================================== */ |
|
19 |
||
20 |
||
21 |
!function ($) {
|
|
22 |
||
23 |
$(function () {
|
|
24 |
||
25 |
"use strict"; // jshint ;_; |
|
26 |
||
27 |
||
28 |
/* CSS TRANSITION SUPPORT (http://www.modernizr.com/) |
|
29 |
* ======================================================= */ |
|
30 |
||
31 |
$.support.transition = (function () {
|
|
32 |
||
33 |
var transitionEnd = (function () {
|
|
34 |
||
35 |
var el = document.createElement('bootstrap')
|
|
36 |
, transEndEventNames = {
|
|
37 |
'WebkitTransition' : 'webkitTransitionEnd' |
|
38 |
, 'MozTransition' : 'transitionend' |
|
39 |
, 'OTransition' : 'oTransitionEnd' |
|
40 |
, 'msTransition' : 'MSTransitionEnd' |
|
41 |
, 'transition' : 'transitionend' |
|
42 |
} |
|
43 |
, name |
|
44 |
||
45 |
for (name in transEndEventNames){
|
|
46 |
if (el.style[name] !== undefined) {
|
|
47 |
return transEndEventNames[name] |
|
48 |
} |
|
49 |
} |
|
50 |
||
51 |
}()) |
|
52 |
||
53 |
return transitionEnd && {
|
|
54 |
end: transitionEnd |
|
55 |
} |
|
56 |
||
57 |
})() |
|
58 |
||
59 |
}) |
|
60 |
||
|
1
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
61 |
}(window.jQuery); |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
62 |
/* ======================================================== |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
63 |
* bootstrap-tab.js v2.0.3 |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
64 |
* http://twitter.github.com/bootstrap/javascript.html#tabs |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
65 |
* ======================================================== |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
66 |
* Copyright 2012 Twitter, Inc. |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
67 |
* |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
68 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
69 |
* you may not use this file except in compliance with the License. |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
70 |
* You may obtain a copy of the License at |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
71 |
* |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
72 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
73 |
* |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
74 |
* Unless required by applicable law or agreed to in writing, software |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
75 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
76 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
77 |
* See the License for the specific language governing permissions and |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
78 |
* limitations under the License. |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
79 |
* ======================================================== */ |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
80 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
81 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
82 |
!function ($) {
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
83 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
84 |
"use strict"; // jshint ;_; |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
85 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
86 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
87 |
/* TAB CLASS DEFINITION |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
88 |
* ==================== */ |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
89 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
90 |
var Tab = function ( element ) {
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
91 |
this.element = $(element) |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
92 |
} |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
93 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
94 |
Tab.prototype = {
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
95 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
96 |
constructor: Tab |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
97 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
98 |
, show: function () {
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
99 |
var $this = this.element |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
100 |
, $ul = $this.closest('ul:not(.dropdown-menu)')
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
101 |
, selector = $this.attr('data-target')
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
102 |
, previous |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
103 |
, $target |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
104 |
, e |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
105 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
106 |
if (!selector) {
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
107 |
selector = $this.attr('href')
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
108 |
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
109 |
} |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
110 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
111 |
if ( $this.parent('li').hasClass('active') ) return
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
112 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
113 |
previous = $ul.find('.active a').last()[0]
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
114 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
115 |
e = $.Event('show', {
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
116 |
relatedTarget: previous |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
117 |
}) |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
118 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
119 |
$this.trigger(e) |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
120 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
121 |
if (e.isDefaultPrevented()) return |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
122 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
123 |
$target = $(selector) |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
124 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
125 |
this.activate($this.parent('li'), $ul)
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
126 |
this.activate($target, $target.parent(), function () {
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
127 |
$this.trigger({
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
128 |
type: 'shown' |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
129 |
, relatedTarget: previous |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
130 |
}) |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
131 |
}) |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
132 |
} |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
133 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
134 |
, activate: function ( element, container, callback) {
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
135 |
var $active = container.find('> .active')
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
136 |
, transition = callback |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
137 |
&& $.support.transition |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
138 |
&& $active.hasClass('fade')
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
139 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
140 |
function next() {
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
141 |
$active |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
142 |
.removeClass('active')
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
143 |
.find('> .dropdown-menu > .active')
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
144 |
.removeClass('active')
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
145 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
146 |
element.addClass('active')
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
147 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
148 |
if (transition) {
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
149 |
element[0].offsetWidth // reflow for transition |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
150 |
element.addClass('in')
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
151 |
} else {
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
152 |
element.removeClass('fade')
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
153 |
} |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
154 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
155 |
if ( element.parent('.dropdown-menu') ) {
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
156 |
element.closest('li.dropdown').addClass('active')
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
157 |
} |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
158 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
159 |
callback && callback() |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
160 |
} |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
161 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
162 |
transition ? |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
163 |
$active.one($.support.transition.end, next) : |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
164 |
next() |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
165 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
166 |
$active.removeClass('in')
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
167 |
} |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
168 |
} |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
169 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
170 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
171 |
/* TAB PLUGIN DEFINITION |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
172 |
* ===================== */ |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
173 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
174 |
$.fn.tab = function ( option ) {
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
175 |
return this.each(function () {
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
176 |
var $this = $(this) |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
177 |
, data = $this.data('tab')
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
178 |
if (!data) $this.data('tab', (data = new Tab(this)))
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
179 |
if (typeof option == 'string') data[option]() |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
180 |
}) |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
181 |
} |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
182 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
183 |
$.fn.tab.Constructor = Tab |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
184 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
185 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
186 |
/* TAB DATA-API |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
187 |
* ============ */ |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
188 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
189 |
$(function () {
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
190 |
$('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
191 |
e.preventDefault() |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
192 |
$(this).tab('show')
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
193 |
}) |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
194 |
}) |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
195 |
|
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
196 |
}(window.jQuery); |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
197 |
/* ========================================================== |
| 0 | 198 |
* bootstrap-alert.js v2.0.3 |
199 |
* http://twitter.github.com/bootstrap/javascript.html#alerts |
|
200 |
* ========================================================== |
|
201 |
* Copyright 2012 Twitter, Inc. |
|
202 |
* |
|
203 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
204 |
* you may not use this file except in compliance with the License. |
|
205 |
* You may obtain a copy of the License at |
|
206 |
* |
|
207 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
208 |
* |
|
209 |
* Unless required by applicable law or agreed to in writing, software |
|
210 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
211 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
212 |
* See the License for the specific language governing permissions and |
|
213 |
* limitations under the License. |
|
214 |
* ========================================================== */ |
|
215 |
||
216 |
||
217 |
!function ($) {
|
|
218 |
||
219 |
"use strict"; // jshint ;_; |
|
220 |
||
221 |
||
222 |
/* ALERT CLASS DEFINITION |
|
223 |
* ====================== */ |
|
224 |
||
225 |
var dismiss = '[data-dismiss="alert"]' |
|
226 |
, Alert = function (el) {
|
|
227 |
$(el).on('click', dismiss, this.close)
|
|
228 |
} |
|
229 |
||
230 |
Alert.prototype.close = function (e) {
|
|
231 |
var $this = $(this) |
|
232 |
, selector = $this.attr('data-target')
|
|
233 |
, $parent |
|
234 |
||
235 |
if (!selector) {
|
|
236 |
selector = $this.attr('href')
|
|
237 |
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 |
|
238 |
} |
|
239 |
||
240 |
$parent = $(selector) |
|
241 |
||
242 |
e && e.preventDefault() |
|
243 |
||
244 |
$parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
|
|
245 |
||
246 |
$parent.trigger(e = $.Event('close'))
|
|
247 |
||
248 |
if (e.isDefaultPrevented()) return |
|
249 |
||
250 |
$parent.removeClass('in')
|
|
251 |
||
252 |
function removeElement() {
|
|
253 |
$parent |
|
254 |
.trigger('closed')
|
|
255 |
.remove() |
|
256 |
} |
|
257 |
||
258 |
$.support.transition && $parent.hasClass('fade') ?
|
|
259 |
$parent.on($.support.transition.end, removeElement) : |
|
260 |
removeElement() |
|
261 |
} |
|
262 |
||
263 |
||
264 |
/* ALERT PLUGIN DEFINITION |
|
265 |
* ======================= */ |
|
266 |
||
267 |
$.fn.alert = function (option) {
|
|
268 |
return this.each(function () {
|
|
269 |
var $this = $(this) |
|
270 |
, data = $this.data('alert')
|
|
271 |
if (!data) $this.data('alert', (data = new Alert(this)))
|
|
272 |
if (typeof option == 'string') data[option].call($this) |
|
273 |
}) |
|
274 |
} |
|
275 |
||
276 |
$.fn.alert.Constructor = Alert |
|
277 |
||
278 |
||
279 |
/* ALERT DATA-API |
|
280 |
* ============== */ |
|
281 |
||
282 |
$(function () {
|
|
283 |
$('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
|
|
284 |
}) |
|
285 |
||
|
1
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
286 |
}(window.jQuery); |
|
c3726f733704
Use minimal bootstrap css and js
Vincent Tondellier <tonton+hg@team1664.org>
parents:
0
diff
changeset
|
287 |
/* ============================================================= |
| 0 | 288 |
* bootstrap-collapse.js v2.0.3 |
289 |
* http://twitter.github.com/bootstrap/javascript.html#collapse |
|
290 |
* ============================================================= |
|
291 |
* Copyright 2012 Twitter, Inc. |
|
292 |
* |
|
293 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
294 |
* you may not use this file except in compliance with the License. |
|
295 |
* You may obtain a copy of the License at |
|
296 |
* |
|
297 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
298 |
* |
|
299 |
* Unless required by applicable law or agreed to in writing, software |
|
300 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
301 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
302 |
* See the License for the specific language governing permissions and |
|
303 |
* limitations under the License. |
|
304 |
* ============================================================ */ |
|
305 |
||
306 |
||
307 |
!function ($) {
|
|
308 |
||
309 |
"use strict"; // jshint ;_; |
|
310 |
||
311 |
||
312 |
/* COLLAPSE PUBLIC CLASS DEFINITION |
|
313 |
* ================================ */ |
|
314 |
||
315 |
var Collapse = function (element, options) {
|
|
316 |
this.$element = $(element) |
|
317 |
this.options = $.extend({}, $.fn.collapse.defaults, options)
|
|
318 |
||
319 |
if (this.options.parent) {
|
|
320 |
this.$parent = $(this.options.parent) |
|
321 |
} |
|
322 |
||
323 |
this.options.toggle && this.toggle() |
|
324 |
} |
|
325 |
||
326 |
Collapse.prototype = {
|
|
327 |
||
328 |
constructor: Collapse |
|
329 |
||
330 |
, dimension: function () {
|
|
331 |
var hasWidth = this.$element.hasClass('width')
|
|
332 |
return hasWidth ? 'width' : 'height' |
|
333 |
} |
|
334 |
||
335 |
, show: function () {
|
|
336 |
var dimension |
|
337 |
, scroll |
|
338 |
, actives |
|
339 |
, hasData |
|
340 |
||
341 |
if (this.transitioning) return |
|
342 |
||
343 |
dimension = this.dimension() |
|
344 |
scroll = $.camelCase(['scroll', dimension].join('-'))
|
|
345 |
actives = this.$parent && this.$parent.find('> .accordion-group > .in')
|
|
346 |
||
347 |
if (actives && actives.length) {
|
|
348 |
hasData = actives.data('collapse')
|
|
349 |
if (hasData && hasData.transitioning) return |
|
350 |
actives.collapse('hide')
|
|
351 |
hasData || actives.data('collapse', null)
|
|
352 |
} |
|
353 |
||
354 |
this.$element[dimension](0) |
|
355 |
this.transition('addClass', $.Event('show'), 'shown')
|
|
356 |
this.$element[dimension](this.$element[0][scroll]) |
|
357 |
} |
|
358 |
||
359 |
, hide: function () {
|
|
360 |
var dimension |
|
361 |
if (this.transitioning) return |
|
362 |
dimension = this.dimension() |
|
363 |
this.reset(this.$element[dimension]()) |
|
364 |
this.transition('removeClass', $.Event('hide'), 'hidden')
|
|
365 |
this.$element[dimension](0) |
|
366 |
} |
|
367 |
||
368 |
, reset: function (size) {
|
|
369 |
var dimension = this.dimension() |
|
370 |
||
371 |
this.$element |
|
372 |
.removeClass('collapse')
|
|
373 |
[dimension](size || 'auto') |
|
374 |
[0].offsetWidth |
|
375 |
||
376 |
this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
|
|
377 |
||
378 |
return this |
|
379 |
} |
|
380 |
||
381 |
, transition: function (method, startEvent, completeEvent) {
|
|
382 |
var that = this |
|
383 |
, complete = function () {
|
|
384 |
if (startEvent.type == 'show') that.reset() |
|
385 |
that.transitioning = 0 |
|
386 |
that.$element.trigger(completeEvent) |
|
387 |
} |
|
388 |
||
389 |
this.$element.trigger(startEvent) |
|
390 |
||
391 |
if (startEvent.isDefaultPrevented()) return |
|
392 |
||
393 |
this.transitioning = 1 |
|
394 |
||
395 |
this.$element[method]('in')
|
|
396 |
||
397 |
$.support.transition && this.$element.hasClass('collapse') ?
|
|
398 |
this.$element.one($.support.transition.end, complete) : |
|
399 |
complete() |
|
400 |
} |
|
401 |
||
402 |
, toggle: function () {
|
|
403 |
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
|
404 |
} |
|
405 |
||
406 |
} |
|
407 |
||
408 |
||
409 |
/* COLLAPSIBLE PLUGIN DEFINITION |
|
410 |
* ============================== */ |
|
411 |
||
412 |
$.fn.collapse = function (option) {
|
|
413 |
return this.each(function () {
|
|
414 |
var $this = $(this) |
|
415 |
, data = $this.data('collapse')
|
|
416 |
, options = typeof option == 'object' && option |
|
417 |
if (!data) $this.data('collapse', (data = new Collapse(this, options)))
|
|
418 |
if (typeof option == 'string') data[option]() |
|
419 |
}) |
|
420 |
} |
|
421 |
||
422 |
$.fn.collapse.defaults = {
|
|
423 |
toggle: true |
|
424 |
} |
|
425 |
||
426 |
$.fn.collapse.Constructor = Collapse |
|
427 |
||
428 |
||
429 |
/* COLLAPSIBLE DATA-API |
|
430 |
* ==================== */ |
|
431 |
||
432 |
$(function () {
|
|
433 |
$('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
|
|
434 |
var $this = $(this), href |
|
435 |
, target = $this.attr('data-target')
|
|
436 |
|| e.preventDefault() |
|
437 |
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
|
438 |
, option = $(target).data('collapse') ? 'toggle' : $this.data()
|
|
439 |
$(target).collapse(option) |
|
440 |
}) |
|
441 |
}) |
|
442 |
||
443 |
}(window.jQuery); |