PageSourceSearch

https://www.museedusport.fr/sites/default/files/js/js_1ZX9trYeUg5AQPxiGOAjWb81V80Hconn6hSo6ZcF59g.js

js museedusport.fr collected 2026-09-24 22:21:11 UTC 13,943 bytes, 318 lines download raw bytes

1/**
2 * @file
3 * Integrate Sidr library with Responsive Menus.
4 */
5(function ($) {
6  /**
7   * Preparation for each element Sidr will affect.
8   */
9  function sidr_it(menuElement, ind, iteration, $windowWidth) {
10    // Only apply if window size is correct.
11    var $media_size = iteration.media_size || 768;
12    // Call Sidr with our settings.
13    $(menuElement).once('responsive-menus-sidr', function() {
14      var $id = 'sidr-' + ind;
15      var $wrapper_id = 'sidr-wrapper-' + ind;
16      $(this).before('<div id="' + $wrapper_id + '"><a id="' + $id + '-button" href="#' + $id + '">' + iteration.trigger_txt + '</a></div>');
17      $('#' + $wrapper_id).hide();
18      if ($windowWidth <= $media_size) {
19        $('#' + $wrapper_id).show();
20        $(this).hide();
21      }
22      // Set 1/0 to true/false respectively.
23      $.each(iteration, function(key, value) {
24        if (value == 0) {
25          iteration[key] = false;
26        }
27        if (value == 1) {
28          iteration[key] = true;
29        }
30      });
31      // Sidr power go.
32      $('#' + $id + '-button').sidr({
33        name: $id || "sidr",
34        speed: parseInt(iteration.speed) || 200,
35        side: iteration.side || "left",
36        source: iteration.selectors[ind] || "#main-menu",
37        displace: iteration.displace,
38        renaming: iteration.renaming,
39        onOpen: function() { eval(iteration.onOpen); } || function() {},
40        onClose: function() { eval(iteration.onClose); } || function() {}
41      });
42    });
43  }
44
45
46  /**
47   * Main loop.
48   */
49  Drupal.behaviors.responsive_menus_sidr = {
50    attach: function (context, settings) {
51      settings.responsive_menus = settings.responsive_menus || {};
52      var $windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
53      $.each(settings.responsive_menus, function(ind, iteration) {
54        if (iteration.responsive_menus_style != 'sidr') {
55          return true;
56        }
57        if (!iteration.selectors.length) {
58          return;
59        }
60        // Iterate each selector.
61        $.each(iteration.selectors, function(index, value) {
62          // Stop if there is no menu element.
63          if ($(value).length < 1) {
64            return true;
65          }
66          // Multi-level (selector hits multiple ul's).
67          if ($(value).length > 1) {
68              $(value).each(function(val_index) {
69                if (!$(this).parents('ul').length) {
70                  sidr_it(this, index, iteration, $windowWidth);
71                }
72              });
73            }
74            else {
75              // Single level.
76              sidr_it(value, index, iteration, $windowWidth);
77            }
78        });
79      });
80
81      // Handle window resizing.
82      $(window).resize(function() {
83        // Window width with legacy browsers.
84        $windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
85        $.each(settings.responsive_menus, function(ind, iteration) {
86          if (iteration.responsive_menus_style != 'sidr') {
87            return true;
88          }
89          if (!iteration.selectors.length) {
90            return;
91          }
92          // Iterate each selector.
93          $.each(iteration.selectors, function(index, value) {
94            // Stop if there is no menu element.
95            if ($(value).length < 1) {
96              return true;
97            }
98            var $wrapper_id = 'sidr-wrapper-' + index;
99            $media_size = iteration.media_size || 768;
100            if ($windowWidth <= $media_size) {
101              if (!$(value).hasClass('sidr-hidden')) {
102                $('#' + $wrapper_id).show();
103                $(value).hide().addClass('sidr-hidden');
104              }
105            }
106            else {
107              if ($(value).hasClass('sidr-hidden')) {
108                $('#' + $wrapper_id).hide();
109                $(value).show().removeClass('sidr-hidden');
110              }
111            }
112          });
113        });
114      });
115    }
116  };
117}(jQuery));
118;
119/*! Sidr - v1.2.1 - 2013-11-06
120 * https://github.com/artberri/sidr
121 * Copyright (c) 2013 Alberto Varela; Licensed MIT */
122(function(e){var t=!1,i=!1,n={isUrl:function(e){var t=RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");return t.test(e)?!0:!1},loadContent:function(e,t){e.html(t)}
122,addPrefix:function(e){var t=e.attr("id"),i=e.attr("class");"string"==typeof t&&""!==t&&e.attr("id",t.replace(/([A-Za-z0-9_.\-]+)/g,"sidr-id-$1")),"string"==typeof i&&""!==i&&"sidr-inner"!==i&&e.attr("class",i.replace(/([A-Za-z0-9_.\-]+)/g,"sidr-class-$1")),e.removeAttr("style")},execute:function(n,s,a){"function"==typeof s?(a=s,s="sidr"):s||(s="sidr");var r,d,l,c=e("#"+s),u=e(c.data("body")),f=e("html"),p=c.outerWidth(!0),g=c.data("speed"),h=c.data("side"),m=c.data("displace"),v=c.data("onOpen"),y=c.data("onClose"),x="sidr"===s?"sidr-open":"sidr-open "+s+"-open";if("open"===n||"toggle"===n&&!c.is(":visible")){if(c.is(":visible")||t)return;if(i!==!1)return o.close(i,function(){o.open(s)}),void 0;t=!0,"left"===h?(r={left:p+"px"},d={left:"0px"}):(r={right:p+"px"},d={right:"0px"}),u.is("body")&&(l=f.scrollTop(),f.css("overflow-x","hidden").scrollTop(l)),m?u.addClass("sidr-animating").css({width:u.width(),position:"absolute"}).animate(r,g,function(){e(this).addClass(x)}):setTimeout(function(){e(this).addClass(x)},g),c.css("display","block").animate(d,g,function(){t=!1,i=s,"function"==typeof a&&a(s),u.removeClass("sidr-animating")}),v()}else{if(!c.is(":visible")||t)return;t=!0,"left"===h?(r={left:0},d={left:"-"+p+"px"}):(r={right:0},d={right:"-"+p+"px"}),u.is("body")&&(l=f.scrollTop(),f.removeAttr("style").scrollTop(l)),u.addClass("sidr-animating").animate(r,g).removeClass(x),c.animate(d,g,function(){c.removeAttr("style").hide(),u.removeAttr("style"),e("html").removeAttr("style"),t=!1,i=!1,"function"==typeof a&&a(s),u.removeClass("sidr-animating")}),y()}}},o={open:function(e,t){n.execute("open",e,t)},close:function(e,t){n.execute("close",e,t)},toggle:function(e,t){n.execute("toggle",e,t)},toogle:function(e,t){n.execute("toggle",e,t)}};e.sidr=function(t){return o[t]?o[t].apply(this,Array.prototype.slice.call(arguments,1)):"function"!=typeof t&&"string"!=typeof t&&t?(e.error("Method "+t+" does not exist on jQuery.sidr"),void 0):o.toggle.apply(this,arguments)},e.fn.sidr=function(t){var i=e.extend({name:"sidr",speed:200,side:"left",source:null,renaming:!0,body:"body",displace:!0,onOpen:function(){},onClose:function(){}},t),s=i.name,a=e("#"+s);if(0===a.length&&(a=e("<div />").attr("id",s).appendTo(e("body"))),a.addClass("sidr").addClass(i.side).data({speed:i.speed,side:i.side,body:i.body,displace:i.displace,onOpen:i.onOpen,onClose:i.onClose}),"function"==typeof i.source){var r=i.source(s);n.loadContent(a,r)}else if("string"==typeof i.source&&n.isUrl(i.source))e.get(i.source,function(e){n.loadContent(a,e)});else if("string"==typeof i.source){var d="",l=i.source.split(",");if(e.each(l,function(t,i){d+='<div class="sidr-inner">'+e(i).html()+"</div>"}),i.renaming){var c=e("<div />").html(d);c.find("*").each(function(t,i){var o=e(i);n.addPrefix(o)}),d=c.html()}n.loadContent(a,d)}else null!==i.source&&e.error("Invalid Sidr Source");return this.each(function(){var t=e(this),i=t.data("sidr");i||(t.data("sidr",s),"ontouchstart"in document.documentElement?(t.bind("touchstart",function(e){e.originalEvent.touches[0],this.touched=e.timeStamp}),t.bind("touchend",function(e){var t=Math.abs(e.timeStamp-this.touched);200>t&&(e.preventDefault(),o.toggle(s))})):t.click(function(e){e.preventDefault(),o.toggle(s)}))})}})(jQuery);;
123(function ($) {
124
125Drupal.googleanalytics = {};
126
127$(document).ready(function() {
128
129  // Attach mousedown, keyup, touchstart events to document only and catch
130  // clicks on all elements.
131  $(document.body).bind("mousedown keyup touchstart", function(event) {
132
133    // Catch the closest surrounding link of a clicked element.
134    $(event.target).closest("a,area").each(function() {
135
136      // Is the clicked URL internal?
137      if (Drupal.googleanalytics.isInternal(this.href)) {
138        // Skip 'click' tracking, if custom tracking events are bound.
139        if ($(this).is('.colorbox') && (Drupal.settings.googleanalytics.trackColorbox)) {
140          // Do nothing here. The custom event will handle all tracking.
141          //console.info("Click on .colorbox item has been detected.");
142        }
143        // Is download tracking activated and the file extension configured for download tracking?
144        else if (Drupal.settings.googleanalytics.trackDownload && Drupal.googleanalytics.isDownload(this.href)) {
145          // Download link clicked.
146          ga("send", {
147            "hitType": "event",
148            "eventCategory": "Downloads",
149            "eventAction": Drupal.googleanalytics.getDownloadExtension(this.href).toUpperCase(),
150            "eventLabel": Drupal.googleanalytics.getPageUrl(this.href),
151            "transport": "beacon"
152          });
153        }
154        else if (Drupal.googleanalytics.isInternalSpecial(this.href)) {
155          // Keep the internal URL for Google Analytics website overlay intact.
156          ga("send", {
157            "hitType": "pageview",
158            "page": Drupal.googleanalytics.getPageUrl(this.href),
159            "transport": "beacon"
160          });
161        }
162      }
163      else {
164        if (Drupal.settings.googleanalytics.trackMailto && $(this).is("a[href^='mailto:'],area[href^='mailto:']")) {
165          // Mailto link clicked.
166          ga("send", {
167            "hitType": "event",
168            "eventCategory": "Mails",
169            "eventAction": "Click",
170            "eventLabel": this.href.substring(7),
171            "transport": "beacon"
172          });
173        }
174        else if (Drupal.settings.googleanalytics.trackOutbound && this.href.match(/^\w+:\/\//i)) {
175          if (Drupal.settings.googleanalytics.trackDomainMode !== 2 || (Drupal.settings.googleanalytics.trackDomainMode === 2 && !Drupal.googleanalytics.isCrossDomain(this.hostname, Drupal.settings.googleanalytics.trackCrossDomains))) {
176            // External link clicked / No top-level cross domain clicked.
177            ga("send", {
178              "hitType": "event",
179              "eventCategory": "Outbound links",
180              "eventAction": "Click",
181              "eventLabel": this.href,
182              "transport": "beacon"
183            });
184          }
185        }
186      }
187    });
188  });
189
190  // Track hash changes as unique pageviews, if this option has been enabled.
191  if (Drupal.settings.googleanalytics.trackUrlFragments) {
192    window.onhashchange = function() {
193      ga("send", {
194        "hitType": "pageview",
195        "page": location.pathname + location.search + location.hash
196      });
197    };
198  }
199
200  // Colorbox: This event triggers when the transition has completed and the
201  // newly loaded content has been revealed.
202  if (Drupal.settings.googleanalytics.trackColorbox) {
203    $(document).bind("cbox_complete", function () {
204      var href = $.colorbox.element().attr("href");
205      if (href) {
206        ga("send", {
207          "hitType": "pageview",
208          "page": Drupal.googleanalytics.getPageUrl(href)
209        });
210      }
211    });
212  }
213
214});
215
216/**
217 * Check whether the hostname is part of the cross domains or not.
218 *
219 * @param string hostname
220 *   The hostname of the clicked URL.
221 * @param array crossDomains
222 *   All cross domain hostnames as JS array.
223 *
224 * @return boolean
225 */
226Drupal.googleanalytics.isCrossDomain = function (hostname, crossDomains) {
227  /**
228   * jQuery < 1.6.3 bug: $.inArray crushes IE6 and Chrome if second argument is
229   * `null` or `undefined`, https://bugs.jquery.com/ticket/10076,
230   * https://github.com/jquery/jquery/commit/a839af034db2bd934e4d4fa6758a3fed8de74174
231   *
232   * @todo: Remove/Refactor in D8
233   */
234  if (!crossDomains) {
235    return false;
236  }
237  else {
238    return $.inArray(hostname, crossDomains) > -1 ? true : false;
239  }
240};
241
242/**
243 * Check whether this is a download URL or not.
244 *
245 * @param string url
246 *   The web url to check.
247 *
248 * @return boolean
249 */
250Drupal.googleanalytics.isDownload = function (url) {
251  var isDownload = new RegExp("\\.(" + Drupal.settings.googleanalytics.trackDownloadExtensions + ")([\?#].*)?$", "i");
252  return isDownload.test(url);
253};
254
255/**
256 * Check whether this is an absolute internal URL or not.
257 *
258 * @param string url
259 *   The web url to check.
260 *
261 * @return boolean
262 */
263Drupal.googleanalytics.isInternal = function (url) {
264  var isInternal = new RegExp("^(https?):\/\/" + window.location.host, "i");
265  return isInternal.test(url);
266};
267
268/**
269 * Check whether this is a special URL or not.
270 *
271 * URL types:
272 *  - gotwo.module /go/* links.
273 *
274 * @param string url
275 *   The web url to check.
276 *
277 * @return boolean
278 */
279Drupal.googleanalytics.isInternalSpecial = function (url) {
280  var isInternalSpecial = new RegExp("(\/go\/.*)$", "i");
281  return isInternalSpecial.test(url);
282};
283
284/**
285 * Extract the relative internal URL from an absolute internal URL.
286 *
287 * Examples:
288 * - https://mydomain.com/node/1 -> /node/1
289 * - https://example.com/foo/bar -> https://example.com/foo/bar
290 *
291 * @param string url
292 *   The web url to check.
293 *
294 * @return string
295 *   Internal website URL
296 */
297Drupal.googleanalytics.getPageUrl = function (url) {
298  var extractInternalUrl = new RegExp("^(https?):\/\/" + window.location.host, "i");
299  return url.replace(extractInternalUrl, '');
300};
301
302/**
303 * Extract the download file extension from the URL.
304 *
305 * @param string url
306 *   The web url to check.
307 *
308 * @return string
309 *   The file extension of the passed url. e.g. "zip", "txt"
310 */
311Drupal.googleanalytics.getDownloadExtension = function (url) {
312  var extractDownloadextension = new RegExp("\\.(" + Drupal.settings.googleanalytics.trackDownloadExtensions + ")([\?#].*)?$", "i");
313  var extension = extractDownloadextension.exec(url);
314  return (extension === null) ? '' : extension[1];
315};
316
317})(jQuery);
318;

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.