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-Smallscreen v1.2b - Provides small-screen 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.sfsmallscreen = function(options){ 26 options = $.extend({ 27 mode: 'inactive', 28 type: 'accordion', 29 breakpoint: 768, 30 breakpointUnit: 'px', 31 useragent: '', 32 title: '', 33 addSelected: false, 34 menuClasses: false, 35 hyperlinkClasses: false, 36 excludeClass_menu: '', 37 excludeClass_hyperlink: '', 38 includeClass_menu: '', 39 includeClass_hyperlink: '', 40 accordionButton: 1, 41 expandText: 'Expand', 42 collapseText: 'Collapse' 43 }, options); 44 45 // We need to clean up the menu from anything unnecessary. 46 function refine(menu){ 47 var 48 refined = menu.clone(), 49 // Things that should not be in the small-screen menus. 50 rm = refined.find('span.sf-sub-indicator, span.sf-description'), 51 // This is a helper class for those who need to add extra markup that shouldn't exist 52 // in the small-screen versions. 53 rh = refined.find('.sf-smallscreen-remove'), 54 // Mega-menus has to be removed too. 55 mm = refined.find('ul.sf-megamenu'); 56 for (var a = 0; a < rh.length; a++){ 57 rh.eq(a).replaceWith(rh.eq(a).html()); 58 } 59 for (var b = 0; b < rm.length; b++){ 60 rm.eq(b).remove(); 61 } 62 if (mm.length > 0){ 63 mm.removeClass('sf-megamenu'); 64 var ol = refined.find('div.sf-megamenu-column > ol'); 65 for (var o = 0; o < ol.length; o++){ 66 ol.eq(o).replaceWith('<ul>' + ol.eq(o).html() + '</ul>'); 67 } 68 var elements = ['div.sf-megamenu-column','.sf-megamenu-wrapper > ol','li.sf-megamenu-wrapper']; 69 for (var i = 0; i < elements.length; i++){ 70 obj = refined.find(elements[i]); 71 for (var t = 0; t < obj.length; t++){ 72 obj.eq(t).replaceWith(obj.eq(t).html()); 73 } 74 } 75 refined.find('.sf-megamenu-column').removeClass('sf-megamenu-column'); 76 } 77 refined.add(refined.find('*')).css({width:''}); 78 return refined; 79 } 80 81 // Creating <option> elements out of the menu. 82 function toSelect(menu, level){ 83 var 84 items = '', 85 childLI = $(menu).children('li'); 86 for (var a = 0; a < childLI.length; a++){ 87 var list = childLI.eq(a), parent = list.children('a, span'); 88 for (var b = 0; b < parent.length; b++){ 89 var 90 item = parent.eq(b), 91 path = item.is('a') ? item.attr('href') : '', 92 // Class names modification. 93 itemClone = item.clone(), 94 classes = (options.hyperlinkClasses) ? ((options.excludeClass_hyperlink && itemClone.hasClass(options.excludeClass_hyperlink)) ? itemClone.removeClass(options.excludeClass_hyperlink).attr('class') : itemClone.attr('class')) : '', 95 classes = (options.includeClass_hyperlink && !itemClone.hasClass(options.includeClass_hyperlink)) ? ((options.hyperlinkClasses) ? itemClone.addClass(options.includeClass_hyperlink).attr('class') : options.includeClass_hyperlink) : classes; 96 // Retaining the active class if requested. 97 if (options.addSelected && item.hasClass('active')){ 98 classes += ' active'; 99 } 100 // <option> has to be disabled if the item is not a link. 101 disable = item.is('span') || item.attr('href')=='#' ? ' disabled="disabled"' : '', 102 // Crystal clear. 103 subIndicator = 1 < level ? Array(level).join('-') + ' ' : ''; 104 // Preparing the <option> element. 105 items += '<option value="' + path + '" class="' + classes + '"' + disable + '>' + subIndicator + $.trim(item.text()) +'</option>', 106 childUL = list.find('> ul'); 107 // Using the function for the sub-menu of this item. 108 for (var u = 0; u < childUL.length; u++){
109 items += toSelect(childUL.eq(u), level + 1); 110 } 111 } 112 } 113 return items; 114 } 115 116 // Create the new version, hide the original. 117 function convert(menu){ 118 var menuID = menu.attr('id'), 119 // Creating a refined version of the menu. 120 refinedMenu = refine(menu); 121 // Currently the plugin provides two reactions to small screens. 122 // Converting the menu to a <select> element, and converting to an accordion version of the menu. 123 if (options.type == 'accordion'){ 124 var 125 toggleID = menuID + '-toggle', 126 accordionID = menuID + '-accordion'; 127 // Making sure the accordion does not exist. 128 if ($('#' + accordionID).length == 0){ 129 var 130 // Getting the style class. 131 styleClass = menu.attr('class').split(' ').filter(function(item){ 132 return item.indexOf('sf-style-') > -1 ? item : ''; 133 }), 134 // Creating the accordion. 135 accordion = $(refinedMenu).attr('id', accordionID); 136 // Removing unnecessary classes. 137 accordion.removeClass('sf-horizontal sf-vertical sf-navbar sf-shadow sf-js-enabled'); 138 // Adding necessary classes. 139 accordion.addClass('sf-accordion sf-hidden'); 140 // Removing style attributes and any unnecessary class. 141 accordion.children('li').removeAttr('style').removeClass('sfHover'); 142 // Doing the same and making sure all the sub-menus are off-screen (hidden). 143 accordion.find('ul').removeAttr('style').not('.sf-hidden').addClass('sf-hidden'); 144 // Creating the accordion toggle switch. 145 var toggle = '<div class="sf-accordion-toggle ' + styleClass + '"><a href="#" id="' + toggleID + '"><span>' + options.title + '</span></a></div>'; 146 147 // Adding Expand\Collapse buttons if requested. 148 if (options.accordionButton == 2){ 149 var parent = accordion.find('li.menuparent'); 150 for (var i = 0; i < parent.length; i++){ 151 parent.eq(i).prepend('<a href="#" class="sf-accordion-button">' + options.expandText + '</a>'); 152 } 153 } 154 // Inserting the according and hiding the original menu. 155 menu.before(toggle).before(accordion).hide(); 156 157 var 158 accordionElement = $('#' + accordionID), 159 // Deciding what should be used as accordion buttons. 160 buttonElement = (options.accordionButton < 2) ? 'a.menuparent,span.nolink.menuparent' : 'a.sf-accordion-button', 161 button = accordionElement.find(buttonElement); 162 163 // Attaching a click event to the toggle switch. 164 $('#' + toggleID).bind('click', function(e){ 165 // Preventing the click. 166 e.preventDefault(); 167 // Adding the sf-expanded class. 168 $(this).toggleClass('sf-expanded'); 169 170 if (accordionElement.hasClass('sf-expanded')){ 171 // If the accordion is already expanded: 172 // Hiding its expanded sub-menus and then the accordion itself as well. 173 accordionElement.add(accordionElement.find('li.sf-expanded')).removeClass('sf-expanded') 174 .end().find('ul').hide() 175 // This is a bit tricky, it's the same trick that has been in use in the main plugin for sometime. 176 // Basically we'll add a class that keeps the sub-menu off-screen and still visible, 177 // and make it invisible and removing the class one moment before showing or hiding it. 178 // This helps screen reader software access all the menu items. 179 .end().hide().addClass('sf-hidden').show(); 180 // Changing the caption of any existing accordion buttons to 'Expand'. 181 if (options.accordionButton == 2){ 182 accordionElement.find('a.sf-accordion-button').text(options.expandText); 183 } 184 } 185 else { 186 // But if it's collapsed, 187 accordionElement.addClass('sf-expanded').hide().removeClass('sf-hidden').show(); 188 } 189 }); 190 191 // Attaching a click event to the buttons. 192 button.bind('click', function(e){ 193 // Making sure the buttons does not exist already. 194 if ($(this).closest('li').children('ul').length > 0){ 195 e.preventDefault(); 196 // Selecting the parent menu items. 197 var parent = $(this).closest('li'); 198 // Creating and inserting Expand\Collapse buttons to the parent menu items, 199 // of course only if not already happened.
200 if (options.accordionButton == 1 && parent.children('a.menuparent,span.nolink.menuparent').length > 0 && parent.children('ul').children('li.sf-clone-parent').length == 0){ 201 var 202 // Cloning the hyperlink of the parent menu item. 203 cloneLink = parent.children('a.menuparent,span.nolink.menuparent').clone(), 204 // Wrapping the hyerplinks in <li>. 205 cloneLink = $('<li class="sf-clone-parent" />').html(cloneLink); 206 // Adding a helper class and attaching them to the sub-menus. 207 parent.children('ul').addClass('sf-has-clone-parent').prepend(cloneLink); 208 } 209 // Once the button is clicked, collapse the sub-menu if it's expanded. 210 if (parent.hasClass('sf-expanded')){ 211 parent.children('ul').slideUp('fast', function(){ 212 // Doing the accessibility trick after hiding the sub-menu. 213 $(this).closest('li').removeClass('sf-expanded').end().addClass('sf-hidden').show(); 214 }); 215 // Changing the caption of the inserted Collapse link to 'Expand', if any is inserted. 216 if (options.accordionButton == 2 && parent.children('.sf-accordion-button').length > 0){ 217 parent.children('.sf-accordion-button').text(options.expandText); 218 } 219 } 220 // Otherwise, expand the sub-menu. 221 else { 222 // Doing the accessibility trick and then showing the sub-menu. 223 parent.children('ul').hide().removeClass('sf-hidden').slideDown('fast') 224 // Changing the caption of the inserted Expand link to 'Collape', if any is inserted. 225 .end().addClass('sf-expanded').children('a.sf-accordion-button').text(options.collapseText) 226 // Hiding any expanded sub-menu of the same level. 227 .end().siblings('li.sf-expanded').children('ul') 228 .slideUp('fast', function(){ 229 // Doing the accessibility trick after hiding it. 230 $(this).closest('li').removeClass('sf-expanded').end().addClass('sf-hidden').show(); 231 }) 232 // Assuming Expand\Collapse buttons do exist, resetting captions, in those hidden sub-menus. 233 .parent().children('a.sf-accordion-button').text(options.expandText); 234 } 235 } 236 }); 237 } 238 } 239 else { 240 var 241 // Class names modification. 242 menuClone = menu.clone(), classes = (options.menuClasses) ? ((options.excludeClass_menu && menuClone.hasClass(options.excludeClass_menu)) ? menuClone.removeClass(options.excludeClass_menu).attr('class') : menuClone.attr('class')) : '', 243 classes = (options.includeClass_menu && !menuClone.hasClass(options.includeClass_menu)) ? ((options.menuClasses) ? menuClone.addClass(options.includeClass_menu).attr('class') : options.includeClass_menu) : classes, 244 classes = (classes) ? ' class="' + classes + '"' : ''; 245 246 // Making sure the <select> element does not exist already. 247 if ($('#' + menuID + '-select').length == 0){ 248 // Creating the <option> elements. 249 var newMenu = toSelect(refinedMenu, 1), 250 // Creating the <select> element and assigning an ID and class name. 251 selectList = $('<select' + classes + ' id="' + menuID + '-select"/>') 252 // Attaching the title and the items to the <select> element. 253 .html('<option>' + options.title + '</option>' + newMenu) 254 // Attaching an event then. 255 .change(function(){ 256 // Except for the first option that is the menu title and not a real menu item. 257 if ($('option:selected', this).index()){ 258 window.location = selectList.val(); 259 } 260 }); 261 // Applying the addSelected option to it. 262 if (options.addSelected){ 263 selectList.find('.active').attr('selected', !0); 264 } 265 // Finally inserting the <select> element into the document then hiding the original menu. 266 menu.before(selectList).hide(); 267 } 268 } 269 } 270 271 // Turn everything back to normal. 272 function turnBack(menu){ 273 var 274 id = '#' + menu.attr('id'); 275 // Removing the small screen version. 276 $(id + '-' + options.type).remove(); 277 // Removing the accordion toggle switch as well. 278 if (options.type == 'accordion'){ 279 $(id + '-toggle').parent('div').remove(); 280 } 281 // Crystal clear! 282 $(id).show(); 283 } 284
285 // Return original object to support chaining. 286 // Although this is unnecessary because of the way the module uses these plugins. 287 for (var s = 0; s < this.length; s++){ 288 var 289 menu = $(this).eq(s), 290 mode = options.mode; 291 // The rest is crystal clear, isn't it? :) 292 if (mode == 'always_active'){ 293 convert(menu); 294 } 295 else if (mode == 'window_width'){ 296 var breakpoint = (options.breakpointUnit == 'em') ? (options.breakpoint * parseFloat($('body').css('font-size'))) : options.breakpoint, 297 windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, 298 timer; 299 if ((typeof Modernizr === 'undefined' || typeof Modernizr.mq !== 'function') && windowWidth < breakpoint){ 300 convert(menu); 301 } 302 else if (typeof Modernizr !== 'undefined' && typeof Modernizr.mq === 'function' && Modernizr.mq('(max-width:' + (breakpoint - 1) + 'px)')) { 303 convert(menu); 304 } 305 $(window).resize(function(){ 306 clearTimeout(timer); 307 timer = setTimeout(function(){ 308 var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; 309 if ((typeof Modernizr === 'undefined' || typeof Modernizr.mq !== 'function') && windowWidth < breakpoint){ 310 convert(menu); 311 } 312 else if (typeof Modernizr !== 'undefined' && typeof Modernizr.mq === 'function' && Modernizr.mq('(max-width:' + (breakpoint - 1) + 'px)')) { 313 convert(menu); 314 } 315 else { 316 turnBack(menu); 317 } 318 }, 50); 319 }); 320 } 321 else if (mode == 'useragent_custom'){ 322 if (options.useragent != ''){ 323 var ua = RegExp(options.useragent, 'i'); 324 if (navigator.userAgent.match(ua)){ 325 convert(menu); 326 } 327 } 328 } 329 else if (mode == 'useragent_predefined' && navigator.userAgent.match(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|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)){ 330 convert(menu); 331 } 332 } 333 return this; 334 } 335})(jQuery); 336; 337/* 338 * Supposition v0.2 - an optional enhancer for Superfish jQuery menu widget. 339 * 340 * Copyright (c) 2008 Joel Birch - based mostly on work by Jesse Klaasse and credit goes largely to him. 341 * Special thanks to Karl Swedberg for valuable input. 342 * 343 * Dual licensed under the MIT and GPL licenses: 344 * http://www.opensource.org/licenses/mit-license.php 345 * http://www.gnu.org/licenses/gpl.html 346 */ 347/* 348 * This is not the original jQuery Supposition plugin. 349 * Please refer to the README for more information. 350 */ 351 352(function($){ 353 $.fn.supposition = function(){ 354 var $w = $(window), /*do this once instead of every onBeforeShow call*/ 355 _offset = function(dir) { 356 return window[dir == 'y' ? 'pageYOffset' : 'pageXOffset'] 357 || document.documentElement && document.documentElement[dir=='y' ? 'scrollTop' : 'scrollLeft'] 358 || document.body[dir=='y' ? 'scrollTop' : 'scrollLeft']; 359 }, 360 onHide = function(){ 361 this.css({bottom:''}); 362 }, 363 onBeforeShow = function(){ 364 this.each(function(){ 365 var $u = $(this); 366 $u.css('display','block'); 367 var $mul = $u.closest('.sf-menu'), 368 level = $u.parents('ul').length, 369 menuWidth = $u.width(), 370 menuParentWidth = $u.closest('li').outerWidth(true), 371 menuParentLeft = $u.closest('li').offset().left, 372 totalRight = $w.width() + _offset('x'), 373 menuRight = $u.offset().left + menuWidth, 374 exactMenuWidth = (menuRight > (menuParentWidth + menuParentLeft)) ? menuWidth - (menuRight - (menuParentWidth + menuParentLeft)) : menuWidth; 375 if ($u.parents('.sf-js-enabled').hasClass('rtl')) { 376 if (menuParentLeft < exactMenuWidth) { 377 if (($mul.hasClass('sf-horizontal') && level == 1) || ($mul.hasClass('sf-navbar') && level == 2)){ 378 $u.css({left:0,right:'auto'}); 379 } 380 else { 381 $u.css({left:menuParentWidth + 'px',right:'auto'}); 382 } 383 } 384 } 385 else { 386 if (menuRight > totalRight && menuParentLeft > menuWidth) { 387 if (($mul.hasClass('sf-horizontal') && level == 1) || ($mul.hasClass('sf-navbar') && level == 2)){ 388 $u.css({right:0,left:'auto'}); 389 } 390 else { 391 $u.css({right:menuParentWidth + 'px',left:'auto'}); 392 } 393 } 394 } 395 var windowHeight = $w.height(), 396 offsetTop = $u.offset().top, 397 menuParentShadow = ($mul.hasClass('sf-shadow') && $u.css('padding-bottom').length > 0) ? parseInt($u.css('padding-bottom').slice(0,-2)) : 0, 398 menuParentHeight = ($mul.hasClass('sf-vertical')) ? '-' + menuParentShadow : $u.parent().outerHeight(true) - menuParentShadow, 399 menuHeight = $u.height(), 400 baseline = windowHeight + _offset('y'); 401 var expandUp = ((offsetTop + menuHeight > baseline) && (offsetTop > menuHeight)); 402 if (expandUp) { 403 $u.css({bottom:menuParentHeight + 'px',top:'auto'}); 404 } 405 $u.css('display','none'); 406 }); 407 }; 408 409 return this.each(function() { 410 var o = $.fn.superfish.o[this.serial]; /* get this menu's options */ 411 412 /* if callbacks already set, store them */ 413 var _onBeforeShow = o.onBeforeShow, 414 _onHide = o.onHide; 415 416 $.extend($.fn.superfish.o[this.serial],{ 417 onBeforeShow: function() { 418 onBeforeShow.call(this); /* fire our Supposition callback */ 419 _onBeforeShow.call(this); /* fire stored callbacks */ 420 }, 421 onHide: function() { 422 onHide.call(this); /* fire our Supposition callback */ 423 _onHide.call(this); /* fire stored callbacks */ 424 } 425 }); 426 }); 427 }; 428})(jQuery);; 429/* 430 * Superfish v1.4.8 - jQuery menu widget 431 * Copyright (c) 2008 Joel Birch 432 * 433 * Dual licensed under the MIT and GPL licenses: 434 * http://www.opensource.org/licenses/mit-license.php 435 * http://www.gnu.org/licenses/gpl.html 436 * 437 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt 438 */ 439/* 440 * This is not the original jQuery Superfish plugin. 441 * Please refer to the README for more information. 442 */ 443 444(function($){ 445 $.fn.superfish = function(op){ 446 var sf = $.fn.superfish, 447 c = sf.c, 448 $arrow = $(['<span class="',c.arrowClass,'"> »</span>'].join('')), 449 over = function(){ 450 var $$ = $(this), menu = getMenu($$); 451 clearTimeout(menu.sfTimer); 452 $$.showSuperfishUl().siblings().hideSuperfishUl(); 453 }, 454 out = function(){ 455 var $$ = $(this), menu = getMenu($$), o = sf.op; 456 clearTimeout(menu.sfTimer); 457 menu.sfTimer=setTimeout(function(){ 458 if ($$.children('.sf-clicked').length == 0){ 459 o.retainPath=($.inArray($$[0],o.$path)>-1);
460 $$.hideSuperfishUl(); 461 if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);} 462 } 463 },o.delay); 464 }, 465 getMenu = function($menu){ 466 var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0]; 467 sf.op = sf.o[menu.serial]; 468 return menu; 469 }, 470 addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); }; 471 472 return this.each(function() { 473 var s = this.serial = sf.o.length; 474 var o = $.extend({},sf.defaults,op); 475 o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels), 476 p = o.$path; 477 for (var l = 0; l < p.length; l++){ 478 p.eq(l).addClass([o.hoverClass,c.bcClass].join(' ')).filter('li:has(ul)').removeClass(o.pathClass); 479 } 480 sf.o[s] = sf.op = o; 481 482 $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() { 483 if (o.autoArrows) addArrow( $(this).children('a:first-child, span.nolink:first-child') ); 484 }) 485 .not('.'+c.bcClass) 486 .hideSuperfishUl(); 487 488 var $a = $('a, span.nolink',this); 489 $a.each(function(i){ 490 var $li = $a.eq(i).parents('li'); 491 $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);}); 492 }); 493 o.onInit.call(this); 494 495 }).each(function() { 496 var menuClasses = [c.menuClass], 497 addShadow = true; 498 if ($.browser !== undefined){ 499 if ($.browser.msie && $.browser.version < 7){ 500 addShadow = false; 501 } 502 } 503 if (sf.op.dropShadows && addShadow){ 504 menuClasses.push(c.shadowClass); 505 } 506 $(this).addClass(menuClasses.join(' ')); 507 }); 508 }; 509 510 var sf = $.fn.superfish; 511 sf.o = []; 512 sf.op = {}; 513 sf.IE7fix = function(){ 514 var o = sf.op; 515 if ($.browser !== undefined){ 516 if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity != undefined) { 517 this.toggleClass(sf.c.shadowClass+'-off'); 518 } 519 } 520 }; 521 sf.c = { 522 bcClass: 'sf-breadcrumb', 523 menuClass: 'sf-js-enabled', 524 anchorClass: 'sf-with-ul', 525 arrowClass: 'sf-sub-indicator', 526 shadowClass: 'sf-shadow' 527 }; 528 sf.defaults = { 529 hoverClass: 'sfHover', 530 pathClass: 'overideThisToUse', 531 pathLevels: 1, 532 delay: 800, 533 animation: {opacity:'show'}, 534 speed: 'fast', 535 autoArrows: true, 536 dropShadows: true, 537 disableHI: false, // true disables hoverIntent detection 538 onInit: function(){}, // callback functions 539 onBeforeShow: function(){}, 540 onShow: function(){}, 541 onHide: function(){} 542 }; 543 $.fn.extend({ 544 hideSuperfishUl : function(){ 545 var o = sf.op, 546 not = (o.retainPath===true) ? o.$path : ''; 547 o.retainPath = false; 548 var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass) 549 .children('ul').addClass('sf-hidden'); 550 o.onHide.call($ul); 551 return this; 552 }, 553 showSuperfishUl : function(){ 554 var o = sf.op, 555 sh = sf.c.shadowClass+'-off', 556 $ul = this.addClass(o.hoverClass) 557 .children('ul.sf-hidden').hide().removeClass('sf-hidden'); 558 sf.IE7fix.call($ul); 559 o.onBeforeShow.call($ul); 560 $ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); }); 561 return this; 562 } 563 }); 564})(jQuery);; 565/* 566 * Supersubs v0.4b - jQuery plugin 567 * Copyright (c) 2013 Joel Birch 568 * 569 * Dual licensed under the MIT and GPL licenses: 570 * http://www.opensource.org/licenses/mit-license.php 571 * http://www.gnu.org/licenses/gpl.html 572 * 573 * This plugin automatically adjusts submenu widths of suckerfish-style menus to that of 574 * their longest list item children. If you use this, please expect bugs and report them 575 * to the jQuery Google Group with the word 'Superfish' in the subject line. 576 * 577 */ 578/* 579 * This is not the original jQuery Supersubs plugin. 580 * Please refer to the README for more information. 581 */ 582 583(function($){ // $ will refer to jQuery within this closure 584 $.fn.supersubs = function(options){ 585 var opts = $.extend({}, $.fn.supersubs.defaults, options);
586 // return original object to support chaining 587 // Although this is unnecessary due to the way the module uses these plugins. 588 for (var a = 0; a < this.length; a++) { 589 // cache selections 590 var $$ = $(this).eq(a), 591 // support metadata 592 o = $.meta ? $.extend({}, opts, $$.data()) : opts; 593 // Jump one level if it's a "NavBar" 594 if ($$.hasClass('sf-navbar')) { 595 $$ = $$.children('li').children('ul'); 596 } 597 // cache all ul elements 598 var $ULs = $$.find('ul'), 599 // get the font size of menu. 600 // .css('fontSize') returns various results cross-browser, so measure an em dash instead 601 fontsize = $('<li id="menu-fontsize">—</li>'), 602 size = fontsize.attr('style','padding:0;position:absolute;top:-99999em;width:auto;') 603 .appendTo($$)[0].clientWidth; //clientWidth is faster than width() 604 // remove em dash 605 fontsize.remove(); 606 607 // loop through each ul in menu 608 for (var b = 0; b < $ULs.length; b++) { 609 var 610 // cache this ul 611 $ul = $ULs.eq(b); 612 // If a multi-column sub-menu, and only if correctly configured. 613 if (o.megamenu && $ul.hasClass('sf-megamenu') && $ul.find('.sf-megamenu-column').length > 0){ 614 // Look through each column. 615 var $column = $ul.find('div.sf-megamenu-column > ol'), 616 // Overall width. 617 mwWidth = 0; 618 for (var d = 0; d < $column.length; d++){ 619 resize($column.eq(d)); 620 // New column width, in pixels. 621 var colWidth = $column.width(); 622 // Just a trick to convert em unit to px. 623 $column.css({width:colWidth}) 624 // Making column parents the same size. 625 .parents('.sf-megamenu-column').css({width:colWidth}); 626 // Overall width. 627 mwWidth += parseInt(colWidth); 628 } 629 // Resizing the columns container too. 630 $ul.add($ul.find('li.sf-megamenu-wrapper, li.sf-megamenu-wrapper > ol')).css({width:mwWidth}); 631 } 632 else { 633 resize($ul); 634 } 635 } 636 } 637 function resize($ul){ 638 var 639 // get all (li) children of this ul 640 $LIs = $ul.children(), 641 // get all anchor grand-children 642 $As = $LIs.children('a'); 643 // force content to one line and save current float property 644 $LIs.css('white-space','nowrap'); 645 // remove width restrictions and floats so elements remain vertically stacked 646 $ul.add($LIs).add($As).css({float:'none',width:'auto'}); 647 // this ul will now be shrink-wrapped to longest li due to position:absolute 648 // so save its width as ems. 649 var emWidth = $ul.get(0).clientWidth / size; 650 // add more width to ensure lines don't turn over at certain sizes in various browsers 651 emWidth += o.extraWidth; 652 // restrict to at least minWidth and at most maxWidth 653 if (emWidth > o.maxWidth) {emWidth = o.maxWidth;} 654 else if (emWidth < o.minWidth) {emWidth = o.minWidth;} 655 emWidth += 'em'; 656 // set ul to width in ems 657 $ul.css({width:emWidth}); 658 // restore li floats to avoid IE bugs 659 // set li width to full width of this ul 660 // revert white-space to normal 661 $LIs.add($As).css({float:'',width:'',whiteSpace:''}); 662 // update offset position of descendant ul to reflect new width of parent. 663 // set it to 100% in case it isn't already set to this in the CSS 664 for (var c = 0; c < $LIs.length; c++) { 665 var $childUl = $LIs.eq(c).children('ul'); 666 var offsetDirection = $childUl.css('left') !== undefined ? 'left' : 'right'; 667 $childUl.css(offsetDirection,'100%'); 668 } 669 } 670 return this; 671 }; 672 // expose defaults 673 $.fn.supersubs.defaults = { 674 megamenu: true, // define width for multi-column sub-menus and their columns. 675 minWidth: 12, // requires em unit. 676 maxWidth: 27, // requires em unit. 677 extraWidth: 1 // extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values 678 }; 679})(jQuery); // plugin code ends 680; 681/** 682 * @file 683 * The Superfish Drupal Behavior to apply the Superfish jQuery plugin to lists. 684 */ 685 686(function ($) { 687 Drupal.behaviors.superfish = { 688 attach: function (context, settings) { 689 // Take a look at each list to apply Superfish to. 690 $.each(settings.superfish || {}, function(index, options) { 691 // Process all Superfish lists. 692 $('#superfish-' + options.id, context).once('superfish', function() { 693 var list = $(this); 694 695 // Check if we are to apply the Supersubs plug-in to it. 696 if (options.plugins || false) { 697 if (options.plugins.supersubs || false) { 698 list.supersubs(options.plugins.supersubs); 699 } 700 } 701 702 // Apply Superfish to the list. 703 list.superfish(options.sf); 704 705 // Check if we are to apply any other plug-in to it. 706 if (options.plugins || false) { 707 if (options.plugins.touchscreen || false) { 708 list.sftouchscreen(options.plugins.touchscreen); 709 } 710 if (options.plugins.smallscreen || false) { 711 list.sfsmallscreen(options.plugins.smallscreen); 712 } 713 if (options.plugins.automaticwidth || false) { 714 list.sfautomaticwidth(); 715 } 716 if (options.plugins.supposition || false) { 717 list.supposition(); 718 } 719 if (options.plugins.bgiframe || false) { 720 list.find('ul').bgIframe({opacity:false}); 721 } 722 } 723 }); 724 }); 725 } 726 }; 727})(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.