1 /* ===================================================
2 * bootstrap-transition.js v2.2.2
3 * http://twitter.github.com/bootstrap/javascript.html#transitions
4 * ===================================================
5 * Copyright 2012 Twitter, Inc.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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 * ========================================================== */
23 "use strict"; // jshint ;_;
26 /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
27 * ======================================================= */
31 $.support.transition = (function () {
33 var transitionEnd = (function () {
35 var el = document.createElement('bootstrap')
36 , transEndEventNames = {
37 'WebkitTransition' : 'webkitTransitionEnd'
38 , 'MozTransition' : 'transitionend'
39 , 'OTransition' : 'oTransitionEnd otransitionend'
40 , 'transition' : 'transitionend'
44 for (name in transEndEventNames){
45 if (el.style[name] !== undefined) {
46 return transEndEventNames[name]
52 return transitionEnd && {
60 }(window.jQuery);/* ==========================================================
61 * bootstrap-alert.js v2.2.2
62 * http://twitter.github.com/bootstrap/javascript.html#alerts
63 * ==========================================================
64 * Copyright 2012 Twitter, Inc.
66 * Licensed under the Apache License, Version 2.0 (the "License");
67 * you may not use this file except in compliance with the License.
68 * You may obtain a copy of the License at
70 * http://www.apache.org/licenses/LICENSE-2.0
72 * Unless required by applicable law or agreed to in writing, software
73 * distributed under the License is distributed on an "AS IS" BASIS,
74 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
75 * See the License for the specific language governing permissions and
76 * limitations under the License.
77 * ========================================================== */
82 "use strict"; // jshint ;_;
85 /* ALERT CLASS DEFINITION
86 * ====================== */
88 var dismiss = '[data-dismiss="alert"]'
89 , Alert = function (el) {
90 $(el).on('click', dismiss, this.close)
93 Alert.prototype.close = function (e) {
95 , selector = $this.attr('data-target')
99 selector = $this.attr('href')
100 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
103 $parent = $(selector)
105 e && e.preventDefault()
107 $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
109 $parent.trigger(e = $.Event('close'))
111 if (e.isDefaultPrevented()) return
113 $parent.removeClass('in')
115 function removeElement() {
121 $.support.transition && $parent.hasClass('fade') ?
122 $parent.on($.support.transition.end, removeElement) :
127 /* ALERT PLUGIN DEFINITION
128 * ======================= */
132 $.fn.alert = function (option) {
133 return this.each(function () {
135 , data = $this.data('alert')
136 if (!data) $this.data('alert', (data = new Alert(this)))
137 if (typeof option == 'string') data[option].call($this)
141 $.fn.alert.Constructor = Alert
145 * ================= */
147 $.fn.alert.noConflict = function () {
156 $(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
158 }(window.jQuery);/* ============================================================
159 * bootstrap-button.js v2.2.2
160 * http://twitter.github.com/bootstrap/javascript.html#buttons
161 * ============================================================
162 * Copyright 2012 Twitter, Inc.
164 * Licensed under the Apache License, Version 2.0 (the "License");
165 * you may not use this file except in compliance with the License.
166 * You may obtain a copy of the License at
168 * http://www.apache.org/licenses/LICENSE-2.0
170 * Unless required by applicable law or agreed to in writing, software
171 * distributed under the License is distributed on an "AS IS" BASIS,
172 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
173 * See the License for the specific language governing permissions and
174 * limitations under the License.
175 * ============================================================ */
180 "use strict"; // jshint ;_;
183 /* BUTTON PUBLIC CLASS DEFINITION
184 * ============================== */
186 var Button = function (element, options) {
187 this.$element = $(element)
188 this.options = $.extend({}, $.fn.button.defaults, options)
191 Button.prototype.setState = function (state) {
193 , $el = this.$element
195 , val = $el.is('input') ? 'val' : 'html'
197 state = state + 'Text'
198 data.resetText || $el.data('resetText', $el[val]())
200 $el[val](data[state] || this.options[state])
202 // push to event loop to allow forms to submit
203 setTimeout(function () {
204 state == 'loadingText' ?
205 $el.addClass(d).attr(d, d) :
206 $el.removeClass(d).removeAttr(d)
210 Button.prototype.toggle = function () {
211 var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
215 .removeClass('active')
217 this.$element.toggleClass('active')
221 /* BUTTON PLUGIN DEFINITION
222 * ======================== */
224 var old = $.fn.button
226 $.fn.button = function (option) {
227 return this.each(function () {
229 , data = $this.data('button')
230 , options = typeof option == 'object' && option
231 if (!data) $this.data('button', (data = new Button(this, options)))
232 if (option == 'toggle') data.toggle()
233 else if (option) data.setState(option)
237 $.fn.button.defaults = {
238 loadingText: 'loading...'
241 $.fn.button.Constructor = Button
244 /* BUTTON NO CONFLICT
245 * ================== */
247 $.fn.button.noConflict = function () {
256 $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
257 var $btn = $(e.target)
258 if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
259 $btn.button('toggle')
262 }(window.jQuery);/* ==========================================================
263 * bootstrap-carousel.js v2.2.2
264 * http://twitter.github.com/bootstrap/javascript.html#carousel
265 * ==========================================================
266 * Copyright 2012 Twitter, Inc.
268 * Licensed under the Apache License, Version 2.0 (the "License");
269 * you may not use this file except in compliance with the License.
270 * You may obtain a copy of the License at
272 * http://www.apache.org/licenses/LICENSE-2.0
274 * Unless required by applicable law or agreed to in writing, software
275 * distributed under the License is distributed on an "AS IS" BASIS,
276 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
277 * See the License for the specific language governing permissions and
278 * limitations under the License.
279 * ========================================================== */
284 "use strict"; // jshint ;_;
287 /* CAROUSEL CLASS DEFINITION
288 * ========================= */
290 var Carousel = function (element, options) {
291 this.$element = $(element)
292 this.options = options
293 this.options.pause == 'hover' && this.$element
294 .on('mouseenter', $.proxy(this.pause, this))
295 .on('mouseleave', $.proxy(this.cycle, this))
298 Carousel.prototype = {
300 cycle: function (e) {
301 if (!e) this.paused = false
302 this.options.interval
304 && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
308 , to: function (pos) {
309 var $active = this.$element.find('.item.active')
310 , children = $active.parent().children()
311 , activePos = children.index($active)
314 if (pos > (children.length - 1) || pos < 0) return
317 return this.$element.one('slid', function () {
322 if (activePos == pos) {
323 return this.pause().cycle()
326 return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
329 , pause: function (e) {
330 if (!e) this.paused = true
331 if (this.$element.find('.next, .prev').length && $.support.transition.end) {
332 this.$element.trigger($.support.transition.end)
335 clearInterval(this.interval)
340 , next: function () {
341 if (this.sliding) return
342 return this.slide('next')
345 , prev: function () {
346 if (this.sliding) return
347 return this.slide('prev')
350 , slide: function (type, next) {
351 var $active = this.$element.find('.item.active')
352 , $next = next || $active[type]()
353 , isCycling = this.interval
354 , direction = type == 'next' ? 'left' : 'right'
355 , fallback = type == 'next' ? 'first' : 'last'
361 isCycling && this.pause()
363 $next = $next.length ? $next : this.$element.find('.item')[fallback]()
365 e = $.Event('slide', {
366 relatedTarget: $next[0]
369 if ($next.hasClass('active')) return
371 if ($.support.transition && this.$element.hasClass('slide')) {
372 this.$element.trigger(e)
373 if (e.isDefaultPrevented()) return
375 $next[0].offsetWidth // force reflow
376 $active.addClass(direction)
377 $next.addClass(direction)
378 this.$element.one($.support.transition.end, function () {
379 $next.removeClass([type, direction].join(' ')).addClass('active')
380 $active.removeClass(['active', direction].join(' '))
382 setTimeout(function () { that.$element.trigger('slid') }, 0)
385 this.$element.trigger(e)
386 if (e.isDefaultPrevented()) return
387 $active.removeClass('active')
388 $next.addClass('active')
390 this.$element.trigger('slid')
393 isCycling && this.cycle()
401 /* CAROUSEL PLUGIN DEFINITION
402 * ========================== */
404 var old = $.fn.carousel
406 $.fn.carousel = function (option) {
407 return this.each(function () {
409 , data = $this.data('carousel')
410 , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
411 , action = typeof option == 'string' ? option : options.slide
412 if (!data) $this.data('carousel', (data = new Carousel(this, options)))
413 if (typeof option == 'number') data.to(option)
414 else if (action) data[action]()
415 else if (options.interval) data.cycle()
419 $.fn.carousel.defaults = {
424 $.fn.carousel.Constructor = Carousel
427 /* CAROUSEL NO CONFLICT
428 * ==================== */
430 $.fn.carousel.noConflict = function () {
436 * ================= */
438 $(document).on('click.carousel.data-api', '[data-slide]', function (e) {
439 var $this = $(this), href
440 , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
441 , options = $.extend({}, $target.data(), $this.data())
442 $target.carousel(options)
446 }(window.jQuery);/* =============================================================
447 * bootstrap-collapse.js v2.2.2
448 * http://twitter.github.com/bootstrap/javascript.html#collapse
449 * =============================================================
450 * Copyright 2012 Twitter, Inc.
452 * Licensed under the Apache License, Version 2.0 (the "License");
453 * you may not use this file except in compliance with the License.
454 * You may obtain a copy of the License at
456 * http://www.apache.org/licenses/LICENSE-2.0
458 * Unless required by applicable law or agreed to in writing, software
459 * distributed under the License is distributed on an "AS IS" BASIS,
460 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
461 * See the License for the specific language governing permissions and
462 * limitations under the License.
463 * ============================================================ */
468 "use strict"; // jshint ;_;
471 /* COLLAPSE PUBLIC CLASS DEFINITION
472 * ================================ */
474 var Collapse = function (element, options) {
475 this.$element = $(element)
476 this.options = $.extend({}, $.fn.collapse.defaults, options)
478 if (this.options.parent) {
479 this.$parent = $(this.options.parent)
482 this.options.toggle && this.toggle()
485 Collapse.prototype = {
487 constructor: Collapse
489 , dimension: function () {
490 var hasWidth = this.$element.hasClass('width')
491 return hasWidth ? 'width' : 'height'
494 , show: function () {
500 if (this.transitioning) return
502 dimension = this.dimension()
503 scroll = $.camelCase(['scroll', dimension].join('-'))
504 actives = this.$parent && this.$parent.find('> .accordion-group > .in')
506 if (actives && actives.length) {
507 hasData = actives.data('collapse')
508 if (hasData && hasData.transitioning) return
509 actives.collapse('hide')
510 hasData || actives.data('collapse', null)
513 this.$element[dimension](0)
514 this.transition('addClass', $.Event('show'), 'shown')
515 $.support.transition && this.$element[dimension](this.$element[0][scroll])
518 , hide: function () {
520 if (this.transitioning) return
521 dimension = this.dimension()
522 this.reset(this.$element[dimension]())
523 this.transition('removeClass', $.Event('hide'), 'hidden')
524 this.$element[dimension](0)
527 , reset: function (size) {
528 var dimension = this.dimension()
531 .removeClass('collapse')
532 [dimension](size || 'auto')
535 this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
540 , transition: function (method, startEvent, completeEvent) {
542 , complete = function () {
543 if (startEvent.type == 'show') that.reset()
544 that.transitioning = 0
545 that.$element.trigger(completeEvent)
548 this.$element.trigger(startEvent)
550 if (startEvent.isDefaultPrevented()) return
552 this.transitioning = 1
554 this.$element[method]('in')
556 $.support.transition && this.$element.hasClass('collapse') ?
557 this.$element.one($.support.transition.end, complete) :
561 , toggle: function () {
562 this[this.$element.hasClass('in') ? 'hide' : 'show']()
568 /* COLLAPSE PLUGIN DEFINITION
569 * ========================== */
571 var old = $.fn.collapse
573 $.fn.collapse = function (option) {
574 return this.each(function () {
576 , data = $this.data('collapse')
577 , options = typeof option == 'object' && option
578 if (!data) $this.data('collapse', (data = new Collapse(this, options)))
579 if (typeof option == 'string') data[option]()
583 $.fn.collapse.defaults = {
587 $.fn.collapse.Constructor = Collapse
590 /* COLLAPSE NO CONFLICT
591 * ==================== */
593 $.fn.collapse.noConflict = function () {
600 * ================= */
602 $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
603 var $this = $(this), href
604 , target = $this.attr('data-target')
605 || e.preventDefault()
606 || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
607 , option = $(target).data('collapse') ? 'toggle' : $this.data()
608 $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
609 $(target).collapse(option)
612 }(window.jQuery);/* ============================================================
613 * bootstrap-dropdown.js v2.2.2
614 * http://twitter.github.com/bootstrap/javascript.html#dropdowns
615 * ============================================================
616 * Copyright 2012 Twitter, Inc.
618 * Licensed under the Apache License, Version 2.0 (the "License");
619 * you may not use this file except in compliance with the License.
620 * You may obtain a copy of the License at
622 * http://www.apache.org/licenses/LICENSE-2.0
624 * Unless required by applicable law or agreed to in writing, software
625 * distributed under the License is distributed on an "AS IS" BASIS,
626 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
627 * See the License for the specific language governing permissions and
628 * limitations under the License.
629 * ============================================================ */
634 "use strict"; // jshint ;_;
637 /* DROPDOWN CLASS DEFINITION
638 * ========================= */
640 var toggle = '[data-toggle=dropdown]'
641 , Dropdown = function (element) {
642 var $el = $(element).on('click.dropdown.data-api', this.toggle)
643 $('html').on('click.dropdown.data-api', function () {
644 $el.parent().removeClass('open')
648 Dropdown.prototype = {
650 constructor: Dropdown
652 , toggle: function (e) {
657 if ($this.is('.disabled, :disabled')) return
659 $parent = getParent($this)
661 isActive = $parent.hasClass('open')
666 $parent.toggleClass('open')
674 , keydown: function (e) {
682 if (!/(38|40|27)/.test(e.keyCode)) return
689 if ($this.is('.disabled, :disabled')) return
691 $parent = getParent($this)
693 isActive = $parent.hasClass('open')
695 if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
697 $items = $('[role=menu] li:not(.divider):visible a', $parent)
699 if (!$items.length) return
701 index = $items.index($items.filter(':focus'))
703 if (e.keyCode == 38 && index > 0) index-- // up
704 if (e.keyCode == 40 && index < $items.length - 1) index++ // down
705 if (!~index) index = 0
714 function clearMenus() {
715 $(toggle).each(function () {
716 getParent($(this)).removeClass('open')
720 function getParent($this) {
721 var selector = $this.attr('data-target')
725 selector = $this.attr('href')
726 selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
729 $parent = $(selector)
730 $parent.length || ($parent = $this.parent())
736 /* DROPDOWN PLUGIN DEFINITION
737 * ========================== */
739 var old = $.fn.dropdown
741 $.fn.dropdown = function (option) {
742 return this.each(function () {
744 , data = $this.data('dropdown')
745 if (!data) $this.data('dropdown', (data = new Dropdown(this)))
746 if (typeof option == 'string') data[option].call($this)
750 $.fn.dropdown.Constructor = Dropdown
753 /* DROPDOWN NO CONFLICT
754 * ==================== */
756 $.fn.dropdown.noConflict = function () {
762 /* APPLY TO STANDARD DROPDOWN ELEMENTS
763 * =================================== */
766 .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
767 .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
768 .on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() })
769 .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
770 .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
772 }(window.jQuery);/* =========================================================
773 * bootstrap-modal.js v2.2.2
774 * http://twitter.github.com/bootstrap/javascript.html#modals
775 * =========================================================
776 * Copyright 2012 Twitter, Inc.
778 * Licensed under the Apache License, Version 2.0 (the "License");
779 * you may not use this file except in compliance with the License.
780 * You may obtain a copy of the License at
782 * http://www.apache.org/licenses/LICENSE-2.0
784 * Unless required by applicable law or agreed to in writing, software
785 * distributed under the License is distributed on an "AS IS" BASIS,
786 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
787 * See the License for the specific language governing permissions and
788 * limitations under the License.
789 * ========================================================= */
794 "use strict"; // jshint ;_;
797 /* MODAL CLASS DEFINITION
798 * ====================== */
800 var Modal = function (element, options) {
801 this.options = options
802 this.$element = $(element)
803 .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
804 this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
811 , toggle: function () {
812 return this[!this.isShown ? 'show' : 'hide']()
815 , show: function () {
817 , e = $.Event('show')
819 this.$element.trigger(e)
821 if (this.isShown || e.isDefaultPrevented()) return
827 this.backdrop(function () {
828 var transition = $.support.transition && that.$element.hasClass('fade')
830 if (!that.$element.parent().length) {
831 that.$element.appendTo(document.body) //don't move modals dom position
838 that.$element[0].offsetWidth // force reflow
843 .attr('aria-hidden', false)
848 that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
849 that.$element.focus().trigger('shown')
854 , hide: function (e) {
855 e && e.preventDefault()
861 this.$element.trigger(e)
863 if (!this.isShown || e.isDefaultPrevented()) return
869 $(document).off('focusin.modal')
873 .attr('aria-hidden', true)
875 $.support.transition && this.$element.hasClass('fade') ?
876 this.hideWithTransition() :
880 , enforceFocus: function () {
882 $(document).on('focusin.modal', function (e) {
883 if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
884 that.$element.focus()
889 , escape: function () {
891 if (this.isShown && this.options.keyboard) {
892 this.$element.on('keyup.dismiss.modal', function ( e ) {
893 e.which == 27 && that.hide()
895 } else if (!this.isShown) {
896 this.$element.off('keyup.dismiss.modal')
900 , hideWithTransition: function () {
902 , timeout = setTimeout(function () {
903 that.$element.off($.support.transition.end)
907 this.$element.one($.support.transition.end, function () {
908 clearTimeout(timeout)
913 , hideModal: function (that) {
921 , removeBackdrop: function () {
922 this.$backdrop.remove()
923 this.$backdrop = null
926 , backdrop: function (callback) {
928 , animate = this.$element.hasClass('fade') ? 'fade' : ''
930 if (this.isShown && this.options.backdrop) {
931 var doAnimate = $.support.transition && animate
933 this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
934 .appendTo(document.body)
936 this.$backdrop.click(
937 this.options.backdrop == 'static' ?
938 $.proxy(this.$element[0].focus, this.$element[0])
939 : $.proxy(this.hide, this)
942 if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
944 this.$backdrop.addClass('in')
947 this.$backdrop.one($.support.transition.end, callback) :
950 } else if (!this.isShown && this.$backdrop) {
951 this.$backdrop.removeClass('in')
953 $.support.transition && this.$element.hasClass('fade')?
954 this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
955 this.removeBackdrop()
957 } else if (callback) {
964 /* MODAL PLUGIN DEFINITION
965 * ======================= */
969 $.fn.modal = function (option) {
970 return this.each(function () {
972 , data = $this.data('modal')
973 , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
974 if (!data) $this.data('modal', (data = new Modal(this, options)))
975 if (typeof option == 'string') data[option]()
976 else if (options.show) data.show()
980 $.fn.modal.defaults = {
986 $.fn.modal.Constructor = Modal
990 * ================= */
992 $.fn.modal.noConflict = function () {
1001 $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
1003 , href = $this.attr('href')
1004 , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
1005 , option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
1011 .one('hide', function () {
1017 /* ===========================================================
1018 * bootstrap-tooltip.js v2.2.2
1019 * http://twitter.github.com/bootstrap/javascript.html#tooltips
1020 * Inspired by the original jQuery.tipsy by Jason Frame
1021 * ===========================================================
1022 * Copyright 2012 Twitter, Inc.
1024 * Licensed under the Apache License, Version 2.0 (the "License");
1025 * you may not use this file except in compliance with the License.
1026 * You may obtain a copy of the License at
1028 * http://www.apache.org/licenses/LICENSE-2.0
1030 * Unless required by applicable law or agreed to in writing, software
1031 * distributed under the License is distributed on an "AS IS" BASIS,
1032 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1033 * See the License for the specific language governing permissions and
1034 * limitations under the License.
1035 * ========================================================== */
1040 "use strict"; // jshint ;_;
1043 /* TOOLTIP PUBLIC CLASS DEFINITION
1044 * =============================== */
1046 var Tooltip = function (element, options) {
1047 this.init('tooltip', element, options)
1050 Tooltip.prototype = {
1052 constructor: Tooltip
1054 , init: function (type, element, options) {
1059 this.$element = $(element)
1060 this.options = this.getOptions(options)
1063 if (this.options.trigger == 'click') {
1064 this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
1065 } else if (this.options.trigger != 'manual') {
1066 eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
1067 eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
1068 this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
1069 this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
1072 this.options.selector ?
1073 (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
1077 , getOptions: function (options) {
1078 options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
1080 if (options.delay && typeof options.delay == 'number') {
1083 , hide: options.delay
1090 , enter: function (e) {
1091 var self = $(e.currentTarget)[this.type](this._options).data(this.type)
1093 if (!self.options.delay || !self.options.delay.show) return self.show()
1095 clearTimeout(this.timeout)
1096 self.hoverState = 'in'
1097 this.timeout = setTimeout(function() {
1098 if (self.hoverState == 'in') self.show()
1099 }, self.options.delay.show)
1102 , leave: function (e) {
1103 var self = $(e.currentTarget)[this.type](this._options).data(this.type)
1105 if (this.timeout) clearTimeout(this.timeout)
1106 if (!self.options.delay || !self.options.delay.hide) return self.hide()
1108 self.hoverState = 'out'
1109 this.timeout = setTimeout(function() {
1110 if (self.hoverState == 'out') self.hide()
1111 }, self.options.delay.hide)
1114 , show: function () {
1123 if (this.hasContent() && this.enabled) {
1127 if (this.options.animation) {
1128 $tip.addClass('fade')
1131 placement = typeof this.options.placement == 'function' ?
1132 this.options.placement.call(this, $tip[0], this.$element[0]) :
1133 this.options.placement
1135 inside = /in/.test(placement)
1139 .css({ top: 0, left: 0, display: 'block' })
1140 .insertAfter(this.$element)
1142 pos = this.getPosition(inside)
1144 actualWidth = $tip[0].offsetWidth
1145 actualHeight = $tip[0].offsetHeight
1147 switch (inside ? placement.split(' ')[1] : placement) {
1149 tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
1152 tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
1155 tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
1158 tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
1164 .addClass(placement)
1169 , setContent: function () {
1170 var $tip = this.tip()
1171 , title = this.getTitle()
1173 $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
1174 $tip.removeClass('fade in top bottom left right')
1177 , hide: function () {
1181 $tip.removeClass('in')
1183 function removeWithAnimation() {
1184 var timeout = setTimeout(function () {
1185 $tip.off($.support.transition.end).detach()
1188 $tip.one($.support.transition.end, function () {
1189 clearTimeout(timeout)
1194 $.support.transition && this.$tip.hasClass('fade') ?
1195 removeWithAnimation() :
1201 , fixTitle: function () {
1202 var $e = this.$element
1203 if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
1204 $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
1208 , hasContent: function () {
1209 return this.getTitle()
1212 , getPosition: function (inside) {
1213 return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
1214 width: this.$element[0].offsetWidth
1215 , height: this.$element[0].offsetHeight
1219 , getTitle: function () {
1221 , $e = this.$element
1224 title = $e.attr('data-original-title')
1225 || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
1230 , tip: function () {
1231 return this.$tip = this.$tip || $(this.options.template)
1234 , validate: function () {
1235 if (!this.$element[0].parentNode) {
1237 this.$element = null
1242 , enable: function () {
1246 , disable: function () {
1247 this.enabled = false
1250 , toggleEnabled: function () {
1251 this.enabled = !this.enabled
1254 , toggle: function (e) {
1255 var self = $(e.currentTarget)[this.type](this._options).data(this.type)
1256 self[self.tip().hasClass('in') ? 'hide' : 'show']()
1259 , destroy: function () {
1260 this.hide().$element.off('.' + this.type).removeData(this.type)
1266 /* TOOLTIP PLUGIN DEFINITION
1267 * ========================= */
1269 var old = $.fn.tooltip
1271 $.fn.tooltip = function ( option ) {
1272 return this.each(function () {
1274 , data = $this.data('tooltip')
1275 , options = typeof option == 'object' && option
1276 if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
1277 if (typeof option == 'string') data[option]()
1281 $.fn.tooltip.Constructor = Tooltip
1283 $.fn.tooltip.defaults = {
1287 , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
1295 /* TOOLTIP NO CONFLICT
1296 * =================== */
1298 $.fn.tooltip.noConflict = function () {
1303 }(window.jQuery);/* ===========================================================
1304 * bootstrap-popover.js v2.2.2
1305 * http://twitter.github.com/bootstrap/javascript.html#popovers
1306 * ===========================================================
1307 * Copyright 2012 Twitter, Inc.
1309 * Licensed under the Apache License, Version 2.0 (the "License");
1310 * you may not use this file except in compliance with the License.
1311 * You may obtain a copy of the License at
1313 * http://www.apache.org/licenses/LICENSE-2.0
1315 * Unless required by applicable law or agreed to in writing, software
1316 * distributed under the License is distributed on an "AS IS" BASIS,
1317 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1318 * See the License for the specific language governing permissions and
1319 * limitations under the License.
1320 * =========================================================== */
1325 "use strict"; // jshint ;_;
1328 /* POPOVER PUBLIC CLASS DEFINITION
1329 * =============================== */
1331 var Popover = function (element, options) {
1332 this.init('popover', element, options)
1336 /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
1337 ========================================== */
1339 Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
1341 constructor: Popover
1343 , setContent: function () {
1344 var $tip = this.tip()
1345 , title = this.getTitle()
1346 , content = this.getContent()
1348 $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
1349 $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
1351 $tip.removeClass('fade top bottom left right in')
1354 , hasContent: function () {
1355 return this.getTitle() || this.getContent()
1358 , getContent: function () {
1360 , $e = this.$element
1363 content = $e.attr('data-content')
1364 || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
1369 , tip: function () {
1371 this.$tip = $(this.options.template)
1376 , destroy: function () {
1377 this.hide().$element.off('.' + this.type).removeData(this.type)
1383 /* POPOVER PLUGIN DEFINITION
1384 * ======================= */
1386 var old = $.fn.popover
1388 $.fn.popover = function (option) {
1389 return this.each(function () {
1391 , data = $this.data('popover')
1392 , options = typeof option == 'object' && option
1393 if (!data) $this.data('popover', (data = new Popover(this, options)))
1394 if (typeof option == 'string') data[option]()
1398 $.fn.popover.Constructor = Popover
1400 $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
1404 , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"></div></div></div>'
1408 /* POPOVER NO CONFLICT
1409 * =================== */
1411 $.fn.popover.noConflict = function () {
1416 }(window.jQuery);/* =============================================================
1417 * bootstrap-scrollspy.js v2.2.2
1418 * http://twitter.github.com/bootstrap/javascript.html#scrollspy
1419 * =============================================================
1420 * Copyright 2012 Twitter, Inc.
1422 * Licensed under the Apache License, Version 2.0 (the "License");
1423 * you may not use this file except in compliance with the License.
1424 * You may obtain a copy of the License at
1426 * http://www.apache.org/licenses/LICENSE-2.0
1428 * Unless required by applicable law or agreed to in writing, software
1429 * distributed under the License is distributed on an "AS IS" BASIS,
1430 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1431 * See the License for the specific language governing permissions and
1432 * limitations under the License.
1433 * ============================================================== */
1438 "use strict"; // jshint ;_;
1441 /* SCROLLSPY CLASS DEFINITION
1442 * ========================== */
1444 function ScrollSpy(element, options) {
1445 var process = $.proxy(this.process, this)
1446 , $element = $(element).is('body') ? $(window) : $(element)
1448 this.options = $.extend({}, $.fn.scrollspy.defaults, options)
1449 this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
1450 this.selector = (this.options.target
1451 || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
1452 || '') + ' .nav li > a'
1453 this.$body = $('body')
1458 ScrollSpy.prototype = {
1460 constructor: ScrollSpy
1462 , refresh: function () {
1466 this.offsets = $([])
1467 this.targets = $([])
1469 $targets = this.$body
1470 .find(this.selector)
1473 , href = $el.data('target') || $el.attr('href')
1474 , $href = /^#\w/.test(href) && $(href)
1477 && [[ $href.position().top + self.$scrollElement.scrollTop(), href ]] ) || null
1479 .sort(function (a, b) { return a[0] - b[0] })
1481 self.offsets.push(this[0])
1482 self.targets.push(this[1])
1486 , process: function () {
1487 var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
1488 , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
1489 , maxScroll = scrollHeight - this.$scrollElement.height()
1490 , offsets = this.offsets
1491 , targets = this.targets
1492 , activeTarget = this.activeTarget
1495 if (scrollTop >= maxScroll) {
1496 return activeTarget != (i = targets.last()[0])
1497 && this.activate ( i )
1500 for (i = offsets.length; i--;) {
1501 activeTarget != targets[i]
1502 && scrollTop >= offsets[i]
1503 && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
1504 && this.activate( targets[i] )
1508 , activate: function (target) {
1512 this.activeTarget = target
1516 .removeClass('active')
1518 selector = this.selector
1519 + '[data-target="' + target + '"],'
1520 + this.selector + '[href="' + target + '"]'
1522 active = $(selector)
1526 if (active.parent('.dropdown-menu').length) {
1527 active = active.closest('li.dropdown').addClass('active')
1530 active.trigger('activate')
1536 /* SCROLLSPY PLUGIN DEFINITION
1537 * =========================== */
1539 var old = $.fn.scrollspy
1541 $.fn.scrollspy = function (option) {
1542 return this.each(function () {
1544 , data = $this.data('scrollspy')
1545 , options = typeof option == 'object' && option
1546 if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
1547 if (typeof option == 'string') data[option]()
1551 $.fn.scrollspy.Constructor = ScrollSpy
1553 $.fn.scrollspy.defaults = {
1558 /* SCROLLSPY NO CONFLICT
1559 * ===================== */
1561 $.fn.scrollspy.noConflict = function () {
1562 $.fn.scrollspy = old
1567 /* SCROLLSPY DATA-API
1568 * ================== */
1570 $(window).on('load', function () {
1571 $('[data-spy="scroll"]').each(function () {
1573 $spy.scrollspy($spy.data())
1577 }(window.jQuery);/* ========================================================
1578 * bootstrap-tab.js v2.2.2
1579 * http://twitter.github.com/bootstrap/javascript.html#tabs
1580 * ========================================================
1581 * Copyright 2012 Twitter, Inc.
1583 * Licensed under the Apache License, Version 2.0 (the "License");
1584 * you may not use this file except in compliance with the License.
1585 * You may obtain a copy of the License at
1587 * http://www.apache.org/licenses/LICENSE-2.0
1589 * Unless required by applicable law or agreed to in writing, software
1590 * distributed under the License is distributed on an "AS IS" BASIS,
1591 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1592 * See the License for the specific language governing permissions and
1593 * limitations under the License.
1594 * ======================================================== */
1599 "use strict"; // jshint ;_;
1602 /* TAB CLASS DEFINITION
1603 * ==================== */
1605 var Tab = function (element) {
1606 this.element = $(element)
1613 , show: function () {
1614 var $this = this.element
1615 , $ul = $this.closest('ul:not(.dropdown-menu)')
1616 , selector = $this.attr('data-target')
1622 selector = $this.attr('href')
1623 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
1626 if ( $this.parent('li').hasClass('active') ) return
1628 previous = $ul.find('.active:last a')[0]
1630 e = $.Event('show', {
1631 relatedTarget: previous
1636 if (e.isDefaultPrevented()) return
1638 $target = $(selector)
1640 this.activate($this.parent('li'), $ul)
1641 this.activate($target, $target.parent(), function () {
1644 , relatedTarget: previous
1649 , activate: function ( element, container, callback) {
1650 var $active = container.find('> .active')
1651 , transition = callback
1652 && $.support.transition
1653 && $active.hasClass('fade')
1657 .removeClass('active')
1658 .find('> .dropdown-menu > .active')
1659 .removeClass('active')
1661 element.addClass('active')
1664 element[0].offsetWidth // reflow for transition
1665 element.addClass('in')
1667 element.removeClass('fade')
1670 if ( element.parent('.dropdown-menu') ) {
1671 element.closest('li.dropdown').addClass('active')
1674 callback && callback()
1678 $active.one($.support.transition.end, next) :
1681 $active.removeClass('in')
1686 /* TAB PLUGIN DEFINITION
1687 * ===================== */
1691 $.fn.tab = function ( option ) {
1692 return this.each(function () {
1694 , data = $this.data('tab')
1695 if (!data) $this.data('tab', (data = new Tab(this)))
1696 if (typeof option == 'string') data[option]()
1700 $.fn.tab.Constructor = Tab
1704 * =============== */
1706 $.fn.tab.noConflict = function () {
1715 $(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
1720 }(window.jQuery);/* =============================================================
1721 * bootstrap-typeahead.js v2.2.2
1722 * http://twitter.github.com/bootstrap/javascript.html#typeahead
1723 * =============================================================
1724 * Copyright 2012 Twitter, Inc.
1726 * Licensed under the Apache License, Version 2.0 (the "License");
1727 * you may not use this file except in compliance with the License.
1728 * You may obtain a copy of the License at
1730 * http://www.apache.org/licenses/LICENSE-2.0
1732 * Unless required by applicable law or agreed to in writing, software
1733 * distributed under the License is distributed on an "AS IS" BASIS,
1734 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1735 * See the License for the specific language governing permissions and
1736 * limitations under the License.
1737 * ============================================================ */
1742 "use strict"; // jshint ;_;
1745 /* TYPEAHEAD PUBLIC CLASS DEFINITION
1746 * ================================= */
1748 var Typeahead = function (element, options) {
1749 this.$element = $(element)
1750 this.options = $.extend({}, $.fn.typeahead.defaults, options)
1751 this.matcher = this.options.matcher || this.matcher
1752 this.sorter = this.options.sorter || this.sorter
1753 this.highlighter = this.options.highlighter || this.highlighter
1754 this.updater = this.options.updater || this.updater
1755 this.source = this.options.source
1756 this.$menu = $(this.options.menu)
1761 Typeahead.prototype = {
1763 constructor: Typeahead
1765 , select: function () {
1766 var val = this.$menu.find('.active').attr('data-value')
1768 .val(this.updater(val))
1773 , updater: function (item) {
1777 , show: function () {
1778 var pos = $.extend({}, this.$element.position(), {
1779 height: this.$element[0].offsetHeight
1783 .insertAfter(this.$element)
1785 top: pos.top + pos.height
1794 , hide: function () {
1800 , lookup: function (event) {
1803 this.query = this.$element.val()
1805 if (!this.query || this.query.length < this.options.minLength) {
1806 return this.shown ? this.hide() : this
1809 items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source
1811 return items ? this.process(items) : this
1814 , process: function (items) {
1817 items = $.grep(items, function (item) {
1818 return that.matcher(item)
1821 items = this.sorter(items)
1823 if (!items.length) {
1824 return this.shown ? this.hide() : this
1827 return this.render(items.slice(0, this.options.items)).show()
1830 , matcher: function (item) {
1831 return ~item.toLowerCase().indexOf(this.query.toLowerCase())
1834 , sorter: function (items) {
1836 , caseSensitive = []
1837 , caseInsensitive = []
1840 while (item = items.shift()) {
1841 if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
1842 else if (~item.indexOf(this.query)) caseSensitive.push(item)
1843 else caseInsensitive.push(item)
1846 return beginswith.concat(caseSensitive, caseInsensitive)
1849 , highlighter: function (item) {
1850 var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
1851 return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
1852 return '<strong>' + match + '</strong>'
1856 , render: function (items) {
1859 items = $(items).map(function (i, item) {
1860 i = $(that.options.item).attr('data-value', item)
1861 i.find('a').html(that.highlighter(item))
1865 items.first().addClass('active')
1866 this.$menu.html(items)
1870 , next: function (event) {
1871 var active = this.$menu.find('.active').removeClass('active')
1872 , next = active.next()
1875 next = $(this.$menu.find('li')[0])
1878 next.addClass('active')
1881 , prev: function (event) {
1882 var active = this.$menu.find('.active').removeClass('active')
1883 , prev = active.prev()
1886 prev = this.$menu.find('li').last()
1889 prev.addClass('active')
1892 , listen: function () {
1894 .on('blur', $.proxy(this.blur, this))
1895 .on('keypress', $.proxy(this.keypress, this))
1896 .on('keyup', $.proxy(this.keyup, this))
1898 if (this.eventSupported('keydown')) {
1899 this.$element.on('keydown', $.proxy(this.keydown, this))
1903 .on('click', $.proxy(this.click, this))
1904 .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
1907 , eventSupported: function(eventName) {
1908 var isSupported = eventName in this.$element
1910 this.$element.setAttribute(eventName, 'return;')
1911 isSupported = typeof this.$element[eventName] === 'function'
1916 , move: function (e) {
1917 if (!this.shown) return
1926 case 38: // up arrow
1931 case 40: // down arrow
1940 , keydown: function (e) {
1941 this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27])
1945 , keypress: function (e) {
1946 if (this.suppressKeyPressRepeat) return
1950 , keyup: function (e) {
1952 case 40: // down arrow
1953 case 38: // up arrow
1961 if (!this.shown) return
1966 if (!this.shown) return
1978 , blur: function (e) {
1980 setTimeout(function () { that.hide() }, 150)
1983 , click: function (e) {
1989 , mouseenter: function (e) {
1990 this.$menu.find('.active').removeClass('active')
1991 $(e.currentTarget).addClass('active')
1997 /* TYPEAHEAD PLUGIN DEFINITION
1998 * =========================== */
2000 var old = $.fn.typeahead
2002 $.fn.typeahead = function (option) {
2003 return this.each(function () {
2005 , data = $this.data('typeahead')
2006 , options = typeof option == 'object' && option
2007 if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
2008 if (typeof option == 'string') data[option]()
2012 $.fn.typeahead.defaults = {
2015 , menu: '<ul class="typeahead dropdown-menu"></ul>'
2016 , item: '<li><a href="#"></a></li>'
2020 $.fn.typeahead.Constructor = Typeahead
2023 /* TYPEAHEAD NO CONFLICT
2024 * =================== */
2026 $.fn.typeahead.noConflict = function () {
2027 $.fn.typeahead = old
2032 /* TYPEAHEAD DATA-API
2033 * ================== */
2035 $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
2037 if ($this.data('typeahead')) return
2039 $this.typeahead($this.data())
2043 /* ==========================================================
2044 * bootstrap-affix.js v2.2.2
2045 * http://twitter.github.com/bootstrap/javascript.html#affix
2046 * ==========================================================
2047 * Copyright 2012 Twitter, Inc.
2049 * Licensed under the Apache License, Version 2.0 (the "License");
2050 * you may not use this file except in compliance with the License.
2051 * You may obtain a copy of the License at
2053 * http://www.apache.org/licenses/LICENSE-2.0
2055 * Unless required by applicable law or agreed to in writing, software
2056 * distributed under the License is distributed on an "AS IS" BASIS,
2057 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2058 * See the License for the specific language governing permissions and
2059 * limitations under the License.
2060 * ========================================================== */
2065 "use strict"; // jshint ;_;
2068 /* AFFIX CLASS DEFINITION
2069 * ====================== */
2071 var Affix = function (element, options) {
2072 this.options = $.extend({}, $.fn.affix.defaults, options)
2073 this.$window = $(window)
2074 .on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
2075 .on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
2076 this.$element = $(element)
2077 this.checkPosition()
2080 Affix.prototype.checkPosition = function () {
2081 if (!this.$element.is(':visible')) return
2083 var scrollHeight = $(document).height()
2084 , scrollTop = this.$window.scrollTop()
2085 , position = this.$element.offset()
2086 , offset = this.options.offset
2087 , offsetBottom = offset.bottom
2088 , offsetTop = offset.top
2089 , reset = 'affix affix-top affix-bottom'
2092 if (typeof offset != 'object') offsetBottom = offsetTop = offset
2093 if (typeof offsetTop == 'function') offsetTop = offset.top()
2094 if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
2096 affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
2097 false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
2098 'bottom' : offsetTop != null && scrollTop <= offsetTop ?
2101 if (this.affixed === affix) return
2103 this.affixed = affix
2104 this.unpin = affix == 'bottom' ? position.top - scrollTop : null
2106 this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
2110 /* AFFIX PLUGIN DEFINITION
2111 * ======================= */
2113 var old = $.fn.affix
2115 $.fn.affix = function (option) {
2116 return this.each(function () {
2118 , data = $this.data('affix')
2119 , options = typeof option == 'object' && option
2120 if (!data) $this.data('affix', (data = new Affix(this, options)))
2121 if (typeof option == 'string') data[option]()
2125 $.fn.affix.Constructor = Affix
2127 $.fn.affix.defaults = {
2132 /* AFFIX NO CONFLICT
2133 * ================= */
2135 $.fn.affix.noConflict = function () {
2144 $(window).on('load', function () {
2145 $('[data-spy="affix"]').each(function () {
2147 , data = $spy.data()
2149 data.offset = data.offset || {}
2151 data.offsetBottom && (data.offset.bottom = data.offsetBottom)
2152 data.offsetTop && (data.offset.top = data.offsetTop)