PageSourceSearch

https://theman.org.uk/js/mobile-menu.js

js theman.org.uk collected 2026-10-10 01:23:55 UTC 4,151 bytes, 126 lines download raw bytes

1! function ($) {
2  "use strict"; // jshint ;_;
3  $(function () {
4    $.support.transition = (function () {
5      var transitionEnd = (function () {
6        var el = document.createElement('bootstrap'),
7          transEndEventNames = {
8            'WebkitTransition': 'webkitTransitionEnd',
9            'MozTransition': 'transitionend',
10            'OTransition': 'oTransitionEnd otransitionend',
11            'transition': 'transitionend'
12          },
13          name
14        for (name in transEndEventNames) {
15          if (el.style[name] !== undefined) {
16            return transEndEventNames[name]
17          }
18        }
19      }())
20      return transitionEnd && {
21        end: transitionEnd
22      }
23    })()
24  })
25}(window.jQuery);
26! function ($) {
27  "use strict"; // jshint ;_;
28  var Collapse = function (element, options) {
29    this.$element = $(element)
30    this.options = $.extend({}, $.fn.collapse.defaults, options)
31    if (this.options.parent) {
32      this.$parent = $(this.options.parent)
33    }
34    this.options.toggle && this.toggle()
35  }
36  Collapse.prototype = {
37    constructor: Collapse
38    ,
39    dimension: function () {
40      var hasWidth = this.$element.hasClass('width')
41      return hasWidth ? 'width' : 'height'
42    }
43    ,
44    show: function () {
45      var dimension, scroll, actives, hasData
46      if (this.transitioning) return
47      dimension = this.dimension()
48      scroll = $.camelCase(['scroll', dimension].join('-'))
49      actives = this.$parent && this.$parent.find('> .top-menu > .in')
50      if (actives && actives.length) {
51        hasData = actives.data('collapse')
52        if (hasData && hasData.transitioning) return
53        actives.collapse('hide')
54        hasData || actives.data('collapse', null)
55      }
56      this.$element[dimension](0)
57      this.transition('addClass', $.Event('show'), 'shown')
58      $.support.transition && this.$element[dimension](this.$element[0][scroll])
59    }
60    ,
61    hide: function () {
62      var dimension
63      if (this.transitioning) return
64      dimension = this.dimension()
65      this.reset(this.$element[dimension]())
66      this.transition('removeClass', $.Event('hide'), 'hidden')
67      this.$element[dimension](0)
68    }
69    ,
70    reset: function (size) {
71      var dimension = this.dimension()
72      this.$element
73        .removeClass('collapse')[dimension](size || 'auto')[0].offsetWidth
74      this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
75      return this
76    }
77    ,
78    transition: function (method, startEvent, completeEvent) {
79      var that = this,
80        complete = function () {
81          if (startEvent.type == 'show') that.reset()
82          that.transitioning = 0
83          that.$element.trigger(completeEvent)
84        }
85      this.$element.trigger(startEvent)
86
87      if (startEvent.isDefaultPrevented()) return
88      this.transitioning = 1
89      this.$element[method]('in')
90      $.support.transition && this.$element.hasClass('collapse') ?
91        this.$element.one($.support.transition.end, complete) :
92        complete()
93    }
94    ,
95    toggle: function () {
96      this[this.$element.hasClass('in') ? 'hide' : 'show']()
97    }
98  }
99  var old = $.fn.collapse
100  $.fn.collapse = function (option) {
101    return this.each(function () {
102      var $this = $(this),
103        data = $this.data('collapse'),
104        options = typeof option == 'object' && option
105      if (!data) $this.data('collapse', (data = new Collapse(this, options)))
106      if (typeof option == 'string') data[option]()
107    })
108  }
109  $.fn.collapse.defaults = {
110    toggle: true
111  }
112  $.fn.collapse.Constructor = Collapse
113  $.fn.collapse.noConflict = function () {
114    $.fn.collapse = old
115    return this
116  }
117  $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
118    var $this = $(this),
119      href, target = $this.attr('data-target') || e.preventDefault() || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
120      ,
121      option = $(target).data('collapse') ? 'toggle' : $this.data()
122    $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
123    $(target).collapse(option)
124  })
125
126}(window.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.