PageSourceSearch

https://www.environmentandsociety.org/sites/default/files/js/js_WIJGYQwVEEKLDmBkRe-XcEJue021Ua_e1XoflEVxPTY.js

js environmentandsociety.org collected 2026-09-24 08:52:54 UTC 19,955 bytes, 540 lines download raw bytes

1/**
2* hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+
3* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
4* 
5* @param  f  onMouseOver function || An object with configuration options
6* @param  g  onMouseOut function  || Nothing (use configuration options object)
7* @author    Brian Cherne brian(at)cherne(dot)net
8*/
9(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);;
10/*
11 * Superfish v1.4.8 - jQuery menu widget
12 * Copyright (c) 2008 Joel Birch
13 *
14 * Dual licensed under the MIT and GPL licenses:
15 *   http://www.opensource.org/licenses/mit-license.php
16 *   http://www.gnu.org/licenses/gpl.html
17 *
18 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
19 */
20
21(function($){
22  $.fn.superfish = function(op){
23    var sf = $.fn.superfish,
24      c = sf.c,
25      $arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
26      over = function(){
27        var $$ = $(this), menu = getMenu($$);
28        clearTimeout(menu.sfTimer);
29        $$.showSuperfishUl().siblings().hideSuperfishUl();
30      },
31      out = function(){
32        var $$ = $(this), menu = getMenu($$), o = sf.op;
33        clearTimeout(menu.sfTimer);
34        menu.sfTimer=setTimeout(function(){
35          o.retainPath=($.inArray($$[0],o.$path)>-1);
36          $$.hideSuperfishUl();
37          if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
38        },o.delay);
39      },
40      getMenu = function($menu){
41        var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
42        sf.op = sf.o[menu.serial];
43        return menu;
44      },
45      addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
46
47    return this.each(function() {
48      var s = this.serial = sf.o.length;
49      var o = $.extend({},sf.defaults,op);
50      o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
51        $(this).addClass([o.hoverClass,c.bcClass].join(' '))
52          .filter('li:has(ul)').removeClass(o.pathClass);
53      });
54      sf.o[s] = sf.op = o;
55
56      $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
57        if (o.autoArrows) addArrow( $('>a:first-child',this) );
58      })
59      .not('.'+c.bcClass)
60        .hideSuperfishUl();
61
62      var $a = $('a',this);
63      $a.each(function(i){
64        var $li = $a.eq(i).parents('li');
65        $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
66      });
67      o.onInit.call(this);
68
69    }).each(function() {
70      var menuClasses = [c.menuClass];
71      if (sf.op.dropShadows  && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
72      $(this).addClass(menuClasses.join(' '));
73    });
74  };
75
76  var sf = $.fn.superfish;
77  sf.o = [];
78  sf.op = {};
79  sf.IE7fix = function(){
80    var o = sf.op;
81    if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
82      this.toggleClass(sf.c.shadowClass+'-off');
83    };
84  sf.c = {
85    bcClass: 'sf-breadcrumb',
86    menuClass: 'sf-js-enabled',
87    anchorClass: 'sf-with-ul',
88    arrowClass: 'sf-sub-indicator',
89    shadowClass: 'sf-shadow'
90  };
91  sf.defaults = {
92    hoverClass: 'sfHover',
93    pathClass: 'overideThisToUse',
94    pathLevels: 1,
95    delay: 800,
96    animation: {opacity:'show'},
97    speed: 'normal',
98    autoArrows: true,
99    dropShadows: true,
100    disableHI: false, // true disables hoverIntent detection
101    onInit: function(){}, // callback functions
102    onBeforeShow: function(){},
103    onShow: function(){},
104    onHide: function(){}
105  };
106  $.fn.extend({
107    hideSuperfishUl : function(){
108      var o = sf.op,
109        not = (o.retainPath===true) ? o.$path : '';
110      o.retainPath = false;
111      var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
112          .find('>ul').hide().css('visibility','hidden');
113      o.onHide.call($ul);
114      return this;
115    },
116    showSuperfishUl : function(){
117      var o = sf.op,
118        sh = sf.c.shadowClass+'-off',
119        $ul = this.addClass(o.hoverClass)
120          .find('>ul:hidden').css('visibility','visible');
121      sf.IE7fix.call($ul);
122      o.onBeforeShow.call($ul);
123      $ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
124      return this;
125    }
126  });
127})(jQuery);;
128/*
129 * Supersubs v0.2b - jQuery plugin - LAST UPDATE: MARCH 23rd, 2011
130 * Copyright (c) 2008 Joel Birch
131 *
132 * Jan 16th, 2011 - Modified a little in order to work with NavBar menus as well.
133 *
134 * Dual licensed under the MIT and GPL licenses:
135 *   http://www.opensource.org/licenses/mit-license.php
136 *   http://www.gnu.org/licenses/gpl.html
137 *
138 * This plugin automatically adjusts submenu widths of suckerfish-style menus to that of
139 * their longest list item children. If you use this, please expect bugs and report them
140 * to the jQuery Google Group with the word 'Superfish' in the subject line.
141 *
142 */
143
144(function($){ // $ will refer to jQuery within this closure
145
146  $.fn.supersubs = function(options){
147    var opts = $.extend({}, $.fn.supersubs.defaults, options);
148	// return original object to support chaining
149    return this.each(function() {
150      // cache selections
151      var $$ = $(this);
152      // support metadata
153      var o = $.meta ? $.extend({}, opts, $$.data()) : opts;
154      // get the font size of menu.
155      // .css('fontSize') returns various results cross-browser, so measure an em dash instead
156      var fontsize = $('<li id="menu-fontsize">&#8212;</li>').css({
157        'padding' : 0,
158        'position' : 'absolute',
159        'top' : '-99999em',
160        'width' : 'auto'
161      }).appendTo($$).width(); //clientWidth is faster, but was incorrect here
162      // remove em dash
163      $('#menu-fontsize').remove();
164
165      // Jump on level if it's a "NavBar"
166      if ($$.hasClass('sf-navbar')) {
167        $$ = $('li > ul', $$);
168      }
169      // cache all ul elements 
170      $ULs = $$.find('ul:not(.sf-megamenu)');
171      // loop through each ul in menu
172      $ULs.each(function(i) {
173        // cache this ul
174        var $ul = $ULs.eq(i);
175        // get all (li) children of this ul
176        var $LIs = $ul.children();
177        // get all anchor grand-children
178        var $As = $LIs.children('a');
179        // force content to one line and save current float property
180        var liFloat = $LIs.css('white-space','nowrap').css('float');
181        // remove width restrictions and floats so elements remain vertically stacked
182        var emWidth = $ul.add($LIs).add($As).css({
183          'float' : 'none',
184          'width'  : 'auto'
185        })
186        // this ul will now be shrink-wrapped to longest li due to position:absolute
187        // so save its width as ems. Clientwidth is 2 times faster than .width() - thanks Dan Switzer
188        .end().end()[0].clientWidth / fontsize;
189        // add more width to ensure lines don't turn over at certain sizes in various browsers
190        emWidth += o.extraWidth;
191        // restrict to at least minWidth and at most maxWidth
192        if (emWidth > o.maxWidth)    { emWidth = o.maxWidth; }
193        else if (emWidth < o.minWidth)  { emWidth = o.minWidth; }
194        emWidth += 'em';
195        // set ul to width in ems
196        $ul.css('width',emWidth);
197        // restore li floats to avoid IE bugs
198        // set li width to full width of this ul
199        // revert white-space to normal
200        $LIs.css({
201          'float' : liFloat,
202          'width' : '100%',
203          'white-space' : 'normal'
204        })
205        // update offset position of descendant ul to reflect new width of parent
206        .each(function(){
207          var $childUl = $('>ul',this);
208          var offsetDirection = $childUl.css('left')!==undefined ? 'left' : 'right';
209          $childUl.css(offsetDirection,emWidth);
210        });
211      });
212
213    });
214  };
215  // expose defaults
216  $.fn.supersubs.defaults = {
217    minWidth: 9, // requires em unit.
218    maxWidth: 25, // requires em unit.
219    extraWidth: 0 // extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values
220  };
221
222})(jQuery); // plugin code ends;
223/*
224* Supposition v0.2 - an optional enhancer for Superfish jQuery menu widget - LAST UPDATE: MARCH 23rd, 2011
225*
226* Copyright (c) 2008 Joel Birch - based mostly on work by Jesse Klaasse and credit goes largely to him.
227* Special thanks to Karl Swedberg for valuable input.
228* 
229* Dec 28th, 2010 - Modified for the Superfish project for Drupal (http://drupal.org/project/superfish)
230*
231* jQuery version: 1.3.x or higher.
232*
233* Dual licensed under the MIT and GPL licenses:
234* 	http://www.opensource.org/licenses/mit-license.php
235* 	http://www.gnu.org/licenses/gpl.html
236*/
237
238(function($){
239  $.fn.supposition = function(){
240    var $w = $(window), /*do this once instead of every onBeforeShow call*/
241    _offset = function(dir) {
242      return window[dir == 'y' ? 'pageYOffset' : 'pageXOffset']
243      || document.documentElement && document.documentElement[dir=='y' ? 'scrollTop' : 'scrollLeft']
244      || document.body[dir=='y' ? 'scrollTop' : 'scrollLeft'];
245    },
246    onHide = function(){
247      this.css({Top:'',Right:'',Bottom:'',Left:''});
248    },
249    onBeforeShow = function(){
250      this.each(function(){
251        var $u = $(this);
252        $u.css('display','block');
253        var menuWidth = $u.width(),
254        menuParentWidth = $u.closest('li').outerWidth(true),
255        menuParentLeft = $u.closest('li').offset().left,
256        totalRight = $w.width() + _offset('x'),
257        menuRight = $u.offset().left + menuWidth,
258        exactMenuWidth = (menuRight > (menuParentWidth + menuParentLeft)) ? menuWidth - (menuRight - (menuParentWidth + menuParentLeft)) : menuWidth;  
259        if ($u.parents('.sf-js-enabled').hasClass('rtl')) {
260          if (menuParentLeft < exactMenuWidth) {
261            $u.css('left', menuParentWidth + 'px');
262            $u.css('right', 'auto');
263          }
264        }
265        else {
266          if (menuRight > totalRight && menuParentLeft > menuWidth) {
267            $u.css('right', menuParentWidth + 'px');
268            $u.css('left', 'auto');
269          }
270        }
271        var windowHeight = $w.height(),
272        offsetTop = $u.offset().top,
273        menuParentHeight = $u.parent().outerHeight(true),
274        menuHeight = $u.height(),
275        baseline = windowHeight + _offset('y');
276        var expandUp = ((offsetTop + menuHeight > baseline) && (offsetTop > menuHeight));
277        if (expandUp) {
278          $u.css('bottom', menuParentHeight + 'px');
279          $u.css('top', 'auto');
280        }
281        $u.css('display','none');
282      });
283    };
284
285    return this.each(function() {
286    var o = $.fn.superfish.o[this.serial]; /* get this menu's options */
287
288    /* if callbacks already set, store them */
289    var _onBeforeShow = o.onBeforeShow,
290    _onHide = o.onHide;
291
292    $.extend($.fn.superfish.o[this.serial],{
293    onBeforeShow: function() {
294    onBeforeShow.call(this); /* fire our Supposition callback */
295    _onBeforeShow.call(this); /* fire stored callbacks */
296    },
297    onHide: function() {
298    onHide.call(this); /* fire our Supposition callback */
299    _onHide.call(this); /* fire stored callbacks */
300    }
301    });
302    });
303  };
304})(jQuery);;
305/*
306 * sf-Touchscreen v1.0b - Provides touchscreen compatibility for the jQuery Superfish plugin. - LAST UPDATE: MARCH 23rd, 2011
307 *
308 * Developer's notes:
309 * Built as a part of the Superfish project for Drupal (http://drupal.org/project/superfish) 
310 * Found any bug? have any cool ideas? contact me right away! http://drupal.org/user/619294/contact
311 *
312 * jQuery version: 1.3.x or higher.
313 *
314 * Dual licensed under the MIT and GPL licenses:
315 *   http://www.opensource.org/licenses/mit-license.php
316 *   http://www.gnu.org/licenses/gpl.html
317*/
318
319(function($){
320  $.fn.sftouchscreen = function() {
321    // Return original object to support chaining.
322    return this.each( function() {
323      // Select hyperlinks from parent menu items.
324      $(this).find('li > ul').closest('li').children('a').each( function() {
325	    var $item = $(this);
326        // No .toggle() here as it's not possible to reset it.
327        $item.click( function(event){
328	      // Already clicked? proceed to the URI.
329          if ($item.hasClass('sf-clicked')) {
330            var $uri = $item.attr('href');
331            window.location = $uri;
332          }
333          else {
334            event.preventDefault();
335            $item.addClass('sf-clicked');
336          }
337        }).closest('li').mouseleave( function(){
338          // So, we reset everything.
339          $item.removeClass('sf-clicked');
340        });
341	  });
342    });
343  };
344})(jQuery);;
345(function ($) {
346
347Drupal.googleanalytics = {};
348
349$(document).ready(function() {
350
351  // Attach mousedown, keyup, touchstart events to document only and catch
352  // clicks on all elements.
353  $(document.body).bind("mousedown keyup touchstart", function(event) {
354
355    // Catch the closest surrounding link of a clicked element.
356    $(event.target).closest("a,area").each(function() {
357
358      // Is the clicked URL internal?
359      if (Drupal.googleanalytics.isInternal(this.href)) {
360        // Skip 'click' tracking, if custom tracking events are bound.
361        if ($(this).is('.colorbox') && (Drupal.settings.googleanalytics.trackColorbox)) {
362          // Do nothing here. The custom event will handle all tracking.
363          //console.info("Click on .colorbox item has been detected.");
364        }
365        // Is download tracking activated and the file extension configured for download tracking?
366        else if (Drupal.settings.googleanalytics.trackDownload && Drupal.googleanalytics.isDownload(this.href)) {
367          // Download link clicked.
368          ga("send", {
369            "hitType": "event",
370            "eventCategory": "Downloads",
371            "eventAction": Drupal.googleanalytics.getDownloadExtension(this.href).toUpperCase(),
372            "eventLabel": Drupal.googleanalytics.getPageUrl(this.href),
373            "transport": "beacon"
374          });
375        }
376        else if (Drupal.googleanalytics.isInternalSpecial(this.href)) {
377          // Keep the internal URL for Google Analytics website overlay intact.
378          ga("send", {
379            "hitType": "pageview",
380            "page": Drupal.googleanalytics.getPageUrl(this.href),
381            "transport": "beacon"
382          });
383        }
384      }
385      else {
386        if (Drupal.settings.googleanalytics.trackMailto && $(this).is("a[href^='mailto:'],area[href^='mailto:']")) {
387          // Mailto link clicked.
388          ga("send", {
389            "hitType": "event",
390            "eventCategory": "Mails",
391            "eventAction": "Click",
392            "eventLabel": this.href.substring(7),
393            "transport": "beacon"
394          });
395        }
396        else if (Drupal.settings.googleanalytics.trackOutbound && this.href.match(/^\w+:\/\//i)) {
397          if (Drupal.settings.googleanalytics.trackDomainMode !== 2 || (Drupal.settings.googleanalytics.trackDomainMode === 2 && !Drupal.googleanalytics.isCrossDomain(this.hostname, Drupal.settings.googleanalytics.trackCrossDomains))) {
398            // External link clicked / No top-level cross domain clicked.
399            ga("send", {
400              "hitType": "event",
401              "eventCategory": "Outbound links",
402              "eventAction": "Click",
403              "eventLabel": this.href,
404              "transport": "beacon"
405            });
406          }
407        }
408      }
409    });
410  });
411
412  // Track hash changes as unique pageviews, if this option has been enabled.
413  if (Drupal.settings.googleanalytics.trackUrlFragments) {
414    window.onhashchange = function() {
415      ga("send", {
416        "hitType": "pageview",
417        "page": location.pathname + location.search + location.hash
418      });
419    };
420  }
421
422  // Colorbox: This event triggers when the transition has completed and the
423  // newly loaded content has been revealed.
424  if (Drupal.settings.googleanalytics.trackColorbox) {
425    $(document).bind("cbox_complete", function () {
426      var href = $.colorbox.element().attr("href");
427      if (href) {
428        ga("send", {
429          "hitType": "pageview",
430          "page": Drupal.googleanalytics.getPageUrl(href)
431        });
432      }
433    });
434  }
435
436});
437
438/**
439 * Check whether the hostname is part of the cross domains or not.
440 *
441 * @param string hostname
442 *   The hostname of the clicked URL.
443 * @param array crossDomains
444 *   All cross domain hostnames as JS array.
445 *
446 * @return boolean
447 */
448Drupal.googleanalytics.isCrossDomain = function (hostname, crossDomains) {
449  /**
450   * jQuery < 1.6.3 bug: $.inArray crushes IE6 and Chrome if second argument is
451   * `null` or `undefined`, https://bugs.jquery.com/ticket/10076,
452   * https://github.com/jquery/jquery/commit/a839af034db2bd934e4d4fa6758a3fed8de74174
453   *
454   * @todo: Remove/Refactor in D8
455   */
456  if (!crossDomains) {
457    return false;
458  }
459  else {
460    return $.inArray(hostname, crossDomains) > -1 ? true : false;
461  }
462};
463
464/**
465 * Check whether this is a download URL or not.
466 *
467 * @param string url
468 *   The web url to check.
469 *
470 * @return boolean
471 */
472Drupal.googleanalytics.isDownload = function (url) {
473  var isDownload = new RegExp("\\.(" + Drupal.settings.googleanalytics.trackDownloadExtensions + ")([\?#].*)?$", "i");
474  return isDownload.test(url);
475};
476
477/**
478 * Check whether this is an absolute internal URL or not.
479 *
480 * @param string url
481 *   The web url to check.
482 *
483 * @return boolean
484 */
485Drupal.googleanalytics.isInternal = function (url) {
486  var isInternal = new RegExp("^(https?):\/\/" + window.location.host, "i");
487  return isInternal.test(url);
488};
489
490/**
491 * Check whether this is a special URL or not.
492 *
493 * URL types:
494 *  - gotwo.module /go/* links.
495 *
496 * @param string url
497 *   The web url to check.
498 *
499 * @return boolean
500 */
501Drupal.googleanalytics.isInternalSpecial = function (url) {
502  var isInternalSpecial = new RegExp("(\/go\/.*)$", "i");
503  return isInternalSpecial.test(url);
504};
505
506/**
507 * Extract the relative internal URL from an absolute internal URL.
508 *
509 * Examples:
510 * - https://mydomain.com/node/1 -> /node/1
511 * - https://example.com/foo/bar -> https://example.com/foo/bar
512 *
513 * @param string url
514 *   The web url to check.
515 *
516 * @return string
517 *   Internal website URL
518 */
519Drupal.googleanalytics.getPageUrl = function (url) {
520  var extractInternalUrl = new RegExp("^(https?):\/\/" + window.location.host, "i");
521  return url.replace(extractInternalUrl, '');
522};
523
524/**
525 * Extract the download file extension from the URL.
526 *
527 * @param string url
528 *   The web url to check.
529 *
530 * @return string
531 *   The file extension of the passed url. e.g. "zip", "txt"
532 */
533Drupal.googleanalytics.getDownloadExtension = function (url) {
534  var extractDownloadextension = new RegExp("\\.(" + Drupal.settings.googleanalytics.trackDownloadExtensions + ")([\?#].*)?$", "i");
535  var extension = extractDownloadextension.exec(url);
536  return (extension === null) ? '' : extension[1];
537};
538
539})(jQuery);
540;

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.