1/** 2 * @file 3 * Bootstrap Popovers. 4 */ 5 6var Drupal = Drupal || {}; 7 8(function ($, Drupal, Bootstrap) { 9 "use strict"; 10 11 var $document = $(document); 12 13 /** 14 * Extend the Bootstrap Popover plugin constructor class. 15 */ 16 Bootstrap.extendPlugin('popover', function (settings) { 17 return { 18 DEFAULTS: { 19 animation: !!settings.popover_animation, 20 autoClose: !!settings.popover_auto_close, 21 enabled: settings.popover_enabled, 22 html: !!settings.popover_html, 23 placement: settings.popover_placement, 24 selector: settings.popover_selector, 25 trigger: settings.popover_trigger, 26 title: settings.popover_title, 27 content: settings.popover_content, 28 delay: parseInt(settings.popover_delay, 10), 29 container: settings.popover_container 30 } 31 }; 32 }); 33 34 /** 35 * Bootstrap Popovers. 36 * 37 * @todo This should really be properly delegated if selector option is set. 38 */ 39 Drupal.behaviors.bootstrapPopovers = { 40 $activePopover: null, 41 attach: function (context) { 42 // Immediately return if popovers are not available. 43 if (!$.fn.popover || !$.fn.popover.Constructor.DEFAULTS.enabled) { 44 return; 45 } 46 47 var _this = this; 48 49 $document 50 .on('show.bs.popover', '[data-toggle=popover]', function () { 51 var $trigger = $(this); 52 var popover = $trigger.data('bs.popover'); 53 54 // Only keep track of clicked triggers that we're manually handling. 55 if (popover.options.originalTrigger === 'click') { 56 if (_this.$activePopover && _this.getOption('autoClose') && !_this.$activePopover.is($trigger)) { 57 _this.$activePopover.popover('hide'); 58 } 59 _this.$activePopover = $trigger; 60 } 61 }) 62 // Unfortunately, :focusable is only made available when using jQuery 63 // UI. While this would be the most semantic pseudo selector to use 64 // here, jQuery UI may not always be loaded. Instead, just use :visible 65 // here as this just needs some sort of selector here. This activates 66 // delegate binding to elements in jQuery so it can work it's bubbling 67 // focus magic since elements don't really propagate their focus events. 68 // @see https://www.drupal.org/project/bootstrap/issues/3013236 69 .on('focus.bs.popover', ':visible', function (e) { 70 var $target = $(e.target); 71 if (_this.$activePopover && _this.getOption('autoClose') && !_this.$activePopover.is($target) && !$target.closest('.popover.in')[0]) { 72 _this.$activePopover.popover('hide'); 73 _this.$activePopover = null; 74 } 75 }) 76 .on('click.bs.popover', function (e) { 77 var $target = $(e.target); 78 if (_this.$activePopover && _this.getOption('autoClose') && !$target.is('[data-toggle=popover]') && !$target.closest('.popover.in')[0]) { 79 _this.$activePopover.popover('hide'); 80 _this.$activePopover = null; 81 } 82 }) 83 .on('keyup.bs.popover', function (e) { 84 if (_this.$activePopover && _this.getOption('autoClose') && e.which === 27) { 85 _this.$activePopover.popover('hide'); 86 _this.$activePopover = null; 87 } 88 }) 89 ; 90 91 var elements = $(context).find('[data-toggle=popover]').toArray(); 92 for (var i = 0; i < elements.length; i++) { 93 var $element = $(elements[i]); 94 var options = $.extend({}, $.fn.popover.Constructor.DEFAULTS, $element.data()); 95 96 // Store the original trigger. 97 options.originalTrigger = options.trigger; 98 99 // If the trigger is "click", then we'll handle it manually here. 100 if (options.trigger === 'click') { 101 options.trigger = 'manual'; 102 } 103 104 // Retrieve content from a target element. 105 var target = options.target || $element.is('a[href^="#"]') && $element.attr('href'); 106 var $target = $document.find(target).clone(); 107 if (!options.content && $target[0]) { 108 $target.removeClass('visually-hidden hidden').removeAttr('aria-hidden'); 109 options.content = $target.wrap('<div/>').parent()[options.html ? 'html' : 'text']() || ''; 110 } 111 112 // Initialize the popover. 113 $element.popover(options); 114 115 // Handle clicks manually. 116 if (options.originalTrigger === 'click') { 117 // To ensure the element is bound multiple times, remove any 118 // previously set event handler before adding another one. 119 $element 120 .off('click.drupal.bootstrap.popover') 121 .on('click.drupal.bootstrap.popover', function (e) { 122 $(this).popover('toggle'); 123 e.preventDefault(); 124 e.stopPropagation(); 125 }) 126 ; 127 } 128 } 129 }, 130 detach: function (context) { 131 // Immediately return if popovers are not available. 132 if (!$.fn.popover || !$.fn.popover.Constructor.DEFAULTS.enabled) { 133 return; 134 } 135 136 // Destroy all popovers. 137 $(context).find('[data-toggle="popover"]') 138 .off('click.drupal.bootstrap.popover') 139 .popover('destroy') 140 ; 141 }, 142 getOption: function(name, defaultValue, element) { 143 var $element = element ? $(element) : this.$activePopover; 144 var options = $.extend(true, {}, $.fn.popover.Constructor.DEFAULTS, ($element && $element.data('bs.popover') || {}).options); 145 if (options[name] !== void 0) { 146 return options[name]; 147 } 148 return defaultValue !== void 0 ? defaultValue : void 0; 149 } 150 }; 151 152})(window.jQuery, window.Drupal, window.Drupal.bootstrap); 153; 154/** 155 * @file 156 * Bootstrap Tooltips. 157 */ 158 159var Drupal = Drupal || {}; 160 161(function ($, Drupal, Bootstrap) { 162 "use strict"; 163 164 /** 165 * Extend the Bootstrap Tooltip plugin constructor class. 166 */ 167 Bootstrap.extendPlugin('tooltip', function (settings) { 168 return { 169 DEFAULTS: { 170 animation: !!settings.tooltip_animation, 171 enabled: settings.tooltip_enabled, 172 html: !!settings.tooltip_html, 173 placement: settings.tooltip_placement, 174 selector: settings.tooltip_selector, 175 trigger: settings.tooltip_trigger, 176 delay: parseInt(settings.tooltip_delay, 10), 177 container: settings.tooltip_container 178 } 179 }; 180 }); 181 182 /** 183 * Bootstrap Tooltips. 184 * 185 * @todo This should really be properly delegated if selector option is set. 186 */ 187 Drupal.behaviors.bootstrapTooltips = { 188 attach: function (context) { 189 // Immediately return if tooltips are not available. 190 if (!$.fn.tooltip || !$.fn.tooltip.Constructor.DEFAULTS.enabled) { 191 return; 192 } 193 194 var elements = $(context).find('[data-toggle="tooltip"]').toArray(); 195 for (var i = 0; i < elements.length; i++) { 196 var $element = $(elements[i]); 197 var options = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, $element.data()); 198 $element.tooltip(options); 199 } 200 }, 201 detach: function (context) { 202 // Immediately return if tooltips are not available. 203 if (!$.fn.tooltip || !$.fn.tooltip.Constructor.DEFAULTS.enabled) { 204 return; 205 } 206 207 // Destroy all tooltips. 208 $(context).find('[data-toggle="tooltip"]').tooltip('destroy'); 209 } 210 }; 211 212})(window.jQuery, window.Drupal, window.Drupal.bootstrap); 213; 214/* 215 * Superfish v1.4.8 - jQuery menu widget 216 * Copyright (c) 2008 Joel Birch 217 * 218 * Dual licensed under the MIT and GPL licenses: 219 * http://www.opensource.org/licenses/mit-license.php 220 * http://www.gnu.org/licenses/gpl.html 221 * 222 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt 223 */ 224/* 225 * This is not the original jQuery Superfish plugin. 226 * Please refer to the README for more information. 227 */ 228 229(function($){ 230 $.fn.superfish = function(op){ 231 var sf = $.fn.superfish, 232 c = sf.c, 233 $arrow = $(['<span class="',c.arrowClass,'"> »</span>'].join('')), 234 over = function(){ 235 var $$ = $(this), menu = getMenu($$); 236 clearTimeout(menu.sfTimer); 237 $$.showSuperfishUl().siblings().hideSuperfishUl(); 238 }, 239 out = function(){ 240 var $$ = $(this), menu = getMenu($$), o = sf.op; 241 clearTimeout(menu.sfTimer); 242 menu.sfTimer=setTimeout(function(){ 243 if ($$.children('.sf-clicked').length == 0){ 244 o.retainPath=($.inArray($$[0],o.$path)>-1);
245 $$.hideSuperfishUl(); 246 if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);} 247 } 248 },o.delay); 249 }, 250 getMenu = function($menu){ 251 var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0]; 252 sf.op = sf.o[menu.serial]; 253 return menu; 254 }, 255 addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); }; 256 257 return this.each(function() { 258 var s = this.serial = sf.o.length; 259 var o = $.extend({},sf.defaults,op); 260 o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels); 261 var p = o.$path; 262 for (var l = 0; l < p.length; l++){ 263 p.eq(l).addClass([o.hoverClass,c.bcClass].join(' ')).filter('li:has(ul)').removeClass(o.pathClass); 264 } 265 sf.o[s] = sf.op = o; 266 267 $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() { 268 if (o.autoArrows) addArrow( $(this).children('a:first-child, span.nolink:first-child') ); 269 }) 270 .not('.'+c.bcClass) 271 .hideSuperfishUl(); 272 273 var $a = $('a, span.nolink',this); 274 $a.each(function(i){ 275 var $li = $a.eq(i).parents('li'); 276 $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);}); 277 }); 278 o.onInit.call(this); 279 280 }).each(function() { 281 var menuClasses = [c.menuClass]; 282 if (sf.op.dropShadows){ 283 menuClasses.push(c.shadowClass); 284 } 285 $(this).addClass(menuClasses.join(' ')); 286 }); 287 }; 288 289 var sf = $.fn.superfish; 290 sf.o = []; 291 sf.op = {}; 292 293 sf.c = { 294 bcClass: 'sf-breadcrumb', 295 menuClass: 'sf-js-enabled', 296 anchorClass: 'sf-with-ul', 297 arrowClass: 'sf-sub-indicator', 298 shadowClass: 'sf-shadow' 299 }; 300 sf.defaults = { 301 hoverClass: 'sfHover', 302 pathClass: 'overideThisToUse', 303 pathLevels: 1, 304 delay: 800, 305 animation: {opacity:'show'}, 306 speed: 'fast', 307 autoArrows: true, 308 dropShadows: true, 309 disableHI: false, // true disables hoverIntent detection 310 onInit: function(){}, // callback functions 311 onBeforeShow: function(){}, 312 onShow: function(){}, 313 onHide: function(){} 314 }; 315 $.fn.extend({ 316 hideSuperfishUl : function(){ 317 var o = sf.op, 318 not = (o.retainPath===true) ? o.$path : ''; 319 o.retainPath = false; 320 var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass) 321 .children('ul').addClass('sf-hidden'); 322 o.onHide.call($ul); 323 return this; 324 }, 325 showSuperfishUl : function(){ 326 var o = sf.op, 327 sh = sf.c.shadowClass+'-off', 328 $ul = this.addClass(o.hoverClass) 329 .children('ul.sf-hidden').hide().removeClass('sf-hidden'); 330 o.onBeforeShow.call($ul); 331 $ul.animate(o.animation,o.speed,function(){ o.onShow.call($ul); }); 332 return this; 333 } 334 }); 335})(jQuery);; 336/*! 337 * hoverIntent v1.10.1 // 2019.10.05 // jQuery v1.7.0+ 338 * http://briancherne.github.io/jquery-hoverIntent/ 339 * 340 * You may use hoverIntent under the terms of the MIT license. Basically that 341 * means you are free to use hoverIntent as long as this header is left intact. 342 * Copyright 2007-2019 Brian Cherne 343 */ 344!function(factory){"use strict";"function"==typeof define&&define.amd?define(["jquery"],factory):"object"==typeof module&&module.exports?module.exports=factory(require("jquery")):jQuery&&!jQuery.fn.hoverIntent&&factory(jQuery)}(function($){"use strict";function track(ev){cX=ev.pageX,cY=ev.pageY}var cX,cY,_cfg={interval:100,sensitivity:6,timeout:0},INSTANCE_COUNT=0,compare=function(ev,$el,s,cfg){if(Math.sqrt((s.pX-cX)*(s.pX-cX)+(s.pY-cY)*(s.pY-cY))<cfg.sensitivity)return $el.off(s.event,track),delete s.timeoutId,s.isActive=!0,ev.pageX=cX,ev.pageY=cY,delete s.pX,delete s.pY,cfg.over.apply($el[0],[ev]);s.pX=cX,s.pY=cY,s.timeoutId=setTimeout(function(){compare(ev,$el,s,cfg)},cfg.interval)};$.fn.hoverIntent=function(handlerIn,handlerOut,selector){var instanceId=INSTANCE_COUNT++,cfg=$.extend({},_cfg);$.isPlainObject(handlerIn)?(cfg=$.extend(cfg,handlerIn),$.isFunction(cfg.out)||(cfg.out=cfg.over)):cfg=$.isFunction(handlerOut)?$.extend(cfg,{over:handlerIn,out:handlerOut,selector:selector}):$.extend(cfg,{over:handlerIn,out:handlerIn,selector:handlerOut});function handleHover(e){var ev=$.extend({},e),$el=$(this),hoverIntentData=$el.data("hoverIntent");hoverIntentData||$el.data("hoverIntent",hoverIntentData={});var state=hoverIntentData[instanceId];state||(hoverIntentData[instanceId]=state={id:instanceId}),state.timeoutId&&(state.timeoutId=clearTimeout(state.timeoutId));
344var mousemove=state.event="mousemove.hoverIntent.hoverIntent"+instanceId;if("mouseenter"===e.type){if(state.isActive)return;state.pX=ev.pageX,state.pY=ev.pageY,$el.off(mousemove,track).on(mousemove,track),state.timeoutId=setTimeout(function(){compare(ev,$el,state,cfg)},cfg.interval)}else{if(!state.isActive)return;$el.off(mousemove,track),state.timeoutId=setTimeout(function(){!function(ev,$el,s,out){var data=$el.data("hoverIntent");data&&delete data[s.id],out.apply($el[0],[ev])}(ev,$el,state,cfg.out)},cfg.timeout)}}return this.on({"mouseenter.hoverIntent":handleHover,"mouseleave.hoverIntent":handleHover},cfg.selector)}});; 345/* 346 * sf-Smallscreen v1.3b - Provides small-screen compatibility for the jQuery Superfish plugin. 347 * 348 * Developer's note: 349 * Built as a part of the Superfish project for Drupal (http://drupal.org/project/superfish) 350 * Found any bug? have any cool ideas? contact me right away! http://drupal.org/user/619294/contact 351 * 352 * jQuery version: 1.3.x or higher. 353 * 354 * Dual licensed under the MIT and GPL licenses: 355 * http://www.opensource.org/licenses/mit-license.php 356 * http://www.gnu.org/licenses/gpl.html 357 */ 358 359(function($){ 360 $.fn.sfsmallscreen = function(options){ 361 options = $.extend({ 362 mode: 'inactive', 363 type: 'accordion', 364 breakpoint: 768, 365 breakpointUnit: 'px', 366 useragent: '', 367 title: '', 368 addSelected: false, 369 menuClasses: false, 370 hyperlinkClasses: false, 371 excludeClass_menu: '', 372 excludeClass_hyperlink: '', 373 includeClass_menu: '', 374 includeClass_hyperlink: '', 375 accordionButton: 1, 376 expandText: 'Expand', 377 collapseText: 'Collapse' 378 }, options); 379 380 // We need to clean up the menu from anything unnecessary. 381 function refine(menu){ 382 var 383 refined = menu.clone(), 384 // Things that should not be in the small-screen menus. 385 rm = refined.find('span.sf-sub-indicator'), 386 // This is a helper class for those who need to add extra markup that shouldn't exist 387 // in the small-screen versions. 388 rh = refined.find('.sf-smallscreen-remove'), 389 // Mega-menus has to be removed too. 390 mm = refined.find('ul.sf-multicolumn'); 391 for (var a = 0; a < rh.length; a++){ 392 rh.eq(a).replaceWith(rh.eq(a).html()); 393 } 394 if (options.accordionButton == 2 || options.type == 'select'){ 395 for (var b = 0; b < rm.length; b++){ 396 rm.eq(b).remove(); 397 } 398 } 399 if (mm.length > 0){ 400 mm.removeClass('sf-multicolumn'); 401 var ol = refined.find('div.sf-multicolumn-column > ol'); 402 for (var o = 0; o < ol.length; o++){ 403 ol.eq(o).replaceWith('<ul>' + ol.eq(o).html() + '</ul>'); 404 } 405 var elements = ['div.sf-multicolumn-column','.sf-multicolumn-wrapper > ol','li.sf-multicolumn-wrapper']; 406 for (var i = 0; i < elements.length; i++){ 407 obj = refined.find(elements[i]); 408 for (var t = 0; t < obj.length; t++){ 409 obj.eq(t).replaceWith(obj.eq(t).html()); 410 } 411 } 412 refined.find('.sf-multicolumn-column').removeClass('sf-multicolumn-column'); 413 } 414 refined.add(refined.find('*')).css({width:''}); 415 return refined; 416 } 417 418 // Creating <option> elements out of the menu. 419 function toSelect(menu, level){ 420 var 421 items = '', 422 childLI = $(menu).children('li'); 423 for (var a = 0; a < childLI.length; a++){ 424 var list = childLI.eq(a), parent = list.children('a, span'); 425 for (var b = 0; b < parent.length; b++){ 426 var 427 item = parent.eq(b), 428 path = (item.is('a') && !!item.attr('href')) ? item.attr('href') : '', 429 // Class names modification. 430 itemClone = item.clone(), 431 classes = (options.hyperlinkClasses) ? ((options.excludeClass_hyperlink && itemClone.hasClass(options.excludeClass_hyperlink)) ? itemClone.removeClass(options.excludeClass_hyperlink).attr('class') : itemClone.attr('class')) : '', 432 classes = (options.includeClass_hyperlink && !itemClone.hasClass(options.includeClass_hyperlink)) ? ((options.hyperlinkClasses) ? itemClone.addClass(options.includeClass_hyperlink).attr('class') : options.includeClass_hyperlink) : classes; 433 // Retaining the active class if requested. 434 if (options.addSelected && item.hasClass('active')){ 435 classes += ' active'; 436 } 437 classes = (classes) ? ' class="' + classes + '"' : ''; 438 // <option> has to be disabled if the item is not a link. 439 disable = (path == '') || (path == '#') ? ' disabled="disabled"' : '', 440 // Crystal clear. 441 subIndicator = 1 < level ? Array(level).join('-') + ' ' : ''; 442 // Preparing the <option> element. 443 items += '<option value="' + path + '"' + classes + disable + '>' + subIndicator + $.trim(item.text()) +'</option>', 444 childUL = list.find('> ul'); 445 // Using the function for the sub-menu of this item. 446 for (var u = 0; u < childUL.length; u++){
447 items += toSelect(childUL.eq(u), level + 1); 448 } 449 } 450 } 451 return items; 452 } 453 454 // Create the new version, hide the original. 455 function convert(menu){ 456 var menuID = menu.attr('id'), 457 // Creating a refined version of the menu. 458 refinedMenu = refine(menu); 459 // Currently the plugin provides two reactions to small screens. 460 // Converting the menu to a <select> element, and converting to an accordion version of the menu. 461 if (options.type == 'accordion'){ 462 var 463 toggleID = menuID + '-toggle', 464 accordionID = menuID + '-accordion'; 465 // Making sure the accordion does not exist. 466 if ($('#' + accordionID).length == 0){ 467 var 468 // Getting the style class. 469 styleClass = menu.attr('class').split(' ').filter(function(item){ 470 return item.indexOf('sf-style-') > -1 ? item : ''; 471 }), 472 // Creating the accordion. 473 accordion = $(refinedMenu).attr('id', accordionID); 474 // Removing unnecessary classes. 475 accordion.removeClass('sf-horizontal sf-vertical sf-navbar sf-shadow sf-js-enabled'); 476 // Adding necessary classes. 477 accordion.addClass('sf-accordion sf-hidden'); 478 // Removing style attributes and any unnecessary class. 479 accordion.find('li').each(function(){ 480 $(this).removeAttr('style').removeClass('sfHover').attr('id', $(this).attr('id') + '-accordion'); 481 }); 482 // Doing the same and making sure all the sub-menus are off-screen (hidden). 483 accordion.children('ul').removeAttr('style').not('.sf-hidden').addClass('sf-hidden'); 484 // Creating the accordion toggle switch. 485 var toggle = '<div class="sf-accordion-toggle ' + styleClass + '"><a href="#" id="' + toggleID + '"><span>' + options.title + '</span></a></div>'; 486 487 // Adding Expand\Collapse buttons if requested. 488 if (options.accordionButton == 2){ 489 accordion.addClass('sf-accordion-with-buttons'); 490 var parent = accordion.find('li.menuparent'); 491 for (var i = 0; i < parent.length; i++){ 492 parent.eq(i).prepend('<a href="#" class="sf-accordion-button">' + options.expandText + '</a>'); 493 } 494 } 495 // Inserting the according and hiding the original menu. 496 menu.before(toggle).before(accordion).hide(); 497 498 var 499 accordionElement = $('#' + accordionID), 500 // Deciding what should be used as accordion buttons. 501 buttonElement = (options.accordionButton < 2) ? 'a.menuparent,span.nolink.menuparent' : 'a.sf-accordion-button', 502 button = accordionElement.find(buttonElement); 503 504 // Attaching a click event to the toggle switch. 505 $('#' + toggleID).on('click', function(e){ 506 // Preventing the click. 507 e.preventDefault(); 508 // Adding the sf-expanded class. 509 $(this).toggleClass('sf-expanded'); 510 511 if (accordionElement.hasClass('sf-expanded')){ 512 // If the accordion is already expanded: 513 // Hiding its expanded sub-menus and then the accordion itself as well. 514 accordionElement.add(accordionElement.find('li.sf-expanded')).removeClass('sf-expanded') 515 .end().children('ul').hide() 516 // This is a bit tricky, it's the same trick that has been in use in the main plugin for some time. 517 // Basically we'll add a class that keeps the sub-menu off-screen and still visible, 518 // and make it invisible and removing the class one moment before showing or hiding it. 519 // This helps screen reader software access all the menu items. 520 .end().hide().addClass('sf-hidden').show(); 521 // Changing the caption of any existing accordion buttons to 'Expand'. 522 if (options.accordionButton == 2){ 523 accordionElement.find('a.sf-accordion-button').text(options.expandText); 524 } 525 } 526 else { 527 // But if it's collapsed, 528 accordionElement.addClass('sf-expanded').hide().removeClass('sf-hidden').show(); 529 } 530 }); 531 532 // Attaching a click event to the buttons. 533 button.on('click', function(e){ 534 // Making sure the buttons does not exist already. 535 if ($(this).closest('li').children('ul').length > 0){ 536 e.preventDefault(); 537 // Selecting the parent menu items. 538 var parent = $(this).closest('li'); 539 // Creating and inserting Expand\Collapse buttons to the parent menu items, 540 // of course only if not already happened.
541 if (options.accordionButton == 1 && parent.children('a.menuparent,span.nolink.menuparent').length > 0 && parent.children('ul').children('li.sf-clone-parent').length == 0){ 542 var 543 // Cloning the hyperlink of the parent menu item. 544 cloneLink = parent.children('a.menuparent').clone(); 545 // Removing unnecessary classes and element(s). 546 cloneLink.removeClass('menuparent sf-with-ul').children('.sf-sub-indicator').remove(); 547 // Wrapping the hyerplinks in <li>. 548 cloneLink = $('<li class="sf-clone-parent" />').html(cloneLink); 549 // Adding a helper class and attaching them to the sub-menus. 550 parent.children('ul').addClass('sf-has-clone-parent').prepend(cloneLink); 551 } 552 // Once the button is clicked, collapse the sub-menu if it's expanded. 553 if (parent.hasClass('sf-expanded')){ 554 parent.children('ul').slideUp('fast', function(){ 555 // Doing the accessibility trick after hiding the sub-menu. 556 $(this).closest('li').removeClass('sf-expanded').end().addClass('sf-hidden').show(); 557 }); 558 // Changing the caption of the inserted Collapse link to 'Expand', if any is inserted. 559 if (options.accordionButton == 2 && parent.children('.sf-accordion-button').length > 0){ 560 parent.children('.sf-accordion-button').text(options.expandText); 561 } 562 } 563 // Otherwise, expand the sub-menu. 564 else { 565 // Doing the accessibility trick and then showing the sub-menu. 566 parent.children('ul').hide().removeClass('sf-hidden').slideDown('fast') 567 // Changing the caption of the inserted Expand link to 'Collape', if any is inserted. 568 .end().addClass('sf-expanded').children('a.sf-accordion-button').text(options.collapseText) 569 // Hiding any expanded sub-menu of the same level. 570 .end().siblings('li.sf-expanded').children('ul') 571 .slideUp('fast', function(){ 572 // Doing the accessibility trick after hiding it. 573 $(this).closest('li').removeClass('sf-expanded').end().addClass('sf-hidden').show(); 574 }) 575 // Assuming Expand\Collapse buttons do exist, resetting captions, in those hidden sub-menus. 576 .parent().children('a.sf-accordion-button').text(options.expandText); 577 } 578 } 579 }); 580 } 581 } 582 else { 583 var 584 // Class names modification. 585 menuClone = menu.clone(), classes = (options.menuClasses) ? ((options.excludeClass_menu && menuClone.hasClass(options.excludeClass_menu)) ? menuClone.removeClass(options.excludeClass_menu).attr('class') : menuClone.attr('class')) : '', 586 classes = (options.includeClass_menu && !menuClone.hasClass(options.includeClass_menu)) ? ((options.menuClasses) ? menuClone.addClass(options.includeClass_menu).attr('class') : options.includeClass_menu) : classes, 587 classes = (classes) ? ' class="' + classes + '"' : ''; 588 589 // Making sure the <select> element does not exist already. 590 if ($('#' + menuID + '-select').length == 0){ 591 // Creating the <option> elements. 592 var newMenu = toSelect(refinedMenu, 1), 593 // Creating the <select> element and assigning an ID and class name. 594 selectList = $('<select' + classes + ' id="' + menuID + '-select"/>') 595 // Attaching the title and the items to the <select> element. 596 .html('<option>' + options.title + '</option>' + newMenu) 597 // Attaching an event then. 598 .change(function(){ 599 // Except for the first option that is the menu title and not a real menu item. 600 if ($('option:selected', this).index()){ 601 window.location = selectList.val(); 602 } 603 }); 604 // Applying the addSelected option to it. 605 if (options.addSelected){ 606 selectList.find('.active').attr('selected', !0); 607 } 608 // Finally inserting the <select> element into the document then hiding the original menu. 609 menu.before(selectList).hide(); 610 } 611 } 612 } 613 614 // Turn everything back to normal. 615 function turnBack(menu){ 616 var 617 id = '#' + menu.attr('id'); 618 // Removing the small screen version. 619 $(id + '-' + options.type).remove(); 620 // Removing the accordion toggle switch as well. 621 if (options.type == 'accordion'){ 622 $(id + '-toggle').parent('div').remove(); 623 } 624 // Remove inline CSS display property; less clear than simply using .show(), but respects stylesheet 625 $(id).css('display', ''); 626 } 627
628 // Return original object to support chaining. 629 // Although this is unnecessary because of the way the module uses these plugins. 630 for (var s = 0; s < this.length; s++){ 631 var 632 menu = $(this).eq(s), 633 mode = options.mode; 634 // The rest is crystal clear, isn't it? :) 635 if (menu.children('li').length == 0){ 636 // Skip empty menu which will not be visible and don't want to suddenly make it visible. 637 } 638 else if (mode == 'always_active'){ 639 convert(menu); 640 } 641 else if (mode == 'window_width'){ 642 var breakpoint = (options.breakpointUnit == 'em') ? (options.breakpoint * parseFloat($('body').css('font-size'))) : options.breakpoint, 643 windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, 644 timer; 645 if ((typeof Modernizr === 'undefined' || typeof Modernizr.mq !== 'function') && windowWidth < breakpoint){ 646 convert(menu); 647 } 648 else if (typeof Modernizr !== 'undefined' && typeof Modernizr.mq === 'function' && Modernizr.mq('(max-width:' + (breakpoint - 1) + 'px)')) { 649 convert(menu); 650 } 651 $(window).resize(function(){ 652 clearTimeout(timer); 653 timer = setTimeout(function(){ 654 var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; 655 if ((typeof Modernizr === 'undefined' || typeof Modernizr.mq !== 'function') && windowWidth < breakpoint){ 656 convert(menu); 657 } 658 else if (typeof Modernizr !== 'undefined' && typeof Modernizr.mq === 'function' && Modernizr.mq('(max-width:' + (breakpoint - 1) + 'px)')) { 659 convert(menu); 660 } 661 else { 662 turnBack(menu); 663 } 664 }, 50); 665 }); 666 } 667 else if (mode == 'useragent_custom'){ 668 if (options.useragent != ''){ 669 var ua = RegExp(options.useragent, 'i'); 670 if (navigator.userAgent.match(ua)){ 671 convert(menu); 672 } 673 } 674 } 675 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)){ 676 convert(menu); 677 } 678 } 679 return this; 680 } 681})(jQuery); 682; 683/* 684 * Supposition v0.2 - an optional enhancer for Superfish jQuery menu widget. 685 * 686 * Copyright (c) 2008 Joel Birch - based mostly on work by Jesse Klaasse and credit goes largely to him. 687 * Special thanks to Karl Swedberg for valuable input. 688 * 689 * Dual licensed under the MIT and GPL licenses: 690 * http://www.opensource.org/licenses/mit-license.php 691 * http://www.gnu.org/licenses/gpl.html 692 */ 693/* 694 * This is not the original jQuery Supposition plugin. 695 * Please refer to the README for more information. 696 */ 697 698(function($){ 699 $.fn.supposition = function(){ 700 var $w = $(window), /*do this once instead of every onBeforeShow call*/ 701 _offset = function(dir) { 702 return window[dir == 'y' ? 'pageYOffset' : 'pageXOffset'] 703 || document.documentElement && document.documentElement[dir=='y' ? 'scrollTop' : 'scrollLeft'] 704 || document.body[dir=='y' ? 'scrollTop' : 'scrollLeft']; 705 }, 706 onHide = function(){ 707 this.css({bottom:''}); 708 }, 709 onBeforeShow = function(){ 710 this.each(function(){ 711 var $u = $(this); 712 $u.css('display','block'); 713 var $mul = $u.closest('.sf-menu'), 714 level = $u.parents('ul').length, 715 menuWidth = $u.width(), 716 menuParentWidth = $u.closest('li').outerWidth(true), 717 menuParentLeft = $u.closest('li').offset().left, 718 totalRight = $w.width() + _offset('x'), 719 menuRight = $u.offset().left + menuWidth, 720 exactMenuWidth = (menuRight > (menuParentWidth + menuParentLeft)) ? menuWidth - (menuRight - (menuParentWidth + menuParentLeft)) : menuWidth; 721 if ($u.parents('.sf-js-enabled').hasClass('rtl')) { 722 if (menuParentLeft < exactMenuWidth) { 723 if (($mul.hasClass('sf-horizontal') && level == 1) || ($mul.hasClass('sf-navbar') && level == 2)){ 724 $u.css({left:0,right:'auto'}); 725 } 726 else { 727 $u.css({left:menuParentWidth + 'px',right:'auto'}); 728 } 729 $u.parent().addClass('sf-supposition-active'); 730 } 731 } 732 else { 733 if (menuRight > totalRight && menuParentLeft > menuWidth) { 734 if (($mul.hasClass('sf-horizontal') && level == 1) || ($mul.hasClass('sf-navbar') && level == 2)){ 735 $u.css({right:0,left:'auto'}); 736 } 737 else { 738 $u.css({right:menuParentWidth + 'px',left:'auto'}); 739 } 740 $u.parent().addClass('sf-supposition-active'); 741 } 742 } 743 var windowHeight = $w.height(), 744 offsetTop = $u.offset().top, 745 menuParentShadow = ($mul.hasClass('sf-shadow') && $u.css('padding-bottom').length > 0) ? parseInt($u.css('padding-bottom').slice(0,-2)) : 0, 746 menuParentHeight = ($mul.hasClass('sf-vertical')) ? '-' + menuParentShadow : $u.parent().outerHeight(true) - menuParentShadow, 747 menuHeight = $u.height(), 748 baseline = windowHeight + _offset('y'); 749 var expandUp = ((offsetTop + menuHeight > baseline) && (offsetTop > menuHeight)); 750 if (expandUp) { 751 $u.css({bottom:menuParentHeight + 'px',top:'auto'}); 752 } 753 $u.css('display','none'); 754 }); 755 }; 756 757 return this.each(function() { 758 var o = $.fn.superfish.o[this.serial]; /* get this menu's options */ 759 760 /* if callbacks already set, store them */ 761 var _onBeforeShow = o.onBeforeShow, 762 _onHide = o.onHide; 763 764 $.extend($.fn.superfish.o[this.serial],{ 765 onBeforeShow: function() { 766 onBeforeShow.call(this); /* fire our Supposition callback */ 767 _onBeforeShow.call(this); /* fire stored callbacks */ 768 }, 769 onHide: function() { 770 onHide.call(this); /* fire our Supposition callback */ 771 _onHide.call(this); /* fire stored callbacks */ 772 } 773 }); 774 }); 775 }; 776})(jQuery);; 777/* 778 * Supersubs v0.4b - jQuery plugin 779 * Copyright (c) 2013 Joel Birch 780 * 781 * Dual licensed under the MIT and GPL licenses: 782 * http://www.opensource.org/licenses/mit-license.php 783 * http://www.gnu.org/licenses/gpl.html 784 * 785 * This plugin automatically adjusts submenu widths of suckerfish-style menus to that of 786 * their longest list item children. If you use this, please expect bugs and report them 787 * to the jQuery Google Group with the word 'Superfish' in the subject line. 788 * 789 */ 790/* 791 * This is not the original jQuery Supersubs plugin. 792 * Please refer to the README for more information. 793 */ 794 795(function($){ // $ will refer to jQuery within this closure 796 $.fn.supersubs = function(options){ 797 var opts = $.extend({}, $.fn.supersubs.defaults, options);
798 // return original object to support chaining 799 // Although this is unnecessary due to the way the module uses these plugins. 800 for (var a = 0; a < this.length; a++) { 801 // cache selections 802 var $$ = $(this).eq(a), 803 // support metadata 804 o = $.meta ? $.extend({}, opts, $$.data()) : opts; 805 // Jump one level if it's a "NavBar" 806 if ($$.hasClass('sf-navbar')) { 807 $$ = $$.children('li').children('ul'); 808 } 809 // cache all ul elements 810 var $ULs = $$.find('ul'); 811 if ($ULs.length) { 812 // get the font size of menu. 813 // .css('fontSize') returns various results cross-browser, so measure an em dash instead 814 var fontsize = $('<li id="menu-fontsize">—</li>'), 815 size = fontsize.attr('style','padding:0;position:absolute;top:-99999em;width:auto;') 816 .appendTo($$)[0].clientWidth; //clientWidth is faster than width() 817 // remove em dash 818 fontsize.remove(); 819 820 // loop through each ul in menu 821 for (var b = 0; b < $ULs.length; b++) { 822 var 823 // cache this ul 824 $ul = $ULs.eq(b); 825 // If a multi-column sub-menu, and only if correctly configured. 826 if (o.multicolumn && $ul.hasClass('sf-multicolumn') && $ul.find('.sf-multicolumn-column').length > 0){ 827 // Look through each column. 828 var $column = $ul.find('div.sf-multicolumn-column > ol'), 829 // Overall width. 830 mwWidth = 0; 831 for (var d = 0; d < $column.length; d++){ 832 resize($column.eq(d)); 833 // New column width, in pixels. 834 var colWidth = Math.ceil($column.width()); 835 // Just a trick to convert em unit to px. 836 $column.css({width:colWidth}) 837 // Making column parents the same size. 838 .parents('.sf-multicolumn-column').css({width:colWidth}); 839 // Overall width. 840 mwWidth += colWidth; 841 } 842 // Resizing the columns container too. 843 $ul.add($ul.find('li.sf-multicolumn-wrapper, li.sf-multicolumn-wrapper > ol')).css({width:mwWidth}); 844 } 845 else { 846 resize($ul); 847 } 848 } 849 } 850 } 851 function resize($ul){ 852 var 853 // get all (li) children of this ul 854 $LIs = $ul.children(), 855 // get all anchor grand-children 856 $As = $LIs.children('a'); 857 // force content to one line and save current float property 858 $LIs.css('white-space','nowrap'); 859 // remove width restrictions and floats so elements remain vertically stacked 860 $ul.add($LIs).add($As).css({float:'none',width:'auto'}); 861 // this ul will now be shrink-wrapped to longest li due to position:absolute 862 // so save its width as ems. 863 var emWidth = $ul.get(0).clientWidth / size; 864 // add more width to ensure lines don't turn over at certain sizes in various browsers 865 emWidth += o.extraWidth; 866 // restrict to at least minWidth and at most maxWidth 867 if (emWidth > o.maxWidth) {emWidth = o.maxWidth;} 868 else if (emWidth < o.minWidth) {emWidth = o.minWidth;} 869 emWidth += 'em'; 870 // set ul to width in ems 871 $ul.css({width:emWidth}); 872 // restore li floats to avoid IE bugs 873 // set li width to full width of this ul 874 // revert white-space to normal 875 $LIs.add($As).css({float:'',width:'',whiteSpace:''}); 876 // update offset position of descendant ul to reflect new width of parent. 877 // set it to 100% in case it isn't already set to this in the CSS 878 for (var c = 0; c < $LIs.length; c++) { 879 var $childUl = $LIs.eq(c).children('ul'); 880 var offsetDirection = $childUl.css('left') !== undefined ? 'left' : 'right'; 881 $childUl.css(offsetDirection,'100%'); 882 } 883 } 884 return this; 885 }; 886 // expose defaults 887 $.fn.supersubs.defaults = { 888 multicolumn: true, // define width for multi-column sub-menus and their columns. 889 minWidth: 12, // requires em unit. 890 maxWidth: 27, // requires em unit. 891 extraWidth: 1 // extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values 892 }; 893})(jQuery); // plugin code ends 894; 895/** 896 * @file 897 * The Superfish Drupal Behavior to apply the Superfish jQuery plugin to lists. 898 */ 899 900(function ($, Drupal, drupalSettings) { 901 902 'use strict'; 903 904 /** 905 * jQuery Superfish plugin. 906 * 907 * @type {Drupal~behavior} 908 * 909 * @prop {Drupal~behaviorAttach} attach 910 * Attaches the behavior to an applicable <ul> element. 911 */ 912 Drupal.behaviors.superfish = { 913 attach: function (context, drupalSettings) { 914 // Take a look at each menu to apply Superfish to. 915 $.each(drupalSettings.superfish || {}, function (index, options) { 916 var $menu = $('ul#' + options.id, context); 917 918 // Check if we are to apply the Supersubs plug-in to it. 919 if (options.plugins || false) { 920 if (options.plugins.supersubs || false) { 921 $menu.supersubs(options.plugins.supersubs); 922 } 923 } 924 925 // Apply Superfish to the menu. 926 $menu.superfish(options.sf); 927 928 // Check if we are to apply any other plug-in to it. 929 if (options.plugins || false) { 930 if (options.plugins.touchscreen || false) { 931 $menu.sftouchscreen(options.plugins.touchscreen); 932 } 933 if (options.plugins.smallscreen || false) { 934 $menu.sfsmallscreen(options.plugins.smallscreen); 935 } 936 if (options.plugins.supposition || false) { 937 $menu.supposition(); 938 } 939 } 940 }); 941 } 942 }; 943})(jQuery, Drupal, drupalSettings); 944;
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.