0
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1 |
/* ===================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
2 |
* bootstrap-transition.js v2.0.3
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
3 |
* http://twitter.github.com/bootstrap/javascript.html#transitions
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
4 |
* ===================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
5 |
* Copyright 2012 Twitter, Inc.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
6 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
7 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
8 |
* you may not use this file except in compliance with the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
9 |
* You may obtain a copy of the License at
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
10 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
11 |
* http://www.apache.org/licenses/LICENSE-2.0
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
12 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
13 |
* Unless required by applicable law or agreed to in writing, software
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
14 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
15 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
16 |
* See the License for the specific language governing permissions and
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
17 |
* limitations under the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
18 |
* ========================================================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
19 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
20 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
21 |
!function ($) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
22 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
23 |
$(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
24 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
25 |
"use strict"; // jshint ;_;
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
26 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
27 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
28 |
/* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
29 |
* ======================================================= */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
30 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
31 |
$.support.transition = (function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
32 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
33 |
var transitionEnd = (function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
34 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
35 |
var el = document.createElement('bootstrap')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
36 |
, transEndEventNames = {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
37 |
'WebkitTransition' : 'webkitTransitionEnd'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
38 |
, 'MozTransition' : 'transitionend'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
39 |
, 'OTransition' : 'oTransitionEnd'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
40 |
, 'msTransition' : 'MSTransitionEnd'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
41 |
, 'transition' : 'transitionend'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
42 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
43 |
, name
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
44 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
45 |
for (name in transEndEventNames){
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
46 |
if (el.style[name] !== undefined) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
47 |
return transEndEventNames[name]
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
48 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
49 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
50 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
51 |
}())
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
52 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
53 |
return transitionEnd && {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
54 |
end: transitionEnd
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
55 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
56 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
57 |
})()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
58 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
59 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
60 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
61 |
}(window.jQuery);/* ==========================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
62 |
* bootstrap-alert.js v2.0.3
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
63 |
* http://twitter.github.com/bootstrap/javascript.html#alerts
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
64 |
* ==========================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
65 |
* Copyright 2012 Twitter, Inc.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
66 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
67 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
68 |
* you may not use this file except in compliance with the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
69 |
* You may obtain a copy of the License at
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
70 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
71 |
* http://www.apache.org/licenses/LICENSE-2.0
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
72 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
73 |
* Unless required by applicable law or agreed to in writing, software
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
74 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
75 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
76 |
* See the License for the specific language governing permissions and
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
77 |
* limitations under the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
78 |
* ========================================================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
79 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
80 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
81 |
!function ($) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
82 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
83 |
"use strict"; // jshint ;_;
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
84 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
85 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
86 |
/* ALERT CLASS DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
87 |
* ====================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
88 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
89 |
var dismiss = '[data-dismiss="alert"]'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
90 |
, Alert = function (el) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
91 |
$(el).on('click', dismiss, this.close)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
92 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
93 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
94 |
Alert.prototype.close = function (e) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
95 |
var $this = $(this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
96 |
, selector = $this.attr('data-target')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
97 |
, $parent
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
98 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
99 |
if (!selector) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
100 |
selector = $this.attr('href')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
101 |
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
102 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
103 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
104 |
$parent = $(selector)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
105 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
106 |
e && e.preventDefault()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
107 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
108 |
$parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
109 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
110 |
$parent.trigger(e = $.Event('close'))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
111 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
112 |
if (e.isDefaultPrevented()) return
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
113 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
114 |
$parent.removeClass('in')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
115 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
116 |
function removeElement() {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
117 |
$parent
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
118 |
.trigger('closed')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
119 |
.remove()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
120 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
121 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
122 |
$.support.transition && $parent.hasClass('fade') ?
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
123 |
$parent.on($.support.transition.end, removeElement) :
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
124 |
removeElement()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
125 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
126 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
127 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
128 |
/* ALERT PLUGIN DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
129 |
* ======================= */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
130 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
131 |
$.fn.alert = function (option) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
132 |
return this.each(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
133 |
var $this = $(this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
134 |
, data = $this.data('alert')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
135 |
if (!data) $this.data('alert', (data = new Alert(this)))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
136 |
if (typeof option == 'string') data[option].call($this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
137 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
138 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
139 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
140 |
$.fn.alert.Constructor = Alert
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
141 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
142 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
143 |
/* ALERT DATA-API
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
144 |
* ============== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
145 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
146 |
$(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
147 |
$('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
148 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
149 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
150 |
}(window.jQuery);/* ============================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
151 |
* bootstrap-button.js v2.0.3
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
152 |
* http://twitter.github.com/bootstrap/javascript.html#buttons
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
153 |
* ============================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
154 |
* Copyright 2012 Twitter, Inc.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
155 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
156 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
157 |
* you may not use this file except in compliance with the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
158 |
* You may obtain a copy of the License at
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
159 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
160 |
* http://www.apache.org/licenses/LICENSE-2.0
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
161 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
162 |
* Unless required by applicable law or agreed to in writing, software
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
163 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
164 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
165 |
* See the License for the specific language governing permissions and
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
166 |
* limitations under the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
167 |
* ============================================================ */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
168 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
169 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
170 |
!function ($) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
171 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
172 |
"use strict"; // jshint ;_;
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
173 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
174 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
175 |
/* BUTTON PUBLIC CLASS DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
176 |
* ============================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
177 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
178 |
var Button = function (element, options) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
179 |
this.$element = $(element)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
180 |
this.options = $.extend({}, $.fn.button.defaults, options)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
181 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
182 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
183 |
Button.prototype.setState = function (state) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
184 |
var d = 'disabled'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
185 |
, $el = this.$element
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
186 |
, data = $el.data()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
187 |
, val = $el.is('input') ? 'val' : 'html'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
188 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
189 |
state = state + 'Text'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
190 |
data.resetText || $el.data('resetText', $el[val]())
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
191 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
192 |
$el[val](data[state] || this.options[state])
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
193 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
194 |
// push to event loop to allow forms to submit
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
195 |
setTimeout(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
196 |
state == 'loadingText' ?
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
197 |
$el.addClass(d).attr(d, d) :
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
198 |
$el.removeClass(d).removeAttr(d)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
199 |
}, 0)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
200 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
201 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
202 |
Button.prototype.toggle = function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
203 |
var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
204 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
205 |
$parent && $parent
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
206 |
.find('.active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
207 |
.removeClass('active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
208 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
209 |
this.$element.toggleClass('active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
210 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
211 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
212 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
213 |
/* BUTTON PLUGIN DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
214 |
* ======================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
215 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
216 |
$.fn.button = function (option) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
217 |
return this.each(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
218 |
var $this = $(this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
219 |
, data = $this.data('button')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
220 |
, options = typeof option == 'object' && option
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
221 |
if (!data) $this.data('button', (data = new Button(this, options)))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
222 |
if (option == 'toggle') data.toggle()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
223 |
else if (option) data.setState(option)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
224 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
225 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
226 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
227 |
$.fn.button.defaults = {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
228 |
loadingText: 'loading...'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
229 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
230 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
231 |
$.fn.button.Constructor = Button
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
232 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
233 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
234 |
/* BUTTON DATA-API
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
235 |
* =============== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
236 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
237 |
$(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
238 |
$('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
239 |
var $btn = $(e.target)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
240 |
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
241 |
$btn.button('toggle')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
242 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
243 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
244 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
245 |
}(window.jQuery);/* ==========================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
246 |
* bootstrap-carousel.js v2.0.3
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
247 |
* http://twitter.github.com/bootstrap/javascript.html#carousel
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
248 |
* ==========================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
249 |
* Copyright 2012 Twitter, Inc.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
250 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
251 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
252 |
* you may not use this file except in compliance with the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
253 |
* You may obtain a copy of the License at
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
254 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
255 |
* http://www.apache.org/licenses/LICENSE-2.0
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
256 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
257 |
* Unless required by applicable law or agreed to in writing, software
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
258 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
259 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
260 |
* See the License for the specific language governing permissions and
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
261 |
* limitations under the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
262 |
* ========================================================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
263 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
264 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
265 |
!function ($) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
266 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
267 |
"use strict"; // jshint ;_;
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
268 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
269 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
270 |
/* CAROUSEL CLASS DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
271 |
* ========================= */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
272 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
273 |
var Carousel = function (element, options) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
274 |
this.$element = $(element)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
275 |
this.options = options
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
276 |
this.options.slide && this.slide(this.options.slide)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
277 |
this.options.pause == 'hover' && this.$element
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
278 |
.on('mouseenter', $.proxy(this.pause, this))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
279 |
.on('mouseleave', $.proxy(this.cycle, this))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
280 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
281 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
282 |
Carousel.prototype = {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
283 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
284 |
cycle: function (e) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
285 |
if (!e) this.paused = false
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
286 |
this.options.interval
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
287 |
&& !this.paused
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
288 |
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
289 |
return this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
290 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
291 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
292 |
, to: function (pos) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
293 |
var $active = this.$element.find('.active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
294 |
, children = $active.parent().children()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
295 |
, activePos = children.index($active)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
296 |
, that = this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
297 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
298 |
if (pos > (children.length - 1) || pos < 0) return
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
299 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
300 |
if (this.sliding) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
301 |
return this.$element.one('slid', function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
302 |
that.to(pos)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
303 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
304 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
305 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
306 |
if (activePos == pos) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
307 |
return this.pause().cycle()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
308 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
309 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
310 |
return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
311 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
312 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
313 |
, pause: function (e) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
314 |
if (!e) this.paused = true
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
315 |
clearInterval(this.interval)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
316 |
this.interval = null
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
317 |
return this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
318 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
319 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
320 |
, next: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
321 |
if (this.sliding) return
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
322 |
return this.slide('next')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
323 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
324 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
325 |
, prev: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
326 |
if (this.sliding) return
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
327 |
return this.slide('prev')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
328 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
329 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
330 |
, slide: function (type, next) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
331 |
var $active = this.$element.find('.active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
332 |
, $next = next || $active[type]()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
333 |
, isCycling = this.interval
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
334 |
, direction = type == 'next' ? 'left' : 'right'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
335 |
, fallback = type == 'next' ? 'first' : 'last'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
336 |
, that = this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
337 |
, e = $.Event('slide')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
338 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
339 |
this.sliding = true
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
340 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
341 |
isCycling && this.pause()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
342 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
343 |
$next = $next.length ? $next : this.$element.find('.item')[fallback]()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
344 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
345 |
if ($next.hasClass('active')) return
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
346 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
347 |
if ($.support.transition && this.$element.hasClass('slide')) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
348 |
this.$element.trigger(e)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
349 |
if (e.isDefaultPrevented()) return
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
350 |
$next.addClass(type)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
351 |
$next[0].offsetWidth // force reflow
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
352 |
$active.addClass(direction)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
353 |
$next.addClass(direction)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
354 |
this.$element.one($.support.transition.end, function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
355 |
$next.removeClass([type, direction].join(' ')).addClass('active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
356 |
$active.removeClass(['active', direction].join(' '))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
357 |
that.sliding = false
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
358 |
setTimeout(function () { that.$element.trigger('slid') }, 0)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
359 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
360 |
} else {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
361 |
this.$element.trigger(e)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
362 |
if (e.isDefaultPrevented()) return
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
363 |
$active.removeClass('active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
364 |
$next.addClass('active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
365 |
this.sliding = false
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
366 |
this.$element.trigger('slid')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
367 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
368 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
369 |
isCycling && this.cycle()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
370 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
371 |
return this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
372 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
373 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
374 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
375 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
376 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
377 |
/* CAROUSEL PLUGIN DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
378 |
* ========================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
379 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
380 |
$.fn.carousel = function (option) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
381 |
return this.each(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
382 |
var $this = $(this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
383 |
, data = $this.data('carousel')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
384 |
, options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
385 |
if (!data) $this.data('carousel', (data = new Carousel(this, options)))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
386 |
if (typeof option == 'number') data.to(option)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
387 |
else if (typeof option == 'string' || (option = options.slide)) data[option]()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
388 |
else if (options.interval) data.cycle()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
389 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
390 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
391 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
392 |
$.fn.carousel.defaults = {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
393 |
interval: 5000
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
394 |
, pause: 'hover'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
395 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
396 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
397 |
$.fn.carousel.Constructor = Carousel
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
398 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
399 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
400 |
/* CAROUSEL DATA-API
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
401 |
* ================= */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
402 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
403 |
$(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
404 |
$('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
405 |
var $this = $(this), href
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
406 |
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
407 |
, options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
408 |
$target.carousel(options)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
409 |
e.preventDefault()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
410 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
411 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
412 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
413 |
}(window.jQuery);/* =============================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
414 |
* bootstrap-collapse.js v2.0.3
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
415 |
* http://twitter.github.com/bootstrap/javascript.html#collapse
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
416 |
* =============================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
417 |
* Copyright 2012 Twitter, Inc.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
418 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
419 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
420 |
* you may not use this file except in compliance with the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
421 |
* You may obtain a copy of the License at
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
422 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
423 |
* http://www.apache.org/licenses/LICENSE-2.0
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
424 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
425 |
* Unless required by applicable law or agreed to in writing, software
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
426 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
427 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
428 |
* See the License for the specific language governing permissions and
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
429 |
* limitations under the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
430 |
* ============================================================ */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
431 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
432 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
433 |
!function ($) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
434 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
435 |
"use strict"; // jshint ;_;
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
436 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
437 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
438 |
/* COLLAPSE PUBLIC CLASS DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
439 |
* ================================ */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
440 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
441 |
var Collapse = function (element, options) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
442 |
this.$element = $(element)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
443 |
this.options = $.extend({}, $.fn.collapse.defaults, options)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
444 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
445 |
if (this.options.parent) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
446 |
this.$parent = $(this.options.parent)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
447 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
448 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
449 |
this.options.toggle && this.toggle()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
450 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
451 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
452 |
Collapse.prototype = {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
453 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
454 |
constructor: Collapse
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
455 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
456 |
, dimension: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
457 |
var hasWidth = this.$element.hasClass('width')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
458 |
return hasWidth ? 'width' : 'height'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
459 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
460 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
461 |
, show: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
462 |
var dimension
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
463 |
, scroll
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
464 |
, actives
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
465 |
, hasData
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
466 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
467 |
if (this.transitioning) return
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
468 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
469 |
dimension = this.dimension()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
470 |
scroll = $.camelCase(['scroll', dimension].join('-'))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
471 |
actives = this.$parent && this.$parent.find('> .accordion-group > .in')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
472 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
473 |
if (actives && actives.length) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
474 |
hasData = actives.data('collapse')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
475 |
if (hasData && hasData.transitioning) return
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
476 |
actives.collapse('hide')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
477 |
hasData || actives.data('collapse', null)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
478 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
479 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
480 |
this.$element[dimension](0)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
481 |
this.transition('addClass', $.Event('show'), 'shown')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
482 |
this.$element[dimension](this.$element[0][scroll])
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
483 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
484 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
485 |
, hide: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
486 |
var dimension
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
487 |
if (this.transitioning) return
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
488 |
dimension = this.dimension()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
489 |
this.reset(this.$element[dimension]())
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
490 |
this.transition('removeClass', $.Event('hide'), 'hidden')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
491 |
this.$element[dimension](0)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
492 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
493 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
494 |
, reset: function (size) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
495 |
var dimension = this.dimension()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
496 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
497 |
this.$element
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
498 |
.removeClass('collapse')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
499 |
[dimension](size || 'auto')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
500 |
[0].offsetWidth
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
501 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
502 |
this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
503 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
504 |
return this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
505 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
506 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
507 |
, transition: function (method, startEvent, completeEvent) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
508 |
var that = this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
509 |
, complete = function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
510 |
if (startEvent.type == 'show') that.reset()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
511 |
that.transitioning = 0
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
512 |
that.$element.trigger(completeEvent)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
513 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
514 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
515 |
this.$element.trigger(startEvent)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
516 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
517 |
if (startEvent.isDefaultPrevented()) return
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
518 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
519 |
this.transitioning = 1
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
520 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
521 |
this.$element[method]('in')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
522 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
523 |
$.support.transition && this.$element.hasClass('collapse') ?
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
524 |
this.$element.one($.support.transition.end, complete) :
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
525 |
complete()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
526 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
527 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
528 |
, toggle: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
529 |
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
530 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
531 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
532 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
533 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
534 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
535 |
/* COLLAPSIBLE PLUGIN DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
536 |
* ============================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
537 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
538 |
$.fn.collapse = function (option) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
539 |
return this.each(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
540 |
var $this = $(this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
541 |
, data = $this.data('collapse')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
542 |
, options = typeof option == 'object' && option
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
543 |
if (!data) $this.data('collapse', (data = new Collapse(this, options)))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
544 |
if (typeof option == 'string') data[option]()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
545 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
546 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
547 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
548 |
$.fn.collapse.defaults = {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
549 |
toggle: true
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
550 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
551 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
552 |
$.fn.collapse.Constructor = Collapse
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
553 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
554 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
555 |
/* COLLAPSIBLE DATA-API
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
556 |
* ==================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
557 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
558 |
$(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
559 |
$('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
560 |
var $this = $(this), href
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
561 |
, target = $this.attr('data-target')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
562 |
|| e.preventDefault()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
563 |
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
564 |
, option = $(target).data('collapse') ? 'toggle' : $this.data()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
565 |
$(target).collapse(option)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
566 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
567 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
568 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
569 |
}(window.jQuery);/* ============================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
570 |
* bootstrap-dropdown.js v2.0.3
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
571 |
* http://twitter.github.com/bootstrap/javascript.html#dropdowns
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
572 |
* ============================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
573 |
* Copyright 2012 Twitter, Inc.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
574 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
575 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
576 |
* you may not use this file except in compliance with the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
577 |
* You may obtain a copy of the License at
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
578 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
579 |
* http://www.apache.org/licenses/LICENSE-2.0
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
580 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
581 |
* Unless required by applicable law or agreed to in writing, software
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
582 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
583 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
584 |
* See the License for the specific language governing permissions and
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
585 |
* limitations under the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
586 |
* ============================================================ */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
587 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
588 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
589 |
!function ($) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
590 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
591 |
"use strict"; // jshint ;_;
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
592 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
593 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
594 |
/* DROPDOWN CLASS DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
595 |
* ========================= */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
596 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
597 |
var toggle = '[data-toggle="dropdown"]'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
598 |
, Dropdown = function (element) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
599 |
var $el = $(element).on('click.dropdown.data-api', this.toggle)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
600 |
$('html').on('click.dropdown.data-api', function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
601 |
$el.parent().removeClass('open')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
602 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
603 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
604 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
605 |
Dropdown.prototype = {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
606 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
607 |
constructor: Dropdown
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
608 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
609 |
, toggle: function (e) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
610 |
var $this = $(this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
611 |
, $parent
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
612 |
, selector
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
613 |
, isActive
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
614 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
615 |
if ($this.is('.disabled, :disabled')) return
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
616 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
617 |
selector = $this.attr('data-target')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
618 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
619 |
if (!selector) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
620 |
selector = $this.attr('href')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
621 |
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
622 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
623 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
624 |
$parent = $(selector)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
625 |
$parent.length || ($parent = $this.parent())
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
626 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
627 |
isActive = $parent.hasClass('open')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
628 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
629 |
clearMenus()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
630 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
631 |
if (!isActive) $parent.toggleClass('open')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
632 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
633 |
return false
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
634 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
635 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
636 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
637 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
638 |
function clearMenus() {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
639 |
$(toggle).parent().removeClass('open')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
640 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
641 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
642 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
643 |
/* DROPDOWN PLUGIN DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
644 |
* ========================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
645 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
646 |
$.fn.dropdown = function (option) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
647 |
return this.each(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
648 |
var $this = $(this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
649 |
, data = $this.data('dropdown')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
650 |
if (!data) $this.data('dropdown', (data = new Dropdown(this)))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
651 |
if (typeof option == 'string') data[option].call($this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
652 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
653 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
654 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
655 |
$.fn.dropdown.Constructor = Dropdown
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
656 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
657 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
658 |
/* APPLY TO STANDARD DROPDOWN ELEMENTS
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
659 |
* =================================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
660 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
661 |
$(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
662 |
$('html').on('click.dropdown.data-api', clearMenus)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
663 |
$('body')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
664 |
.on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
665 |
.on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
666 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
667 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
668 |
}(window.jQuery);/* =========================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
669 |
* bootstrap-modal.js v2.0.3
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
670 |
* http://twitter.github.com/bootstrap/javascript.html#modals
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
671 |
* =========================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
672 |
* Copyright 2012 Twitter, Inc.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
673 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
674 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
675 |
* you may not use this file except in compliance with the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
676 |
* You may obtain a copy of the License at
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
677 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
678 |
* http://www.apache.org/licenses/LICENSE-2.0
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
679 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
680 |
* Unless required by applicable law or agreed to in writing, software
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
681 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
682 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
683 |
* See the License for the specific language governing permissions and
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
684 |
* limitations under the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
685 |
* ========================================================= */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
686 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
687 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
688 |
!function ($) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
689 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
690 |
"use strict"; // jshint ;_;
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
691 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
692 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
693 |
/* MODAL CLASS DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
694 |
* ====================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
695 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
696 |
var Modal = function (content, options) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
697 |
this.options = options
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
698 |
this.$element = $(content)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
699 |
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
700 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
701 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
702 |
Modal.prototype = {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
703 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
704 |
constructor: Modal
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
705 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
706 |
, toggle: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
707 |
return this[!this.isShown ? 'show' : 'hide']()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
708 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
709 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
710 |
, show: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
711 |
var that = this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
712 |
, e = $.Event('show')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
713 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
714 |
this.$element.trigger(e)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
715 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
716 |
if (this.isShown || e.isDefaultPrevented()) return
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
717 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
718 |
$('body').addClass('modal-open')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
719 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
720 |
this.isShown = true
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
721 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
722 |
escape.call(this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
723 |
backdrop.call(this, function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
724 |
var transition = $.support.transition && that.$element.hasClass('fade')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
725 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
726 |
if (!that.$element.parent().length) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
727 |
that.$element.appendTo(document.body) //don't move modals dom position
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
728 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
729 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
730 |
that.$element
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
731 |
.show()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
732 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
733 |
if (transition) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
734 |
that.$element[0].offsetWidth // force reflow
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
735 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
736 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
737 |
that.$element.addClass('in')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
738 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
739 |
transition ?
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
740 |
that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
741 |
that.$element.trigger('shown')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
742 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
743 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
744 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
745 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
746 |
, hide: function (e) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
747 |
e && e.preventDefault()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
748 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
749 |
var that = this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
750 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
751 |
e = $.Event('hide')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
752 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
753 |
this.$element.trigger(e)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
754 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
755 |
if (!this.isShown || e.isDefaultPrevented()) return
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
756 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
757 |
this.isShown = false
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
758 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
759 |
$('body').removeClass('modal-open')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
760 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
761 |
escape.call(this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
762 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
763 |
this.$element.removeClass('in')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
764 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
765 |
$.support.transition && this.$element.hasClass('fade') ?
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
766 |
hideWithTransition.call(this) :
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
767 |
hideModal.call(this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
768 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
769 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
770 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
771 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
772 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
773 |
/* MODAL PRIVATE METHODS
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
774 |
* ===================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
775 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
776 |
function hideWithTransition() {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
777 |
var that = this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
778 |
, timeout = setTimeout(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
779 |
that.$element.off($.support.transition.end)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
780 |
hideModal.call(that)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
781 |
}, 500)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
782 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
783 |
this.$element.one($.support.transition.end, function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
784 |
clearTimeout(timeout)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
785 |
hideModal.call(that)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
786 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
787 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
788 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
789 |
function hideModal(that) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
790 |
this.$element
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
791 |
.hide()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
792 |
.trigger('hidden')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
793 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
794 |
backdrop.call(this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
795 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
796 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
797 |
function backdrop(callback) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
798 |
var that = this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
799 |
, animate = this.$element.hasClass('fade') ? 'fade' : ''
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
800 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
801 |
if (this.isShown && this.options.backdrop) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
802 |
var doAnimate = $.support.transition && animate
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
803 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
804 |
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
805 |
.appendTo(document.body)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
806 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
807 |
if (this.options.backdrop != 'static') {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
808 |
this.$backdrop.click($.proxy(this.hide, this))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
809 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
810 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
811 |
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
812 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
813 |
this.$backdrop.addClass('in')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
814 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
815 |
doAnimate ?
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
816 |
this.$backdrop.one($.support.transition.end, callback) :
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
817 |
callback()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
818 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
819 |
} else if (!this.isShown && this.$backdrop) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
820 |
this.$backdrop.removeClass('in')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
821 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
822 |
$.support.transition && this.$element.hasClass('fade')?
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
823 |
this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
824 |
removeBackdrop.call(this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
825 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
826 |
} else if (callback) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
827 |
callback()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
828 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
829 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
830 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
831 |
function removeBackdrop() {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
832 |
this.$backdrop.remove()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
833 |
this.$backdrop = null
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
834 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
835 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
836 |
function escape() {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
837 |
var that = this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
838 |
if (this.isShown && this.options.keyboard) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
839 |
$(document).on('keyup.dismiss.modal', function ( e ) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
840 |
e.which == 27 && that.hide()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
841 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
842 |
} else if (!this.isShown) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
843 |
$(document).off('keyup.dismiss.modal')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
844 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
845 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
846 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
847 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
848 |
/* MODAL PLUGIN DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
849 |
* ======================= */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
850 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
851 |
$.fn.modal = function (option) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
852 |
return this.each(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
853 |
var $this = $(this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
854 |
, data = $this.data('modal')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
855 |
, options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
856 |
if (!data) $this.data('modal', (data = new Modal(this, options)))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
857 |
if (typeof option == 'string') data[option]()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
858 |
else if (options.show) data.show()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
859 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
860 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
861 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
862 |
$.fn.modal.defaults = {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
863 |
backdrop: true
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
864 |
, keyboard: true
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
865 |
, show: true
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
866 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
867 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
868 |
$.fn.modal.Constructor = Modal
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
869 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
870 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
871 |
/* MODAL DATA-API
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
872 |
* ============== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
873 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
874 |
$(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
875 |
$('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
876 |
var $this = $(this), href
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
877 |
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
878 |
, option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
879 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
880 |
e.preventDefault()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
881 |
$target.modal(option)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
882 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
883 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
884 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
885 |
}(window.jQuery);/* ===========================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
886 |
* bootstrap-tooltip.js v2.0.3
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
887 |
* http://twitter.github.com/bootstrap/javascript.html#tooltips
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
888 |
* Inspired by the original jQuery.tipsy by Jason Frame
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
889 |
* ===========================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
890 |
* Copyright 2012 Twitter, Inc.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
891 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
892 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
893 |
* you may not use this file except in compliance with the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
894 |
* You may obtain a copy of the License at
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
895 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
896 |
* http://www.apache.org/licenses/LICENSE-2.0
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
897 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
898 |
* Unless required by applicable law or agreed to in writing, software
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
899 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
900 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
901 |
* See the License for the specific language governing permissions and
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
902 |
* limitations under the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
903 |
* ========================================================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
904 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
905 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
906 |
!function ($) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
907 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
908 |
"use strict"; // jshint ;_;
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
909 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
910 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
911 |
/* TOOLTIP PUBLIC CLASS DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
912 |
* =============================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
913 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
914 |
var Tooltip = function (element, options) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
915 |
this.init('tooltip', element, options)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
916 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
917 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
918 |
Tooltip.prototype = {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
919 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
920 |
constructor: Tooltip
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
921 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
922 |
, init: function (type, element, options) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
923 |
var eventIn
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
924 |
, eventOut
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
925 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
926 |
this.type = type
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
927 |
this.$element = $(element)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
928 |
this.options = this.getOptions(options)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
929 |
this.enabled = true
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
930 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
931 |
if (this.options.trigger != 'manual') {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
932 |
eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
933 |
eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
934 |
this.$element.on(eventIn, this.options.selector, $.proxy(this.enter, this))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
935 |
this.$element.on(eventOut, this.options.selector, $.proxy(this.leave, this))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
936 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
937 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
938 |
this.options.selector ?
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
939 |
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
940 |
this.fixTitle()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
941 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
942 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
943 |
, getOptions: function (options) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
944 |
options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
945 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
946 |
if (options.delay && typeof options.delay == 'number') {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
947 |
options.delay = {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
948 |
show: options.delay
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
949 |
, hide: options.delay
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
950 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
951 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
952 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
953 |
return options
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
954 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
955 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
956 |
, enter: function (e) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
957 |
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
958 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
959 |
if (!self.options.delay || !self.options.delay.show) return self.show()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
960 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
961 |
clearTimeout(this.timeout)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
962 |
self.hoverState = 'in'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
963 |
this.timeout = setTimeout(function() {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
964 |
if (self.hoverState == 'in') self.show()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
965 |
}, self.options.delay.show)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
966 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
967 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
968 |
, leave: function (e) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
969 |
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
970 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
971 |
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
972 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
973 |
clearTimeout(this.timeout)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
974 |
self.hoverState = 'out'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
975 |
this.timeout = setTimeout(function() {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
976 |
if (self.hoverState == 'out') self.hide()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
977 |
}, self.options.delay.hide)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
978 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
979 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
980 |
, show: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
981 |
var $tip
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
982 |
, inside
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
983 |
, pos
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
984 |
, actualWidth
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
985 |
, actualHeight
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
986 |
, placement
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
987 |
, tp
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
988 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
989 |
if (this.hasContent() && this.enabled) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
990 |
$tip = this.tip()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
991 |
this.setContent()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
992 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
993 |
if (this.options.animation) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
994 |
$tip.addClass('fade')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
995 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
996 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
997 |
placement = typeof this.options.placement == 'function' ?
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
998 |
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
999 |
this.options.placement
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1000 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1001 |
inside = /in/.test(placement)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1002 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1003 |
$tip
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1004 |
.remove()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1005 |
.css({ top: 0, left: 0, display: 'block' })
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1006 |
.appendTo(inside ? this.$element : document.body)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1007 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1008 |
pos = this.getPosition(inside)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1009 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1010 |
actualWidth = $tip[0].offsetWidth
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1011 |
actualHeight = $tip[0].offsetHeight
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1012 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1013 |
switch (inside ? placement.split(' ')[1] : placement) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1014 |
case 'bottom':
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1015 |
tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1016 |
break
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1017 |
case 'top':
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1018 |
tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1019 |
break
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1020 |
case 'left':
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1021 |
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1022 |
break
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1023 |
case 'right':
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1024 |
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1025 |
break
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1026 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1027 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1028 |
$tip
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1029 |
.css(tp)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1030 |
.addClass(placement)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1031 |
.addClass('in')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1032 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1033 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1034 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1035 |
, isHTML: function(text) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1036 |
// html string detection logic adapted from jQuery
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1037 |
return typeof text != 'string'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1038 |
|| ( text.charAt(0) === "<"
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1039 |
&& text.charAt( text.length - 1 ) === ">"
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1040 |
&& text.length >= 3
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1041 |
) || /^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(text)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1042 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1043 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1044 |
, setContent: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1045 |
var $tip = this.tip()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1046 |
, title = this.getTitle()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1047 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1048 |
$tip.find('.tooltip-inner')[this.isHTML(title) ? 'html' : 'text'](title)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1049 |
$tip.removeClass('fade in top bottom left right')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1050 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1051 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1052 |
, hide: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1053 |
var that = this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1054 |
, $tip = this.tip()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1055 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1056 |
$tip.removeClass('in')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1057 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1058 |
function removeWithAnimation() {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1059 |
var timeout = setTimeout(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1060 |
$tip.off($.support.transition.end).remove()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1061 |
}, 500)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1062 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1063 |
$tip.one($.support.transition.end, function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1064 |
clearTimeout(timeout)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1065 |
$tip.remove()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1066 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1067 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1068 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1069 |
$.support.transition && this.$tip.hasClass('fade') ?
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1070 |
removeWithAnimation() :
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1071 |
$tip.remove()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1072 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1073 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1074 |
, fixTitle: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1075 |
var $e = this.$element
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1076 |
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1077 |
$e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1078 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1079 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1080 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1081 |
, hasContent: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1082 |
return this.getTitle()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1083 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1084 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1085 |
, getPosition: function (inside) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1086 |
return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1087 |
width: this.$element[0].offsetWidth
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1088 |
, height: this.$element[0].offsetHeight
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1089 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1090 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1091 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1092 |
, getTitle: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1093 |
var title
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1094 |
, $e = this.$element
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1095 |
, o = this.options
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1096 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1097 |
title = $e.attr('data-original-title')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1098 |
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1099 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1100 |
return title
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1101 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1102 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1103 |
, tip: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1104 |
return this.$tip = this.$tip || $(this.options.template)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1105 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1106 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1107 |
, validate: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1108 |
if (!this.$element[0].parentNode) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1109 |
this.hide()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1110 |
this.$element = null
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1111 |
this.options = null
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1112 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1113 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1114 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1115 |
, enable: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1116 |
this.enabled = true
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1117 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1118 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1119 |
, disable: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1120 |
this.enabled = false
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1121 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1122 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1123 |
, toggleEnabled: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1124 |
this.enabled = !this.enabled
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1125 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1126 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1127 |
, toggle: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1128 |
this[this.tip().hasClass('in') ? 'hide' : 'show']()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1129 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1130 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1131 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1132 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1133 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1134 |
/* TOOLTIP PLUGIN DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1135 |
* ========================= */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1136 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1137 |
$.fn.tooltip = function ( option ) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1138 |
return this.each(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1139 |
var $this = $(this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1140 |
, data = $this.data('tooltip')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1141 |
, options = typeof option == 'object' && option
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1142 |
if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1143 |
if (typeof option == 'string') data[option]()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1144 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1145 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1146 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1147 |
$.fn.tooltip.Constructor = Tooltip
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1148 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1149 |
$.fn.tooltip.defaults = {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1150 |
animation: true
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1151 |
, placement: 'top'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1152 |
, selector: false
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1153 |
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1154 |
, trigger: 'hover'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1155 |
, title: ''
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1156 |
, delay: 0
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1157 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1158 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1159 |
}(window.jQuery);/* ===========================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1160 |
* bootstrap-popover.js v2.0.3
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1161 |
* http://twitter.github.com/bootstrap/javascript.html#popovers
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1162 |
* ===========================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1163 |
* Copyright 2012 Twitter, Inc.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1164 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1165 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1166 |
* you may not use this file except in compliance with the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1167 |
* You may obtain a copy of the License at
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1168 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1169 |
* http://www.apache.org/licenses/LICENSE-2.0
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1170 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1171 |
* Unless required by applicable law or agreed to in writing, software
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1172 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1173 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1174 |
* See the License for the specific language governing permissions and
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1175 |
* limitations under the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1176 |
* =========================================================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1177 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1178 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1179 |
!function ($) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1180 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1181 |
"use strict"; // jshint ;_;
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1182 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1183 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1184 |
/* POPOVER PUBLIC CLASS DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1185 |
* =============================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1186 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1187 |
var Popover = function ( element, options ) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1188 |
this.init('popover', element, options)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1189 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1190 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1191 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1192 |
/* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1193 |
========================================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1194 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1195 |
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1196 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1197 |
constructor: Popover
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1198 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1199 |
, setContent: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1200 |
var $tip = this.tip()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1201 |
, title = this.getTitle()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1202 |
, content = this.getContent()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1203 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1204 |
$tip.find('.popover-title')[this.isHTML(title) ? 'html' : 'text'](title)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1205 |
$tip.find('.popover-content > *')[this.isHTML(content) ? 'html' : 'text'](content)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1206 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1207 |
$tip.removeClass('fade top bottom left right in')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1208 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1209 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1210 |
, hasContent: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1211 |
return this.getTitle() || this.getContent()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1212 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1213 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1214 |
, getContent: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1215 |
var content
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1216 |
, $e = this.$element
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1217 |
, o = this.options
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1218 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1219 |
content = $e.attr('data-content')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1220 |
|| (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1221 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1222 |
return content
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1223 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1224 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1225 |
, tip: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1226 |
if (!this.$tip) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1227 |
this.$tip = $(this.options.template)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1228 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1229 |
return this.$tip
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1230 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1231 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1232 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1233 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1234 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1235 |
/* POPOVER PLUGIN DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1236 |
* ======================= */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1237 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1238 |
$.fn.popover = function (option) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1239 |
return this.each(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1240 |
var $this = $(this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1241 |
, data = $this.data('popover')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1242 |
, options = typeof option == 'object' && option
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1243 |
if (!data) $this.data('popover', (data = new Popover(this, options)))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1244 |
if (typeof option == 'string') data[option]()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1245 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1246 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1247 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1248 |
$.fn.popover.Constructor = Popover
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1249 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1250 |
$.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1251 |
placement: 'right'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1252 |
, content: ''
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1253 |
, template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1254 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1255 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1256 |
}(window.jQuery);/* =============================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1257 |
* bootstrap-scrollspy.js v2.0.3
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1258 |
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1259 |
* =============================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1260 |
* Copyright 2012 Twitter, Inc.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1261 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1262 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1263 |
* you may not use this file except in compliance with the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1264 |
* You may obtain a copy of the License at
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1265 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1266 |
* http://www.apache.org/licenses/LICENSE-2.0
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1267 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1268 |
* Unless required by applicable law or agreed to in writing, software
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1269 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1270 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1271 |
* See the License for the specific language governing permissions and
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1272 |
* limitations under the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1273 |
* ============================================================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1274 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1275 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1276 |
!function ($) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1277 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1278 |
"use strict"; // jshint ;_;
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1279 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1280 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1281 |
/* SCROLLSPY CLASS DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1282 |
* ========================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1283 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1284 |
function ScrollSpy( element, options) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1285 |
var process = $.proxy(this.process, this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1286 |
, $element = $(element).is('body') ? $(window) : $(element)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1287 |
, href
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1288 |
this.options = $.extend({}, $.fn.scrollspy.defaults, options)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1289 |
this.$scrollElement = $element.on('scroll.scroll.data-api', process)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1290 |
this.selector = (this.options.target
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1291 |
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1292 |
|| '') + ' .nav li > a'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1293 |
this.$body = $('body')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1294 |
this.refresh()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1295 |
this.process()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1296 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1297 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1298 |
ScrollSpy.prototype = {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1299 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1300 |
constructor: ScrollSpy
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1301 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1302 |
, refresh: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1303 |
var self = this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1304 |
, $targets
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1305 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1306 |
this.offsets = $([])
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1307 |
this.targets = $([])
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1308 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1309 |
$targets = this.$body
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1310 |
.find(this.selector)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1311 |
.map(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1312 |
var $el = $(this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1313 |
, href = $el.data('target') || $el.attr('href')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1314 |
, $href = /^#\w/.test(href) && $(href)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1315 |
return ( $href
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1316 |
&& href.length
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1317 |
&& [[ $href.position().top, href ]] ) || null
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1318 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1319 |
.sort(function (a, b) { return a[0] - b[0] })
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1320 |
.each(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1321 |
self.offsets.push(this[0])
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1322 |
self.targets.push(this[1])
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1323 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1324 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1325 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1326 |
, process: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1327 |
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1328 |
, scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1329 |
, maxScroll = scrollHeight - this.$scrollElement.height()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1330 |
, offsets = this.offsets
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1331 |
, targets = this.targets
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1332 |
, activeTarget = this.activeTarget
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1333 |
, i
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1334 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1335 |
if (scrollTop >= maxScroll) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1336 |
return activeTarget != (i = targets.last()[0])
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1337 |
&& this.activate ( i )
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1338 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1339 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1340 |
for (i = offsets.length; i--;) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1341 |
activeTarget != targets[i]
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1342 |
&& scrollTop >= offsets[i]
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1343 |
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1344 |
&& this.activate( targets[i] )
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1345 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1346 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1347 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1348 |
, activate: function (target) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1349 |
var active
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1350 |
, selector
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1351 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1352 |
this.activeTarget = target
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1353 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1354 |
$(this.selector)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1355 |
.parent('.active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1356 |
.removeClass('active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1357 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1358 |
selector = this.selector
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1359 |
+ '[data-target="' + target + '"],'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1360 |
+ this.selector + '[href="' + target + '"]'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1361 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1362 |
active = $(selector)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1363 |
.parent('li')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1364 |
.addClass('active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1365 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1366 |
if (active.parent('.dropdown-menu')) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1367 |
active = active.closest('li.dropdown').addClass('active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1368 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1369 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1370 |
active.trigger('activate')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1371 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1372 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1373 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1374 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1375 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1376 |
/* SCROLLSPY PLUGIN DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1377 |
* =========================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1378 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1379 |
$.fn.scrollspy = function ( option ) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1380 |
return this.each(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1381 |
var $this = $(this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1382 |
, data = $this.data('scrollspy')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1383 |
, options = typeof option == 'object' && option
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1384 |
if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1385 |
if (typeof option == 'string') data[option]()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1386 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1387 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1388 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1389 |
$.fn.scrollspy.Constructor = ScrollSpy
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1390 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1391 |
$.fn.scrollspy.defaults = {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1392 |
offset: 10
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1393 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1394 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1395 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1396 |
/* SCROLLSPY DATA-API
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1397 |
* ================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1398 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1399 |
$(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1400 |
$('[data-spy="scroll"]').each(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1401 |
var $spy = $(this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1402 |
$spy.scrollspy($spy.data())
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1403 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1404 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1405 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1406 |
}(window.jQuery);/* ========================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1407 |
* bootstrap-tab.js v2.0.3
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1408 |
* http://twitter.github.com/bootstrap/javascript.html#tabs
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1409 |
* ========================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1410 |
* Copyright 2012 Twitter, Inc.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1411 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1412 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1413 |
* you may not use this file except in compliance with the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1414 |
* You may obtain a copy of the License at
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1415 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1416 |
* http://www.apache.org/licenses/LICENSE-2.0
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1417 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1418 |
* Unless required by applicable law or agreed to in writing, software
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1419 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1420 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1421 |
* See the License for the specific language governing permissions and
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1422 |
* limitations under the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1423 |
* ======================================================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1424 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1425 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1426 |
!function ($) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1427 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1428 |
"use strict"; // jshint ;_;
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1429 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1430 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1431 |
/* TAB CLASS DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1432 |
* ==================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1433 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1434 |
var Tab = function ( element ) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1435 |
this.element = $(element)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1436 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1437 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1438 |
Tab.prototype = {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1439 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1440 |
constructor: Tab
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1441 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1442 |
, show: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1443 |
var $this = this.element
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1444 |
, $ul = $this.closest('ul:not(.dropdown-menu)')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1445 |
, selector = $this.attr('data-target')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1446 |
, previous
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1447 |
, $target
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1448 |
, e
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1449 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1450 |
if (!selector) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1451 |
selector = $this.attr('href')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1452 |
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1453 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1454 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1455 |
if ( $this.parent('li').hasClass('active') ) return
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1456 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1457 |
previous = $ul.find('.active a').last()[0]
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1458 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1459 |
e = $.Event('show', {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1460 |
relatedTarget: previous
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1461 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1462 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1463 |
$this.trigger(e)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1464 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1465 |
if (e.isDefaultPrevented()) return
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1466 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1467 |
$target = $(selector)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1468 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1469 |
this.activate($this.parent('li'), $ul)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1470 |
this.activate($target, $target.parent(), function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1471 |
$this.trigger({
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1472 |
type: 'shown'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1473 |
, relatedTarget: previous
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1474 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1475 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1476 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1477 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1478 |
, activate: function ( element, container, callback) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1479 |
var $active = container.find('> .active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1480 |
, transition = callback
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1481 |
&& $.support.transition
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1482 |
&& $active.hasClass('fade')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1483 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1484 |
function next() {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1485 |
$active
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1486 |
.removeClass('active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1487 |
.find('> .dropdown-menu > .active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1488 |
.removeClass('active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1489 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1490 |
element.addClass('active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1491 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1492 |
if (transition) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1493 |
element[0].offsetWidth // reflow for transition
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1494 |
element.addClass('in')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1495 |
} else {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1496 |
element.removeClass('fade')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1497 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1498 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1499 |
if ( element.parent('.dropdown-menu') ) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1500 |
element.closest('li.dropdown').addClass('active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1501 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1502 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1503 |
callback && callback()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1504 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1505 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1506 |
transition ?
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1507 |
$active.one($.support.transition.end, next) :
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1508 |
next()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1509 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1510 |
$active.removeClass('in')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1511 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1512 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1513 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1514 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1515 |
/* TAB PLUGIN DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1516 |
* ===================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1517 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1518 |
$.fn.tab = function ( option ) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1519 |
return this.each(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1520 |
var $this = $(this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1521 |
, data = $this.data('tab')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1522 |
if (!data) $this.data('tab', (data = new Tab(this)))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1523 |
if (typeof option == 'string') data[option]()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1524 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1525 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1526 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1527 |
$.fn.tab.Constructor = Tab
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1528 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1529 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1530 |
/* TAB DATA-API
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1531 |
* ============ */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1532 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1533 |
$(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1534 |
$('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1535 |
e.preventDefault()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1536 |
$(this).tab('show')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1537 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1538 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1539 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1540 |
}(window.jQuery);/* =============================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1541 |
* bootstrap-typeahead.js v2.0.3
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1542 |
* http://twitter.github.com/bootstrap/javascript.html#typeahead
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1543 |
* =============================================================
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1544 |
* Copyright 2012 Twitter, Inc.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1545 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1546 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1547 |
* you may not use this file except in compliance with the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1548 |
* You may obtain a copy of the License at
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1549 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1550 |
* http://www.apache.org/licenses/LICENSE-2.0
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1551 |
*
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1552 |
* Unless required by applicable law or agreed to in writing, software
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1553 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1554 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1555 |
* See the License for the specific language governing permissions and
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1556 |
* limitations under the License.
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1557 |
* ============================================================ */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1558 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1559 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1560 |
!function($){
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1561 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1562 |
"use strict"; // jshint ;_;
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1563 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1564 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1565 |
/* TYPEAHEAD PUBLIC CLASS DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1566 |
* ================================= */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1567 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1568 |
var Typeahead = function (element, options) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1569 |
this.$element = $(element)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1570 |
this.options = $.extend({}, $.fn.typeahead.defaults, options)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1571 |
this.matcher = this.options.matcher || this.matcher
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1572 |
this.sorter = this.options.sorter || this.sorter
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1573 |
this.highlighter = this.options.highlighter || this.highlighter
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1574 |
this.updater = this.options.updater || this.updater
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1575 |
this.$menu = $(this.options.menu).appendTo('body')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1576 |
this.source = this.options.source
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1577 |
this.shown = false
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1578 |
this.listen()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1579 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1580 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1581 |
Typeahead.prototype = {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1582 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1583 |
constructor: Typeahead
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1584 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1585 |
, select: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1586 |
var val = this.$menu.find('.active').attr('data-value')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1587 |
this.$element
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1588 |
.val(this.updater(val))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1589 |
.change()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1590 |
return this.hide()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1591 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1592 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1593 |
, updater: function (item) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1594 |
return item
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1595 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1596 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1597 |
, show: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1598 |
var pos = $.extend({}, this.$element.offset(), {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1599 |
height: this.$element[0].offsetHeight
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1600 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1601 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1602 |
this.$menu.css({
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1603 |
top: pos.top + pos.height
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1604 |
, left: pos.left
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1605 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1606 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1607 |
this.$menu.show()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1608 |
this.shown = true
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1609 |
return this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1610 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1611 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1612 |
, hide: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1613 |
this.$menu.hide()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1614 |
this.shown = false
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1615 |
return this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1616 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1617 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1618 |
, lookup: function (event) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1619 |
var that = this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1620 |
, items
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1621 |
, q
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1622 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1623 |
this.query = this.$element.val()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1624 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1625 |
if (!this.query) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1626 |
return this.shown ? this.hide() : this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1627 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1628 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1629 |
items = $.grep(this.source, function (item) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1630 |
return that.matcher(item)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1631 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1632 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1633 |
items = this.sorter(items)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1634 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1635 |
if (!items.length) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1636 |
return this.shown ? this.hide() : this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1637 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1638 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1639 |
return this.render(items.slice(0, this.options.items)).show()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1640 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1641 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1642 |
, matcher: function (item) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1643 |
return ~item.toLowerCase().indexOf(this.query.toLowerCase())
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1644 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1645 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1646 |
, sorter: function (items) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1647 |
var beginswith = []
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1648 |
, caseSensitive = []
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1649 |
, caseInsensitive = []
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1650 |
, item
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1651 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1652 |
while (item = items.shift()) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1653 |
if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1654 |
else if (~item.indexOf(this.query)) caseSensitive.push(item)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1655 |
else caseInsensitive.push(item)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1656 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1657 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1658 |
return beginswith.concat(caseSensitive, caseInsensitive)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1659 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1660 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1661 |
, highlighter: function (item) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1662 |
var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1663 |
return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1664 |
return '<strong>' + match + '</strong>'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1665 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1666 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1667 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1668 |
, render: function (items) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1669 |
var that = this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1670 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1671 |
items = $(items).map(function (i, item) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1672 |
i = $(that.options.item).attr('data-value', item)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1673 |
i.find('a').html(that.highlighter(item))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1674 |
return i[0]
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1675 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1676 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1677 |
items.first().addClass('active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1678 |
this.$menu.html(items)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1679 |
return this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1680 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1681 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1682 |
, next: function (event) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1683 |
var active = this.$menu.find('.active').removeClass('active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1684 |
, next = active.next()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1685 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1686 |
if (!next.length) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1687 |
next = $(this.$menu.find('li')[0])
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1688 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1689 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1690 |
next.addClass('active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1691 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1692 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1693 |
, prev: function (event) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1694 |
var active = this.$menu.find('.active').removeClass('active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1695 |
, prev = active.prev()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1696 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1697 |
if (!prev.length) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1698 |
prev = this.$menu.find('li').last()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1699 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1700 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1701 |
prev.addClass('active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1702 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1703 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1704 |
, listen: function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1705 |
this.$element
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1706 |
.on('blur', $.proxy(this.blur, this))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1707 |
.on('keypress', $.proxy(this.keypress, this))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1708 |
.on('keyup', $.proxy(this.keyup, this))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1709 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1710 |
if ($.browser.webkit || $.browser.msie) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1711 |
this.$element.on('keydown', $.proxy(this.keypress, this))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1712 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1713 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1714 |
this.$menu
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1715 |
.on('click', $.proxy(this.click, this))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1716 |
.on('mouseenter', 'li', $.proxy(this.mouseenter, this))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1717 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1718 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1719 |
, keyup: function (e) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1720 |
switch(e.keyCode) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1721 |
case 40: // down arrow
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1722 |
case 38: // up arrow
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1723 |
break
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1724 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1725 |
case 9: // tab
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1726 |
case 13: // enter
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1727 |
if (!this.shown) return
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1728 |
this.select()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1729 |
break
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1730 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1731 |
case 27: // escape
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1732 |
if (!this.shown) return
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1733 |
this.hide()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1734 |
break
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1735 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1736 |
default:
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1737 |
this.lookup()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1738 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1739 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1740 |
e.stopPropagation()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1741 |
e.preventDefault()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1742 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1743 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1744 |
, keypress: function (e) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1745 |
if (!this.shown) return
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1746 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1747 |
switch(e.keyCode) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1748 |
case 9: // tab
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1749 |
case 13: // enter
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1750 |
case 27: // escape
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1751 |
e.preventDefault()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1752 |
break
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1753 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1754 |
case 38: // up arrow
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1755 |
if (e.type != 'keydown') break
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1756 |
e.preventDefault()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1757 |
this.prev()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1758 |
break
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1759 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1760 |
case 40: // down arrow
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1761 |
if (e.type != 'keydown') break
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1762 |
e.preventDefault()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1763 |
this.next()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1764 |
break
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1765 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1766 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1767 |
e.stopPropagation()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1768 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1769 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1770 |
, blur: function (e) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1771 |
var that = this
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1772 |
setTimeout(function () { that.hide() }, 150)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1773 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1774 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1775 |
, click: function (e) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1776 |
e.stopPropagation()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1777 |
e.preventDefault()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1778 |
this.select()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1779 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1780 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1781 |
, mouseenter: function (e) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1782 |
this.$menu.find('.active').removeClass('active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1783 |
$(e.currentTarget).addClass('active')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1784 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1785 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1786 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1787 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1788 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1789 |
/* TYPEAHEAD PLUGIN DEFINITION
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1790 |
* =========================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1791 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1792 |
$.fn.typeahead = function (option) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1793 |
return this.each(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1794 |
var $this = $(this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1795 |
, data = $this.data('typeahead')
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1796 |
, options = typeof option == 'object' && option
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1797 |
if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1798 |
if (typeof option == 'string') data[option]()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1799 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1800 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1801 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1802 |
$.fn.typeahead.defaults = {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1803 |
source: []
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1804 |
, items: 8
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1805 |
, menu: '<ul class="typeahead dropdown-menu"></ul>'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1806 |
, item: '<li><a href="#"></a></li>'
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1807 |
}
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1808 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1809 |
$.fn.typeahead.Constructor = Typeahead
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1810 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1811 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1812 |
/* TYPEAHEAD DATA-API
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1813 |
* ================== */
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1814 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1815 |
$(function () {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1816 |
$('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1817 |
var $this = $(this)
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1818 |
if ($this.data('typeahead')) return
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1819 |
e.preventDefault()
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1820 |
$this.typeahead($this.data())
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1821 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1822 |
})
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1823 |
|
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff
changeset
|
1824 |
}(window.jQuery); |