PageSourceSearch

https://tjdanesrescue.org.uk/components/com_gridbox/libraries/bootstrap/bootstrap.js?2.20.2.3

js tjdanesrescue.org.uk collected 2026-10-04 02:10:58 UTC 34,079 bytes, 765 lines download raw bytes

1try {
2    jQuery.event.special.touchstart = {
3        setup: function( _, ns, handle ) {
4            this.addEventListener("touchstart", handle, { passive: !ns.includes("noPreventDefault") });
5        }
6    };
7    jQuery.event.special.touchmove = {
8        setup: function( _, ns, handle ) {
9            this.addEventListener("touchmove", handle, { passive: !ns.includes("noPreventDefault") });
10        }
11    };
12    jQuery.event.special.scroll = {
13        setup: function( _, ns, handle ){
14            this.addEventListener("scroll", handle, { passive: true });
15        }
16    };
17    jQuery.event.special.wheel = {
18        setup: function( _, ns, handle ){
19            this.addEventListener("wheel", handle, { passive: true });
20        }
21    };
22    jQuery.event.special.mousewheel = {
23        setup: function( _, ns, handle ){
24            this.addEventListener("mousewheel", handle, { passive: true });
25        }
26    };
27} catch (e){
28    console.info(e)
29}
30
31document.addEventListener('DOMContentLoaded', function(){
32    jQuery(document).off('click.bs.tab.data-api click.bs.modal.data-api click.bs.collapse.data-api click.dropdown.data-api');
33
34    !function ($) {
35        "use strict";
36        var toggle = '[data-toggle=dropdown]',
37            Dropdown = function(element){
38                var $el = $(element).on('click.dropdown.data-api', this.toggle)
39                    .on('mouseover.dropdown.data-api', this.toggle)
40                $('html').on('click.dropdown.data-api', function () {
41                    $el.parent().parent().removeClass('nav-hover')
42                    $el.parent().removeClass('open');
43                });
44            }
45
46        Dropdown.prototype = {
47            constructor: Dropdown,
48            toggle: function(e){
49                var $this = $(this),
50                    $parent, isActive, url, isHover;
51                if ($this.is('.disabled, :disabled')) return;
52                $parent = getParent($this);
53                isActive = $parent.hasClass('open');
54                isHover = $parent.parent().hasClass('nav-hover');
55                if (!isHover && e.type == 'mouseover') return;
56                url = $this.attr('href');
57                if (e.type == 'click' && (url) && (url !== '#')) {
58                    window.location = url;
59                    return;
60                }
61                clearMenus()
62                if ((!isActive && e.type != 'mouseover') || (isHover && e.type == 'mouseover')) {
63                    if ('ontouchstart' in document.documentElement) {
64                        $('<div class="dropdown-backdrop"/>').insertBefore($(this)).on('click', clearMenus);
65                        $this.on('hover', function () {
66                            $('.dropdown-backdrop').remove()
67                        });
68                    }
69                    $parent.parent().toggleClass('nav-hover');
70                    $parent.toggleClass('open')
71                }
72                $this.focus()
73                return false
74            },
75            keydown: function (e) {
76                var $this, $items, $active, $parent, isActive, index;
77                if (!/(38|40|27)/.test(e.keyCode)) return
78                $this = $(this);
79                e.preventDefault()
80                e.stopPropagation()
81                if ($this.is('.disabled, :disabled')) return
82                $parent = getParent($this)
83                isActive = $parent.hasClass('open')
84                if (!isActive || (isActive && e.keyCode == 27)) {
85                    if (e.which == 27) $parent.find(toggle).focus()
86                    return $this.click()
87                }
88                $items = $('[role=menu] li:not(.divider):visible a', $parent)
89                if (!$items.length) return
90                index = $items.index($items.filter(':focus'))
91                if (e.keyCode == 38 && index > 0) index--
92                if (e.keyCode == 40 && index < $items.length - 1) index++
93                if (!~index) index = 0
94                $items.eq(index).focus();
95            }
96        }
97        function clearMenus(){
98            $(toggle).parent().parent().removeClass('nav-hover')
99            $('.dropdown-backdrop').remove()
100            $(toggle).each(function () {
101                getParent($(this)).removeClass('open')
102            })
103        }
104        function getParent($this) {
105            var selector = $this.attr('data-target'),
106                $parent;
107            if (!selector) {
108                selector = $this.attr('href')
109                selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
110            }
111            selector = selector === '#' ? [] : selector;
112            $parent = selector && $(document).find(selector)
113            if (!$parent || !$parent.length) $parent = $this.parent()
114
115            return $parent
116        }
117        var old = $.fn.dropdown
118        $.fn.dropdown = function (option) {
119            return this.each(function () {
120                var $this = $(this),
121                    data = $this.data('dropdown');
122                if (!data) $this.data('dropdown', (data = new Dropdown(this)))
123                if (typeof option == 'string') data[option].call($this)
124            });
125        }
126        $.fn.dropdown.Constructor = Dropdown
127        $.fn.dropdown.noConflict = function () {
128            $.fn.dropdown = old
129            return this
130        }
131        $(document)
132        .on('click.dropdown.data-api', clearMenus)
133        .on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
134        .on('click.dropdown.data-api'  , toggle, Dropdown.prototype.toggle)
135        .on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
136        .on('mouseover.dropdown.data-api', toggle, Dropdown.prototype.toggle)
137    }(window.$g ? window.$g : window.jQuery);
138
139    !function ($) {
140        "use strict";
141
142        var dismiss = '[data-dismiss="alert"]',
143            Alert = function(el){
144                $(el).on('click', dismiss, this.close)
145            }
146        Alert.prototype.close = function(e){
147            var $this = $(this),
148                selector = $this.attr('data-target'),
149                $parent;
150            if (!selector) {
151                selector = $this.attr('href')
152                selector = selector === '#' ? '' : selector
153            }
154            $parent = $(document).find(selector);
155            e && e.preventDefault()
156            $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
157            $parent.trigger(e = $.Event('close'))
158            if (e.isDefaultPrevented()) return
159            $parent.removeClass('in')
160            function removeElement() {
161                $parent.trigger('closed').remove()
162            }
163            $.support.transition && $parent.hasClass('fade') ?
164                $parent.on($.support.transition.end, removeElement) : removeElement()
165        }
166        var old = $.fn.alert
167        $.fn.alert = function (option) {
168            return this.each(function () {
169                var $this = $(this),
170                    data = $this.data('alert');
171                if (!data) $this.data('alert', (data = new Alert(this)))
172                if (typeof option == 'string') data[option].call($this)
173            });
174        }
175        $.fn.alert.Constructor = Alert;
176        $.fn.alert.noConflict = function(){
177            $.fn.alert = old;
178            return this
179        }
180        $(document).on('click.alert.data-api', dismiss, Alert.prototype.close);
181    }(window.$g ? window.$g : window.jQuery);
182
183    !function ($) {
184        "use strict";
185
186        $(function(){
187            $.support.transition = (function(){
188                var transitionEnd = (function(){
189                    var el = document.createElement('bootstrap'),
190                        transEndEventNames = {
191                            'WebkitTransition' : 'webkitTransitionEnd',
192                            'MozTransition' : 'transitionend',
193                            'OTransition' : 'oTransitionEnd otransitionend',
194                            'transition' : 'transitionend'
195                        },
196                        name
197                    for (name in transEndEventNames){
198                        if (el.style[name] !== undefined) {
199                            return transEndEventNames[name]
200                        }
201                    }
202                }())
203
204                return transitionEnd && {
205                    end: transitionEnd
206                }
207            })()
208        })
209    }(window.$g ? window.$g : window.jQuery);
210
211    !function ($) {
212        "use strict";
213
214        var Tab = function(element){
215            this.element = $(element);
216        }
217
218        Tab.prototype = {
219            constructor: Tab,
220            show: function(){
221                var $this = this.element,
222                    $ul = $this.closest('ul:not(.dropdown-menu)'),
223                    selector = $this.attr('data-target'),
224                    previous, $target, e;
225                if (!selector) {
226                    selector = $this.attr('href');
227                }
228                if ($this.parent('li').hasClass('active')) return;
229                previous = $ul.find('.active:last a')[0];
230                e = $.Event('show', {
231                    relatedTarget: previous
232                });
233                $this.trigger(e);
234                if (e.isDefaultPrevented()) return;
235                $target = $(selector);
236                this.activate($this.parent('li'), $ul);
237                this.activate($target, $target.parent(), function(){
238                    $this.trigger({
239                        type: 'shown',
240                        relatedTarget: previous
241                    });
242                });
243            },
244            activate: function(element, container, callback){
245                var $active = container.find('> .active'),
246                    transition = callback && $.support.transition && $active.hasClass('fade');
247                function next() {
248                    $active.removeClass('active').find('> .dropdown-menu > .active').removeClass('active');
249                    element.addClass('active')
250                    if (transition) {
251                        element[0].offsetWidth;
252                        element.addClass('in');
253                    } else {
254                        element.removeClass('fade');
255                    }
256                    if (element.parent('.dropdown-menu')) {
257                        element.closest('li.dropdown').addClass('active');
258                    }
259                    callback && callback();
260                }
261                transition ? $active.one($.support.transition.end, next) : next();
262                $active.removeClass('in');
263            }
264        }
265
266        var old = $.fn.tab;
267        $.fn.tab = function(option){
268            return this.each(function(){
269                var $this = $(this),
270                    data = $this.data('tab');
271                    if (!data) $this.data('tab', (data = new Tab(this)));
272                    if (typeof option == 'string') data[option]();
273                });
274        }
275        $.fn.tab.Constructor = Tab;
276        $.fn.tab.noConflict = function(){
277            $.fn.tab = old;
278            return this;
279        }
280
281        $(document).off('click.tab.data-api').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function(e){
282            e.preventDefault();
283            $(this).tab('show');
284        });
285    }(window.$g ? window.$g : window.jQuery);
286
287    !function ($) {
288        "use strict";
289
290        var Modal = function(element, options){
291            this.options = options;
292            this.$element = $(element).delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this));
293            this.options.remote && this.$element.find('.modal-body').load(this.options.remote);
294        }
295
296        Modal.prototype = {
297            constructor: Modal,
298            toggle: function(){
299                return this[!this.isShown ? 'show' : 'hide']();
300            },
301            show: function(){
302                var that = this,
303                    e = $.Event('show');
304                this.$element.trigger(e);
305                if (this.isShown || e.isDefaultPrevented()) return;
306                this.$element.trigger('show-gridbox-modal');
307                this.isShown = true;
308                this.escape();
309                this.backdrop(function(){
310                    var transition = $.support.transition && that.$element.hasClass('fade');
311                    if (!that.$element.parent().length) {
312                        that.$element.appendTo(document.body);
313                    }
314                    that.$element.show();
315                    if (transition) {
316                        that.$element[0].offsetWidth;
317                    }
318                    that.$element.addClass('in').attr('aria-hidden', false);
319                    transition ?
320                        that.$element.one($.support.transition.end, function(){that.$element.focus().trigger('shown')}) :
321                        that.$element.focus().trigger('shown');
322                    });
323            },
324            hide: function(e){
325                e && e.preventDefault();
326                var that = this;
327                e = $.Event('hide');
328                this.$element.trigger(e);
329                if (!this.isShown || e.isDefaultPrevented()) return;
330                this.isShown = false;
331                this.escape();
332                this.$element.removeClass('in').attr('aria-hidden', true);
333                $.support.transition && this.$element.hasClass('fade') ? this.hideWithTransition() : this.hideModal();
334            },
335            escape: function(){
336                var that = this;
337                if (this.isShown && this.options.keyboard) {
338                    this.$element.on('keyup.dismiss.modal', function(e){
339                        e.which == 27 && that.hide();
340                    });
341                } else if (!this.isShown) {
342                    this.$element.off('keyup.dismiss.modal');
343                }
344            },
345            hideWithTransition: function(){
346                var that = this,
347                    timeout = setTimeout(function(){
348                        that.$element.off($.support.transition.end);
349                        that.hideModal();
350                    }, 500);
351                this.$element.one($.support.transition.end, function(){
352                    clearTimeout(timeout);
353                    that.hideModal();
354                });
355            },
356            hideModal: function(){
357                var that = this;
358                this.$element.hide();
359                this.backdrop(function(){
360                    that.removeBackdrop();
361                    that.$element.trigger('hidden');
362                    that.$element.trigger('hidden-gridbox-modal');
363                });
364            },
365            removeBackdrop: function(){
366                if (!this.outBackdrop) {
367                    return;
368                }
369                this.outBackdrop.remove();
370                this.outBackdrop = null;
371            },
372            backdrop: function(callback){
373                var that = this,
374                    animate = this.$element.hasClass('fade') ? 'fade' : '';
375                if (this.$backdrop) {
376                    this.outBackdrop = this.$backdrop;
377                    this.$backdrop = null;
378                }
379                if (this.isShown && this.options.backdrop) {
380                    var doAnimate = $.support.transition && animate;
381                    this.$backdrop = $('<div class="modal-backdrop '+animate+'" />').appendTo(document.body);
382                    this.$backdrop.click(this.options.backdrop == 'static' ?
383                        $.proxy(this.$element[0].focus, this.$element[0]) : $.proxy(this.hide, this));
384                    if (doAnimate) this.$backdrop[0].offsetWidth;
385                    this.$backdrop.addClass('in');
386                    if (!callback) return;
387                    doAnimate ? this.$backdrop.one($.support.transition.end, callback) : callback();
388                } else if (!this.isShown && this.outBackdrop) {
389                    this.outBackdrop.removeClass('in');
390                    $.support.transition && this.$element.hasClass('fade') ?
391                    this.outBackdrop.one($.support.transition.end, callback) : setTimeout(callback, 300);
392                } else if (callback) {
393                    callback();
394                }
395            }
396        }
397
398        var old = $.fn.modal;
399        $.fn.modal = function(option){
400            return this.each(function(){
401                var $this = $(this),
402                    data = $this.data('modal'),
403                    options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option);
404                if (!data) {
405                    $this.data('modal', (data = new Modal(this, options)))
406                }
407                if (typeof option == 'string') {
408                    data[option]();
409                } else if (options.show) {
410                    data.show();
411                }
412            });
413        }
414        $.fn.modal.defaults = {
415            backdrop: true,
416            keyboard: true,
417            show: true
418        }
419        $.fn.modal.Constructor = Modal;
420        $.fn.modal.noConflict = function(){
421            $.fn.modal = old;
422            return this;
423        }
424        $(document).off('click.modal.data-api').on('click.modal.data-api', '[data-toggle="modal"]', function(e){
425            var $this = $(this),
426                href = $this.attr('href'),
427                $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))), //strip for ie7
428                option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data());
429            e.preventDefault();
430            $target.modal(option).one('hide', function(){
431                $this.focus();
432            });
433        });
434    }(window.$g ? window.$g : window.jQuery);
435
436    !function ($){
437        "use strict";
438
439        var Collapse = function(element, options){
440            this.$element = $(element);
441            this.options = $.extend({}, $.fn.collapse.defaults, options);
442            if (this.options.parent) {
443                this.$parent = $(this.options.parent);
444            }
445            this.options.toggle && this.toggle();
446        }
447
448        Collapse.prototype = {
449            constructor: Collapse,
450            dimension: function(){
451                var hasWidth = this.$element.hasClass('width');
452                return hasWidth ? 'width' : 'height';
453            },
454            show: function(){
455                var dimension, scroll, actives, hasData;
456                if (this.transitioning || this.$element.hasClass('in')) return;
457                dimension = this.dimension();
458                scroll = $.camelCase(['scroll', dimension].join('-'));
459                actives = this.$parent && this.$parent.find('> .accordion-group > .in');
460                if (actives && actives.length) {
461                    hasData = actives.data('collapse');
462                    if (hasData && hasData.transitioning) return;
463                    actives.collapse('hide');
464                    hasData || actives.data('collapse', null);
465                }
466                this.$element[dimension](0);
467                this.transition('addClass', $.Event('show'), 'shown');
468                $.support.transition && this.$element[dimension](this.$element[0][scroll]);
469            },
470            hide: function(){
471                var dimension;
472                if (this.transitioning || !this.$element.hasClass('in')) return;
473                dimension = this.dimension();
474                this.reset(this.$element[dimension]());
475                this.transition('removeClass', $.Event('hide'), 'hidden');
476                this.$element[dimension](0);
477            },
478            reset: function(size){
479                var dimension = this.dimension();
480                this.$element.removeClass('collapse')[dimension](size || 'auto')[0].offsetWidth;
481                this.$element[size !== null ? 'addClass' : 'removeClass']('collapse');
482                return this;
483            },
484            transition: function(method, startEvent, completeEvent){
485                var that = this,
486                    complete = function(){
487                        if (startEvent.type == 'show') that.reset();
488                        that.transitioning = 0;
489                        that.$element.trigger(completeEvent);
490                    };
491                this.$element.trigger(startEvent);
492                if (startEvent.isDefaultPrevented()) return;
493                this.transitioning = 1;
494                this.$element[method]('in');
495                $.support.transition && this.$element.hasClass('collapse') ? this.$element.one($.support.transition.end, complete) : complete();
496            },
497            toggle: function(){
498                this[this.$element.hasClass('in') ? 'hide' : 'show']();
499            }
500        }
501
502        var old = $.fn.collapse;
503        $.fn.collapse = function(option){
504            return this.each(function(){
505                var $this = $(this),
506                    data = $this.data('collapse'),
507                    options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option);
508                if (!data) $this.data('collapse', (data = new Collapse(this, options)));
509                if (typeof option == 'string') data[option]();
510            });
511        }
512        $.fn.collapse.defaults = {
513            toggle: true
514        }
515        $.fn.collapse.Constructor = Collapse;
516        $.fn.collapse.noConflict = function(){
517            $.fn.collapse = old;
518            return this;
519        }
520        $(document).off('click.collapse.data-api').on('click.collapse.data-api', '[data-toggle=collapse]', function(e){
521            var $this = $(this), href,
522                target = $this.attr('data-target') || e.preventDefault() || (href = $this.attr('href')),
523                option = $(target).data('collapse') ? 'toggle' : $this.data();
524            $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed');
525            $(target).collapse(option);
526        });
527    }(window.$g ? window.$g : window.jQuery);
528
529    !function ($) {
530        "use strict";
531        var Tooltip = function (element, options) {
532            this.init('tooltip', element, options);
533        }
534        Tooltip.prototype = {
535            constructor: Tooltip,
536            init: function (type, element, options) {
537                var eventIn, eventOut, triggers, trigger, i;
538                this.type = type;
539                this.$element = $(element);
540                this.options = this.getOptions(options);
541                this.enabled = true;
542                triggers = this.options.trigger.split(' ');
543                for (i = triggers.length; i--;) {
544                    trigger = triggers[i];
545                    if (trigger == 'click') {
546                        this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this));
547                    } else if (trigger != 'manual') {
548                        eventIn = trigger == 'hover' ? 'mouseenter' : 'focus';
549                        eventOut = trigger == 'hover' ? 'mouseleave' : 'blur';
550                        this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this));
551                        this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this));
552                    }
553                }
554                this.options.selector ?
555                (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : this.fixTitle()
556            },
557            getOptions: function (options) {
558                options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options);
559                if (options.delay && typeof options.delay == 'number') {
560                    options.delay = {
561                        show: options.delay,
562                        hide: options.delay
563                    }
564                }
565
566                return options
567            },
568            enter: function (e) {
569                var defaults = $.fn[this.type].defaults,
570                    options = {}, self;
571
572                this._options && $.each(this._options, function (key, value) {
573                    if (defaults[key] != value) options[key] = value;
574                }, this);
575                self = $(e.currentTarget)[this.type](options).data(this.type)
576                if (!self.options.delay || !self.options.delay.show) return self.show();
577                clearTimeout(this.timeout)
578                self.hoverState = 'in'
579                this.timeout = setTimeout(function() {
580                    if (self.hoverState == 'in') self.show()
581                }, self.options.delay.show)
582            },
583            leave: function (e) {
584                var self = $(e.currentTarget)[this.type](this._options).data(this.type)
585                if (this.timeout) clearTimeout(this.timeout)
586                if (!self.options.delay || !self.options.delay.hide) return self.hide()
587                self.hoverState = 'out'
588                this.timeout = setTimeout(function() {
589                    if (self.hoverState == 'out') self.hide()
590                }, self.options.delay.hide)
591            },
592            show: function () {
593                var $tip, pos, actualWidth, actualHeight, placement, tp, e = $.Event('show');
594                if (this.hasContent() && this.enabled) {
595                    this.$element.trigger(e)
596                    if (e.isDefaultPrevented()) return
597                    $tip = this.tip()
598                    this.setContent()
599                    if (this.options.animation) {
600                        $tip.addClass('fade')
601                    }
602                    placement = typeof this.options.placement == 'function' ?
603                        this.options.placement.call(this, $tip[0], this.$element[0]) : this.options.placement;
604                    $tip.detach().css({ top: 0, left: 0, display: 'block' });
605                    this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
606                    pos = this.getPosition()
607                    actualWidth = $tip[0].offsetWidth
608                    actualHeight = $tip[0].offsetHeight
609                    switch (placement) {
610                        case 'bottom':
611                            tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
612                            break
613                        case 'top':
614                            tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
615                            break
616                        case 'left':
617                            tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
618                            break
619                        case 'right':
620                            tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
621                            break
622                    }
623                    this.applyPlacement(tp, placement)
624                    this.$element.trigger('shown')
625                }
626            },
627            applyPlacement: function(offset, placement){
628                var $tip = this.tip(),
629                    width = $tip[0].offsetWidth,
630                    height = $tip[0].offsetHeight,
631                    actualWidth, actualHeight, delta, replace;
632                $tip.offset(offset).addClass(placement).addClass('in');
633                actualWidth = $tip[0].offsetWidth
634                actualHeight = $tip[0].offsetHeight
635                if (placement == 'top' && actualHeight != height) {
636                    offset.top = offset.top + height - actualHeight
637                    replace = true
638                }
639                if (placement == 'bottom' || placement == 'top') {
640                    delta = 0
641                    if (offset.left < 0){
642                        delta = offset.left * -2
643                        offset.left = 0
644                        $tip.offset(offset)
645                        actualWidth = $tip[0].offsetWidth
646                        actualHeight = $tip[0].offsetHeight
647                    }
648                    this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
649                } else {
650                    this.replaceArrow(actualHeight - height, actualHeight, 'top')
651                }
652                if (replace) $tip.offset(offset)
653            },
654            replaceArrow: function(delta, dimension, position){
655                this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '');
656            },
657            setContent: function () {
658                var $tip = this.tip(),
659                    title = this.getTitle();
660                $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
661                $tip.removeClass('fade in top bottom left right')
662            },
663            hide: function () {
664                var that = this,
665                    $tip = this.tip(),
666                    e = $.Event('hideme');
667                this.$element.trigger(e)
668                if (e.isDefaultPrevented()) return
669                $tip.removeClass('in')
670                function removeWithAnimation() {
671                    var timeout = setTimeout(function () {
672                        $tip.off($.support.transition.end).detach()
673                    }, 500);
674                    $tip.one($.support.transition.end, function () {
675                        clearTimeout(timeout)
676                        $tip.detach()
677                    })
678                }
679                $.support.transition && this.$tip.hasClass('fade') ? removeWithAnimation() : $tip.detach();
680                this.$element.trigger('hidden')
681
682                return this
683            },
684            fixTitle: function () {
685                var $e = this.$element
686                if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
687                    $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
688                }
689            },
690            hasContent: function () {
691                return this.getTitle()
692            },
693            getPosition: function () {
694                var el = this.$element[0]
695                return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
696                    width: el.offsetWidth,
697                    height: el.offsetHeight
698                }, this.$element.offset())
699            },
700            getTitle: function () {
701                var title,
702                    $e = this.$element,
703                    o = this.options
704                title = $e.attr('data-original-title') || (typeof o.title == 'function' ? o.title.call($e[0]) :  o.title)
705
706                return title
707            },
708            tip: function (){
709                return this.$tip = this.$tip || $(this.options.template)
710            },
711            arrow: function(){
712                return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
713            },
714            validate: function (){
715                if (!this.$element[0].parentNode) {
716                    this.hide()
717                    this.$element = null
718                    this.options = null
719                }
720            },
721            enable: function (){
722                this.enabled = true
723            },
724            disable: function (){
725                this.enabled = false
726            },
727            toggleEnabled: function (){
728                this.enabled = !this.enabled
729            },
730            toggle: function (e){
731                var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this
732                self.tip().hasClass('in') ? self.hide() : self.show()
733            },
734            destroy: function () {
735                this.hide().$element.off('.' + this.type).removeData(this.type)
736            }
737        }
738        var old = $.fn.tooltip
739        $.fn.tooltip = function(option) {
740            return this.each(function(){
741                var $this = $(this),
742                    data = $this.data('tooltip'),
743                    options = typeof option == 'object' && option;
744                if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
745                if (typeof option == 'string') data[option]()
746            });
747        }
748        $.fn.tooltip.Constructor = Tooltip
749        $.fn.tooltip.defaults = {
750            animation: true,
751            placement: 'top',
752            selector: false,
753            template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
754            trigger: 'hover focus',
755            title: '',
756            delay: 0,
757            html: true,
758            container: false
759        }
760        $.fn.tooltip.noConflict = function(){
761            $.fn.tooltip = old
762            return this
763        }
764    }(window.$g ? window.$g : window.jQuery);
765});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.