PageSourceSearch

https://www.tonershop.be/Themes/TonershopNL/javascript/collapse.js

js tonershop.be collected 2026-10-07 00:54:44 UTC 8,426 bytes, 242 lines download raw bytes

vendor: 8,426 bytes, lines 1-242
1/*!
2 * Bootstrap v3.2.0 (http://getbootstrap.com)
3 * Copyright 2011-2014 Twitter, Inc.
4 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5 */
6
7if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript requires jQuery') }
8
9/* ========================================================================
10 * Bootstrap: transition.js v3.2.0
11 * http://getbootstrap.com/javascript/#transitions
12 * ========================================================================
13 * Copyright 2011-2014 Twitter, Inc.
14 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
15 * ======================================================================== */
16
17
18+function (newJquery) {
19    'use strict';
20
21    // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
22    // ============================================================
23
24    function transitionEnd() {
25        var el = document.createElement('bootstrap')
26
27        var transEndEventNames = {
28            WebkitTransition: 'webkitTransitionEnd',
29            MozTransition: 'transitionend',
30            OTransition: 'oTransitionEnd otransitionend',
31            transition: 'transitionend'
32        }
33
34        for (var name in transEndEventNames) {
35            if (el.style[name] !== undefined) {
36                return { end: transEndEventNames[name] }
37            }
38        }
39
40        return false // explicit for ie8 (  ._.)
41    }
42
43    // http://blog.alexmaccaw.com/css-transitions
44    newJquery.fn.emulateTransitionEnd = function (duration) {
45        var called = false
46        var newJqueryel = this
47        newJquery(this).one('bsTransitionEnd', function () { called = true })
48        var callback = function () { if (!called) newJquery(newJqueryel).trigger(newJquery.support.transition.end) }
49        setTimeout(callback, duration)
50        return this
51    }
52
53    newJquery(function () {
54        newJquery.support.transition = transitionEnd()
55
56        if (!newJquery.support.transition) return
57
58        newJquery.event.special.bsTransitionEnd = {
59            bindType: newJquery.support.transition.end,
60            delegateType: newJquery.support.transition.end,
61            handle: function (e) {
62                if (newJquery(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
63            }
64        }
65    })
66
67}(jQuery);
68
69
70
71
72/* ========================================================================
73 * Bootstrap: collapse.js v3.2.0
74 * http://getbootstrap.com/javascript/#collapse
75 * ========================================================================
76 * Copyright 2011-2014 Twitter, Inc.
77 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
78 * ======================================================================== */
79
80
81+function (newJquery) {
82    'use strict';
83
84    // COLLAPSE PUBLIC CLASS DEFINITION
85    // ================================
86
87    var Collapse = function (element, options) {
88        this.newJqueryelement = newJquery(element)
89        this.options = newJquery.extend({}, Collapse.DEFAULTS, options)
90        this.transitioning = null
91
92        if (this.options.parent) this.newJqueryparent = newJquery(this.options.parent)
93        if (this.options.toggle) this.toggle()
94    }
95
96    Collapse.VERSION = '3.2.0'
97
98    Collapse.TRANSITION_DURATION = 350
99
100    Collapse.DEFAULTS = {
101        toggle: true
102    }
103
104    Collapse.prototype.dimension = function () {
105        var hasWidth = this.newJqueryelement.hasClass('width')
106        return hasWidth ? 'width' : 'height'
107    }
108
109    Collapse.prototype.show = function () {
110        if (this.transitioning || this.newJqueryelement.hasClass('in')) return
111
112        var startEvent = newJquery.Event('show.bs.collapse')
113        this.newJqueryelement.trigger(startEvent)
114        if (startEvent.isDefaultPrevented()) return
115
116        var actives = this.newJqueryparent && this.newJqueryparent.find('> .panel > .in')
117
118        if (actives && actives.length) {
119            var hasData = actives.data('bs.collapse')
120            if (hasData && hasData.transitioning) return
121            Plugin.call(actives, 'hide')
122            hasData || actives.data('bs.collapse', null)
123        }
124
125        var dimension = this.dimension()
126
127        this.newJqueryelement
128          .removeClass('collapse')
129          .addClass('collapsing')[dimension](0)
130
131        this.transitioning = 1
132
133        var complete = function () {
134            this.newJqueryelement
135              .removeClass('collapsing')
136              .addClass('collapse in')[dimension]('')
137            this.transitioning = 0
138            this.newJqueryelement
139              .trigger('shown.bs.collapse')
140        }
141
142        if (!newJquery.support.transition) return complete.call(this)
143
144        var scrollSize = newJquery.camelCase(['scroll', dimension].join('-'))
145
146        this.newJqueryelement
147          .one('bsTransitionEnd', newJquery.proxy(complete, this))
148          .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.newJqueryelement[0][scrollSize])
149    }
150
151    Collapse.prototype.hide = function () {
152        if (this.transitioning || !this.newJqueryelement.hasClass('in')) return
153
154        var startEvent = newJquery.Event('hide.bs.collapse')
155        this.newJqueryelement.trigger(startEvent)
156        if (startEvent.isDefaultPrevented()) return
157
158        var dimension = this.dimension()
159
160        this.newJqueryelement[dimension](this.newJqueryelement[dimension]())[0].offsetHeight
161
162        this.newJqueryelement
163          .addClass('collapsing')
164          .removeClass('collapse in')
165
166        this.transitioning = 1
167
168        var complete = function () {
169            this.transitioning = 0
170            this.newJqueryelement
171              .trigger('hidden.bs.collapse')
172              .removeClass('collapsing')
173              .addClass('collapse')
174        }
175
176        if (!newJquery.support.transition) return complete.call(this)
177
178        this.newJqueryelement
179          [dimension](0)
180          .one('bsTransitionEnd', newJquery.proxy(complete, this))
181          .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
182    }
183
184    Collapse.prototype.toggle = function () {
185        this[this.newJqueryelement.hasClass('in') ? 'hide' : 'show']()
186    }
187
188
189    // COLLAPSE PLUGIN DEFINITION
190    // ==========================
191
192    function Plugin(option) {
193        return this.each(function () {
194            var newJquerythis = newJquery(this)
195            var data = newJquerythis.data('bs.collapse')
196            var options = newJquery.extend({}, Collapse.DEFAULTS, newJquerythis.data(), typeof option == 'object' && option)
197
198            if (!data && options.toggle && option == 'show') options.toggle = false
199            if (!data) newJquerythis.data('bs.collapse', (data = new Collapse(this, options)))
200            if (typeof option == 'string') data[option]()
201        })
202    }
203
204    var old = newJquery.fn.collapse
205
206    newJquery.fn.collapse = Plugin
207    newJquery.fn.collapse.Constructor = Collapse
208
209
210    // COLLAPSE NO CONFLICT
211    // ====================
212
213    newJquery.fn.collapse.noConflict = function () {
214        newJquery.fn.collapse = old
215        return this
216    }
217
218
219    // COLLAPSE DATA-API
220    // =================
221
222    newJquery(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
223        var href
224        var newJquerythis = newJquery(this)
225        var target = newJquerythis.attr('data-target')
226            || e.preventDefault()
227            || (href = newJquerythis.attr('href')) && href.replace(/.*(?=#[^\s]+newJquery)/, '') // strip for ie7
228        var newJquerytarget = newJquery(target)
229        var data = newJquerytarget.data('bs.collapse')
230        var option = data ? 'toggle' : newJquerythis.data()
231        var parent = newJquerythis.attr('data-parent')
232        var newJqueryparent = parent && newJquery(parent)
233
234        if (!data || !data.transitioning) {
235            if (newJqueryparent) newJqueryparent.find('[data-toggle="collapse"][data-parent="' + parent + '"]').not(newJquerythis).addClass('collapsed')
236            newJquerythis.toggleClass('collapsed', newJquerytarget.hasClass('in'))
237        }
238
239        Plugin.call(newJquerytarget, option)
240    })
241
242}(jQuery);

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.