1
|
|
|
/* =================================================== |
2
|
|
|
* bootstrap-transition.js v2.3.2 |
3
|
|
|
* http://twitter.github.com/bootstrap/javascript.html#transitions |
4
|
|
|
* =================================================== |
5
|
|
|
* Copyright 2012 Twitter, Inc. |
6
|
|
|
* |
7
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
8
|
|
|
* you may not use this file except in compliance with the License. |
9
|
|
|
* You may obtain a copy of the License at |
10
|
|
|
* |
11
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
12
|
|
|
* |
13
|
|
|
* Unless required by applicable law or agreed to in writing, software |
14
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
15
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
16
|
|
|
* See the License for the specific language governing permissions and |
17
|
|
|
* limitations under the License. |
18
|
|
|
* ========================================================== */ |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* Custom version for Joomla! |
22
|
|
|
*/ |
23
|
|
|
|
24
|
|
|
!function ($) { |
25
|
|
|
|
26
|
|
|
"use strict"; // jshint ;_; |
27
|
|
|
|
28
|
|
|
|
29
|
|
|
/* CSS TRANSITION SUPPORT (http://www.modernizr.com/) |
30
|
|
|
* ======================================================= */ |
31
|
|
|
|
32
|
|
|
$(function () { |
33
|
|
|
|
34
|
|
|
$.support.transition = (function () { |
35
|
|
|
|
36
|
|
|
var transitionEnd = (function () { |
37
|
|
|
|
38
|
|
|
var el = document.createElement('bootstrap') |
39
|
|
|
, transEndEventNames = { |
40
|
|
|
'WebkitTransition' : 'webkitTransitionEnd' |
41
|
|
|
, 'MozTransition' : 'transitionend' |
42
|
|
|
, 'OTransition' : 'oTransitionEnd otransitionend' |
43
|
|
|
, 'transition' : 'transitionend' |
44
|
|
|
} |
45
|
|
|
, name |
46
|
|
|
|
47
|
|
|
for (name in transEndEventNames){ |
48
|
|
|
if (el.style[name] !== undefined) { |
49
|
|
|
return transEndEventNames[name] |
50
|
|
|
} |
51
|
|
|
} |
|
|
|
|
52
|
|
|
|
53
|
|
|
}()) |
54
|
|
|
|
55
|
|
|
return transitionEnd && { |
56
|
|
|
end: transitionEnd |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
})() |
60
|
|
|
|
61
|
|
|
}) |
62
|
|
|
|
63
|
|
|
}(window.jQuery);/* ========================================================== |
64
|
|
|
* bootstrap-alert.js v2.3.2 |
65
|
|
|
* http://twitter.github.com/bootstrap/javascript.html#alerts |
66
|
|
|
* ========================================================== |
67
|
|
|
* Copyright 2012 Twitter, Inc. |
68
|
|
|
* |
69
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
70
|
|
|
* you may not use this file except in compliance with the License. |
71
|
|
|
* You may obtain a copy of the License at |
72
|
|
|
* |
73
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
74
|
|
|
* |
75
|
|
|
* Unless required by applicable law or agreed to in writing, software |
76
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
77
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
78
|
|
|
* See the License for the specific language governing permissions and |
79
|
|
|
* limitations under the License. |
80
|
|
|
* ========================================================== */ |
81
|
|
|
|
82
|
|
|
|
83
|
|
|
!function ($) { |
84
|
|
|
|
85
|
|
|
"use strict"; // jshint ;_; |
86
|
|
|
|
87
|
|
|
|
88
|
|
|
/* ALERT CLASS DEFINITION |
89
|
|
|
* ====================== */ |
90
|
|
|
|
91
|
|
|
var dismiss = '[data-dismiss="alert"]' |
92
|
|
|
, Alert = function (el) { |
93
|
|
|
$(el).on('click', dismiss, this.close) |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
Alert.prototype.close = function (e) { |
97
|
|
|
var $this = $(this) |
98
|
|
|
, selector = $this.attr('data-target') |
99
|
|
|
, $parent |
100
|
|
|
|
101
|
|
|
if (!selector) { |
102
|
|
|
selector = $this.attr('href') |
103
|
|
|
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
$parent = $(selector) |
107
|
|
|
|
108
|
|
|
e && e.preventDefault() |
109
|
|
|
|
110
|
|
|
$parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) |
111
|
|
|
|
112
|
|
|
$parent.trigger(e = $.Event('close')) |
113
|
|
|
|
114
|
|
|
if (e.isDefaultPrevented()) return |
|
|
|
|
115
|
|
|
|
116
|
|
|
$parent.removeClass('in') |
117
|
|
|
|
118
|
|
|
function removeElement() { |
119
|
|
|
$parent |
120
|
|
|
.trigger('closed') |
121
|
|
|
.remove() |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
$.support.transition && $parent.hasClass('fade') ? |
125
|
|
|
$parent.on($.support.transition.end, removeElement) : |
126
|
|
|
removeElement() |
127
|
|
|
} |
128
|
|
|
|
129
|
|
|
|
130
|
|
|
/* ALERT PLUGIN DEFINITION |
131
|
|
|
* ======================= */ |
132
|
|
|
|
133
|
|
|
var old = $.fn.alert |
134
|
|
|
|
135
|
|
|
$.fn.alert = function (option) { |
136
|
|
|
return this.each(function () { |
137
|
|
|
var $this = $(this) |
138
|
|
|
, data = $this.data('alert') |
139
|
|
|
if (!data) $this.data('alert', (data = new Alert(this))) |
|
|
|
|
140
|
|
|
if (typeof option == 'string') data[option].call($this) |
|
|
|
|
141
|
|
|
}) |
142
|
|
|
} |
143
|
|
|
|
144
|
|
|
$.fn.alert.Constructor = Alert |
145
|
|
|
|
146
|
|
|
|
147
|
|
|
/* ALERT NO CONFLICT |
148
|
|
|
* ================= */ |
149
|
|
|
|
150
|
|
|
$.fn.alert.noConflict = function () { |
151
|
|
|
$.fn.alert = old |
152
|
|
|
return this |
153
|
|
|
} |
154
|
|
|
|
155
|
|
|
|
156
|
|
|
/* ALERT DATA-API |
157
|
|
|
* ============== */ |
158
|
|
|
|
159
|
|
|
$(document).on('click.alert.data-api', dismiss, Alert.prototype.close) |
160
|
|
|
|
161
|
|
|
}(window.jQuery);/* ============================================================ |
162
|
|
|
* bootstrap-button.js v2.3.2 |
163
|
|
|
* http://twitter.github.com/bootstrap/javascript.html#buttons |
164
|
|
|
* ============================================================ |
165
|
|
|
* Copyright 2012 Twitter, Inc. |
166
|
|
|
* |
167
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
168
|
|
|
* you may not use this file except in compliance with the License. |
169
|
|
|
* You may obtain a copy of the License at |
170
|
|
|
* |
171
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
172
|
|
|
* |
173
|
|
|
* Unless required by applicable law or agreed to in writing, software |
174
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
175
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
176
|
|
|
* See the License for the specific language governing permissions and |
177
|
|
|
* limitations under the License. |
178
|
|
|
* ============================================================ */ |
179
|
|
|
|
180
|
|
|
|
181
|
|
|
!function ($) { |
182
|
|
|
|
183
|
|
|
"use strict"; // jshint ;_; |
184
|
|
|
|
185
|
|
|
|
186
|
|
|
/* BUTTON PUBLIC CLASS DEFINITION |
187
|
|
|
* ============================== */ |
188
|
|
|
|
189
|
|
|
var Button = function (element, options) { |
190
|
|
|
this.$element = $(element) |
191
|
|
|
this.options = $.extend({}, $.fn.button.defaults, options) |
192
|
|
|
} |
193
|
|
|
|
194
|
|
|
Button.prototype.setState = function (state) { |
195
|
|
|
var d = 'disabled' |
196
|
|
|
, $el = this.$element |
197
|
|
|
, data = $el.data() |
198
|
|
|
, val = $el.is('input') ? 'val' : 'html' |
199
|
|
|
|
200
|
|
|
state = state + 'Text' |
201
|
|
|
data.resetText || $el.data('resetText', $el[val]()) |
202
|
|
|
|
203
|
|
|
$el[val](data[state] || this.options[state]) |
204
|
|
|
|
205
|
|
|
// push to event loop to allow forms to submit |
206
|
|
|
setTimeout(function () { |
207
|
|
|
state == 'loadingText' ? |
208
|
|
|
$el.addClass(d).attr(d, d) : |
209
|
|
|
$el.removeClass(d).removeAttr(d) |
210
|
|
|
}, 0) |
211
|
|
|
} |
212
|
|
|
|
213
|
|
|
Button.prototype.toggle = function () { |
214
|
|
|
var $parent = this.$element.closest('[data-toggle="buttons-radio"]') |
215
|
|
|
|
216
|
|
|
$parent && $parent |
217
|
|
|
.find('.active') |
218
|
|
|
.removeClass('active') |
219
|
|
|
|
220
|
|
|
this.$element.toggleClass('active') |
221
|
|
|
} |
222
|
|
|
|
223
|
|
|
|
224
|
|
|
/* BUTTON PLUGIN DEFINITION |
225
|
|
|
* ======================== */ |
226
|
|
|
|
227
|
|
|
var old = $.fn.button |
228
|
|
|
|
229
|
|
|
$.fn.button = function (option) { |
230
|
|
|
return this.each(function () { |
231
|
|
|
var $this = $(this) |
232
|
|
|
, data = $this.data('button') |
233
|
|
|
, options = typeof option == 'object' && option |
234
|
|
|
if (!data) $this.data('button', (data = new Button(this, options))) |
|
|
|
|
235
|
|
|
if (option == 'toggle') data.toggle() |
|
|
|
|
236
|
|
|
else if (option) data.setState(option) |
|
|
|
|
237
|
|
|
}) |
238
|
|
|
} |
239
|
|
|
|
240
|
|
|
$.fn.button.defaults = { |
241
|
|
|
loadingText: 'loading...' |
242
|
|
|
} |
243
|
|
|
|
244
|
|
|
$.fn.button.Constructor = Button |
245
|
|
|
|
246
|
|
|
|
247
|
|
|
/* BUTTON NO CONFLICT |
248
|
|
|
* ================== */ |
249
|
|
|
|
250
|
|
|
$.fn.button.noConflict = function () { |
251
|
|
|
$.fn.button = old |
252
|
|
|
return this |
253
|
|
|
} |
254
|
|
|
|
255
|
|
|
|
256
|
|
|
/* BUTTON DATA-API |
257
|
|
|
* =============== */ |
258
|
|
|
|
259
|
|
|
$(document).on('click.button.data-api', '[data-toggle^=button]', function (e) { |
260
|
|
|
var $btn = $(e.target) |
261
|
|
|
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') |
|
|
|
|
262
|
|
|
$btn.button('toggle') |
263
|
|
|
}) |
264
|
|
|
|
265
|
|
|
}(window.jQuery);/* ========================================================== |
266
|
|
|
* bootstrap-carousel.js v2.3.2 |
267
|
|
|
* http://twitter.github.com/bootstrap/javascript.html#carousel |
268
|
|
|
* ========================================================== |
269
|
|
|
* Copyright 2012 Twitter, Inc. |
270
|
|
|
* |
271
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
272
|
|
|
* you may not use this file except in compliance with the License. |
273
|
|
|
* You may obtain a copy of the License at |
274
|
|
|
* |
275
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
276
|
|
|
* |
277
|
|
|
* Unless required by applicable law or agreed to in writing, software |
278
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
279
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
280
|
|
|
* See the License for the specific language governing permissions and |
281
|
|
|
* limitations under the License. |
282
|
|
|
* ========================================================== */ |
283
|
|
|
|
284
|
|
|
|
285
|
|
|
!function ($) { |
286
|
|
|
|
287
|
|
|
"use strict"; // jshint ;_; |
288
|
|
|
|
289
|
|
|
|
290
|
|
|
/* CAROUSEL CLASS DEFINITION |
291
|
|
|
* ========================= */ |
292
|
|
|
|
293
|
|
|
var Carousel = function (element, options) { |
294
|
|
|
this.$element = $(element) |
295
|
|
|
this.$indicators = this.$element.find('.carousel-indicators') |
296
|
|
|
this.options = options |
297
|
|
|
this.options.pause == 'hover' && this.$element |
298
|
|
|
.on('mouseenter', $.proxy(this.pause, this)) |
299
|
|
|
.on('mouseleave', $.proxy(this.cycle, this)) |
300
|
|
|
} |
301
|
|
|
|
302
|
|
|
Carousel.prototype = { |
303
|
|
|
|
304
|
|
|
cycle: function (e) { |
305
|
|
|
if (!e) this.paused = false |
|
|
|
|
306
|
|
|
if (this.interval) clearInterval(this.interval); |
|
|
|
|
307
|
|
|
this.options.interval |
308
|
|
|
&& !this.paused |
309
|
|
|
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) |
310
|
|
|
return this |
311
|
|
|
} |
312
|
|
|
|
313
|
|
|
, getActiveIndex: function () { |
314
|
|
|
this.$active = this.$element.find('.item.active') |
315
|
|
|
this.$items = this.$active.parent().children() |
316
|
|
|
return this.$items.index(this.$active) |
317
|
|
|
} |
318
|
|
|
|
319
|
|
|
, to: function (pos) { |
320
|
|
|
var activeIndex = this.getActiveIndex() |
321
|
|
|
, that = this |
322
|
|
|
|
323
|
|
|
if (pos > (this.$items.length - 1) || pos < 0) return |
|
|
|
|
324
|
|
|
|
325
|
|
|
if (this.sliding) { |
326
|
|
|
return this.$element.one('slid', function () { |
327
|
|
|
that.to(pos) |
328
|
|
|
}) |
329
|
|
|
} |
330
|
|
|
|
331
|
|
|
if (activeIndex == pos) { |
332
|
|
|
return this.pause().cycle() |
333
|
|
|
} |
334
|
|
|
|
335
|
|
|
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) |
336
|
|
|
} |
337
|
|
|
|
338
|
|
|
, pause: function (e) { |
339
|
|
|
if (!e) this.paused = true |
|
|
|
|
340
|
|
|
if (this.$element.find('.next, .prev').length && $.support.transition.end) { |
341
|
|
|
this.$element.trigger($.support.transition.end) |
342
|
|
|
this.cycle(true) |
343
|
|
|
} |
344
|
|
|
clearInterval(this.interval) |
345
|
|
|
this.interval = null |
346
|
|
|
return this |
347
|
|
|
} |
348
|
|
|
|
349
|
|
|
, next: function () { |
350
|
|
|
if (this.sliding) return |
|
|
|
|
351
|
|
|
return this.slide('next') |
352
|
|
|
} |
353
|
|
|
|
354
|
|
|
, prev: function () { |
355
|
|
|
if (this.sliding) return |
|
|
|
|
356
|
|
|
return this.slide('prev') |
357
|
|
|
} |
358
|
|
|
|
359
|
|
|
, slide: function (type, next) { |
360
|
|
|
var $active = this.$element.find('.item.active') |
361
|
|
|
, $next = next || $active[type]() |
362
|
|
|
, isCycling = this.interval |
363
|
|
|
, direction = type == 'next' ? 'left' : 'right' |
364
|
|
|
, fallback = type == 'next' ? 'first' : 'last' |
365
|
|
|
, that = this |
366
|
|
|
, e |
367
|
|
|
|
368
|
|
|
this.sliding = true |
369
|
|
|
|
370
|
|
|
isCycling && this.pause() |
371
|
|
|
|
372
|
|
|
$next = $next.length ? $next : this.$element.find('.item')[fallback]() |
373
|
|
|
|
374
|
|
|
e = $.Event('slide', { |
375
|
|
|
relatedTarget: $next[0] |
376
|
|
|
, direction: direction |
377
|
|
|
}) |
378
|
|
|
|
379
|
|
|
if ($next.hasClass('active')) return |
|
|
|
|
380
|
|
|
|
381
|
|
|
if (this.$indicators.length) { |
382
|
|
|
this.$indicators.find('.active').removeClass('active') |
383
|
|
|
this.$element.one('slid', function () { |
384
|
|
|
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) |
385
|
|
|
$nextIndicator && $nextIndicator.addClass('active') |
386
|
|
|
}) |
387
|
|
|
} |
388
|
|
|
|
389
|
|
|
if ($.support.transition && this.$element.hasClass('slide')) { |
390
|
|
|
this.$element.trigger(e) |
391
|
|
|
if (e.isDefaultPrevented()) return |
|
|
|
|
392
|
|
|
$next.addClass(type) |
393
|
|
|
$next[0].offsetWidth // force reflow |
|
|
|
|
394
|
|
|
$active.addClass(direction) |
395
|
|
|
$next.addClass(direction) |
396
|
|
|
this.$element.one($.support.transition.end, function () { |
397
|
|
|
$next.removeClass([type, direction].join(' ')).addClass('active') |
398
|
|
|
$active.removeClass(['active', direction].join(' ')) |
399
|
|
|
that.sliding = false |
400
|
|
|
setTimeout(function () { that.$element.trigger('slid') }, 0) |
401
|
|
|
}) |
402
|
|
|
} else { |
403
|
|
|
this.$element.trigger(e) |
404
|
|
|
if (e.isDefaultPrevented()) return |
|
|
|
|
405
|
|
|
$active.removeClass('active') |
406
|
|
|
$next.addClass('active') |
407
|
|
|
this.sliding = false |
408
|
|
|
this.$element.trigger('slid') |
409
|
|
|
} |
410
|
|
|
|
411
|
|
|
isCycling && this.cycle() |
412
|
|
|
|
413
|
|
|
return this |
414
|
|
|
} |
415
|
|
|
|
416
|
|
|
} |
417
|
|
|
|
418
|
|
|
|
419
|
|
|
/* CAROUSEL PLUGIN DEFINITION |
420
|
|
|
* ========================== */ |
421
|
|
|
|
422
|
|
|
var old = $.fn.carousel |
423
|
|
|
|
424
|
|
|
$.fn.carousel = function (option) { |
425
|
|
|
return this.each(function () { |
426
|
|
|
var $this = $(this) |
427
|
|
|
, data = $this.data('carousel') |
428
|
|
|
, options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) |
429
|
|
|
, action = typeof option == 'string' ? option : options.slide |
430
|
|
|
if (!data) $this.data('carousel', (data = new Carousel(this, options))) |
|
|
|
|
431
|
|
|
if (typeof option == 'number') data.to(option) |
|
|
|
|
432
|
|
|
else if (action) data[action]() |
|
|
|
|
433
|
|
|
else if (options.interval) data.pause().cycle() |
|
|
|
|
434
|
|
|
}) |
435
|
|
|
} |
436
|
|
|
|
437
|
|
|
$.fn.carousel.defaults = { |
438
|
|
|
interval: 5000 |
439
|
|
|
, pause: 'hover' |
440
|
|
|
} |
441
|
|
|
|
442
|
|
|
$.fn.carousel.Constructor = Carousel |
443
|
|
|
|
444
|
|
|
|
445
|
|
|
/* CAROUSEL NO CONFLICT |
446
|
|
|
* ==================== */ |
447
|
|
|
|
448
|
|
|
$.fn.carousel.noConflict = function () { |
449
|
|
|
$.fn.carousel = old |
450
|
|
|
return this |
451
|
|
|
} |
452
|
|
|
|
453
|
|
|
/* CAROUSEL DATA-API |
454
|
|
|
* ================= */ |
455
|
|
|
|
456
|
|
|
$(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { |
457
|
|
|
var $this = $(this), href |
458
|
|
|
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 |
459
|
|
|
, options = $.extend({}, $target.data(), $this.data()) |
460
|
|
|
, slideIndex |
461
|
|
|
|
462
|
|
|
$target.carousel(options) |
463
|
|
|
|
464
|
|
|
if (slideIndex = $this.attr('data-slide-to')) { |
465
|
|
|
$target.data('carousel').pause().to(slideIndex).cycle() |
466
|
|
|
} |
467
|
|
|
|
468
|
|
|
e.preventDefault() |
469
|
|
|
}) |
470
|
|
|
|
471
|
|
|
}(window.jQuery);/* ============================================================= |
472
|
|
|
* bootstrap-collapse.js v2.3.2 |
473
|
|
|
* http://twitter.github.com/bootstrap/javascript.html#collapse |
474
|
|
|
* ============================================================= |
475
|
|
|
* Copyright 2012 Twitter, Inc. |
476
|
|
|
* |
477
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
478
|
|
|
* you may not use this file except in compliance with the License. |
479
|
|
|
* You may obtain a copy of the License at |
480
|
|
|
* |
481
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
482
|
|
|
* |
483
|
|
|
* Unless required by applicable law or agreed to in writing, software |
484
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
485
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
486
|
|
|
* See the License for the specific language governing permissions and |
487
|
|
|
* limitations under the License. |
488
|
|
|
* ============================================================ */ |
489
|
|
|
|
490
|
|
|
|
491
|
|
|
!function ($) { |
492
|
|
|
|
493
|
|
|
"use strict"; // jshint ;_; |
494
|
|
|
|
495
|
|
|
|
496
|
|
|
/* COLLAPSE PUBLIC CLASS DEFINITION |
497
|
|
|
* ================================ */ |
498
|
|
|
|
499
|
|
|
var Collapse = function (element, options) { |
500
|
|
|
this.$element = $(element) |
501
|
|
|
this.options = $.extend({}, $.fn.collapse.defaults, options) |
502
|
|
|
|
503
|
|
|
if (this.options.parent) { |
504
|
|
|
this.$parent = $(this.options.parent) |
505
|
|
|
} |
506
|
|
|
|
507
|
|
|
this.options.toggle && this.toggle() |
508
|
|
|
} |
509
|
|
|
|
510
|
|
|
Collapse.prototype = { |
511
|
|
|
|
512
|
|
|
constructor: Collapse |
513
|
|
|
|
514
|
|
|
, dimension: function () { |
515
|
|
|
var hasWidth = this.$element.hasClass('width') |
516
|
|
|
return hasWidth ? 'width' : 'height' |
517
|
|
|
} |
518
|
|
|
|
519
|
|
|
, show: function () { |
520
|
|
|
var dimension |
521
|
|
|
, scroll |
522
|
|
|
, actives |
523
|
|
|
, hasData |
524
|
|
|
|
525
|
|
|
if (this.transitioning || this.$element.hasClass('in')) return |
|
|
|
|
526
|
|
|
|
527
|
|
|
dimension = this.dimension() |
528
|
|
|
scroll = $.camelCase(['scroll', dimension].join('-')) |
529
|
|
|
actives = this.$parent && this.$parent.find('> .accordion-group > .in') |
530
|
|
|
|
531
|
|
|
if (actives && actives.length) { |
532
|
|
|
hasData = actives.data('collapse') |
533
|
|
|
if (hasData && hasData.transitioning) return |
|
|
|
|
534
|
|
|
actives.collapse('hide') |
535
|
|
|
hasData || actives.data('collapse', null) |
536
|
|
|
} |
537
|
|
|
|
538
|
|
|
this.$element[dimension](0) |
539
|
|
|
this.transition('addClass', $.Event('show'), 'shown') |
540
|
|
|
$.support.transition && this.$element[dimension](this.$element[0][scroll]) |
541
|
|
|
} |
542
|
|
|
|
543
|
|
|
, hide: function () { |
544
|
|
|
var dimension |
545
|
|
|
if (this.transitioning || !this.$element.hasClass('in')) return |
|
|
|
|
546
|
|
|
dimension = this.dimension() |
547
|
|
|
this.reset(this.$element[dimension]()) |
548
|
|
|
// JOOMLA JUI >>> |
549
|
|
|
/* ORIGINAL: |
550
|
|
|
this.transition('removeClass', $.Event('hide'), 'hidden') |
551
|
|
|
*/ |
552
|
|
|
this.transition('removeClass', $.Event('hideme'), 'hidden') |
553
|
|
|
// < Joomla JUI |
554
|
|
|
|
555
|
|
|
this.$element[dimension](0) |
556
|
|
|
} |
557
|
|
|
|
558
|
|
|
, reset: function (size) { |
559
|
|
|
var dimension = this.dimension() |
560
|
|
|
|
561
|
|
|
this.$element |
|
|
|
|
562
|
|
|
.removeClass('collapse') |
563
|
|
|
[dimension](size || 'auto') |
564
|
|
|
[0].offsetWidth |
565
|
|
|
|
566
|
|
|
this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') |
567
|
|
|
|
568
|
|
|
return this |
569
|
|
|
} |
570
|
|
|
|
571
|
|
|
, transition: function (method, startEvent, completeEvent) { |
572
|
|
|
var that = this |
573
|
|
|
, complete = function () { |
574
|
|
|
if (startEvent.type == 'show') that.reset() |
|
|
|
|
575
|
|
|
that.transitioning = 0 |
576
|
|
|
that.$element.trigger(completeEvent) |
577
|
|
|
} |
578
|
|
|
|
579
|
|
|
this.$element.trigger(startEvent) |
580
|
|
|
|
581
|
|
|
if (startEvent.isDefaultPrevented()) return |
|
|
|
|
582
|
|
|
|
583
|
|
|
this.transitioning = 1 |
584
|
|
|
|
585
|
|
|
this.$element[method]('in') |
586
|
|
|
|
587
|
|
|
$.support.transition && this.$element.hasClass('collapse') ? |
588
|
|
|
this.$element.one($.support.transition.end, complete) : |
589
|
|
|
complete() |
590
|
|
|
} |
591
|
|
|
|
592
|
|
|
, toggle: function () { |
593
|
|
|
this[this.$element.hasClass('in') ? 'hide' : 'show']() |
594
|
|
|
} |
595
|
|
|
|
596
|
|
|
} |
597
|
|
|
|
598
|
|
|
|
599
|
|
|
/* COLLAPSE PLUGIN DEFINITION |
600
|
|
|
* ========================== */ |
601
|
|
|
|
602
|
|
|
var old = $.fn.collapse |
603
|
|
|
|
604
|
|
|
$.fn.collapse = function (option) { |
605
|
|
|
return this.each(function () { |
606
|
|
|
var $this = $(this) |
607
|
|
|
, data = $this.data('collapse') |
608
|
|
|
, options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option) |
609
|
|
|
if (!data) $this.data('collapse', (data = new Collapse(this, options))) |
|
|
|
|
610
|
|
|
if (typeof option == 'string') data[option]() |
|
|
|
|
611
|
|
|
}) |
612
|
|
|
} |
613
|
|
|
|
614
|
|
|
$.fn.collapse.defaults = { |
615
|
|
|
toggle: true |
616
|
|
|
} |
617
|
|
|
|
618
|
|
|
$.fn.collapse.Constructor = Collapse |
619
|
|
|
|
620
|
|
|
|
621
|
|
|
/* COLLAPSE NO CONFLICT |
622
|
|
|
* ==================== */ |
623
|
|
|
|
624
|
|
|
$.fn.collapse.noConflict = function () { |
625
|
|
|
$.fn.collapse = old |
626
|
|
|
return this |
627
|
|
|
} |
628
|
|
|
|
629
|
|
|
|
630
|
|
|
/* COLLAPSE DATA-API |
631
|
|
|
* ================= */ |
632
|
|
|
|
633
|
|
|
$(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { |
634
|
|
|
var $this = $(this), href |
635
|
|
|
, target = $this.attr('data-target') |
636
|
|
|
|| e.preventDefault() |
637
|
|
|
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 |
638
|
|
|
, option = $(target).data('collapse') ? 'toggle' : $this.data() |
639
|
|
|
$this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') |
640
|
|
|
$(target).collapse(option) |
641
|
|
|
}) |
642
|
|
|
|
643
|
|
|
}(window.jQuery); |
644
|
|
|
/* ============================================================ |
645
|
|
|
* bootstrap-dropdown.js v2.3.2 |
646
|
|
|
* http://twitter.github.com/bootstrap/javascript.html#dropdowns |
647
|
|
|
* ============================================================ |
648
|
|
|
* Copyright 2012 Twitter, Inc. |
649
|
|
|
* |
650
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
651
|
|
|
* you may not use this file except in compliance with the License. |
652
|
|
|
* You may obtain a copy of the License at |
653
|
|
|
* |
654
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
655
|
|
|
* |
656
|
|
|
* Unless required by applicable law or agreed to in writing, software |
657
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
658
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
659
|
|
|
* See the License for the specific language governing permissions and |
660
|
|
|
* limitations under the License. |
661
|
|
|
* ============================================================ */ |
662
|
|
|
|
663
|
|
|
|
664
|
|
|
!function ($) { |
665
|
|
|
|
666
|
|
|
"use strict"; // jshint ;_; |
667
|
|
|
|
668
|
|
|
|
669
|
|
|
/* DROPDOWN CLASS DEFINITION |
670
|
|
|
* ========================= */ |
671
|
|
|
|
672
|
|
|
var toggle = '[data-toggle=dropdown]' |
673
|
|
|
, Dropdown = function (element) { |
674
|
|
|
var $el = $(element).on('click.dropdown.data-api', this.toggle) |
675
|
|
|
// JOOMLA JUI >>> |
676
|
|
|
.on('mouseover.dropdown.data-api', this.toggle) |
677
|
|
|
// < Joomla JUI |
678
|
|
|
$('html').on('click.dropdown.data-api', function () { |
679
|
|
|
// JOOMLA JUI >>> |
680
|
|
|
$el.parent().parent().removeClass('nav-hover') |
681
|
|
|
// < Joomla JUI |
682
|
|
|
$el.parent().removeClass('open') |
683
|
|
|
}) |
684
|
|
|
} |
685
|
|
|
|
686
|
|
|
Dropdown.prototype = { |
687
|
|
|
|
688
|
|
|
constructor: Dropdown |
689
|
|
|
|
690
|
|
|
, toggle: function (e) { |
691
|
|
|
// JOOMLA JUI >>> |
692
|
|
|
/* ORIGINAL |
693
|
|
|
var $this = $(this) |
694
|
|
|
, $parent |
695
|
|
|
, isActive |
696
|
|
|
*/ |
697
|
|
|
var $this = $(this) |
698
|
|
|
, $parent |
699
|
|
|
, isActive |
700
|
|
|
, url |
701
|
|
|
, isHover |
702
|
|
|
// < Joomla JUI |
703
|
|
|
|
704
|
|
|
if ($this.is('.disabled, :disabled')) return |
|
|
|
|
705
|
|
|
|
706
|
|
|
$parent = getParent($this) |
707
|
|
|
|
708
|
|
|
isActive = $parent.hasClass('open') |
709
|
|
|
// JOOMLA JUI >>> |
710
|
|
|
isHover = $parent.parent().hasClass('nav-hover') |
711
|
|
|
if(!isHover && e.type == 'mouseover') return |
|
|
|
|
712
|
|
|
// < Joomla JUI |
713
|
|
|
|
714
|
|
|
url = $this.attr('href') |
715
|
|
|
if (e.type == 'click' && (url) && (url !== '#')) { |
716
|
|
|
window.location = url |
717
|
|
|
return |
718
|
|
|
} |
719
|
|
|
|
720
|
|
|
clearMenus() |
721
|
|
|
|
722
|
|
|
// JOOMLA JUI >>> |
723
|
|
|
if ((!isActive && e.type != 'mouseover') || (isHover && e.type == 'mouseover')) { |
724
|
|
|
if ('ontouchstart' in document.documentElement) { |
725
|
|
|
// if mobile we we use a backdrop because click events don't delegate |
726
|
|
|
$('<div class="dropdown-backdrop"/>').insertBefore($(this)).on('click', clearMenus) |
727
|
|
|
$this.on('hover', function () { |
728
|
|
|
$('.dropdown-backdrop').remove() |
729
|
|
|
}); |
730
|
|
|
} |
731
|
|
|
$parent.parent().toggleClass('nav-hover'); |
732
|
|
|
$parent.toggleClass('open') |
733
|
|
|
} |
734
|
|
|
// < Joomla JUI |
735
|
|
|
|
736
|
|
|
$this.focus() |
737
|
|
|
|
738
|
|
|
return false |
739
|
|
|
} |
740
|
|
|
|
741
|
|
|
, keydown: function (e) { |
742
|
|
|
var $this |
743
|
|
|
, $items |
744
|
|
|
, $active |
|
|
|
|
745
|
|
|
, $parent |
746
|
|
|
, isActive |
747
|
|
|
, index |
748
|
|
|
|
749
|
|
|
if (!/(38|40|27)/.test(e.keyCode)) return |
|
|
|
|
750
|
|
|
|
751
|
|
|
$this = $(this) |
752
|
|
|
|
753
|
|
|
e.preventDefault() |
754
|
|
|
e.stopPropagation() |
755
|
|
|
|
756
|
|
|
if ($this.is('.disabled, :disabled')) return |
|
|
|
|
757
|
|
|
|
758
|
|
|
$parent = getParent($this) |
759
|
|
|
|
760
|
|
|
isActive = $parent.hasClass('open') |
761
|
|
|
|
762
|
|
|
if (!isActive || (isActive && e.keyCode == 27)) { |
763
|
|
|
if (e.which == 27) $parent.find(toggle).focus() |
|
|
|
|
764
|
|
|
return $this.click() |
765
|
|
|
} |
766
|
|
|
|
767
|
|
|
$items = $('[role=menu] li:not(.divider):visible a', $parent) |
768
|
|
|
|
769
|
|
|
if (!$items.length) return |
|
|
|
|
770
|
|
|
|
771
|
|
|
index = $items.index($items.filter(':focus')) |
772
|
|
|
|
773
|
|
|
if (e.keyCode == 38 && index > 0) index-- // up |
|
|
|
|
774
|
|
|
if (e.keyCode == 40 && index < $items.length - 1) index++ // down |
|
|
|
|
775
|
|
|
if (!~index) index = 0 |
|
|
|
|
776
|
|
|
|
777
|
|
|
$items |
778
|
|
|
.eq(index) |
779
|
|
|
.focus() |
|
|
|
|
780
|
|
|
} |
781
|
|
|
|
782
|
|
|
} |
783
|
|
|
|
784
|
|
|
function clearMenus() { |
785
|
|
|
// JOOMLA JUI >>> |
786
|
|
|
$(toggle).parent().parent().removeClass('nav-hover') |
787
|
|
|
// < Joomla JUI |
788
|
|
|
$('.dropdown-backdrop').remove() |
789
|
|
|
$(toggle).each(function () { |
790
|
|
|
getParent($(this)).removeClass('open') |
791
|
|
|
}) |
792
|
|
|
} |
793
|
|
|
|
794
|
|
|
function getParent($this) { |
795
|
|
|
var selector = $this.attr('data-target') |
796
|
|
|
, $parent |
797
|
|
|
|
798
|
|
|
if (!selector) { |
799
|
|
|
selector = $this.attr('href') |
800
|
|
|
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 |
801
|
|
|
} |
802
|
|
|
|
803
|
|
|
$parent = selector && $(selector) |
804
|
|
|
|
805
|
|
|
if (!$parent || !$parent.length) $parent = $this.parent() |
|
|
|
|
806
|
|
|
|
807
|
|
|
return $parent |
808
|
|
|
} |
809
|
|
|
|
810
|
|
|
|
811
|
|
|
/* DROPDOWN PLUGIN DEFINITION |
812
|
|
|
* ========================== */ |
813
|
|
|
|
814
|
|
|
var old = $.fn.dropdown |
815
|
|
|
|
816
|
|
|
$.fn.dropdown = function (option) { |
817
|
|
|
return this.each(function () { |
818
|
|
|
var $this = $(this) |
819
|
|
|
, data = $this.data('dropdown') |
820
|
|
|
if (!data) $this.data('dropdown', (data = new Dropdown(this))) |
|
|
|
|
821
|
|
|
if (typeof option == 'string') data[option].call($this) |
|
|
|
|
822
|
|
|
}) |
823
|
|
|
} |
824
|
|
|
|
825
|
|
|
$.fn.dropdown.Constructor = Dropdown |
826
|
|
|
|
827
|
|
|
|
828
|
|
|
/* DROPDOWN NO CONFLICT |
829
|
|
|
* ==================== */ |
830
|
|
|
|
831
|
|
|
$.fn.dropdown.noConflict = function () { |
832
|
|
|
$.fn.dropdown = old |
833
|
|
|
return this |
834
|
|
|
} |
835
|
|
|
|
836
|
|
|
|
837
|
|
|
/* APPLY TO STANDARD DROPDOWN ELEMENTS |
838
|
|
|
* =================================== */ |
839
|
|
|
|
840
|
|
|
$(document) |
841
|
|
|
.on('click.dropdown.data-api', clearMenus) |
842
|
|
|
.on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) |
843
|
|
|
.on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle) |
844
|
|
|
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) |
845
|
|
|
// JOOMLA JUI >>> |
846
|
|
|
.on('mouseover.dropdown.data-api', toggle, Dropdown.prototype.toggle) |
847
|
|
|
// < Joomla JUI |
848
|
|
|
}(window.jQuery); |
849
|
|
|
/* ========================================================= |
850
|
|
|
* bootstrap-modal.js v2.3.2 |
851
|
|
|
* http://twitter.github.com/bootstrap/javascript.html#modals |
852
|
|
|
* ========================================================= |
853
|
|
|
* Copyright 2012 Twitter, Inc. |
854
|
|
|
* |
855
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
856
|
|
|
* you may not use this file except in compliance with the License. |
857
|
|
|
* You may obtain a copy of the License at |
858
|
|
|
* |
859
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
860
|
|
|
* |
861
|
|
|
* Unless required by applicable law or agreed to in writing, software |
862
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
863
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
864
|
|
|
* See the License for the specific language governing permissions and |
865
|
|
|
* limitations under the License. |
866
|
|
|
* ========================================================= */ |
867
|
|
|
|
868
|
|
|
|
869
|
|
|
!function ($) { |
870
|
|
|
|
871
|
|
|
"use strict"; // jshint ;_; |
872
|
|
|
|
873
|
|
|
|
874
|
|
|
/* MODAL CLASS DEFINITION |
875
|
|
|
* ====================== */ |
876
|
|
|
|
877
|
|
|
var Modal = function (element, options) { |
878
|
|
|
this.options = options |
879
|
|
|
this.$element = $(element) |
880
|
|
|
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)) |
881
|
|
|
this.options.remote && this.$element.find('.modal-body').load(this.options.remote) |
882
|
|
|
} |
883
|
|
|
|
884
|
|
|
Modal.prototype = { |
885
|
|
|
|
886
|
|
|
constructor: Modal |
887
|
|
|
|
888
|
|
|
, toggle: function () { |
889
|
|
|
return this[!this.isShown ? 'show' : 'hide']() |
890
|
|
|
} |
891
|
|
|
|
892
|
|
|
, show: function () { |
893
|
|
|
var that = this |
894
|
|
|
, e = $.Event('show') |
895
|
|
|
|
896
|
|
|
this.$element.trigger(e) |
897
|
|
|
|
898
|
|
|
if (this.isShown || e.isDefaultPrevented()) return |
|
|
|
|
899
|
|
|
|
900
|
|
|
this.isShown = true |
901
|
|
|
|
902
|
|
|
this.escape() |
903
|
|
|
|
904
|
|
|
this.backdrop(function () { |
905
|
|
|
var transition = $.support.transition && that.$element.hasClass('fade') |
906
|
|
|
|
907
|
|
|
if (!that.$element.parent().length) { |
908
|
|
|
that.$element.appendTo(document.body) //don't move modals dom position |
909
|
|
|
} |
910
|
|
|
|
911
|
|
|
that.$element.show() |
912
|
|
|
|
913
|
|
|
if (transition) { |
914
|
|
|
that.$element[0].offsetWidth // force reflow |
|
|
|
|
915
|
|
|
} |
916
|
|
|
|
917
|
|
|
that.$element |
918
|
|
|
.addClass('in') |
919
|
|
|
.attr('aria-hidden', false) |
920
|
|
|
|
921
|
|
|
that.enforceFocus() |
922
|
|
|
|
923
|
|
|
transition ? |
924
|
|
|
that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) : |
925
|
|
|
that.$element.focus().trigger('shown') |
926
|
|
|
|
927
|
|
|
}) |
928
|
|
|
} |
929
|
|
|
|
930
|
|
|
, hide: function (e) { |
931
|
|
|
e && e.preventDefault() |
932
|
|
|
|
933
|
|
|
var that = this |
|
|
|
|
934
|
|
|
|
935
|
|
|
e = $.Event('hide') |
936
|
|
|
|
937
|
|
|
this.$element.trigger(e) |
938
|
|
|
|
939
|
|
|
if (!this.isShown || e.isDefaultPrevented()) return |
|
|
|
|
940
|
|
|
|
941
|
|
|
this.isShown = false |
942
|
|
|
|
943
|
|
|
this.escape() |
944
|
|
|
|
945
|
|
|
$(document).off('focusin.modal') |
946
|
|
|
|
947
|
|
|
this.$element |
948
|
|
|
.removeClass('in') |
949
|
|
|
.attr('aria-hidden', true) |
950
|
|
|
|
951
|
|
|
$.support.transition && this.$element.hasClass('fade') ? |
952
|
|
|
this.hideWithTransition() : |
953
|
|
|
this.hideModal() |
954
|
|
|
} |
955
|
|
|
|
956
|
|
|
, enforceFocus: function () { |
957
|
|
|
var that = this |
958
|
|
|
$(document).on('focusin.modal', function (e) { |
959
|
|
|
if (that.$element[0] !== e.target && !that.$element.has(e.target).length) { |
960
|
|
|
that.$element.focus() |
961
|
|
|
} |
962
|
|
|
}) |
963
|
|
|
} |
964
|
|
|
|
965
|
|
|
, escape: function () { |
966
|
|
|
var that = this |
967
|
|
|
if (this.isShown && this.options.keyboard) { |
968
|
|
|
this.$element.on('keyup.dismiss.modal', function ( e ) { |
969
|
|
|
e.which == 27 && that.hide() |
970
|
|
|
}) |
971
|
|
|
} else if (!this.isShown) { |
972
|
|
|
this.$element.off('keyup.dismiss.modal') |
973
|
|
|
} |
974
|
|
|
} |
975
|
|
|
|
976
|
|
|
, hideWithTransition: function () { |
977
|
|
|
var that = this |
978
|
|
|
, timeout = setTimeout(function () { |
979
|
|
|
that.$element.off($.support.transition.end) |
980
|
|
|
that.hideModal() |
981
|
|
|
}, 500) |
982
|
|
|
|
983
|
|
|
this.$element.one($.support.transition.end, function () { |
984
|
|
|
clearTimeout(timeout) |
985
|
|
|
that.hideModal() |
986
|
|
|
}) |
987
|
|
|
} |
988
|
|
|
|
989
|
|
|
, hideModal: function () { |
990
|
|
|
var that = this |
991
|
|
|
this.$element.hide() |
992
|
|
|
this.backdrop(function () { |
993
|
|
|
that.removeBackdrop() |
994
|
|
|
that.$element.trigger('hidden') |
995
|
|
|
}) |
996
|
|
|
} |
997
|
|
|
|
998
|
|
|
, removeBackdrop: function () { |
999
|
|
|
this.$backdrop && this.$backdrop.remove() |
1000
|
|
|
this.$backdrop = null |
1001
|
|
|
} |
1002
|
|
|
|
1003
|
|
|
, backdrop: function (callback) { |
1004
|
|
|
var that = this |
|
|
|
|
1005
|
|
|
, animate = this.$element.hasClass('fade') ? 'fade' : '' |
1006
|
|
|
|
1007
|
|
|
if (this.isShown && this.options.backdrop) { |
1008
|
|
|
var doAnimate = $.support.transition && animate |
1009
|
|
|
|
1010
|
|
|
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') |
1011
|
|
|
.appendTo(document.body) |
1012
|
|
|
|
1013
|
|
|
this.$backdrop.click( |
1014
|
|
|
this.options.backdrop == 'static' ? |
1015
|
|
|
$.proxy(this.$element[0].focus, this.$element[0]) |
1016
|
|
|
: $.proxy(this.hide, this) |
1017
|
|
|
) |
1018
|
|
|
|
1019
|
|
|
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow |
|
|
|
|
1020
|
|
|
|
1021
|
|
|
this.$backdrop.addClass('in') |
1022
|
|
|
|
1023
|
|
|
if (!callback) return |
|
|
|
|
1024
|
|
|
|
1025
|
|
|
doAnimate ? |
1026
|
|
|
this.$backdrop.one($.support.transition.end, callback) : |
1027
|
|
|
callback() |
1028
|
|
|
|
1029
|
|
|
} else if (!this.isShown && this.$backdrop) { |
1030
|
|
|
this.$backdrop.removeClass('in') |
1031
|
|
|
|
1032
|
|
|
$.support.transition && this.$element.hasClass('fade')? |
1033
|
|
|
this.$backdrop.one($.support.transition.end, callback) : |
1034
|
|
|
callback() |
1035
|
|
|
|
1036
|
|
|
} else if (callback) { |
1037
|
|
|
callback() |
1038
|
|
|
} |
1039
|
|
|
} |
1040
|
|
|
} |
1041
|
|
|
|
1042
|
|
|
|
1043
|
|
|
/* MODAL PLUGIN DEFINITION |
1044
|
|
|
* ======================= */ |
1045
|
|
|
|
1046
|
|
|
var old = $.fn.modal |
1047
|
|
|
|
1048
|
|
|
$.fn.modal = function (option) { |
1049
|
|
|
return this.each(function () { |
1050
|
|
|
var $this = $(this) |
1051
|
|
|
, data = $this.data('modal') |
1052
|
|
|
, options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option) |
1053
|
|
|
if (!data) $this.data('modal', (data = new Modal(this, options))) |
|
|
|
|
1054
|
|
|
if (typeof option == 'string') data[option]() |
|
|
|
|
1055
|
|
|
else if (options.show) data.show() |
|
|
|
|
1056
|
|
|
}) |
1057
|
|
|
} |
1058
|
|
|
|
1059
|
|
|
$.fn.modal.defaults = { |
1060
|
|
|
backdrop: true |
1061
|
|
|
, keyboard: true |
1062
|
|
|
, show: true |
1063
|
|
|
} |
1064
|
|
|
|
1065
|
|
|
$.fn.modal.Constructor = Modal |
1066
|
|
|
|
1067
|
|
|
|
1068
|
|
|
/* MODAL NO CONFLICT |
1069
|
|
|
* ================= */ |
1070
|
|
|
|
1071
|
|
|
$.fn.modal.noConflict = function () { |
1072
|
|
|
$.fn.modal = old |
1073
|
|
|
return this |
1074
|
|
|
} |
1075
|
|
|
|
1076
|
|
|
|
1077
|
|
|
/* MODAL DATA-API |
1078
|
|
|
* ============== */ |
1079
|
|
|
|
1080
|
|
|
$(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) { |
1081
|
|
|
var $this = $(this) |
1082
|
|
|
, href = $this.attr('href') |
1083
|
|
|
, $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7 |
1084
|
|
|
, option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data()) |
1085
|
|
|
|
1086
|
|
|
e.preventDefault() |
1087
|
|
|
|
1088
|
|
|
$target |
1089
|
|
|
.modal(option) |
1090
|
|
|
.one('hide', function () { |
1091
|
|
|
$this.focus() |
1092
|
|
|
}) |
1093
|
|
|
}) |
1094
|
|
|
|
1095
|
|
|
}(window.jQuery); |
1096
|
|
|
/* =========================================================== |
1097
|
|
|
* bootstrap-tooltip.js v2.3.2 |
1098
|
|
|
* http://twitter.github.com/bootstrap/javascript.html#tooltips |
1099
|
|
|
* Inspired by the original jQuery.tipsy by Jason Frame |
1100
|
|
|
* =========================================================== |
1101
|
|
|
* Copyright 2012 Twitter, Inc. |
1102
|
|
|
* |
1103
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
1104
|
|
|
* you may not use this file except in compliance with the License. |
1105
|
|
|
* You may obtain a copy of the License at |
1106
|
|
|
* |
1107
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
1108
|
|
|
* |
1109
|
|
|
* Unless required by applicable law or agreed to in writing, software |
1110
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
1111
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
1112
|
|
|
* See the License for the specific language governing permissions and |
1113
|
|
|
* limitations under the License. |
1114
|
|
|
* ========================================================== */ |
1115
|
|
|
|
1116
|
|
|
|
1117
|
|
|
!function ($) { |
1118
|
|
|
|
1119
|
|
|
"use strict"; // jshint ;_; |
1120
|
|
|
|
1121
|
|
|
|
1122
|
|
|
/* TOOLTIP PUBLIC CLASS DEFINITION |
1123
|
|
|
* =============================== */ |
1124
|
|
|
|
1125
|
|
|
var Tooltip = function (element, options) { |
1126
|
|
|
this.init('tooltip', element, options) |
1127
|
|
|
} |
1128
|
|
|
|
1129
|
|
|
Tooltip.prototype = { |
1130
|
|
|
|
1131
|
|
|
constructor: Tooltip |
1132
|
|
|
|
1133
|
|
|
, init: function (type, element, options) { |
1134
|
|
|
var eventIn |
1135
|
|
|
, eventOut |
1136
|
|
|
, triggers |
1137
|
|
|
, trigger |
1138
|
|
|
, i |
1139
|
|
|
|
1140
|
|
|
this.type = type |
1141
|
|
|
this.$element = $(element) |
1142
|
|
|
this.options = this.getOptions(options) |
1143
|
|
|
this.enabled = true |
1144
|
|
|
|
1145
|
|
|
triggers = this.options.trigger.split(' ') |
1146
|
|
|
|
1147
|
|
|
for (i = triggers.length; i--;) { |
1148
|
|
|
trigger = triggers[i] |
1149
|
|
|
if (trigger == 'click') { |
1150
|
|
|
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) |
1151
|
|
|
} else if (trigger != 'manual') { |
1152
|
|
|
eventIn = trigger == 'hover' ? 'mouseenter' : 'focus' |
1153
|
|
|
eventOut = trigger == 'hover' ? 'mouseleave' : 'blur' |
1154
|
|
|
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) |
1155
|
|
|
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) |
1156
|
|
|
} |
1157
|
|
|
} |
1158
|
|
|
|
1159
|
|
|
this.options.selector ? |
1160
|
|
|
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : |
1161
|
|
|
this.fixTitle() |
1162
|
|
|
} |
1163
|
|
|
|
1164
|
|
|
, getOptions: function (options) { |
1165
|
|
|
options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options) |
1166
|
|
|
|
1167
|
|
|
if (options.delay && typeof options.delay == 'number') { |
1168
|
|
|
options.delay = { |
1169
|
|
|
show: options.delay |
1170
|
|
|
, hide: options.delay |
1171
|
|
|
} |
1172
|
|
|
} |
1173
|
|
|
|
1174
|
|
|
return options |
1175
|
|
|
} |
1176
|
|
|
|
1177
|
|
|
, enter: function (e) { |
1178
|
|
|
var defaults = $.fn[this.type].defaults |
1179
|
|
|
, options = {} |
1180
|
|
|
, self |
1181
|
|
|
|
1182
|
|
|
this._options && $.each(this._options, function (key, value) { |
1183
|
|
|
if (defaults[key] != value) options[key] = value |
|
|
|
|
1184
|
|
|
}, this) |
1185
|
|
|
|
1186
|
|
|
self = $(e.currentTarget)[this.type](options).data(this.type) |
1187
|
|
|
|
1188
|
|
|
if (!self.options.delay || !self.options.delay.show) return self.show() |
|
|
|
|
1189
|
|
|
|
1190
|
|
|
clearTimeout(this.timeout) |
1191
|
|
|
self.hoverState = 'in' |
1192
|
|
|
this.timeout = setTimeout(function() { |
1193
|
|
|
if (self.hoverState == 'in') self.show() |
|
|
|
|
1194
|
|
|
}, self.options.delay.show) |
|
|
|
|
1195
|
|
|
} |
1196
|
|
|
|
1197
|
|
|
, leave: function (e) { |
1198
|
|
|
var self = $(e.currentTarget)[this.type](this._options).data(this.type) |
1199
|
|
|
|
1200
|
|
|
if (this.timeout) clearTimeout(this.timeout) |
|
|
|
|
1201
|
|
|
if (!self.options.delay || !self.options.delay.hide) return self.hide() |
|
|
|
|
1202
|
|
|
|
1203
|
|
|
self.hoverState = 'out' |
1204
|
|
|
this.timeout = setTimeout(function() { |
1205
|
|
|
if (self.hoverState == 'out') self.hide() |
|
|
|
|
1206
|
|
|
}, self.options.delay.hide) |
|
|
|
|
1207
|
|
|
} |
1208
|
|
|
|
1209
|
|
|
, show: function () { |
1210
|
|
|
var $tip |
1211
|
|
|
, pos |
1212
|
|
|
, actualWidth |
1213
|
|
|
, actualHeight |
1214
|
|
|
, placement |
1215
|
|
|
, tp |
1216
|
|
|
, e = $.Event('show') |
1217
|
|
|
|
1218
|
|
|
if (this.hasContent() && this.enabled) { |
1219
|
|
|
this.$element.trigger(e) |
1220
|
|
|
if (e.isDefaultPrevented()) return |
|
|
|
|
1221
|
|
|
$tip = this.tip() |
1222
|
|
|
this.setContent() |
1223
|
|
|
|
1224
|
|
|
if (this.options.animation) { |
1225
|
|
|
$tip.addClass('fade') |
1226
|
|
|
} |
1227
|
|
|
|
1228
|
|
|
placement = typeof this.options.placement == 'function' ? |
1229
|
|
|
this.options.placement.call(this, $tip[0], this.$element[0]) : |
1230
|
|
|
this.options.placement |
1231
|
|
|
|
1232
|
|
|
$tip |
1233
|
|
|
.detach() |
1234
|
|
|
.css({ top: 0, left: 0, display: 'block' }) |
1235
|
|
|
|
1236
|
|
|
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) |
1237
|
|
|
|
1238
|
|
|
pos = this.getPosition() |
1239
|
|
|
|
1240
|
|
|
actualWidth = $tip[0].offsetWidth |
1241
|
|
|
actualHeight = $tip[0].offsetHeight |
1242
|
|
|
|
1243
|
|
|
switch (placement) { |
|
|
|
|
1244
|
|
|
case 'bottom': |
1245
|
|
|
tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2} |
1246
|
|
|
break |
1247
|
|
|
case 'top': |
1248
|
|
|
tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2} |
1249
|
|
|
break |
1250
|
|
|
case 'left': |
1251
|
|
|
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth} |
1252
|
|
|
break |
1253
|
|
|
case 'right': |
1254
|
|
|
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width} |
1255
|
|
|
break |
1256
|
|
|
} |
1257
|
|
|
|
1258
|
|
|
this.applyPlacement(tp, placement) |
|
|
|
|
1259
|
|
|
this.$element.trigger('shown') |
1260
|
|
|
} |
1261
|
|
|
} |
1262
|
|
|
|
1263
|
|
|
, applyPlacement: function(offset, placement){ |
1264
|
|
|
var $tip = this.tip() |
1265
|
|
|
, width = $tip[0].offsetWidth |
1266
|
|
|
, height = $tip[0].offsetHeight |
1267
|
|
|
, actualWidth |
1268
|
|
|
, actualHeight |
1269
|
|
|
, delta |
1270
|
|
|
, replace |
1271
|
|
|
|
1272
|
|
|
$tip |
1273
|
|
|
.offset(offset) |
1274
|
|
|
.addClass(placement) |
1275
|
|
|
.addClass('in') |
1276
|
|
|
|
1277
|
|
|
actualWidth = $tip[0].offsetWidth |
1278
|
|
|
actualHeight = $tip[0].offsetHeight |
1279
|
|
|
|
1280
|
|
|
if (placement == 'top' && actualHeight != height) { |
1281
|
|
|
offset.top = offset.top + height - actualHeight |
1282
|
|
|
replace = true |
1283
|
|
|
} |
1284
|
|
|
|
1285
|
|
|
if (placement == 'bottom' || placement == 'top') { |
1286
|
|
|
delta = 0 |
1287
|
|
|
|
1288
|
|
|
if (offset.left < 0){ |
1289
|
|
|
delta = offset.left * -2 |
1290
|
|
|
offset.left = 0 |
1291
|
|
|
$tip.offset(offset) |
1292
|
|
|
actualWidth = $tip[0].offsetWidth |
1293
|
|
|
actualHeight = $tip[0].offsetHeight |
|
|
|
|
1294
|
|
|
} |
1295
|
|
|
|
1296
|
|
|
this.replaceArrow(delta - width + actualWidth, actualWidth, 'left') |
1297
|
|
|
} else { |
1298
|
|
|
this.replaceArrow(actualHeight - height, actualHeight, 'top') |
1299
|
|
|
} |
1300
|
|
|
|
1301
|
|
|
if (replace) $tip.offset(offset) |
|
|
|
|
1302
|
|
|
} |
1303
|
|
|
|
1304
|
|
|
, replaceArrow: function(delta, dimension, position){ |
1305
|
|
|
this |
1306
|
|
|
.arrow() |
1307
|
|
|
.css(position, delta ? (50 * (1 - delta / dimension) + "%") : '') |
1308
|
|
|
} |
1309
|
|
|
|
1310
|
|
|
, setContent: function () { |
1311
|
|
|
var $tip = this.tip() |
1312
|
|
|
, title = this.getTitle() |
1313
|
|
|
|
1314
|
|
|
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) |
1315
|
|
|
$tip.removeClass('fade in top bottom left right') |
1316
|
|
|
} |
1317
|
|
|
|
1318
|
|
|
, hide: function () { |
1319
|
|
|
// JOOMLA JUI >>> |
1320
|
|
|
/* ORIGINAL: |
1321
|
|
|
var that = this |
1322
|
|
|
, $tip = this.tip() |
1323
|
|
|
, e = $.Event('hide') |
1324
|
|
|
*/ |
1325
|
|
|
var that = this |
|
|
|
|
1326
|
|
|
, $tip = this.tip() |
1327
|
|
|
, e = $.Event('hideme') |
1328
|
|
|
// < Joomla JUI |
1329
|
|
|
|
1330
|
|
|
this.$element.trigger(e) |
1331
|
|
|
if (e.isDefaultPrevented()) return |
|
|
|
|
1332
|
|
|
|
1333
|
|
|
$tip.removeClass('in') |
1334
|
|
|
|
1335
|
|
|
function removeWithAnimation() { |
1336
|
|
|
var timeout = setTimeout(function () { |
1337
|
|
|
$tip.off($.support.transition.end).detach() |
1338
|
|
|
}, 500) |
1339
|
|
|
|
1340
|
|
|
$tip.one($.support.transition.end, function () { |
1341
|
|
|
clearTimeout(timeout) |
1342
|
|
|
$tip.detach() |
1343
|
|
|
}) |
1344
|
|
|
} |
1345
|
|
|
|
1346
|
|
|
$.support.transition && this.$tip.hasClass('fade') ? |
1347
|
|
|
removeWithAnimation() : |
1348
|
|
|
$tip.detach() |
1349
|
|
|
|
1350
|
|
|
this.$element.trigger('hidden') |
1351
|
|
|
|
1352
|
|
|
return this |
1353
|
|
|
} |
1354
|
|
|
|
1355
|
|
|
, fixTitle: function () { |
1356
|
|
|
var $e = this.$element |
1357
|
|
|
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') { |
1358
|
|
|
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '') |
1359
|
|
|
} |
1360
|
|
|
} |
1361
|
|
|
|
1362
|
|
|
, hasContent: function () { |
1363
|
|
|
return this.getTitle() |
1364
|
|
|
} |
1365
|
|
|
|
1366
|
|
|
, getPosition: function () { |
1367
|
|
|
var el = this.$element[0] |
1368
|
|
|
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : { |
1369
|
|
|
width: el.offsetWidth |
1370
|
|
|
, height: el.offsetHeight |
1371
|
|
|
}, this.$element.offset()) |
1372
|
|
|
} |
1373
|
|
|
|
1374
|
|
|
, getTitle: function () { |
1375
|
|
|
var title |
1376
|
|
|
, $e = this.$element |
1377
|
|
|
, o = this.options |
1378
|
|
|
|
1379
|
|
|
title = $e.attr('data-original-title') |
1380
|
|
|
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) |
1381
|
|
|
|
1382
|
|
|
return title |
1383
|
|
|
} |
1384
|
|
|
|
1385
|
|
|
, tip: function () { |
1386
|
|
|
return this.$tip = this.$tip || $(this.options.template) |
1387
|
|
|
} |
1388
|
|
|
|
1389
|
|
|
, arrow: function(){ |
1390
|
|
|
return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow") |
1391
|
|
|
} |
1392
|
|
|
|
1393
|
|
|
, validate: function () { |
1394
|
|
|
if (!this.$element[0].parentNode) { |
1395
|
|
|
this.hide() |
1396
|
|
|
this.$element = null |
1397
|
|
|
this.options = null |
1398
|
|
|
} |
1399
|
|
|
} |
1400
|
|
|
|
1401
|
|
|
, enable: function () { |
1402
|
|
|
this.enabled = true |
1403
|
|
|
} |
1404
|
|
|
|
1405
|
|
|
, disable: function () { |
1406
|
|
|
this.enabled = false |
1407
|
|
|
} |
1408
|
|
|
|
1409
|
|
|
, toggleEnabled: function () { |
1410
|
|
|
this.enabled = !this.enabled |
1411
|
|
|
} |
1412
|
|
|
|
1413
|
|
|
, toggle: function (e) { |
1414
|
|
|
var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this |
1415
|
|
|
self.tip().hasClass('in') ? self.hide() : self.show() |
1416
|
|
|
} |
1417
|
|
|
|
1418
|
|
|
, destroy: function () { |
1419
|
|
|
this.hide().$element.off('.' + this.type).removeData(this.type) |
1420
|
|
|
} |
1421
|
|
|
|
1422
|
|
|
} |
1423
|
|
|
|
1424
|
|
|
|
1425
|
|
|
/* TOOLTIP PLUGIN DEFINITION |
1426
|
|
|
* ========================= */ |
1427
|
|
|
|
1428
|
|
|
var old = $.fn.tooltip |
1429
|
|
|
|
1430
|
|
|
$.fn.tooltip = function ( option ) { |
1431
|
|
|
return this.each(function () { |
1432
|
|
|
var $this = $(this) |
1433
|
|
|
, data = $this.data('tooltip') |
1434
|
|
|
, options = typeof option == 'object' && option |
1435
|
|
|
if (!data) $this.data('tooltip', (data = new Tooltip(this, options))) |
|
|
|
|
1436
|
|
|
if (typeof option == 'string') data[option]() |
|
|
|
|
1437
|
|
|
}) |
1438
|
|
|
} |
1439
|
|
|
|
1440
|
|
|
$.fn.tooltip.Constructor = Tooltip |
1441
|
|
|
|
1442
|
|
|
$.fn.tooltip.defaults = { |
1443
|
|
|
animation: true |
1444
|
|
|
, placement: 'top' |
1445
|
|
|
, selector: false |
1446
|
|
|
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>' |
1447
|
|
|
, trigger: 'hover focus' |
1448
|
|
|
, title: '' |
1449
|
|
|
, delay: 0 |
1450
|
|
|
// JOOMLA JUI >>> |
1451
|
|
|
/* ORIGINAL: |
1452
|
|
|
, html: false |
1453
|
|
|
*/ |
1454
|
|
|
, html: true |
1455
|
|
|
// < Joomla JUI |
1456
|
|
|
, container: false |
1457
|
|
|
} |
1458
|
|
|
|
1459
|
|
|
|
1460
|
|
|
/* TOOLTIP NO CONFLICT |
1461
|
|
|
* =================== */ |
1462
|
|
|
|
1463
|
|
|
$.fn.tooltip.noConflict = function () { |
1464
|
|
|
$.fn.tooltip = old |
1465
|
|
|
return this |
1466
|
|
|
} |
1467
|
|
|
|
1468
|
|
|
}(window.jQuery); |
1469
|
|
|
/* =========================================================== |
1470
|
|
|
* bootstrap-popover.js v2.3.2 |
1471
|
|
|
* http://twitter.github.com/bootstrap/javascript.html#popovers |
1472
|
|
|
* =========================================================== |
1473
|
|
|
* Copyright 2012 Twitter, Inc. |
1474
|
|
|
* |
1475
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
1476
|
|
|
* you may not use this file except in compliance with the License. |
1477
|
|
|
* You may obtain a copy of the License at |
1478
|
|
|
* |
1479
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
1480
|
|
|
* |
1481
|
|
|
* Unless required by applicable law or agreed to in writing, software |
1482
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
1483
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
1484
|
|
|
* See the License for the specific language governing permissions and |
1485
|
|
|
* limitations under the License. |
1486
|
|
|
* =========================================================== */ |
1487
|
|
|
|
1488
|
|
|
|
1489
|
|
|
!function ($) { |
1490
|
|
|
|
1491
|
|
|
"use strict"; // jshint ;_; |
1492
|
|
|
|
1493
|
|
|
|
1494
|
|
|
/* POPOVER PUBLIC CLASS DEFINITION |
1495
|
|
|
* =============================== */ |
1496
|
|
|
|
1497
|
|
|
var Popover = function (element, options) { |
1498
|
|
|
this.init('popover', element, options) |
1499
|
|
|
} |
1500
|
|
|
|
1501
|
|
|
|
1502
|
|
|
/* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js |
1503
|
|
|
========================================== */ |
1504
|
|
|
|
1505
|
|
|
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, { |
1506
|
|
|
|
1507
|
|
|
constructor: Popover |
1508
|
|
|
|
1509
|
|
|
, setContent: function () { |
1510
|
|
|
var $tip = this.tip() |
1511
|
|
|
, title = this.getTitle() |
1512
|
|
|
, content = this.getContent() |
1513
|
|
|
|
1514
|
|
|
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) |
1515
|
|
|
$tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content) |
1516
|
|
|
|
1517
|
|
|
$tip.removeClass('fade top bottom left right in') |
1518
|
|
|
} |
1519
|
|
|
|
1520
|
|
|
, hasContent: function () { |
1521
|
|
|
return this.getTitle() || this.getContent() |
1522
|
|
|
} |
1523
|
|
|
|
1524
|
|
|
, getContent: function () { |
1525
|
|
|
var content |
1526
|
|
|
, $e = this.$element |
1527
|
|
|
, o = this.options |
1528
|
|
|
|
1529
|
|
|
content = (typeof o.content == 'function' ? o.content.call($e[0]) : o.content) |
1530
|
|
|
|| $e.attr('data-content') |
1531
|
|
|
|
1532
|
|
|
return content |
1533
|
|
|
} |
1534
|
|
|
|
1535
|
|
|
, tip: function () { |
1536
|
|
|
if (!this.$tip) { |
1537
|
|
|
this.$tip = $(this.options.template) |
1538
|
|
|
} |
1539
|
|
|
return this.$tip |
1540
|
|
|
} |
1541
|
|
|
|
1542
|
|
|
, destroy: function () { |
1543
|
|
|
this.hide().$element.off('.' + this.type).removeData(this.type) |
1544
|
|
|
} |
1545
|
|
|
|
1546
|
|
|
}) |
1547
|
|
|
|
1548
|
|
|
|
1549
|
|
|
/* POPOVER PLUGIN DEFINITION |
1550
|
|
|
* ======================= */ |
1551
|
|
|
|
1552
|
|
|
var old = $.fn.popover |
1553
|
|
|
|
1554
|
|
|
$.fn.popover = function (option) { |
1555
|
|
|
return this.each(function () { |
1556
|
|
|
var $this = $(this) |
1557
|
|
|
, data = $this.data('popover') |
1558
|
|
|
, options = typeof option == 'object' && option |
1559
|
|
|
if (!data) $this.data('popover', (data = new Popover(this, options))) |
|
|
|
|
1560
|
|
|
if (typeof option == 'string') data[option]() |
|
|
|
|
1561
|
|
|
}) |
1562
|
|
|
} |
1563
|
|
|
|
1564
|
|
|
$.fn.popover.Constructor = Popover |
1565
|
|
|
|
1566
|
|
|
$.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, { |
1567
|
|
|
placement: 'right' |
1568
|
|
|
, trigger: 'click' |
1569
|
|
|
, content: '' |
1570
|
|
|
, template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' |
1571
|
|
|
}) |
1572
|
|
|
|
1573
|
|
|
|
1574
|
|
|
/* POPOVER NO CONFLICT |
1575
|
|
|
* =================== */ |
1576
|
|
|
|
1577
|
|
|
$.fn.popover.noConflict = function () { |
1578
|
|
|
$.fn.popover = old |
1579
|
|
|
return this |
1580
|
|
|
} |
1581
|
|
|
|
1582
|
|
|
}(window.jQuery); |
1583
|
|
|
/* ============================================================= |
1584
|
|
|
* bootstrap-scrollspy.js v2.3.2 |
1585
|
|
|
* http://twitter.github.com/bootstrap/javascript.html#scrollspy |
1586
|
|
|
* ============================================================= |
1587
|
|
|
* Copyright 2012 Twitter, Inc. |
1588
|
|
|
* |
1589
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
1590
|
|
|
* you may not use this file except in compliance with the License. |
1591
|
|
|
* You may obtain a copy of the License at |
1592
|
|
|
* |
1593
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
1594
|
|
|
* |
1595
|
|
|
* Unless required by applicable law or agreed to in writing, software |
1596
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
1597
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
1598
|
|
|
* See the License for the specific language governing permissions and |
1599
|
|
|
* limitations under the License. |
1600
|
|
|
* ============================================================== */ |
1601
|
|
|
|
1602
|
|
|
|
1603
|
|
|
!function ($) { |
1604
|
|
|
|
1605
|
|
|
"use strict"; // jshint ;_; |
1606
|
|
|
|
1607
|
|
|
|
1608
|
|
|
/* SCROLLSPY CLASS DEFINITION |
1609
|
|
|
* ========================== */ |
1610
|
|
|
|
1611
|
|
|
function ScrollSpy(element, options) { |
1612
|
|
|
var process = $.proxy(this.process, this) |
1613
|
|
|
, $element = $(element).is('body') ? $(window) : $(element) |
1614
|
|
|
, href |
1615
|
|
|
this.options = $.extend({}, $.fn.scrollspy.defaults, options) |
1616
|
|
|
this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process) |
1617
|
|
|
this.selector = (this.options.target |
1618
|
|
|
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 |
1619
|
|
|
|| '') + ' .nav li > a' |
1620
|
|
|
this.$body = $('body') |
1621
|
|
|
this.refresh() |
1622
|
|
|
this.process() |
1623
|
|
|
} |
1624
|
|
|
|
1625
|
|
|
ScrollSpy.prototype = { |
1626
|
|
|
|
1627
|
|
|
constructor: ScrollSpy |
1628
|
|
|
|
1629
|
|
|
, refresh: function () { |
1630
|
|
|
var self = this |
1631
|
|
|
, $targets |
1632
|
|
|
|
1633
|
|
|
this.offsets = $([]) |
1634
|
|
|
this.targets = $([]) |
1635
|
|
|
|
1636
|
|
|
$targets = this.$body |
|
|
|
|
1637
|
|
|
.find(this.selector) |
1638
|
|
|
.map(function () { |
1639
|
|
|
var $el = $(this) |
1640
|
|
|
, href = $el.data('target') || $el.attr('href') |
1641
|
|
|
, $href = /^#\w/.test(href) && $(href) |
1642
|
|
|
return ( $href |
1643
|
|
|
&& $href.length |
1644
|
|
|
&& [[ $href.position().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]] ) || null |
1645
|
|
|
}) |
1646
|
|
|
.sort(function (a, b) { return a[0] - b[0] }) |
1647
|
|
|
.each(function () { |
1648
|
|
|
self.offsets.push(this[0]) |
1649
|
|
|
self.targets.push(this[1]) |
1650
|
|
|
}) |
1651
|
|
|
} |
1652
|
|
|
|
1653
|
|
|
, process: function () { |
1654
|
|
|
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset |
1655
|
|
|
, scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight |
1656
|
|
|
, maxScroll = scrollHeight - this.$scrollElement.height() |
1657
|
|
|
, offsets = this.offsets |
1658
|
|
|
, targets = this.targets |
1659
|
|
|
, activeTarget = this.activeTarget |
1660
|
|
|
, i |
1661
|
|
|
|
1662
|
|
|
if (scrollTop >= maxScroll) { |
1663
|
|
|
return activeTarget != (i = targets.last()[0]) |
1664
|
|
|
&& this.activate ( i ) |
1665
|
|
|
} |
1666
|
|
|
|
1667
|
|
|
for (i = offsets.length; i--;) { |
1668
|
|
|
activeTarget != targets[i] |
1669
|
|
|
&& scrollTop >= offsets[i] |
1670
|
|
|
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1]) |
1671
|
|
|
&& this.activate( targets[i] ) |
1672
|
|
|
} |
|
|
|
|
1673
|
|
|
} |
1674
|
|
|
|
1675
|
|
|
, activate: function (target) { |
1676
|
|
|
var active |
1677
|
|
|
, selector |
1678
|
|
|
|
1679
|
|
|
this.activeTarget = target |
1680
|
|
|
|
1681
|
|
|
$(this.selector) |
1682
|
|
|
.parent('.active') |
1683
|
|
|
.removeClass('active') |
1684
|
|
|
|
1685
|
|
|
selector = this.selector |
1686
|
|
|
+ '[data-target="' + target + '"],' |
1687
|
|
|
+ this.selector + '[href="' + target + '"]' |
1688
|
|
|
|
1689
|
|
|
active = $(selector) |
1690
|
|
|
.parent('li') |
1691
|
|
|
.addClass('active') |
1692
|
|
|
|
1693
|
|
|
if (active.parent('.dropdown-menu').length) { |
1694
|
|
|
active = active.closest('li.dropdown').addClass('active') |
1695
|
|
|
} |
1696
|
|
|
|
1697
|
|
|
active.trigger('activate') |
1698
|
|
|
} |
1699
|
|
|
|
1700
|
|
|
} |
1701
|
|
|
|
1702
|
|
|
|
1703
|
|
|
/* SCROLLSPY PLUGIN DEFINITION |
1704
|
|
|
* =========================== */ |
1705
|
|
|
|
1706
|
|
|
var old = $.fn.scrollspy |
1707
|
|
|
|
1708
|
|
|
$.fn.scrollspy = function (option) { |
1709
|
|
|
return this.each(function () { |
1710
|
|
|
var $this = $(this) |
1711
|
|
|
, data = $this.data('scrollspy') |
1712
|
|
|
, options = typeof option == 'object' && option |
1713
|
|
|
if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options))) |
|
|
|
|
1714
|
|
|
if (typeof option == 'string') data[option]() |
|
|
|
|
1715
|
|
|
}) |
1716
|
|
|
} |
1717
|
|
|
|
1718
|
|
|
$.fn.scrollspy.Constructor = ScrollSpy |
1719
|
|
|
|
1720
|
|
|
$.fn.scrollspy.defaults = { |
1721
|
|
|
offset: 10 |
1722
|
|
|
} |
1723
|
|
|
|
1724
|
|
|
|
1725
|
|
|
/* SCROLLSPY NO CONFLICT |
1726
|
|
|
* ===================== */ |
1727
|
|
|
|
1728
|
|
|
$.fn.scrollspy.noConflict = function () { |
1729
|
|
|
$.fn.scrollspy = old |
1730
|
|
|
return this |
1731
|
|
|
} |
1732
|
|
|
|
1733
|
|
|
|
1734
|
|
|
/* SCROLLSPY DATA-API |
1735
|
|
|
* ================== */ |
1736
|
|
|
|
1737
|
|
|
$(window).on('load', function () { |
1738
|
|
|
$('[data-spy="scroll"]').each(function () { |
1739
|
|
|
var $spy = $(this) |
1740
|
|
|
$spy.scrollspy($spy.data()) |
1741
|
|
|
}) |
1742
|
|
|
}) |
1743
|
|
|
|
1744
|
|
|
}(window.jQuery);/* ======================================================== |
1745
|
|
|
* bootstrap-tab.js v2.3.2 |
1746
|
|
|
* http://twitter.github.com/bootstrap/javascript.html#tabs |
1747
|
|
|
* ======================================================== |
1748
|
|
|
* Copyright 2012 Twitter, Inc. |
1749
|
|
|
* |
1750
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
1751
|
|
|
* you may not use this file except in compliance with the License. |
1752
|
|
|
* You may obtain a copy of the License at |
1753
|
|
|
* |
1754
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
1755
|
|
|
* |
1756
|
|
|
* Unless required by applicable law or agreed to in writing, software |
1757
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
1758
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
1759
|
|
|
* See the License for the specific language governing permissions and |
1760
|
|
|
* limitations under the License. |
1761
|
|
|
* ======================================================== */ |
1762
|
|
|
|
1763
|
|
|
|
1764
|
|
|
!function ($) { |
1765
|
|
|
|
1766
|
|
|
"use strict"; // jshint ;_; |
1767
|
|
|
|
1768
|
|
|
|
1769
|
|
|
/* TAB CLASS DEFINITION |
1770
|
|
|
* ==================== */ |
1771
|
|
|
|
1772
|
|
|
var Tab = function (element) { |
1773
|
|
|
this.element = $(element) |
1774
|
|
|
} |
1775
|
|
|
|
1776
|
|
|
Tab.prototype = { |
1777
|
|
|
|
1778
|
|
|
constructor: Tab |
1779
|
|
|
|
1780
|
|
|
, show: function () { |
1781
|
|
|
var $this = this.element |
1782
|
|
|
, $ul = $this.closest('ul:not(.dropdown-menu)') |
1783
|
|
|
, selector = $this.attr('data-target') |
1784
|
|
|
, previous |
1785
|
|
|
, $target |
1786
|
|
|
, e |
1787
|
|
|
|
1788
|
|
|
if (!selector) { |
1789
|
|
|
selector = $this.attr('href') |
1790
|
|
|
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 |
1791
|
|
|
} |
1792
|
|
|
|
1793
|
|
|
if ( $this.parent('li').hasClass('active') ) return |
|
|
|
|
1794
|
|
|
|
1795
|
|
|
previous = $ul.find('.active:last a')[0] |
1796
|
|
|
|
1797
|
|
|
e = $.Event('show', { |
1798
|
|
|
relatedTarget: previous |
1799
|
|
|
}) |
1800
|
|
|
|
1801
|
|
|
$this.trigger(e) |
1802
|
|
|
|
1803
|
|
|
if (e.isDefaultPrevented()) return |
|
|
|
|
1804
|
|
|
|
1805
|
|
|
$target = $(selector) |
1806
|
|
|
|
1807
|
|
|
this.activate($this.parent('li'), $ul) |
1808
|
|
|
this.activate($target, $target.parent(), function () { |
1809
|
|
|
$this.trigger({ |
1810
|
|
|
type: 'shown' |
1811
|
|
|
, relatedTarget: previous |
1812
|
|
|
}) |
1813
|
|
|
}) |
1814
|
|
|
} |
1815
|
|
|
|
1816
|
|
|
, activate: function ( element, container, callback) { |
1817
|
|
|
var $active = container.find('> .active') |
1818
|
|
|
, transition = callback |
1819
|
|
|
&& $.support.transition |
1820
|
|
|
&& $active.hasClass('fade') |
1821
|
|
|
|
1822
|
|
|
function next() { |
1823
|
|
|
$active |
1824
|
|
|
.removeClass('active') |
1825
|
|
|
.find('> .dropdown-menu > .active') |
1826
|
|
|
.removeClass('active') |
1827
|
|
|
|
1828
|
|
|
element.addClass('active') |
1829
|
|
|
|
1830
|
|
|
if (transition) { |
1831
|
|
|
element[0].offsetWidth // reflow for transition |
|
|
|
|
1832
|
|
|
element.addClass('in') |
1833
|
|
|
} else { |
1834
|
|
|
element.removeClass('fade') |
1835
|
|
|
} |
1836
|
|
|
|
1837
|
|
|
if ( element.parent('.dropdown-menu') ) { |
1838
|
|
|
element.closest('li.dropdown').addClass('active') |
1839
|
|
|
} |
1840
|
|
|
|
1841
|
|
|
callback && callback() |
1842
|
|
|
} |
1843
|
|
|
|
1844
|
|
|
transition ? |
1845
|
|
|
$active.one($.support.transition.end, next) : |
1846
|
|
|
next() |
1847
|
|
|
|
1848
|
|
|
$active.removeClass('in') |
1849
|
|
|
} |
1850
|
|
|
} |
1851
|
|
|
|
1852
|
|
|
|
1853
|
|
|
/* TAB PLUGIN DEFINITION |
1854
|
|
|
* ===================== */ |
1855
|
|
|
|
1856
|
|
|
var old = $.fn.tab |
1857
|
|
|
|
1858
|
|
|
$.fn.tab = function ( option ) { |
1859
|
|
|
return this.each(function () { |
1860
|
|
|
var $this = $(this) |
1861
|
|
|
, data = $this.data('tab') |
1862
|
|
|
if (!data) $this.data('tab', (data = new Tab(this))) |
|
|
|
|
1863
|
|
|
if (typeof option == 'string') data[option]() |
|
|
|
|
1864
|
|
|
}) |
1865
|
|
|
} |
1866
|
|
|
|
1867
|
|
|
$.fn.tab.Constructor = Tab |
1868
|
|
|
|
1869
|
|
|
|
1870
|
|
|
/* TAB NO CONFLICT |
1871
|
|
|
* =============== */ |
1872
|
|
|
|
1873
|
|
|
$.fn.tab.noConflict = function () { |
1874
|
|
|
$.fn.tab = old |
1875
|
|
|
return this |
1876
|
|
|
} |
1877
|
|
|
|
1878
|
|
|
|
1879
|
|
|
/* TAB DATA-API |
1880
|
|
|
* ============ */ |
1881
|
|
|
|
1882
|
|
|
$(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { |
1883
|
|
|
e.preventDefault() |
1884
|
|
|
$(this).tab('show') |
1885
|
|
|
}) |
1886
|
|
|
|
1887
|
|
|
}(window.jQuery);/* ============================================================= |
1888
|
|
|
* bootstrap-typeahead.js v2.3.2 |
1889
|
|
|
* http://twitter.github.com/bootstrap/javascript.html#typeahead |
1890
|
|
|
* ============================================================= |
1891
|
|
|
* Copyright 2012 Twitter, Inc. |
1892
|
|
|
* |
1893
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
1894
|
|
|
* you may not use this file except in compliance with the License. |
1895
|
|
|
* You may obtain a copy of the License at |
1896
|
|
|
* |
1897
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
1898
|
|
|
* |
1899
|
|
|
* Unless required by applicable law or agreed to in writing, software |
1900
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
1901
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
1902
|
|
|
* See the License for the specific language governing permissions and |
1903
|
|
|
* limitations under the License. |
1904
|
|
|
* ============================================================ */ |
1905
|
|
|
|
1906
|
|
|
|
1907
|
|
|
!function($){ |
1908
|
|
|
|
1909
|
|
|
"use strict"; // jshint ;_; |
1910
|
|
|
|
1911
|
|
|
|
1912
|
|
|
/* TYPEAHEAD PUBLIC CLASS DEFINITION |
1913
|
|
|
* ================================= */ |
1914
|
|
|
|
1915
|
|
|
var Typeahead = function (element, options) { |
1916
|
|
|
this.$element = $(element) |
1917
|
|
|
this.options = $.extend({}, $.fn.typeahead.defaults, options) |
1918
|
|
|
this.matcher = this.options.matcher || this.matcher |
1919
|
|
|
this.sorter = this.options.sorter || this.sorter |
1920
|
|
|
this.highlighter = this.options.highlighter || this.highlighter |
1921
|
|
|
this.updater = this.options.updater || this.updater |
1922
|
|
|
this.source = this.options.source |
1923
|
|
|
this.$menu = $(this.options.menu) |
1924
|
|
|
this.shown = false |
1925
|
|
|
this.listen() |
1926
|
|
|
} |
1927
|
|
|
|
1928
|
|
|
Typeahead.prototype = { |
1929
|
|
|
|
1930
|
|
|
constructor: Typeahead |
1931
|
|
|
|
1932
|
|
|
, select: function () { |
1933
|
|
|
var val = this.$menu.find('.active').attr('data-value') |
1934
|
|
|
this.$element |
1935
|
|
|
.val(this.updater(val)) |
1936
|
|
|
.change() |
1937
|
|
|
return this.hide() |
1938
|
|
|
} |
1939
|
|
|
|
1940
|
|
|
, updater: function (item) { |
1941
|
|
|
return item |
1942
|
|
|
} |
1943
|
|
|
|
1944
|
|
|
, show: function () { |
1945
|
|
|
var pos = $.extend({}, this.$element.position(), { |
1946
|
|
|
height: this.$element[0].offsetHeight |
1947
|
|
|
}) |
1948
|
|
|
|
1949
|
|
|
this.$menu |
1950
|
|
|
.insertAfter(this.$element) |
1951
|
|
|
.css({ |
1952
|
|
|
top: pos.top + pos.height |
1953
|
|
|
, left: pos.left |
1954
|
|
|
}) |
1955
|
|
|
.show() |
1956
|
|
|
|
1957
|
|
|
this.shown = true |
1958
|
|
|
return this |
1959
|
|
|
} |
1960
|
|
|
|
1961
|
|
|
, hide: function () { |
1962
|
|
|
this.$menu.hide() |
1963
|
|
|
this.shown = false |
1964
|
|
|
return this |
1965
|
|
|
} |
1966
|
|
|
|
1967
|
|
|
, lookup: function (event) { |
|
|
|
|
1968
|
|
|
var items |
1969
|
|
|
|
1970
|
|
|
this.query = this.$element.val() |
1971
|
|
|
|
1972
|
|
|
if (!this.query || this.query.length < this.options.minLength) { |
1973
|
|
|
return this.shown ? this.hide() : this |
1974
|
|
|
} |
1975
|
|
|
|
1976
|
|
|
items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source |
1977
|
|
|
|
1978
|
|
|
return items ? this.process(items) : this |
1979
|
|
|
} |
1980
|
|
|
|
1981
|
|
|
, process: function (items) { |
1982
|
|
|
var that = this |
1983
|
|
|
|
1984
|
|
|
items = $.grep(items, function (item) { |
1985
|
|
|
return that.matcher(item) |
1986
|
|
|
}) |
1987
|
|
|
|
1988
|
|
|
items = this.sorter(items) |
1989
|
|
|
|
1990
|
|
|
if (!items.length) { |
1991
|
|
|
return this.shown ? this.hide() : this |
1992
|
|
|
} |
1993
|
|
|
|
1994
|
|
|
return this.render(items.slice(0, this.options.items)).show() |
1995
|
|
|
} |
1996
|
|
|
|
1997
|
|
|
, matcher: function (item) { |
1998
|
|
|
return ~item.toLowerCase().indexOf(this.query.toLowerCase()) |
1999
|
|
|
} |
2000
|
|
|
|
2001
|
|
|
, sorter: function (items) { |
2002
|
|
|
var beginswith = [] |
2003
|
|
|
, caseSensitive = [] |
2004
|
|
|
, caseInsensitive = [] |
2005
|
|
|
, item |
2006
|
|
|
|
2007
|
|
|
while (item = items.shift()) { |
2008
|
|
|
if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item) |
|
|
|
|
2009
|
|
|
else if (~item.indexOf(this.query)) caseSensitive.push(item) |
|
|
|
|
2010
|
|
|
else caseInsensitive.push(item) |
2011
|
|
|
} |
2012
|
|
|
|
2013
|
|
|
return beginswith.concat(caseSensitive, caseInsensitive) |
2014
|
|
|
} |
2015
|
|
|
|
2016
|
|
|
, highlighter: function (item) { |
2017
|
|
|
var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&') |
2018
|
|
|
return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) { |
2019
|
|
|
return '<strong>' + match + '</strong>' |
2020
|
|
|
}) |
2021
|
|
|
} |
2022
|
|
|
|
2023
|
|
|
, render: function (items) { |
2024
|
|
|
var that = this |
2025
|
|
|
|
2026
|
|
|
items = $(items).map(function (i, item) { |
2027
|
|
|
i = $(that.options.item).attr('data-value', item) |
2028
|
|
|
i.find('a').html(that.highlighter(item)) |
2029
|
|
|
return i[0] |
2030
|
|
|
}) |
2031
|
|
|
|
2032
|
|
|
items.first().addClass('active') |
2033
|
|
|
this.$menu.html(items) |
2034
|
|
|
return this |
2035
|
|
|
} |
2036
|
|
|
|
2037
|
|
|
, next: function (event) { |
|
|
|
|
2038
|
|
|
var active = this.$menu.find('.active').removeClass('active') |
2039
|
|
|
, next = active.next() |
2040
|
|
|
|
2041
|
|
|
if (!next.length) { |
2042
|
|
|
next = $(this.$menu.find('li')[0]) |
2043
|
|
|
} |
2044
|
|
|
|
2045
|
|
|
next.addClass('active') |
2046
|
|
|
} |
2047
|
|
|
|
2048
|
|
|
, prev: function (event) { |
|
|
|
|
2049
|
|
|
var active = this.$menu.find('.active').removeClass('active') |
2050
|
|
|
, prev = active.prev() |
2051
|
|
|
|
2052
|
|
|
if (!prev.length) { |
2053
|
|
|
prev = this.$menu.find('li').last() |
2054
|
|
|
} |
2055
|
|
|
|
2056
|
|
|
prev.addClass('active') |
2057
|
|
|
} |
2058
|
|
|
|
2059
|
|
|
, listen: function () { |
2060
|
|
|
this.$element |
2061
|
|
|
.on('focus', $.proxy(this.focus, this)) |
2062
|
|
|
.on('blur', $.proxy(this.blur, this)) |
2063
|
|
|
.on('keypress', $.proxy(this.keypress, this)) |
2064
|
|
|
.on('keyup', $.proxy(this.keyup, this)) |
2065
|
|
|
|
2066
|
|
|
if (this.eventSupported('keydown')) { |
2067
|
|
|
this.$element.on('keydown', $.proxy(this.keydown, this)) |
2068
|
|
|
} |
2069
|
|
|
|
2070
|
|
|
this.$menu |
2071
|
|
|
.on('click', $.proxy(this.click, this)) |
2072
|
|
|
.on('mouseenter', 'li', $.proxy(this.mouseenter, this)) |
2073
|
|
|
.on('mouseleave', 'li', $.proxy(this.mouseleave, this)) |
2074
|
|
|
} |
2075
|
|
|
|
2076
|
|
|
, eventSupported: function(eventName) { |
2077
|
|
|
var isSupported = eventName in this.$element |
2078
|
|
|
if (!isSupported) { |
2079
|
|
|
this.$element.setAttribute(eventName, 'return;') |
2080
|
|
|
isSupported = typeof this.$element[eventName] === 'function' |
2081
|
|
|
} |
2082
|
|
|
return isSupported |
2083
|
|
|
} |
2084
|
|
|
|
2085
|
|
|
, move: function (e) { |
2086
|
|
|
if (!this.shown) return |
|
|
|
|
2087
|
|
|
|
2088
|
|
|
switch(e.keyCode) { |
|
|
|
|
2089
|
|
|
case 9: // tab |
2090
|
|
|
case 13: // enter |
2091
|
|
|
case 27: // escape |
2092
|
|
|
e.preventDefault() |
2093
|
|
|
break |
2094
|
|
|
|
2095
|
|
|
case 38: // up arrow |
2096
|
|
|
e.preventDefault() |
2097
|
|
|
this.prev() |
2098
|
|
|
break |
2099
|
|
|
|
2100
|
|
|
case 40: // down arrow |
2101
|
|
|
e.preventDefault() |
2102
|
|
|
this.next() |
2103
|
|
|
break |
2104
|
|
|
} |
2105
|
|
|
|
2106
|
|
|
e.stopPropagation() |
2107
|
|
|
} |
2108
|
|
|
|
2109
|
|
|
, keydown: function (e) { |
2110
|
|
|
this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27]) |
2111
|
|
|
this.move(e) |
2112
|
|
|
} |
2113
|
|
|
|
2114
|
|
|
, keypress: function (e) { |
2115
|
|
|
if (this.suppressKeyPressRepeat) return |
|
|
|
|
2116
|
|
|
this.move(e) |
2117
|
|
|
} |
2118
|
|
|
|
2119
|
|
|
, keyup: function (e) { |
2120
|
|
|
switch(e.keyCode) { |
2121
|
|
|
case 40: // down arrow |
2122
|
|
|
case 38: // up arrow |
2123
|
|
|
case 16: // shift |
2124
|
|
|
case 17: // ctrl |
2125
|
|
|
case 18: // alt |
2126
|
|
|
break |
2127
|
|
|
|
2128
|
|
|
case 9: // tab |
2129
|
|
|
case 13: // enter |
2130
|
|
|
if (!this.shown) return |
|
|
|
|
2131
|
|
|
this.select() |
2132
|
|
|
break |
2133
|
|
|
|
2134
|
|
|
case 27: // escape |
2135
|
|
|
if (!this.shown) return |
|
|
|
|
2136
|
|
|
this.hide() |
2137
|
|
|
break |
2138
|
|
|
|
2139
|
|
|
default: |
2140
|
|
|
this.lookup() |
2141
|
|
|
} |
2142
|
|
|
|
2143
|
|
|
e.stopPropagation() |
2144
|
|
|
e.preventDefault() |
2145
|
|
|
} |
2146
|
|
|
|
2147
|
|
|
, focus: function (e) { |
|
|
|
|
2148
|
|
|
this.focused = true |
2149
|
|
|
} |
2150
|
|
|
|
2151
|
|
|
, blur: function (e) { |
|
|
|
|
2152
|
|
|
this.focused = false |
2153
|
|
|
if (!this.mousedover && this.shown) this.hide() |
|
|
|
|
2154
|
|
|
} |
2155
|
|
|
|
2156
|
|
|
, click: function (e) { |
2157
|
|
|
e.stopPropagation() |
2158
|
|
|
e.preventDefault() |
2159
|
|
|
this.select() |
2160
|
|
|
this.$element.focus() |
2161
|
|
|
} |
2162
|
|
|
|
2163
|
|
|
, mouseenter: function (e) { |
2164
|
|
|
this.mousedover = true |
2165
|
|
|
this.$menu.find('.active').removeClass('active') |
2166
|
|
|
$(e.currentTarget).addClass('active') |
2167
|
|
|
} |
2168
|
|
|
|
2169
|
|
|
, mouseleave: function (e) { |
|
|
|
|
2170
|
|
|
this.mousedover = false |
2171
|
|
|
if (!this.focused && this.shown) this.hide() |
|
|
|
|
2172
|
|
|
} |
2173
|
|
|
|
2174
|
|
|
} |
2175
|
|
|
|
2176
|
|
|
|
2177
|
|
|
/* TYPEAHEAD PLUGIN DEFINITION |
2178
|
|
|
* =========================== */ |
2179
|
|
|
|
2180
|
|
|
var old = $.fn.typeahead |
2181
|
|
|
|
2182
|
|
|
$.fn.typeahead = function (option) { |
2183
|
|
|
return this.each(function () { |
2184
|
|
|
var $this = $(this) |
2185
|
|
|
, data = $this.data('typeahead') |
2186
|
|
|
, options = typeof option == 'object' && option |
2187
|
|
|
if (!data) $this.data('typeahead', (data = new Typeahead(this, options))) |
|
|
|
|
2188
|
|
|
if (typeof option == 'string') data[option]() |
|
|
|
|
2189
|
|
|
}) |
2190
|
|
|
} |
2191
|
|
|
|
2192
|
|
|
$.fn.typeahead.defaults = { |
2193
|
|
|
source: [] |
2194
|
|
|
, items: 8 |
2195
|
|
|
, menu: '<ul class="typeahead dropdown-menu"></ul>' |
2196
|
|
|
, item: '<li><a href="#"></a></li>' |
2197
|
|
|
, minLength: 1 |
2198
|
|
|
} |
2199
|
|
|
|
2200
|
|
|
$.fn.typeahead.Constructor = Typeahead |
2201
|
|
|
|
2202
|
|
|
|
2203
|
|
|
/* TYPEAHEAD NO CONFLICT |
2204
|
|
|
* =================== */ |
2205
|
|
|
|
2206
|
|
|
$.fn.typeahead.noConflict = function () { |
2207
|
|
|
$.fn.typeahead = old |
2208
|
|
|
return this |
2209
|
|
|
} |
2210
|
|
|
|
2211
|
|
|
|
2212
|
|
|
/* TYPEAHEAD DATA-API |
2213
|
|
|
* ================== */ |
2214
|
|
|
|
2215
|
|
|
$(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) { |
|
|
|
|
2216
|
|
|
var $this = $(this) |
2217
|
|
|
if ($this.data('typeahead')) return |
|
|
|
|
2218
|
|
|
$this.typeahead($this.data()) |
2219
|
|
|
}) |
2220
|
|
|
|
2221
|
|
|
}(window.jQuery); |
2222
|
|
|
/* ========================================================== |
2223
|
|
|
* bootstrap-affix.js v2.3.2 |
2224
|
|
|
* http://twitter.github.com/bootstrap/javascript.html#affix |
2225
|
|
|
* ========================================================== |
2226
|
|
|
* Copyright 2012 Twitter, Inc. |
2227
|
|
|
* |
2228
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
2229
|
|
|
* you may not use this file except in compliance with the License. |
2230
|
|
|
* You may obtain a copy of the License at |
2231
|
|
|
* |
2232
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
2233
|
|
|
* |
2234
|
|
|
* Unless required by applicable law or agreed to in writing, software |
2235
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
2236
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
2237
|
|
|
* See the License for the specific language governing permissions and |
2238
|
|
|
* limitations under the License. |
2239
|
|
|
* ========================================================== */ |
2240
|
|
|
|
2241
|
|
|
|
2242
|
|
|
!function ($) { |
2243
|
|
|
|
2244
|
|
|
"use strict"; // jshint ;_; |
2245
|
|
|
|
2246
|
|
|
|
2247
|
|
|
/* AFFIX CLASS DEFINITION |
2248
|
|
|
* ====================== */ |
2249
|
|
|
|
2250
|
|
|
var Affix = function (element, options) { |
2251
|
|
|
this.options = $.extend({}, $.fn.affix.defaults, options) |
2252
|
|
|
this.$window = $(window) |
2253
|
|
|
.on('scroll.affix.data-api', $.proxy(this.checkPosition, this)) |
2254
|
|
|
.on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this)) |
2255
|
|
|
this.$element = $(element) |
2256
|
|
|
this.checkPosition() |
2257
|
|
|
} |
2258
|
|
|
|
2259
|
|
|
Affix.prototype.checkPosition = function () { |
2260
|
|
|
if (!this.$element.is(':visible')) return |
|
|
|
|
2261
|
|
|
|
2262
|
|
|
var scrollHeight = $(document).height() |
2263
|
|
|
, scrollTop = this.$window.scrollTop() |
2264
|
|
|
, position = this.$element.offset() |
2265
|
|
|
, offset = this.options.offset |
2266
|
|
|
, offsetBottom = offset.bottom |
2267
|
|
|
, offsetTop = offset.top |
2268
|
|
|
, reset = 'affix affix-top affix-bottom' |
2269
|
|
|
, affix |
2270
|
|
|
|
2271
|
|
|
if (typeof offset != 'object') offsetBottom = offsetTop = offset |
|
|
|
|
2272
|
|
|
if (typeof offsetTop == 'function') offsetTop = offset.top() |
|
|
|
|
2273
|
|
|
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom() |
|
|
|
|
2274
|
|
|
|
2275
|
|
|
affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? |
2276
|
|
|
false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? |
2277
|
|
|
'bottom' : offsetTop != null && scrollTop <= offsetTop ? |
2278
|
|
|
'top' : false |
2279
|
|
|
|
2280
|
|
|
if (this.affixed === affix) return |
|
|
|
|
2281
|
|
|
|
2282
|
|
|
this.affixed = affix |
2283
|
|
|
this.unpin = affix == 'bottom' ? position.top - scrollTop : null |
2284
|
|
|
|
2285
|
|
|
this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : '')) |
2286
|
|
|
} |
2287
|
|
|
|
2288
|
|
|
|
2289
|
|
|
/* AFFIX PLUGIN DEFINITION |
2290
|
|
|
* ======================= */ |
2291
|
|
|
|
2292
|
|
|
var old = $.fn.affix |
2293
|
|
|
|
2294
|
|
|
$.fn.affix = function (option) { |
2295
|
|
|
return this.each(function () { |
2296
|
|
|
var $this = $(this) |
2297
|
|
|
, data = $this.data('affix') |
2298
|
|
|
, options = typeof option == 'object' && option |
2299
|
|
|
if (!data) $this.data('affix', (data = new Affix(this, options))) |
|
|
|
|
2300
|
|
|
if (typeof option == 'string') data[option]() |
|
|
|
|
2301
|
|
|
}) |
2302
|
|
|
} |
2303
|
|
|
|
2304
|
|
|
$.fn.affix.Constructor = Affix |
2305
|
|
|
|
2306
|
|
|
$.fn.affix.defaults = { |
2307
|
|
|
offset: 0 |
2308
|
|
|
} |
2309
|
|
|
|
2310
|
|
|
|
2311
|
|
|
/* AFFIX NO CONFLICT |
2312
|
|
|
* ================= */ |
2313
|
|
|
|
2314
|
|
|
$.fn.affix.noConflict = function () { |
2315
|
|
|
$.fn.affix = old |
2316
|
|
|
return this |
2317
|
|
|
} |
2318
|
|
|
|
2319
|
|
|
|
2320
|
|
|
/* AFFIX DATA-API |
2321
|
|
|
* ============== */ |
2322
|
|
|
|
2323
|
|
|
$(window).on('load', function () { |
2324
|
|
|
$('[data-spy="affix"]').each(function () { |
2325
|
|
|
var $spy = $(this) |
2326
|
|
|
, data = $spy.data() |
2327
|
|
|
|
2328
|
|
|
data.offset = data.offset || {} |
2329
|
|
|
|
2330
|
|
|
data.offsetBottom && (data.offset.bottom = data.offsetBottom) |
2331
|
|
|
data.offsetTop && (data.offset.top = data.offsetTop) |
2332
|
|
|
|
2333
|
|
|
$spy.affix(data) |
2334
|
|
|
}) |
2335
|
|
|
}) |
2336
|
|
|
|
2337
|
|
|
|
2338
|
|
|
}(window.jQuery); |
2339
|
|
|
|