PageSourceSearch

https://ethnobiology.org/sites/default/files/js/js_HvzxUl38HBv9IN8uQEjKBEff1sWcLWuvcKqOk9CjcFQ.js

js ethnobiology.org collected 2026-10-02 05:36:55 UTC 21,411 bytes, 523 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 * sf-Touchscreen v1.3b - Provides touchscreen compatibility for the jQuery Superfish plugin.
12 *
13 * Developer's note:
14 * Built as a part of the Superfish project for Drupal (http://drupal.org/project/superfish)
15 * Found any bug? have any cool ideas? contact me right away! http://drupal.org/user/619294/contact
16 *
17 * jQuery version: 1.3.x or higher.
18 *
19 * Dual licensed under the MIT and GPL licenses:
20 *  http://www.opensource.org/licenses/mit-license.php
21 *  http://www.gnu.org/licenses/gpl.html
22 */
23
24(function($){
25  $.fn.sftouchscreen = function(options){
26    options = $.extend({
27      mode: 'inactive',
28      breakpoint: 768,
29      breakpointUnit: 'px',
30      useragent: '',
31      behaviour: 2,
32      disableHover: false
33    }, options);
34
35    function activate(menu){
36      var eventHandler = (('ontouchstart' in window) || (window.DocumentTouch && document instanceof DocumentTouch)) ? ['click touchstart','mouseup touchend'] : ['click','mouseup'];
37      // Select hyperlinks from parent menu items.
38      menu.find('li:has(ul)').children('a,span.nolink').each(function(){
39        var item = $(this),
40        parent = item.closest('li');
41        if (options.disableHover){
42          parent.unbind('mouseenter mouseleave');
43        }
44        if (options.behaviour == 2){
45          if (parent.children('a.menuparent,span.nolink.menuparent').length > 0 && parent.children('ul').children('.sf-clone-parent').length == 0){
46            var
47            // Cloning the hyperlink of the parent menu item.
48            cloneLink = parent.children('a.menuparent,span.nolink.menuparent').clone(),
49            // Wrapping the hyerplinks in <li>.
50            cloneLink = $('<li class="sf-clone-parent" />').html(cloneLink);
51            // Removing unnecessary stuff.
52            cloneLink.find('.sf-sub-indicator').remove(),
53            // Adding a helper class and attaching them to the sub-menus.
54            parent.children('ul').addClass('sf-has-clone-parent').prepend(cloneLink);
55          }
56        }
57        // No .toggle() here as it's not possible to reset it.
58        item.bind(eventHandler[0], function(event){
59          // Already clicked?
60          if (item.hasClass('sf-clicked')){
61            // Depending on the preferred behaviour, either proceed to the URL.
62            if (options.behaviour == 0){
63              window.location = item.attr('href');
64            }
65            // or collapse the sub-menu.
66            else if (options.behaviour == 1 || options.behaviour == 2){
67              event.preventDefault();
68              item.removeClass('sf-clicked');
69              parent.hideSuperfishUl().find('a,span.nolink').removeClass('sf-clicked');
70            }
71          }
72          // Prevent the default action otherwise.
73          else {
74            event.preventDefault();
75            item.addClass('sf-clicked');
76            parent.showSuperfishUl().siblings('li:has(ul)').hideSuperfishUl().find('.sf-clicked').removeClass('sf-clicked');
77          }
78        });
79      });
80
81      $(document).bind(eventHandler[1], function(event){
82        if (menu.not(event.target) && menu.has(event.target).length === 0){
83          menu.find('.sf-clicked').removeClass('sf-clicked');
84          menu.find('li:has(ul)').hideSuperfishUl();
85        }
86      });
87    }
88    // Return original object to support chaining.
89    // This is not necessary actually because of the way the module uses these plugins.
90    for (var b = 0; b < this.length; b++) {
91      var menu = $(this).eq(b),
92      mode = options.mode;
93      // The rest is crystal clear, isn't it? :)
94      if (mode == 'always_active'){
95        activate(menu);
96      }
97      else if (mode == 'window_width'){
98        var breakpoint = (options.breakpointUnit == 'em') ? (options.breakpoint * parseFloat($('body').css('font-size'))) : options.breakpoint,
99        windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
100        timer;
101        if ((typeof Modernizr === 'undefined' || typeof Modernizr.mq !== 'function') && windowWidth < breakpoint){
102          activate(menu);
103        }
104        else if (typeof Modernizr !== 'undefined' && typeof Modernizr.mq === 'function' && Modernizr.mq('(max-width:' + (breakpoint - 1) + 'px)')) {
105          activate(menu);
106        }
107        $(window).resize(function(){
108          clearTimeout(timer);
109          timer = setTimeout(function(){
110            var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
111            if ((typeof Modernizr === 'undefined' || typeof Modernizr.mq !== 'function') && windowWidth < breakpoint){
112              activate(menu);
113            }
114            else if (typeof Modernizr !== 'undefined' && typeof Modernizr.mq === 'function' && Modernizr.mq('(max-width:' + (breakpoint - 1) + 'px)')) {
115              activate(menu);
116            }
117          }, 50);
118        });
119      }
120      else if (mode == 'useragent_custom'){
121        if (options.useragent != ''){
122          var ua = RegExp(options.useragent, 'i');
123          if (navigator.userAgent.match(ua)){
124            activate(menu);
125          }
126        }
127      }
128      else if (mode == 'useragent_predefined' && navigator.userAgent.match(/(android|bb\d+|meego)|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i)){
129        activate(menu);
130      }
131    }
132    return this;
133  }
134})(jQuery);
135;
136/*
137 * Supposition v0.2 - an optional enhancer for Superfish jQuery menu widget.
138 *
139 * Copyright (c) 2008 Joel Birch - based mostly on work by Jesse Klaasse and credit goes largely to him.
140 * Special thanks to Karl Swedberg for valuable input.
141 *
142 * Dual licensed under the MIT and GPL licenses:
143 *  http://www.opensource.org/licenses/mit-license.php
144 *  http://www.gnu.org/licenses/gpl.html
145 */
146/*
147 * This is not the original jQuery Supposition plugin.
148 * Please refer to the README for more information.
149 */
150
151(function($){
152  $.fn.supposition = function(){
153    var $w = $(window), /*do this once instead of every onBeforeShow call*/
154    _offset = function(dir) {
155      return window[dir == 'y' ? 'pageYOffset' : 'pageXOffset']
156      || document.documentElement && document.documentElement[dir=='y' ? 'scrollTop' : 'scrollLeft']
157      || document.body[dir=='y' ? 'scrollTop' : 'scrollLeft'];
158    },
159    onHide = function(){
160      this.css({bottom:''});
161    },
162    onBeforeShow = function(){
163      this.each(function(){
164        var $u = $(this);
165        $u.css('display','block');
166        var $mul = $u.closest('.sf-menu'),
167        level = $u.parents('ul').length,
168        menuWidth = $u.width(),
169        menuParentWidth = $u.closest('li').outerWidth(true),
170        menuParentLeft = $u.closest('li').offset().left,
171        totalRight = $w.width() + _offset('x'),
172        menuRight = $u.offset().left + menuWidth,
173        exactMenuWidth = (menuRight > (menuParentWidth + menuParentLeft)) ? menuWidth - (menuRight - (menuParentWidth + menuParentLeft)) : menuWidth;
174        if ($u.parents('.sf-js-enabled').hasClass('rtl')) {
175          if (menuParentLeft < exactMenuWidth) {
176            if (($mul.hasClass('sf-horizontal') && level == 1) || ($mul.hasClass('sf-navbar') && level == 2)){
177              $u.css({left:0,right:'auto'});
178            }
179            else {
180              $u.css({left:menuParentWidth + 'px',right:'auto'});
181            }
182          }
183        }
184        else {
185          if (menuRight > totalRight && menuParentLeft > menuWidth) {
186            if (($mul.hasClass('sf-horizontal') && level == 1) || ($mul.hasClass('sf-navbar') && level == 2)){
187              $u.css({right:0,left:'auto'});
188            }
189            else {
190              $u.css({right:menuParentWidth + 'px',left:'auto'});
191            }
192          }
193        }
194        var windowHeight = $w.height(),
195        offsetTop = $u.offset().top,
196        menuParentShadow = ($mul.hasClass('sf-shadow') && $u.css('padding-bottom').length > 0) ? parseInt($u.css('padding-bottom').slice(0,-2)) : 0,
197        menuParentHeight = ($mul.hasClass('sf-vertical')) ? '-' + menuParentShadow : $u.parent().outerHeight(true) - menuParentShadow,
198        menuHeight = $u.height(),
199        baseline = windowHeight + _offset('y');
200        var expandUp = ((offsetTop + menuHeight > baseline) && (offsetTop > menuHeight));
201        if (expandUp) {
202          $u.css({bottom:menuParentHeight + 'px',top:'auto'});
203        }
204        $u.css('display','none');
205      });
206    };
207
208    return this.each(function() {
209      var o = $.fn.superfish.o[this.serial]; /* get this menu's options */
210
211      /* if callbacks already set, store them */
212      var _onBeforeShow = o.onBeforeShow,
213      _onHide = o.onHide;
214
215      $.extend($.fn.superfish.o[this.serial],{
216        onBeforeShow: function() {
217          onBeforeShow.call(this); /* fire our Supposition callback */
218          _onBeforeShow.call(this); /* fire stored callbacks */
219        },
220        onHide: function() {
221          onHide.call(this); /* fire our Supposition callback */
222          _onHide.call(this); /* fire stored callbacks */
223        }
224      });
225    });
226  };
227})(jQuery);;
228/*
229 * Superfish v1.4.8 - jQuery menu widget
230 * Copyright (c) 2008 Joel Birch
231 *
232 * Dual licensed under the MIT and GPL licenses:
233 *  http://www.opensource.org/licenses/mit-license.php
234 *  http://www.gnu.org/licenses/gpl.html
235 *
236 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
237 */
238/*
239 * This is not the original jQuery Superfish plugin.
240 * Please refer to the README for more information.
241 */
242
243(function($){
244  $.fn.superfish = function(op){
245    var sf = $.fn.superfish,
246      c = sf.c,
247      $arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
248      over = function(){
249        var $$ = $(this), menu = getMenu($$);
250        clearTimeout(menu.sfTimer);
251        $$.showSuperfishUl().siblings().hideSuperfishUl();
252      },
253      out = function(){
254        var $$ = $(this), menu = getMenu($$), o = sf.op;
255        clearTimeout(menu.sfTimer);
256        menu.sfTimer=setTimeout(function(){
257          if ($$.children('.sf-clicked').length == 0){
258            o.retainPath=($.inArray($$[0],o.$path)>-1);
259            $$.hideSuperfishUl();
260            if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
261          }
262        },o.delay);
263      },
264      getMenu = function($menu){
265        var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
266        sf.op = sf.o[menu.serial];
267        return menu;
268      },
269      addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
270
271    return this.each(function() {
272      var s = this.serial = sf.o.length;
273      var o = $.extend({},sf.defaults,op);
274      o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels),
275      p = o.$path;
276      for (var l = 0; l < p.length; l++){
277        p.eq(l).addClass([o.hoverClass,c.bcClass].join(' ')).filter('li:has(ul)').removeClass(o.pathClass);
278      }
279      sf.o[s] = sf.op = o;
280
281      $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
282        if (o.autoArrows) addArrow( $(this).children('a:first-child, span.nolink:first-child') );
283      })
284      .not('.'+c.bcClass)
285        .hideSuperfishUl();
286
287      var $a = $('a, span.nolink',this);
288      $a.each(function(i){
289        var $li = $a.eq(i).parents('li');
290        $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
291      });
292      o.onInit.call(this);
293
294    }).each(function() {
295      var menuClasses = [c.menuClass],
296      addShadow = true;
297      if ($.browser !== undefined){
298        if ($.browser.msie && $.browser.version < 7){
299          addShadow = false;
300        }
301      }
302      if (sf.op.dropShadows && addShadow){
303        menuClasses.push(c.shadowClass);
304      }
305      $(this).addClass(menuClasses.join(' '));
306    });
307  };
308
309  var sf = $.fn.superfish;
310  sf.o = [];
311  sf.op = {};
312  sf.IE7fix = function(){
313    var o = sf.op;
314    if ($.browser !== undefined){
315      if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity != undefined) {
316        this.toggleClass(sf.c.shadowClass+'-off');
317      }
318    }
319  };
320  sf.c = {
321    bcClass: 'sf-breadcrumb',
322    menuClass: 'sf-js-enabled',
323    anchorClass: 'sf-with-ul',
324    arrowClass: 'sf-sub-indicator',
325    shadowClass: 'sf-shadow'
326  };
327  sf.defaults = {
328    hoverClass: 'sfHover',
329    pathClass: 'overideThisToUse',
330    pathLevels: 1,
331    delay: 800,
332    animation: {opacity:'show'},
333    speed: 'fast',
334    autoArrows: true,
335    dropShadows: true,
336    disableHI: false, // true disables hoverIntent detection
337    onInit: function(){}, // callback functions
338    onBeforeShow: function(){},
339    onShow: function(){},
340    onHide: function(){}
341  };
342  $.fn.extend({
343    hideSuperfishUl : function(){
344      var o = sf.op,
345        not = (o.retainPath===true) ? o.$path : '';
346      o.retainPath = false;
347      var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
348          .children('ul').addClass('sf-hidden');
349      o.onHide.call($ul);
350      return this;
351    },
352    showSuperfishUl : function(){
353      var o = sf.op,
354        sh = sf.c.shadowClass+'-off',
355        $ul = this.addClass(o.hoverClass)
356          .children('ul.sf-hidden').hide().removeClass('sf-hidden');
357      sf.IE7fix.call($ul);
358      o.onBeforeShow.call($ul);
359      $ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
360      return this;
361    }
362  });
363})(jQuery);;
364/*
365 * Supersubs v0.4b - jQuery plugin
366 * Copyright (c) 2013 Joel Birch
367 *
368 * Dual licensed under the MIT and GPL licenses:
369 *  http://www.opensource.org/licenses/mit-license.php
370 *  http://www.gnu.org/licenses/gpl.html
371 *
372 * This plugin automatically adjusts submenu widths of suckerfish-style menus to that of
373 * their longest list item children. If you use this, please expect bugs and report them
374 * to the jQuery Google Group with the word 'Superfish' in the subject line.
375 *
376 */
377/*
378 * This is not the original jQuery Supersubs plugin.
379 * Please refer to the README for more information.
380 */
381
382(function($){ // $ will refer to jQuery within this closure
383  $.fn.supersubs = function(options){
384    var opts = $.extend({}, $.fn.supersubs.defaults, options);
385    // return original object to support chaining
386    // Although this is unnecessary due to the way the module uses these plugins.
387    for (var a = 0; a < this.length; a++) {
388      // cache selections
389      var $$ = $(this).eq(a),
390      // support metadata
391      o = $.meta ? $.extend({}, opts, $$.data()) : opts;
392      // Jump one level if it's a "NavBar"
393      if ($$.hasClass('sf-navbar')) {
394        $$ = $$.children('li').children('ul');
395      }
396      // cache all ul elements
397      var $ULs = $$.find('ul'),
398      // get the font size of menu.
399      // .css('fontSize') returns various results cross-browser, so measure an em dash instead
400      fontsize = $('<li id="menu-fontsize">&#8212;</li>'),
401      size = fontsize.attr('style','padding:0;position:absolute;top:-99999em;width:auto;')
402      .appendTo($$)[0].clientWidth; //clientWidth is faster than width()
403      // remove em dash
404      fontsize.remove();
405
406      // loop through each ul in menu
407      for (var b = 0; b < $ULs.length; b++) {
408        var
409        // cache this ul
410        $ul = $ULs.eq(b);
411        // If a multi-column sub-menu, and only if correctly configured.
412        if (o.megamenu && $ul.hasClass('sf-megamenu') && $ul.find('.sf-megamenu-column').length > 0){
413          // Look through each column.
414          var $column = $ul.find('div.sf-megamenu-column > ol'),
415          // Overall width.
416          mwWidth = 0;
417          for (var d = 0; d < $column.length; d++){
418            resize($column.eq(d));
419            // New column width, in pixels.
420            var colWidth = $column.width();
421            // Just a trick to convert em unit to px.
422            $column.css({width:colWidth})
423            // Making column parents the same size.
424            .parents('.sf-megamenu-column').css({width:colWidth});
425            // Overall width.
426            mwWidth += parseInt(colWidth);
427          }
428          // Resizing the columns container too.
429          $ul.add($ul.find('li.sf-megamenu-wrapper, li.sf-megamenu-wrapper > ol')).css({width:mwWidth});
430        }
431        else {
432          resize($ul);
433        }
434      }
435    }
436    function resize($ul){
437      var
438      // get all (li) children of this ul
439      $LIs = $ul.children(),
440      // get all anchor grand-children
441      $As = $LIs.children('a');
442      // force content to one line and save current float property
443      $LIs.css('white-space','nowrap');
444      // remove width restrictions and floats so elements remain vertically stacked
445      $ul.add($LIs).add($As).css({float:'none',width:'auto'});
446      // this ul will now be shrink-wrapped to longest li due to position:absolute
447      // so save its width as ems.
448      var emWidth = $ul.get(0).clientWidth / size;
449      // add more width to ensure lines don't turn over at certain sizes in various browsers
450      emWidth += o.extraWidth;
451      // restrict to at least minWidth and at most maxWidth
452      if (emWidth > o.maxWidth) {emWidth = o.maxWidth;}
453      else if (emWidth < o.minWidth) {emWidth = o.minWidth;}
454      emWidth += 'em';
455      // set ul to width in ems
456      $ul.css({width:emWidth});
457      // restore li floats to avoid IE bugs
458      // set li width to full width of this ul
459      // revert white-space to normal
460      $LIs.add($As).css({float:'',width:'',whiteSpace:''});
461      // update offset position of descendant ul to reflect new width of parent.
462      // set it to 100% in case it isn't already set to this in the CSS
463      for (var c = 0; c < $LIs.length; c++) {
464        var $childUl = $LIs.eq(c).children('ul');
465        var offsetDirection = $childUl.css('left') !== undefined ? 'left' : 'right';
466        $childUl.css(offsetDirection,'100%');
467      }
468    }
469    return this;
470  };
471  // expose defaults
472  $.fn.supersubs.defaults = {
473    megamenu: true, // define width for multi-column sub-menus and their columns.
474    minWidth: 12, // requires em unit.
475    maxWidth: 27, // requires em unit.
476    extraWidth: 1 // extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values
477  };
478})(jQuery); // plugin code ends
479;
480/**
481 * @file
482 * The Superfish Drupal Behavior to apply the Superfish jQuery plugin to lists.
483 */
484
485(function ($) {
486  Drupal.behaviors.superfish = {
487    attach: function (context, settings) {
488      // Take a look at each list to apply Superfish to.
489      $.each(settings.superfish || {}, function(index, options) {
490        // Process all Superfish lists.
491        $('#superfish-' + options.id, context).once('superfish', function() {
492          var list = $(this);
493
494          // Check if we are to apply the Supersubs plug-in to it.
495          if (options.plugins || false) {
496            if (options.plugins.supersubs || false) {
497              list.supersubs(options.plugins.supersubs);
498            }
499          }
500
501          // Apply Superfish to the list.
502          list.superfish(options.sf);
503
504          // Check if we are to apply any other plug-in to it.
505          if (options.plugins || false) {
506            if (options.plugins.touchscreen || false) {
507              list.sftouchscreen(options.plugins.touchscreen);
508            }
509            if (options.plugins.smallscreen || false) {
510              list.sfsmallscreen(options.plugins.smallscreen);
511            }
512            if (options.plugins.supposition || false) {
513              list.supposition();
514            }
515            if (options.plugins.bgiframe || false) {
516              list.find('ul').bgIframe({opacity:false});
517            }
518          }
519        });
520      });
521    }
522  };
523})(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.