1/* 2 * Foundation Responsive Library 3 * http://foundation.zurb.com 4 * Copyright 2014, ZURB 5 * Free to use under the MIT license. 6 * http://www.opensource.org/licenses/mit-license.php 7*/ 8 9(function ($, window, document, undefined) { 10 'use strict'; 11 12 var header_helpers = function (class_array) { 13 var i = class_array.length; 14 var head = $('head'); 15 16 while (i--) { 17 if(head.has('.' + class_array[i]).length === 0) { 18 head.append('<meta class="' + class_array[i] + '" />'); 19 } 20 } 21 }; 22 23 header_helpers([ 24 'foundation-mq-small', 25 'foundation-mq-small-only', 26 'foundation-mq-medium', 27 'foundation-mq-medium-only', 28 'foundation-mq-large', 29 'foundation-mq-large-only', 30 'foundation-mq-xlarge', 31 'foundation-mq-xlarge-only', 32 'foundation-mq-xxlarge', 33 'foundation-data-attribute-namespace']); 34 35 // Enable FastClick if present 36 37 $(function() { 38 if (typeof FastClick !== 'undefined') { 39 // Don't attach to body if undefined 40 if (typeof document.body !== 'undefined') { 41 FastClick.attach(document.body); 42 } 43 } 44 }); 45 46 // private Fast Selector wrapper, 47 // returns jQuery object. Only use where 48 // getElementById is not available. 49 var S = function (selector, context) { 50 if (typeof selector === 'string') { 51 if (context) { 52 var cont; 53 if (context.jquery) { 54 cont = context[0]; 55 if (!cont) return context; 56 } else { 57 cont = context; 58 } 59 return $(cont.querySelectorAll(selector)); 60 } 61 62 return $(document.querySelectorAll(selector)); 63 } 64 65 return $(selector, context); 66 }; 67 68 // Namespace functions. 69 70 var attr_name = function (init) { 71 var arr = []; 72 if (!init) arr.push('data'); 73 if (this.namespace.length > 0) arr.push(this.namespace); 74 arr.push(this.name); 75 76 return arr.join('-'); 77 }; 78 79 var add_namespace = function (str) { 80 var parts = str.split('-'), 81 i = parts.length, 82 arr = []; 83 84 while (i--) { 85 if (i !== 0) { 86 arr.push(parts[i]); 87 } else { 88 if (this.namespace.length > 0) { 89 arr.push(this.namespace, parts[i]); 90 } else { 91 arr.push(parts[i]); 92 } 93 } 94 } 95 96 return arr.reverse().join('-'); 97 }; 98 99 // Event binding and data-options updating. 100 101 var bindings = function (method, options) { 102 var self = this, 103 should_bind_events = !S(this).data(this.attr_name(true)); 104 105 if (S(this.scope).is('[' + this.attr_name() +']')) { 106 S(this.scope).data(this.attr_name(true) + '-init', $.extend({}, this.settings, (options || method), this.data_options(S(this.scope)))); 107 108 if (should_bind_events) { 109 this.events(this.scope); 110 } 111 112 } else { 113 S('[' + this.attr_name() +']', this.scope).each(function () { 114 var should_bind_events = !S(this).data(self.attr_name(true) + '-init'); 115 S(this).data(self.attr_name(true) + '-init', $.extend({}, self.settings, (options || method), self.data_options(S(this)))); 116 117 if (should_bind_events) { 118 self.events(this); 119 } 120 }); 121 } 122 // # Patch to fix #5043 to move this *after* the if/else clause in order for Backbone and similar frameworks to have improved control over event binding and data-options updating. 123 if (typeof method === 'string') { 124 return this[method].call(this, options); 125 } 126 127 }; 128 129 var single_image_loaded = function (image, callback) { 130 function loaded () { 131 callback(image[0]); 132 } 133 134 function bindLoad () { 135 this.one('load', loaded); 136 137 if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { 138 var src = this.attr( 'src' ), 139 param = src.match( /\?/ ) ? '&' : '?'; 140 141 param += 'random=' + (new Date()).getTime(); 142 this.attr('src', src + param); 143 } 144 } 145 146 if (!image.attr('src')) { 147 loaded(); 148 return; 149 } 150 151 if (image[0].complete || image[0].readyState === 4) { 152 loaded(); 153 } else { 154 bindLoad.call(image); 155 } 156 }; 157 158 /* 159 https://github.com/paulirish/matchMedia.js 160 */ 161 162 window.matchMedia = window.matchMedia || (function( doc ) { 163 164 'use strict'; 165 166 var bool, 167 docElem = doc.documentElement, 168 refNode = docElem.firstElementChild || docElem.firstChild, 169 // fakeBody required for <FF4 when executed in <head> 170 fakeBody = doc.createElement( 'body' ), 171 div = doc.createElement( 'div' ); 172 173 div.id = 'mq-test-1'; 174 div.style.cssText = 'position:absolute;top:-100em'; 175 fakeBody.style.background = 'none'; 176 fakeBody.appendChild(div); 177 178 return function (q) { 179 180 div.innerHTML = '­<style media="' + q + '"> #mq-test-1 { width: 42px; }</style>'; 181
182 docElem.insertBefore( fakeBody, refNode ); 183 bool = div.offsetWidth === 42; 184 docElem.removeChild( fakeBody ); 185 186 return { 187 matches: bool, 188 media: q 189 }; 190 191 }; 192 193 }( document )); 194 195 /* 196 * jquery.requestAnimationFrame 197 * https://github.com/gnarf37/jquery-requestAnimationFrame 198 * Requires jQuery 1.8+ 199 * 200 * Copyright (c) 2012 Corey Frang 201 * Licensed under the MIT license. 202 */ 203 204 (function(jQuery) { 205 206 // requestAnimationFrame polyfill adapted from Erik Möller 207 // fixes from Paul Irish and Tino Zijdel 208 // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ 209 // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating 210 211 var animating, 212 lastTime = 0, 213 vendors = ['webkit', 'moz'], 214 requestAnimationFrame = window.requestAnimationFrame, 215 cancelAnimationFrame = window.cancelAnimationFrame, 216 jqueryFxAvailable = 'undefined' !== typeof jQuery.fx; 217 218 for (; lastTime < vendors.length && !requestAnimationFrame; lastTime++) { 219 requestAnimationFrame = window[ vendors[lastTime] + 'RequestAnimationFrame' ]; 220 cancelAnimationFrame = cancelAnimationFrame || 221 window[ vendors[lastTime] + 'CancelAnimationFrame' ] || 222 window[ vendors[lastTime] + 'CancelRequestAnimationFrame' ]; 223 } 224 225 function raf() { 226 if (animating) { 227 requestAnimationFrame(raf); 228 229 if (jqueryFxAvailable) { 230 jQuery.fx.tick(); 231 } 232 } 233 } 234 235 if (requestAnimationFrame) { 236 // use rAF 237 window.requestAnimationFrame = requestAnimationFrame; 238 window.cancelAnimationFrame = cancelAnimationFrame; 239 240 if (jqueryFxAvailable) { 241 jQuery.fx.timer = function (timer) { 242 if (timer() && jQuery.timers.push(timer) && !animating) { 243 animating = true; 244 raf(); 245 } 246 }; 247 248 jQuery.fx.stop = function () { 249 animating = false; 250 }; 251 } 252 } else { 253 // polyfill 254 window.requestAnimationFrame = function (callback) { 255 var currTime = new Date().getTime(), 256 timeToCall = Math.max(0, 16 - (currTime - lastTime)), 257 id = window.setTimeout(function () { 258 callback(currTime + timeToCall); 259 }, timeToCall); 260 lastTime = currTime + timeToCall; 261 return id; 262 }; 263 264 window.cancelAnimationFrame = function (id) { 265 clearTimeout(id); 266 }; 267 268 } 269 270 }( $ )); 271 272 273 function removeQuotes (string) { 274 if (typeof string === 'string' || string instanceof String) { 275 string = string.replace(/^['\\/"]+|(;\s?})+|['\\/"]+$/g, ''); 276 } 277 278 return string; 279 } 280 281 window.Foundation = { 282 name : 'Foundation', 283 284 version : '{{VERSION}}', 285 286 media_queries : { 287 'small' : S('.foundation-mq-small').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''), 288 'small-only' : S('.foundation-mq-small-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''), 289 'medium' : S('.foundation-mq-medium').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''), 290 'medium-only' : S('.foundation-mq-medium-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
291 'large' : S('.foundation-mq-large').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''), 292 'large-only' : S('.foundation-mq-large-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''), 293 'xlarge' : S('.foundation-mq-xlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''), 294 'xlarge-only' : S('.foundation-mq-xlarge-only').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''), 295 'xxlarge' : S('.foundation-mq-xxlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, '') 296 }, 297 298 stylesheet : $('<style></style>').appendTo('head')[0].sheet, 299 300 global: { 301 namespace: undefined 302 }, 303 304 init : function (scope, libraries, method, options, response) { 305 var args = [scope, method, options, response], 306 responses = []; 307 308 // check RTL 309 this.rtl = /rtl/i.test(S('html').attr('dir')); 310 311 // set foundation global scope 312 this.scope = scope || this.scope; 313 314 this.set_namespace(); 315 316 if (libraries && typeof libraries === 'string' && !/reflow/i.test(libraries)) { 317 if (this.libs.hasOwnProperty(libraries)) { 318 responses.push(this.init_lib(libraries, args)); 319 } 320 } else { 321 for (var lib in this.libs) { 322 responses.push(this.init_lib(lib, libraries)); 323 } 324 } 325 326 S(window).load(function(){ 327 S(window) 328 .trigger('resize.fndtn.clearing') 329 .trigger('resize.fndtn.dropdown') 330 .trigger('resize.fndtn.equalizer') 331 .trigger('resize.fndtn.interchange') 332 .trigger('resize.fndtn.joyride') 333 .trigger('resize.fndtn.magellan') 334 .trigger('resize.fndtn.topbar') 335 .trigger('resize.fndtn.slider'); 336 }); 337 338 return scope; 339 }, 340 341 init_lib : function (lib, args) { 342 if (this.libs.hasOwnProperty(lib)) { 343 this.patch(this.libs[lib]); 344 345 if (args && args.hasOwnProperty(lib)) { 346 if (typeof this.libs[lib].settings !== 'undefined') { 347 $.extend(true, this.libs[lib].settings, args[lib]); 348 } 349 else if (typeof this.libs[lib].defaults !== 'undefined') { 350 $.extend(true, this.libs[lib].defaults, args[lib]); 351 } 352 return this.libs[lib].init.apply(this.libs[lib], [this.scope, args[lib]]); 353 } 354 355 args = args instanceof Array ? args : new Array(args); 356 return this.libs[lib].init.apply(this.libs[lib], args); 357 } 358 359 return function () {}; 360 }, 361 362 patch : function (lib) { 363 lib.scope = this.scope; 364 lib.namespace = this.global.namespace; 365 lib.rtl = this.rtl; 366 lib['data_options'] = this.utils.data_options; 367 lib['attr_name'] = attr_name; 368 lib['add_namespace'] = add_namespace; 369 lib['bindings'] = bindings; 370 lib['S'] = this.utils.S; 371 }, 372 373 inherit : function (scope, methods) { 374 var methods_arr = methods.split(' '), 375 i = methods_arr.length; 376 377 while (i--) { 378 if (this.utils.hasOwnProperty(methods_arr[i])) { 379 scope[methods_arr[i]] = this.utils[methods_arr[i]]; 380 } 381 } 382 }, 383 384 set_namespace: function () { 385 386 // Description: 387 // Don't bother reading the namespace out of the meta tag 388 // if the namespace has been set globally in javascript 389 // 390 // Example: 391 // Foundation.global.namespace = 'my-namespace'; 392 // or make it an empty string: 393 // Foundation.global.namespace = ''; 394 // 395 // 396 397 // If the namespace has not been set (is undefined), try to read it out of the meta element. 398 // Otherwise use the globally defined namespace, even if it's empty ('') 399 var namespace = ( this.global.namespace === undefined ) ? $('.foundation-data-attribute-namespace').css('font-family') : this.global.namespace; 400 401 // Finally, if the namsepace is either undefined or false, set it to an empty string. 402 // Otherwise use the namespace value. 403 this.global.namespace = ( namespace === undefined || /false/i.test(namespace) ) ? '' : namespace; 404 }, 405 406 libs : {}, 407 408 // methods that can be inherited in libraries 409 utils : { 410 411 // Description: 412 // Fast Selector wrapper returns jQuery object. Only use where getElementById 413 // is not available. 414 // 415 // Arguments:
416 // Selector (String): CSS selector describing the element(s) to be 417 // returned as a jQuery object. 418 // 419 // Scope (String): CSS selector describing the area to be searched. Default 420 // is document. 421 // 422 // Returns: 423 // Element (jQuery Object): jQuery object containing elements matching the 424 // selector within the scope. 425 S : S, 426 427 // Description: 428 // Executes a function a max of once every n milliseconds 429 // 430 // Arguments: 431 // Func (Function): Function to be throttled. 432 // 433 // Delay (Integer): Function execution threshold in milliseconds. 434 // 435 // Returns: 436 // Lazy_function (Function): Function with throttling applied. 437 throttle : function (func, delay) { 438 var timer = null; 439 440 return function () { 441 var context = this, args = arguments; 442 443 if (timer == null) { 444 timer = setTimeout(function () { 445 func.apply(context, args); 446 timer = null; 447 }, delay); 448 } 449 }; 450 }, 451 452 // Description: 453 // Executes a function when it stops being invoked for n seconds 454 // Modified version of _.debounce() http://underscorejs.org 455 // 456 // Arguments: 457 // Func (Function): Function to be debounced. 458 // 459 // Delay (Integer): Function execution threshold in milliseconds. 460 // 461 // Immediate (Bool): Whether the function should be called at the beginning 462 // of the delay instead of the end. Default is false. 463 // 464 // Returns: 465 // Lazy_function (Function): Function with debouncing applied. 466 debounce : function (func, delay, immediate) { 467 var timeout, result; 468 return function () { 469 var context = this, args = arguments; 470 var later = function () { 471 timeout = null; 472 if (!immediate) result = func.apply(context, args); 473 }; 474 var callNow = immediate && !timeout; 475 clearTimeout(timeout); 476 timeout = setTimeout(later, delay); 477 if (callNow) result = func.apply(context, args); 478 return result; 479 }; 480 }, 481 482 // Description: 483 // Parses data-options attribute 484 // 485 // Arguments: 486 // El (jQuery Object): Element to be parsed. 487 // 488 // Returns: 489 // Options (Javascript Object): Contents of the element's data-options 490 // attribute. 491 data_options : function (el, data_attr_name) { 492 data_attr_name = data_attr_name || 'options'; 493 var opts = {}, ii, p, opts_arr, 494 data_options = function (el) { 495 var namespace = Foundation.global.namespace; 496 497 if (namespace.length > 0) { 498 return el.data(namespace + '-' + data_attr_name); 499 } 500 501 return el.data(data_attr_name); 502 }; 503 504 var cached_options = data_options(el); 505 506 if (typeof cached_options === 'object') { 507 return cached_options; 508 } 509 510 opts_arr = (cached_options || ':').split(';'); 511 ii = opts_arr.length; 512 513 function isNumber (o) { 514 return ! isNaN (o-0) && o !== null && o !== '' && o !== false && o !== true; 515 } 516 517 function trim (str) { 518 if (typeof str === 'string') return $.trim(str); 519 return str; 520 } 521 522 while (ii--) { 523 p = opts_arr[ii].split(':'); 524 p = [p[0], p.slice(1).join(':')]; 525 526 if (/true/i.test(p[1])) p[1] = true; 527 if (/false/i.test(p[1])) p[1] = false; 528 if (isNumber(p[1])) { 529 if (p[1].indexOf('.') === -1) { 530 p[1] = parseInt(p[1], 10); 531 } else { 532 p[1] = parseFloat(p[1]); 533 } 534 } 535 536 if (p.length === 2 && p[0].length > 0) { 537 opts[trim(p[0])] = trim(p[1]); 538 } 539 } 540 541 return opts; 542 }, 543 544 // Description: 545 // Adds JS-recognizable media queries 546 // 547 // Arguments: 548 // Media (String): Key string for the media query to be stored as in 549 // Foundation.media_queries 550 //
551 // Class (String): Class name for the generated <meta> tag 552 register_media : function (media, media_class) { 553 if(Foundation.media_queries[media] === undefined) { 554 $('head').append('<meta class="' + media_class + '"/>'); 555 Foundation.media_queries[media] = removeQuotes($('.' + media_class).css('font-family')); 556 } 557 }, 558 559 // Description: 560 // Add custom CSS within a JS-defined media query 561 // 562 // Arguments: 563 // Rule (String): CSS rule to be appended to the document. 564 // 565 // Media (String): Optional media query string for the CSS rule to be 566 // nested under. 567 add_custom_rule : function (rule, media) { 568 if (media === undefined && Foundation.stylesheet) { 569 Foundation.stylesheet.insertRule(rule, Foundation.stylesheet.cssRules.length); 570 } else { 571 var query = Foundation.media_queries[media]; 572 573 if (query !== undefined) { 574 Foundation.stylesheet.insertRule('@media ' + 575 Foundation.media_queries[media] + '{ ' + rule + ' }'); 576 } 577 } 578 }, 579 580 // Description: 581 // Performs a callback function when an image is fully loaded 582 // 583 // Arguments: 584 // Image (jQuery Object): Image(s) to check if loaded. 585 // 586 // Callback (Function): Function to execute when image is fully loaded. 587 image_loaded : function (images, callback) { 588 var self = this, 589 unloaded = images.length; 590 591 if (unloaded === 0) { 592 callback(images); 593 } 594 595 images.each(function () { 596 single_image_loaded(self.S(this), function () { 597 unloaded -= 1; 598 if (unloaded === 0) { 599 callback(images); 600 } 601 }); 602 }); 603 }, 604 605 // Description: 606 // Returns a random, alphanumeric string 607 // 608 // Arguments: 609 // Length (Integer): Length of string to be generated. Defaults to random 610 // integer. 611 // 612 // Returns: 613 // Rand (String): Pseudo-random, alphanumeric string. 614 random_str : function () { 615 if (!this.fidx) this.fidx = 0; 616 this.prefix = this.prefix || [(this.name || 'F'), (+new Date).toString(36)].join('-'); 617 618 return this.prefix + (this.fidx++).toString(36); 619 }, 620 621 // Description: 622 // Helper for window.matchMedia 623 // 624 // Arguments: 625 // mq (String): Media query 626 // 627 // Returns: 628 // (Boolean): Whether the media query passes or not 629 match : function (mq) { 630 return window.matchMedia(mq).matches; 631 }, 632 633 // Description: 634 // Helpers for checking Foundation default media queries with JS 635 // 636 // Returns: 637 // (Boolean): Whether the media query passes or not 638 639 is_small_up : function () { 640 return this.match(Foundation.media_queries.small); 641 }, 642 643 is_medium_up : function () { 644 return this.match(Foundation.media_queries.medium); 645 }, 646 647 is_large_up : function () { 648 return this.match(Foundation.media_queries.large); 649 }, 650 651 is_xlarge_up : function () { 652 return this.match(Foundation.media_queries.xlarge); 653 }, 654 655 is_xxlarge_up : function () { 656 return this.match(Foundation.media_queries.xxlarge); 657 }, 658 659 is_small_only : function () { 660 return !this.is_medium_up() && !this.is_large_up() && !this.is_xlarge_up() && !this.is_xxlarge_up(); 661 }, 662 663 is_medium_only : function () { 664 return this.is_medium_up() && !this.is_large_up() && !this.is_xlarge_up() && !this.is_xxlarge_up(); 665 }, 666 667 is_large_only : function () { 668 return this.is_medium_up() && this.is_large_up() && !this.is_xlarge_up() && !this.is_xxlarge_up(); 669 }, 670 671 is_xlarge_only : function () { 672 return this.is_medium_up() && this.is_large_up() && this.is_xlarge_up() && !this.is_xxlarge_up(); 673 }, 674 675 is_xxlarge_only : function () { 676 return this.is_medium_up() && this.is_large_up() && this.is_xlarge_up() && this.is_xxlarge_up(); 677 } 678 } 679 }; 680 681 $.fn.foundation = function () { 682 var args = Array.prototype.slice.call(arguments, 0); 683 684 return this.each(function () {
685 Foundation.init.apply(Foundation, [this].concat(args)); 686 return this; 687 }); 688 }; 689 690}(jQuery, window, window.document)); 691 692;(function ($, window, document, undefined) { 693 'use strict'; 694 695 Foundation.libs.offcanvas = { 696 name : 'offcanvas', 697 698 version : '{{VERSION}}', 699 700 settings : { 701 open_method: 'move', 702 close_on_click: false 703 }, 704 705 init : function (scope, method, options) { 706 this.bindings(method, options); 707 }, 708 709 events : function () { 710 var self = this, 711 S = self.S, 712 move_class = '', 713 right_postfix = '', 714 left_postfix = ''; 715 716 if (this.settings.open_method === 'move') { 717 move_class = 'move-'; 718 right_postfix = 'right'; 719 left_postfix = 'left'; 720 } else if (this.settings.open_method === 'overlap_single') { 721 move_class = 'offcanvas-overlap-'; 722 right_postfix = 'right'; 723 left_postfix = 'left'; 724 } else if (this.settings.open_method === 'overlap') { 725 move_class = 'offcanvas-overlap'; 726 } 727 728 S(this.scope).off('.offcanvas') 729 .on('click.fndtn.offcanvas', '.left-off-canvas-toggle', function (e) { 730 self.click_toggle_class(e, move_class + right_postfix); 731 if (self.settings.open_method !== 'overlap'){ 732 S('.left-submenu').removeClass(move_class + right_postfix); 733 } 734 $('.left-off-canvas-toggle').attr('aria-expanded', 'true'); 735 }) 736 .on('click.fndtn.offcanvas', '.left-off-canvas-menu a', function (e) { 737 var settings = self.get_settings(e); 738 var parent = S(this).parent(); 739 740 if(settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')){ 741 self.hide.call(self, move_class + right_postfix, self.get_wrapper(e)); 742 parent.parent().removeClass(move_class + right_postfix); 743 }else if(S(this).parent().hasClass('has-submenu')){ 744 e.preventDefault(); 745 S(this).siblings('.left-submenu').toggleClass(move_class + right_postfix); 746 }else if(parent.hasClass('back')){ 747 e.preventDefault(); 748 parent.parent().removeClass(move_class + right_postfix); 749 } 750 $('.left-off-canvas-toggle').attr('aria-expanded', 'true'); 751 }) 752 .on('click.fndtn.offcanvas', '.right-off-canvas-toggle', function (e) { 753 self.click_toggle_class(e, move_class + left_postfix); 754 if (self.settings.open_method !== 'overlap'){ 755 S('.right-submenu').removeClass(move_class + left_postfix); 756 } 757 $('.right-off-canvas-toggle').attr('aria-expanded', 'true'); 758 }) 759 .on('click.fndtn.offcanvas', '.right-off-canvas-menu a', function (e) { 760 var settings = self.get_settings(e); 761 var parent = S(this).parent(); 762 763 if(settings.close_on_click && !parent.hasClass('has-submenu') && !parent.hasClass('back')){ 764 self.hide.call(self, move_class + left_postfix, self.get_wrapper(e)); 765 parent.parent().removeClass(move_class + left_postfix); 766 }else if(S(this).parent().hasClass('has-submenu')){ 767 e.preventDefault(); 768 S(this).siblings('.right-submenu').toggleClass(move_class + left_postfix); 769 }else if(parent.hasClass('back')){ 770 e.preventDefault(); 771 parent.parent().removeClass(move_class + left_postfix); 772 } 773 $('.right-off-canvas-toggle').attr('aria-expanded', 'true'); 774 }) 775 .on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) { 776 self.click_remove_class(e, move_class + left_postfix); 777 S('.right-submenu').removeClass(move_class + left_postfix); 778 if (right_postfix){ 779 self.click_remove_class(e, move_class + right_postfix); 780 S('.left-submenu').removeClass(move_class + left_postfix); 781 } 782 $('.right-off-canvas-toggle').attr('aria-expanded', 'true'); 783 }) 784 .on('click.fndtn.offcanvas', '.exit-off-canvas', function (e) { 785 self.click_remove_class(e, move_class + left_postfix); 786 $('.left-off-canvas-toggle').attr('aria-expanded', 'false'); 787 if (right_postfix) { 788 self.click_remove_class(e, move_class + right_postfix); 789 $('.right-off-canvas-toggle').attr('aria-expanded', 'false'); 790 } 791 }); 792 }, 793 794 toggle: function(class_name, $off_canvas) { 795 $off_canvas = $off_canvas || this.get_wrapper(); 796 if ($off_canvas.is('.' + class_name)) { 797 this.hide(class_name, $off_canvas); 798 } else { 799 this.show(class_name, $off_canvas); 800 } 801 }, 802 803 show: function(class_name, $off_canvas) { 804 $off_canvas = $off_canvas || this.get_wrapper(); 805 $off_canvas.trigger('open').trigger('open.fndtn.offcanvas'); 806 $off_canvas.addClass(class_name); 807 }, 808 809 hide: function(class_name, $off_canvas) { 810 $off_canvas = $off_canvas || this.get_wrapper(); 811 $off_canvas.trigger('close').trigger('close.fndtn.offcanvas'); 812 $off_canvas.removeClass(class_name); 813 }, 814
815 click_toggle_class: function(e, class_name) { 816 e.preventDefault(); 817 var $off_canvas = this.get_wrapper(e); 818 this.toggle(class_name, $off_canvas); 819 }, 820 821 click_remove_class: function(e, class_name) { 822 e.preventDefault(); 823 var $off_canvas = this.get_wrapper(e); 824 this.hide(class_name, $off_canvas); 825 }, 826 827 get_settings: function(e) { 828 var offcanvas = this.S(e.target).closest('[' + this.attr_name() + ']'); 829 return offcanvas.data(this.attr_name(true) + '-init') || this.settings; 830 }, 831 832 get_wrapper: function(e) { 833 var $off_canvas = this.S(e ? e.target : this.scope).closest('.off-canvas-wrap'); 834 835 if ($off_canvas.length === 0) { 836 $off_canvas = this.S('.off-canvas-wrap'); 837 } 838 return $off_canvas; 839 }, 840 841 reflow : function () {} 842 }; 843}(jQuery, window, window.document)); 844 845;(function ($, window, document, undefined) { 846 'use strict'; 847 848 Foundation.libs.accordion = { 849 name : 'accordion', 850 851 version : '{{VERSION}}', 852 853 settings : { 854 content_class: 'content', 855 active_class: 'active', 856 multi_expand: false, 857 toggleable: true, 858 callback : function () {} 859 }, 860 861 init : function (scope, method, options) { 862 this.bindings(method, options); 863 }, 864 865 events : function () { 866 var self = this; 867 var S = this.S; 868 S(this.scope) 869 .off('.fndtn.accordion') 870 .on('click.fndtn.accordion', '[' + this.attr_name() + '] > .accordion-navigation > a', function (e) { 871 var accordion = S(this).closest('[' + self.attr_name() + ']'), 872 groupSelector = self.attr_name() + '=' + accordion.attr(self.attr_name()), 873 settings = accordion.data(self.attr_name(true) + '-init') || self.settings, 874 target = S('#' + this.href.split('#')[1]), 875 aunts = $('> .accordion-navigation', accordion), 876 siblings = aunts.children('.'+settings.content_class), 877 active_content = siblings.filter('.' + settings.active_class); 878 879 e.preventDefault(); 880 881 if (accordion.attr(self.attr_name())) { 882 siblings = siblings.add('[' + groupSelector + '] dd > '+'.'+settings.content_class); 883 aunts = aunts.add('[' + groupSelector + '] .accordion-navigation'); 884 } 885 886 if (settings.toggleable && target.is(active_content)) { 887 target.parent('.accordion-navigation').toggleClass(settings.active_class, false); 888 target.toggleClass(settings.active_class, false); 889 settings.callback(target); 890 target.triggerHandler('toggled', [accordion]); 891 accordion.triggerHandler('toggled', [target]); 892 return; 893 } 894 895 if (!settings.multi_expand) { 896 siblings.removeClass(settings.active_class); 897 aunts.removeClass(settings.active_class); 898 } 899 900 target.addClass(settings.active_class).parent().addClass(settings.active_class); 901 settings.callback(target); 902 target.triggerHandler('toggled', [accordion]); 903 accordion.triggerHandler('toggled', [target]); 904 }); 905 }, 906 907 off : function () {}, 908 909 reflow : function () {} 910 }; 911}(jQuery, window, window.document)); 912 913;(function ($, window, document, undefined) { 914 'use strict'; 915 916 Foundation.libs.equalizer = { 917 name : 'equalizer', 918 919 version : '{{VERSION}}', 920 921 settings : { 922 use_tallest: true, 923 before_height_change: $.noop, 924 after_height_change: $.noop, 925 equalize_on_stack: false 926 }, 927 928 init : function (scope, method, options) { 929 Foundation.inherit(this, 'image_loaded'); 930 this.bindings(method, options); 931 this.reflow(); 932 }, 933 934 events : function () { 935 this.S(window).off('.equalizer').on('resize.fndtn.equalizer', function(e){ 936 this.reflow(); 937 }.bind(this)); 938 }, 939 940 equalize: function(equalizer) { 941 var isStacked = false, 942 vals = equalizer.find('[' + this.attr_name() + '-watch]:visible'), 943 settings = equalizer.data(this.attr_name(true)+'-init'); 944 945 if (vals.length === 0) return; 946 var firstTopOffset = vals.first().offset().top; 947 settings.before_height_change(); 948 equalizer.trigger('before-height-change').trigger('before-height-change.fndth.equalizer'); 949 vals.height('inherit'); 950 vals.each(function(){ 951 var el = $(this); 952 if (el.offset().top !== firstTopOffset) { 953 isStacked = true; 954 } 955 }); 956 957 if (settings.equalize_on_stack === false) { 958 if (isStacked) return; 959 }; 960 961 var heights = vals.map(function(){ return $(this).outerHeight(false) }).get(); 962 963 if (settings.use_tallest) { 964 var max = Math.max.apply(null, heights); 965 vals.css('height', max); 966 } else { 967 var min = Math.min.apply(null, heights); 968 vals.css('height', min); 969 } 970 settings.after_height_change(); 971 equalizer.trigger('after-height-change').trigger('after-height-change.fndtn.equalizer'); 972 }, 973 974 reflow : function () { 975 var self = this; 976 977 this.S('[' + this.attr_name() + ']', this.scope).each(function(){ 978 var $eq_target = $(this); 979 self.image_loaded(self.S('img', this), function(){ 980 self.equalize($eq_target) 981 }); 982 }); 983 } 984 }; 985})(jQuery, window, window.document); 986 987;(function ($, window, document, undefined) { 988 'use strict'; 989 990 Foundation.libs.dropdown = { 991 name : 'dropdown', 992 993 version : '{{VERSION}}', 994 995 settings : {
996 active_class: 'open', 997 disabled_class: 'disabled', 998 mega_class: 'mega', 999 align: 'bottom', 1000 is_hover: false, 1001 hover_timeout: 150, 1002 opened: function(){}, 1003 closed: function(){} 1004 }, 1005 1006 init : function (scope, method, options) { 1007 Foundation.inherit(this, 'throttle'); 1008 1009 $.extend(true, this.settings, method, options); 1010 this.bindings(method, options); 1011 }, 1012 1013 events : function (scope) { 1014 var self = this, 1015 S = self.S; 1016 1017 S(this.scope) 1018 .off('.dropdown') 1019 .on('click.fndtn.dropdown', '[' + this.attr_name() + ']', function (e) { 1020 var settings = S(this).data(self.attr_name(true) + '-init') || self.settings; 1021 if (!settings.is_hover || Modernizr.touch) { 1022 e.preventDefault(); 1023 if (S(this).parent('[data-reveal-id]')) { 1024 e.stopPropagation(); 1025 } 1026 self.toggle($(this)); 1027 } 1028 }) 1029 .on('mouseenter.fndtn.dropdown', '[' + this.attr_name() + '], [' + this.attr_name() + '-content]', function (e) { 1030 var $this = S(this), 1031 dropdown, 1032 target; 1033 1034 clearTimeout(self.timeout); 1035 1036 if ($this.data(self.data_attr())) { 1037 dropdown = S('#' + $this.data(self.data_attr())); 1038 target = $this; 1039 } else { 1040 dropdown = $this; 1041 target = S('[' + self.attr_name() + '="' + dropdown.attr('id') + '"]'); 1042 } 1043 1044 var settings = target.data(self.attr_name(true) + '-init') || self.settings; 1045 1046 if(S(e.currentTarget).data(self.data_attr()) && settings.is_hover) { 1047 self.closeall.call(self); 1048 } 1049 1050 if (settings.is_hover) self.open.apply(self, [dropdown, target]); 1051 }) 1052 .on('mouseleave.fndtn.dropdown', '[' + this.attr_name() + '], [' + this.attr_name() + '-content]', function (e) { 1053 var $this = S(this); 1054 var settings; 1055 1056 if ($this.data(self.data_attr())) { 1057 settings = $this.data(self.data_attr(true) + '-init') || self.settings; 1058 } 1059 else { 1060 var target = S('[' + self.attr_name() + '="' + S(this).attr('id') + '"]'), 1061 settings = target.data(self.attr_name(true) + '-init') || self.settings; 1062 } 1063 1064 self.timeout = setTimeout(function () { 1065 if ($this.data(self.data_attr())) { 1066 if (settings.is_hover) self.close.call(self, S('#' + $this.data(self.data_attr()))); 1067 } else { 1068 if (settings.is_hover) self.close.call(self, $this); 1069 } 1070 }.bind(this), settings.hover_timeout); 1071 }) 1072 .on('click.fndtn.dropdown', function (e) { 1073 var parent = S(e.target).closest('[' + self.attr_name() + '-content]'); 1074 var links = parent.find('a'); 1075 1076 if (links.length > 0 && parent.attr('aria-autoclose') !== "false") { 1077 self.close.call(self, S('[' + self.attr_name() + '-content]')); 1078 } 1079 1080 if (e.target !== document && !$.contains(document.documentElement, e.target)) { 1081 return; 1082 } 1083 1084 if (S(e.target).closest('[' + self.attr_name() + ']').length > 0) { 1085 return; 1086 } 1087 1088 if (!(S(e.target).data('revealId')) && 1089 (parent.length > 0 && (S(e.target).is('[' + self.attr_name() + '-content]') || 1090 $.contains(parent.first()[0], e.target)))) { 1091 e.stopPropagation(); 1092 return; 1093 } 1094 1095 self.close.call(self, S('[' + self.attr_name() + '-content]')); 1096 }) 1097 .on('opened.fndtn.dropdown', '[' + self.attr_name() + '-content]', function () { 1098 self.settings.opened.call(this); 1099 }) 1100 .on('closed.fndtn.dropdown', '[' + self.attr_name() + '-content]', function () { 1101 self.settings.closed.call(this); 1102 }); 1103 1104 S(window) 1105 .off('.dropdown') 1106 .on('resize.fndtn.dropdown', self.throttle(function () { 1107 self.resize.call(self); 1108 }, 50)); 1109 1110 this.resize(); 1111 }, 1112 1113 close: function (dropdown) { 1114 var self = this; 1115 dropdown.each(function () { 1116 var original_target = $('[' + self.attr_name() + '=' + dropdown[0].id + ']') || $('aria-controls=' + dropdown[0].id+ ']'); 1117 original_target.attr('aria-expanded', 'false'); 1118 if (self.S(this).hasClass(self.settings.active_class)) { 1119 self.S(this) 1120 .css(Foundation.rtl ? 'right':'left', '-99999px') 1121 .attr('aria-hidden', 'true') 1122 .removeClass(self.settings.active_class) 1123 .prev('[' + self.attr_name() + ']') 1124 .removeClass(self.settings.active_class) 1125 .removeData('target'); 1126 1127 self.S(this).trigger('closed').trigger('closed.fndtn.dropdown', [dropdown]); 1128 } 1129 }); 1130 dropdown.removeClass('f-open-' + this.attr_name(true)); 1131 }, 1132 1133 closeall: function() { 1134 var self = this; 1135 $.each(self.S('.f-open-' + this.attr_name(true)), function() { 1136 self.close.call(self, self.S(this)); 1137 }); 1138 }, 1139 1140 open: function (dropdown, target) { 1141 this 1142 .css(dropdown 1143 .addClass(this.settings.active_class), target); 1144 dropdown.prev('[' + this.attr_name() + ']').addClass(this.settings.active_class); 1145 dropdown.data('target', target.get(0)).trigger('opened').trigger('opened.fndtn.dropdown', [dropdown, target]); 1146 dropdown.attr('aria-hidden', 'false'); 1147 target.attr('aria-expanded', 'true'); 1148 dropdown.focus(); 1149 dropdown.addClass('f-open-' + this.attr_name(true)); 1150 }, 1151 1152 data_attr: function () { 1153 if (this.namespace.length > 0) { 1154 return this.namespace + '-' + this.name; 1155 } 1156 1157 return this.name; 1158 }, 1159 1160 toggle : function (target) { 1161 if (target.hasClass(this.settings.disabled_class)) { 1162 return; 1163 } 1164 var dropdown = this.S('#' + target.data(this.data_attr())); 1165 if (dropdown.length === 0) {
1166 // No dropdown found, not continuing 1167 return; 1168 } 1169 1170 this.close.call(this, this.S('[' + this.attr_name() + '-content]').not(dropdown)); 1171 1172 if (dropdown.hasClass(this.settings.active_class)) { 1173 this.close.call(this, dropdown); 1174 if (dropdown.data('target') !== target.get(0)) 1175 this.open.call(this, dropdown, target); 1176 } else { 1177 this.open.call(this, dropdown, target); 1178 } 1179 }, 1180 1181 resize : function () { 1182 var dropdown = this.S('[' + this.attr_name() + '-content].open'), 1183 target = this.S('[' + this.attr_name() + '="' + dropdown.attr('id') + '"]'); 1184 1185 if (dropdown.length && target.length) { 1186 this.css(dropdown, target); 1187 } 1188 }, 1189 1190 css : function (dropdown, target) { 1191 var left_offset = Math.max((target.width() - dropdown.width()) / 2, 8), 1192 settings = target.data(this.attr_name(true) + '-init') || this.settings; 1193 1194 this.clear_idx(); 1195 1196 if (this.small()) { 1197 var p = this.dirs.bottom.call(dropdown, target, settings); 1198 1199 dropdown.attr('style', '').removeClass('drop-left drop-right drop-top').css({ 1200 position : 'absolute', 1201 width: '95%', 1202 'max-width': 'none', 1203 top: p.top 1204 }); 1205 1206 dropdown.css(Foundation.rtl ? 'right':'left', left_offset); 1207 } else { 1208 1209 this.style(dropdown, target, settings); 1210 } 1211 1212 return dropdown; 1213 }, 1214 1215 style : function (dropdown, target, settings) { 1216 var css = $.extend({position: 'absolute'}, 1217 this.dirs[settings.align].call(dropdown, target, settings)); 1218 1219 dropdown.attr('style', '').css(css); 1220 }, 1221 1222 // return CSS property object 1223 // `this` is the dropdown 1224 dirs : { 1225 // Calculate target offset 1226 _base : function (t) { 1227 var o_p = this.offsetParent(), 1228 o = o_p.offset(), 1229 p = t.offset(); 1230 1231 p.top -= o.top; 1232 p.left -= o.left; 1233 1234 //set some flags on the p object to pass along 1235 p.missRight = false; 1236 p.missTop = false; 1237 p.missLeft = false; 1238 p.leftRightFlag = false; 1239 1240 //lets see if the panel will be off the screen 1241 //get the actual width of the page and store it 1242 var actualBodyWidth; 1243 if (document.getElementsByClassName('row')[0]) { 1244 actualBodyWidth = document.getElementsByClassName('row')[0].clientWidth; 1245 } else { 1246 actualBodyWidth = window.outerWidth; 1247 } 1248 1249 var actualMarginWidth = (window.outerWidth - actualBodyWidth) / 2; 1250 var actualBoundary = actualBodyWidth; 1251 1252 if (!this.hasClass('mega')) { 1253 //miss top 1254 if (t.offset().top <= this.outerHeight()) { 1255 p.missTop = true; 1256 actualBoundary = window.outerWidth - actualMarginWidth; 1257 p.leftRightFlag = true; 1258 } 1259 1260 //miss right 1261 if (t.offset().left + this.outerWidth() > t.offset().left + actualMarginWidth && t.offset().left - actualMarginWidth > this.outerWidth()) { 1262 p.missRight = true; 1263 p.missLeft = false; 1264 } 1265 1266 //miss left 1267 if (t.offset().left - this.outerWidth() <= 0) { 1268 p.missLeft = true; 1269 p.missRight = false; 1270 } 1271 } 1272 1273 return p; 1274 }, 1275 1276 top: function (t, s) { 1277 var self = Foundation.libs.dropdown, 1278 p = self.dirs._base.call(this, t); 1279 1280 this.addClass('drop-top'); 1281 1282 if (p.missTop == true) { 1283 p.top = p.top + t.outerHeight() + this.outerHeight(); 1284 this.removeClass('drop-top'); 1285 } 1286 1287 if (p.missRight == true) { 1288 p.left = p.left - this.outerWidth() + t.outerWidth(); 1289 } 1290 1291 if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) { 1292 self.adjust_pip(this,t,s,p); 1293 } 1294 1295 if (Foundation.rtl) { 1296 return {left: p.left - this.outerWidth() + t.outerWidth(), 1297 top: p.top - this.outerHeight()}; 1298 } 1299 1300 return {left: p.left, top: p.top - this.outerHeight()}; 1301 }, 1302 1303 bottom: function (t,s) { 1304 var self = Foundation.libs.dropdown, 1305 p = self.dirs._base.call(this, t); 1306 1307 if (p.missRight == true) { 1308 p.left = p.left - this.outerWidth() + t.outerWidth(); 1309 } 1310 1311 if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) { 1312 self.adjust_pip(this,t,s,p); 1313 } 1314 1315 if (self.rtl) { 1316 return {left: p.left - this.outerWidth() + t.outerWidth(), top: p.top + t.outerHeight()}; 1317 } 1318 1319 return {left: p.left, top: p.top + t.outerHeight()}; 1320 }, 1321 1322 left: function (t, s) { 1323 var p = Foundation.libs.dropdown.dirs._base.call(this, t); 1324 1325 this.addClass('drop-left'); 1326 1327 if (p.missLeft == true) { 1328 p.left = p.left + this.outerWidth(); 1329 p.top = p.top + t.outerHeight(); 1330 this.removeClass('drop-left'); 1331 } 1332 1333 return {left: p.left - this.outerWidth(), top: p.top};
1334 }, 1335 1336 right: function (t, s) { 1337 var p = Foundation.libs.dropdown.dirs._base.call(this, t); 1338 1339 this.addClass('drop-right'); 1340 1341 if (p.missRight == true) { 1342 p.left = p.left - this.outerWidth(); 1343 p.top = p.top + t.outerHeight(); 1344 this.removeClass('drop-right'); 1345 } else { 1346 p.triggeredRight = true; 1347 } 1348 1349 var self = Foundation.libs.dropdown; 1350 1351 if (t.outerWidth() < this.outerWidth() || self.small() || this.hasClass(s.mega_menu)) { 1352 self.adjust_pip(this,t,s,p); 1353 } 1354 1355 return {left: p.left + t.outerWidth(), top: p.top}; 1356 } 1357 }, 1358 1359 // Insert rule to style psuedo elements 1360 adjust_pip : function (dropdown,target,settings,position) { 1361 var sheet = Foundation.stylesheet, 1362 pip_offset_base = 8; 1363 1364 if (dropdown.hasClass(settings.mega_class)) { 1365 pip_offset_base = position.left + (target.outerWidth()/2) - 8; 1366 } 1367 else if (this.small()) { 1368 pip_offset_base += position.left - 8; 1369 } 1370 1371 this.rule_idx = sheet.cssRules.length; 1372 1373 //default 1374 var sel_before = '.f-dropdown.open:before', 1375 sel_after = '.f-dropdown.open:after', 1376 css_before = 'left: ' + pip_offset_base + 'px;', 1377 css_after = 'left: ' + (pip_offset_base - 1) + 'px;'; 1378 1379 if (position.missRight == true) { 1380 pip_offset_base = dropdown.outerWidth() - 23; 1381 sel_before = '.f-dropdown.open:before', 1382 sel_after = '.f-dropdown.open:after', 1383 css_before = 'left: ' + pip_offset_base + 'px;', 1384 css_after = 'left: ' + (pip_offset_base - 1) + 'px;'; 1385 } 1386 1387 //just a case where right is fired, but its not missing right 1388 if (position.triggeredRight == true) { 1389 sel_before = '.f-dropdown.open:before', 1390 sel_after = '.f-dropdown.open:after', 1391 css_before = 'left:-12px;', 1392 css_after = 'left:-14px;'; 1393 } 1394 1395 if (sheet.insertRule) { 1396 sheet.insertRule([sel_before, '{', css_before, '}'].join(' '), this.rule_idx); 1397 sheet.insertRule([sel_after, '{', css_after, '}'].join(' '), this.rule_idx + 1); 1398 } else { 1399 sheet.addRule(sel_before, css_before, this.rule_idx); 1400 sheet.addRule(sel_after, css_after, this.rule_idx + 1); 1401 } 1402 }, 1403 1404 // Remove old dropdown rule index 1405 clear_idx : function () { 1406 var sheet = Foundation.stylesheet; 1407 1408 if (typeof this.rule_idx !== 'undefined') { 1409 sheet.deleteRule(this.rule_idx); 1410 sheet.deleteRule(this.rule_idx); 1411 delete this.rule_idx; 1412 } 1413 }, 1414 1415 small : function () { 1416 return matchMedia(Foundation.media_queries.small).matches && 1417 !matchMedia(Foundation.media_queries.medium).matches; 1418 }, 1419 1420 off: function () { 1421 this.S(this.scope).off('.fndtn.dropdown'); 1422 this.S('html, body').off('.fndtn.dropdown'); 1423 this.S(window).off('.fndtn.dropdown'); 1424 this.S('[data-dropdown-content]').off('.fndtn.dropdown'); 1425 }, 1426 1427 reflow : function () {} 1428 }; 1429}(jQuery, window, window.document)); 1430 1431;(function ($, window, document, undefined) { 1432 'use strict'; 1433 1434 Foundation.libs.tab = { 1435 name : 'tab', 1436 1437 version : '{{VERSION}}', 1438 1439 settings : { 1440 active_class: 'active', 1441 callback : function () {}, 1442 deep_linking: false, 1443 scroll_to_content: true, 1444 is_hover: false 1445 }, 1446 1447 default_tab_hashes: [], 1448 1449 init : function (scope, method, options) { 1450 var self = this, 1451 S = this.S; 1452 1453 this.bindings(method, options); 1454 this.handle_location_hash_change(); 1455 1456 // Store the default active tabs which will be referenced when the 1457 // location hash is absent, as in the case of navigating the tabs and 1458 // returning to the first viewing via the browser Back button. 1459 S('[' + this.attr_name() + '] > .active > a', this.scope).each(function () { 1460 self.default_tab_hashes.push(this.hash); 1461 }); 1462 1463 // store the initial href, which is used to allow correct behaviour of the 1464 // browser back button when deep linking is turned on. 1465 self.entry_location = window.location.href; 1466 }, 1467 1468 events : function () { 1469 var self = this, 1470 S = this.S; 1471 1472 var usual_tab_behavior = function (e) { 1473 var settings = S(this).closest('[' + self.attr_name() +']').data(self.attr_name(true) + '-init'); 1474 if (!settings.is_hover || Modernizr.touch) { 1475 e.preventDefault(); 1476 e.stopPropagation(); 1477 self.toggle_active_tab(S(this).parent()); 1478 } 1479 }; 1480 1481 S(this.scope) 1482 .off('.tab') 1483 // Click event: tab title 1484 .on('focus.fndtn.tab', '[' + this.attr_name() + '] > * > a', usual_tab_behavior ) 1485 .on('click.fndtn.tab', '[' + this.attr_name() + '] > * > a', usual_tab_behavior ) 1486 // Hover event: tab title 1487 .on('mouseenter.fndtn.tab', '[' + this.attr_name() + '] > * > a', function (e) { 1488 var settings = S(this).closest('[' + self.attr_name() +']').data(self.attr_name(true) + '-init'); 1489 if (settings.is_hover) self.toggle_active_tab(S(this).parent()); 1490 }); 1491 1492 // Location hash change event 1493 S(window).on('hashchange.fndtn.tab', function (e) { 1494 e.preventDefault(); 1495 self.handle_location_hash_change(); 1496 }); 1497 }, 1498 1499 handle_location_hash_change : function () { 1500 1501 var self = this, 1502 S = this.S; 1503 1504 S('[' + this.attr_name() + ']', this.scope).each(function () { 1505 var settings = S(this).data(self.attr_name(true) + '-init'); 1506 if (settings.deep_linking) { 1507 // Match the location hash to a label 1508 var hash; 1509 if (settings.scroll_to_content) { 1510 hash = self.scope.location.hash; 1511 } else { 1512 // prefix the hash to prevent anchor scrolling 1513 hash = self.scope.location.hash.replace('fndtn-', ''); 1514 } 1515 if (hash != '') { 1516 // Check whether the location hash references a tab content div or 1517 // another element on the page (inside or outside the tab content div) 1518 var hash_element = S(hash); 1519 if (hash_element.hasClass('content') && hash_element.parent().hasClass('tabs-content')) { 1520 // Tab content div 1521 self.toggle_active_tab($('[' + self.attr_name() + '] > * > a[href=' + hash + ']').parent()); 1522 } else { 1523 // Not the tab content div. If inside the tab content, find the 1524 // containing tab and toggle it as active. 1525 var hash_tab_container_id = hash_element.closest('.content').attr('id'); 1526 if (hash_tab_container_id != undefined) { 1527 self.toggle_active_tab($('[' + self.attr_name() + '] > * > a[href=#' + hash_tab_container_id + ']').parent(), hash); 1528 } 1529 } 1530 } else { 1531 // Reference the default tab hashes which were initialized in the init function 1532 for (var ind = 0; ind < self.default_tab_hashes.length; ind++) { 1533 self.toggle_active_tab($('[' + self.attr_name() + '] > * > a[href=' + self.default_tab_hashes[ind] + ']').parent()); 1534 } 1535 } 1536 } 1537 }); 1538 }, 1539 1540 toggle_active_tab: function (tab, location_hash) { 1541 var self = this, 1542 S = self.S, 1543 tabs = tab.closest('[' + this.attr_name() + ']'), 1544 tab_link = tab.find('a'), 1545 anchor = tab.children('a').first(), 1546 target_hash = '#' + anchor.attr('href').split('#')[1], 1547 target = S(target_hash), 1548 siblings = tab.siblings(), 1549 settings = tabs.data(this.attr_name(true) + '-init'), 1550 interpret_keyup_action = function(e) { 1551 // Light modification of Heydon Pickering's Practical ARIA Examples: http://heydonworks.com/practical_aria_examples/js/a11y.js 1552 1553 // define current, previous and next (possible) tabs 1554 1555 var $original = $(this); 1556 var $prev = $(this).parents('li').prev().children('[role="tab"]'); 1557 var $next = $(this).parents('li').next().children('[role="tab"]'); 1558 var $target; 1559 1560 // find the direction (prev or next) 1561 1562 switch (e.keyCode) { 1563 case 37: 1564 $target = $prev; 1565 break; 1566 case 39: 1567 $target = $next; 1568 break; 1569 default: 1570 $target = false 1571 break; 1572 } 1573 1574 if ($target.length) { 1575 $original.attr({ 1576 'tabindex' : '-1', 1577 'aria-selected' : null 1578 }); 1579 $target.attr({ 1580 'tabindex' : '0', 1581 'aria-selected' : true 1582 }).focus(); 1583 } 1584 1585 // Hide panels 1586 1587 $('[role="tabpanel"]') 1588 .attr('aria-hidden', 'true'); 1589 1590 // Show panel which corresponds to target 1591 1592 $('#' + $(document.activeElement).attr('href').substring(1)) 1593 .attr('aria-hidden', null); 1594 1595 }, 1596 go_to_hash = function(hash) { 1597 // This function allows correct behaviour of the browser's back button when deep linking is enabled. Without it 1598 // the user would get continually redirected to the default hash. 1599 var is_entry_location = window.location.href === self.entry_location, 1600 default_hash = settings.scroll_to_content ? self.default_tab_hashes[0] : 'fndtn-' + self.default_tab_hashes[0].replace('#', '') 1601 1602 if (!(is_entry_location && hash === default_hash)) { 1603 window.location.hash = hash; 1604 } 1605 }; 1606 1607 // allow usage of data-tab-content attribute instead of href 1608 if (S(this).data(this.data_attr('tab-content'))) { 1609 target_hash = '#' + S(this).data(this.data_attr('tab-content')).split('#')[1]; 1610 target = S(target_hash); 1611 } 1612 1613 if (settings.deep_linking) { 1614 1615 if (settings.scroll_to_content) { 1616 1617 // retain current hash to scroll to content 1618 go_to_hash(location_hash || target_hash); 1619 1620 if (location_hash == undefined || location_hash == target_hash) { 1621 tab.parent()[0].scrollIntoView(); 1622 } else { 1623 S(target_hash)[0].scrollIntoView(); 1624 } 1625 } else { 1626 // prefix the hashes so that the browser doesn't scroll down 1627 if (location_hash != undefined) { 1628 go_to_hash('fndtn-' + location_hash.replace('#', '')); 1629 } else { 1630 go_to_hash('fndtn-' + target_hash.replace('#', '')); 1631 } 1632 } 1633 } 1634 1635 // WARNING: The activation and deactivation of the tab content must 1636 // occur after the deep linking in order to properly refresh the browser 1637 // window (notably in Chrome). 1638 // Clean up multiple attr instances to done once 1639 tab.addClass(settings.active_class).triggerHandler('opened'); 1640 tab_link.attr({'aria-selected': 'true', tabindex: 0}); 1641 siblings.removeClass(settings.active_class) 1642 siblings.find('a').attr({'aria-selected': 'false', tabindex: -1}); 1643 target.siblings().removeClass(settings.active_class).attr({'aria-hidden': 'true', tabindex: -1}); 1644 target.addClass(settings.active_class).attr('aria-hidden', 'false').removeAttr('tabindex'); 1645 settings.callback(tab); 1646 target.triggerHandler('toggled', [tab]); 1647 tabs.triggerHandler('toggled', [target]); 1648 1649 tab_link.off('keydown').on('keydown', interpret_keyup_action ); 1650 }, 1651 1652 data_attr: function (str) { 1653 if (this.namespace.length > 0) { 1654 return this.namespace + '-' + str; 1655 } 1656 1657 return str; 1658 }, 1659 1660 off : function () {}, 1661 1662 reflow : function () {} 1663 }; 1664}(jQuery, window, window.document)); 1665 1666/*! 1667 * hoverIntent v1.8.0 // 2014.06.29 // jQuery v1.9.1+ 1668 * http://cherne.net/brian/resources/jquery.hoverIntent.html 1669 * 1670 * You may use hoverIntent under the terms of the MIT license. Basically that 1671 * means you are free to use hoverIntent as long as this header is left intact. 1672 * Copyright 2007, 2014 Brian Cherne 1673 */ 1674 1675/* hoverIntent is similar to jQuery's built-in "hover" method except that 1676 * instead of firing the handlerIn function immediately, hoverIntent checks 1677 * to see if the user's mouse has slowed down (beneath the sensitivity 1678 * threshold) before firing the event. The handlerOut function is only 1679 * called after a matching handlerIn. 1680 * 1681 * // basic usage ... just like .hover() 1682 * .hoverIntent( handlerIn, handlerOut ) 1683 * .hoverIntent( handlerInOut ) 1684 * 1685 * // basic usage ... with event delegation! 1686 * .hoverIntent( handlerIn, handlerOut, selector ) 1687 * .hoverIntent( handlerInOut, selector ) 1688 * 1689 * // using a basic configuration object 1690 * .hoverIntent( config ) 1691 * 1692 * @param handlerIn function OR configuration object 1693 * @param handlerOut function OR selector for delegation OR undefined 1694 * @param selector selector OR undefined 1695 * @author Brian Cherne <brian(at)cherne(dot)net> 1696 */ 1697(function($) { 1698 $.fn.hoverIntent = function(handlerIn,handlerOut,selector) { 1699 1700 // default configuration values 1701 var cfg = { 1702 interval: 100, 1703 sensitivity: 6, 1704 timeout: 0 1705 }; 1706
1707 if ( typeof handlerIn === "object" ) { 1708 cfg = $.extend(cfg, handlerIn ); 1709 } else if ($.isFunction(handlerOut)) { 1710 cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } ); 1711 } else { 1712 cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } ); 1713 } 1714 1715 // instantiate variables 1716 // cX, cY = current X and Y position of mouse, updated by mousemove event 1717 // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval 1718 var cX, cY, pX, pY; 1719 1720 // A private function for getting mouse position 1721 var track = function(ev) { 1722 cX = ev.pageX; 1723 cY = ev.pageY; 1724 }; 1725 1726 // A private function for comparing current and previous mouse position 1727 var compare = function(ev,ob) { 1728 ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); 1729 // compare mouse positions to see if they've crossed the threshold 1730 if ( Math.sqrt( (pX-cX)*(pX-cX) + (pY-cY)*(pY-cY) ) < cfg.sensitivity ) { 1731 $(ob).off("mousemove.hoverIntent",track); 1732 // set hoverIntent state to true (so mouseOut can be called) 1733 ob.hoverIntent_s = true; 1734 return cfg.over.apply(ob,[ev]); 1735 } else { 1736 // set previous coordinates for next time 1737 pX = cX; pY = cY; 1738 // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs) 1739 ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval ); 1740 } 1741 }; 1742 1743 // A private function for delaying the mouseOut function 1744 var delay = function(ev,ob) { 1745 ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); 1746 ob.hoverIntent_s = false; 1747 return cfg.out.apply(ob,[ev]); 1748 }; 1749 1750 // A private function for handling mouse 'hovering' 1751 var handleHover = function(e) { 1752 // copy objects to be passed into t (required for event object to be passed in IE) 1753 var ev = $.extend({},e); 1754 var ob = this; 1755 1756 // cancel hoverIntent timer if it exists 1757 if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); } 1758 1759 // if e.type === "mouseenter" 1760 if (e.type === "mouseenter") { 1761 // set "previous" X and Y position based on initial entry point 1762 pX = ev.pageX; pY = ev.pageY; 1763 // update "current" X and Y position based on mousemove 1764 $(ob).on("mousemove.hoverIntent",track); 1765 // start polling interval (self-calling timeout) to compare mouse coordinates over time 1766 if (!ob.hoverIntent_s) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );} 1767 1768 // else e.type == "mouseleave" 1769 } else { 1770 // unbind expensive mousemove event 1771 $(ob).off("mousemove.hoverIntent",track); 1772 // if hoverIntent state is true, then call the mouseOut function after the specified delay 1773 if (ob.hoverIntent_s) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );} 1774 } 1775 }; 1776 1777 // listen for mouseenter and mouseleave 1778 return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector); 1779 }; 1780})(jQuery); 1781 1782jQuery(document).ready(function($) { 1783 $('.accordions h3').each(function() { 1784 var $this = $(this); 1785 // create unique id for a11y relationship 1786 var id = 'accordion-' + $this.index(); 1787 // wrap the content and make it focusable 1788 $this.nextUntil('h3').wrapAll('<div id="'+ id +'" aria-hidden="true">'); 1789 var panel = $this.next(); 1790 // Add the button inside the <h2> so both the heading and button semanics are read 1791 $this.wrapInner('<button aria-expanded="false" aria-controls="'+ id +'">'); 1792 var button = $this.children('button'); 1793 // Toggle the state properties 1794 button.on('click', function(e) { 1795 e.preventDefault(); 1796 var state = $(this).attr('aria-expanded') === 'false' ? true : false; 1797 $(this).attr('aria-expanded', state); 1798 $(this).parent('h3').toggleClass('is-active'); 1799 panel.attr('aria-hidden', !state); 1800 });
1801 }); 1802}); 1803/* 1804 * easyListSplitter 1.0.2 - jQuery Plugin 1805 * written by Andrea Cima Serniotti 1806 * http://www.madeincima.eu 1807 * 1808 * Copyright (c) 2010 Andrea Cima Serniotti (http://www.madeincima.eu) 1809 * Dual licensed under the MIT (MIT-LICENSE.txt) 1810 * and GPL (GPL-LICENSE.txt) licenses. 1811 * 1812 * Built for jQuery library 1813 * http://jquery.com 1814 * 1815 */ 1816 1817 /* 1818 To activate the plugin add the following code to your own js file: 1819 1820 $('.your-list-class-name').easyListSplitter({ 1821 colNumber: 3, 1822 direction: 'horizontal' 1823 }); 1824 1825 */ 1826 1827var j = 1; 1828 1829(function(jQuery) { 1830 jQuery.fn.easyListSplitter = function(options) { 1831 1832 var defaults = { 1833 colNumber: 2, // Insert here the number of columns you want. Consider that the plugin will create the number of cols requested only if there are enough items in the list. 1834 direction: 'vertical' 1835 }; 1836 1837 this.each(function() { 1838 1839 var obj = jQuery(this); 1840 var settings = jQuery.extend(defaults, options); 1841 var totalListElements = jQuery(this).children('li').size(); 1842 var baseColItems = Math.ceil(totalListElements / settings.colNumber); 1843 var listClass = jQuery(this).attr('class'); 1844 1845 // -------- Create List Elements given colNumber ------------------------------------------------------------------------------ 1846 1847 for (i=1;i<=settings.colNumber;i++) 1848 { 1849 if(i==1){ 1850 jQuery(this).addClass('listCol1').wrap('<div class="listContainer'+j+'"></div>'); 1851 } else if(jQuery(this).is('ul')){ // Check whether the list is ordered or unordered 1852 jQuery(this).parents('.listContainer'+j).append('<ul class="listCol'+i+'"></ul>'); 1853 } else{ 1854 jQuery(this).parents('.listContainer'+j).append('<ol class="listCol'+i+'"></ol>'); 1855 } 1856 jQuery('.listContainer'+j+' > ul,.listContainer'+j+' > ol').addClass(listClass); 1857 } 1858 1859 var listItem = 0; 1860 var k = 1; 1861 var l = 0; 1862 1863 if(settings.direction == 'vertical'){ // -------- Append List Elements to the respective listCol - Vertical ------------------------------- 1864 1865 jQuery(this).children('li').each(function(){ 1866 listItem = listItem+1; 1867 if (listItem > baseColItems*(settings.colNumber-1) ){ 1868 jQuery(this).parents('.listContainer'+j).find('.listCol'+settings.colNumber).append(this); 1869 } 1870 else { 1871 if(listItem<=(baseColItems*k)){ 1872 jQuery(this).parents('.listContainer'+j).find('.listCol'+k).append(this); 1873 } 1874 else{ 1875 jQuery(this).parents('.listContainer'+j).find('.listCol'+(k+1)).append(this); 1876 k = k+1; 1877 } 1878 } 1879 }); 1880 1881 jQuery('.listContainer'+j).find('ol,ul').each(function(){ 1882 if(jQuery(this).children().size() == 0) { 1883 jQuery(this).remove(); 1884 } 1885 }); 1886 1887 } else{ // -------- Append List Elements to the respective listCol - Horizontal ---------------------------------------------------------- 1888 1889 jQuery(this).children('li').each(function(){ 1890 l = l+1; 1891 1892 if(l <= settings.colNumber){ 1893 jQuery(this).parents('.listContainer'+j).find('.listCol'+l).append(this); 1894 1895 } else { 1896 l = 1; 1897 jQuery(this).parents('.listContainer'+j).find('.listCol'+l).append(this); 1898 } 1899 }); 1900 } 1901 1902 jQuery('.listContainer'+j).find('ol:last,ul:last').addClass('last'); // Set class last on the last UL or OL 1903 j = j+1; 1904 1905 }); 1906 }; 1907})(jQuery); 1908jQuery(document).ready(function($) { 1909 1910 // Need to change the image source of the mobile nav toggle button 1911 i=1; 1912 function changeImage(swap) { 1913 swap.click=++i; 1914 swap.src = ((swap.click)%2 == 0) ? "/Portals/_default/Skins/SangCounty2014/assets/img/mobile-menu.png" : "/Portals/_default/Skins/SangCounty2014/assets/img/mobile-menu-2.png"; 1915 //console.log(changeImage + swap.src); 1916 } 1917 1918 // Drop selects 1919 if (!$('body').hasClass('dnnEditState')) { 1920 $('body').click(function() { 1921 $('ul#drop-select').removeClass('open'); 1922 $('ul#drop-select > li:not(:first-child)').hide(); 1923 }); 1924 $('ul').removeClass('no-js'); 1925 $(function(){ 1926 $('ul#drop-select').click(function (e) { 1927 var $this = $(this); 1928 if ($this.hasClass('open')) { 1929 $this.removeClass('open'); 1930 $('> li:not(:first-child)', $this).hide(); 1931 } else { 1932 var $others = $('ul#drop-select').not($this); 1933 $others.removeClass('open'); 1934 $('> li:not(:first-child)', $others).hide(); 1935 1936 $this.addClass('open'); 1937 $('> li:not(:first-child)', $this).show(); 1938 } 1939 e.stopPropagation(); 1940 }); 1941 });
1942 } 1943 1944 // Open Program Areas by default 1945 $('.sidebar .a2:contains(Program Areas)').siblings('ul').css('display', 'block'); 1946 $('.sidebar .a2:contains(Meetings)').siblings('ul').css('display', 'block'); 1947 1948 // Expand Secondary menu level 1949 $(function() { 1950 var isActive = true; 1951 $('.right-off-canvas-menu .li1 span').click(function() { 1952 if (isActive) { 1953 $(this).parent().addClass('open'); 1954 $(this).next('.ul2').slideDown('fast'); 1955 isActive = false; 1956 } else { 1957 $(this).parent().removeClass('open'); 1958 $(this).next('.ul2').slideUp('fast'); 1959 isActive = true; 1960 } 1961 }); 1962 }); 1963 // Place any jQuery/helper plugins in here. 1964 $(window).load(function() { 1965 /* $('.nav .li1').hoverIntent(function () { 1966 $('.div2', this).slideToggle(200); 1967 }); */ 1968 $('img[longdesc]').each(function() { 1969 var title = $(this).attr('title'); 1970 var longdesc = $(this).attr('longdesc'); 1971 var alt = $(this).attr('alt'); 1972 var imgsize = $(this).css('width'); 1973 $(this).wrap('<div class="caption"></div>').after('<em>' + longdesc + '</em>'); 1974 }); 1975 //For Mega Menu 1976 $('.ul2 .li2:nth-child(4n+4)').after('<li class="li2 clear"></li>'); 1977 // $('.li1.I.Want.To .div2 .ul2').easyListSplitter({ 1978 // colNumber: 5, 1979 // direction: 'horizontal' 1980 // }); 1981 // $('.li1.E-Government .div2 .ul2').easyListSplitter({ 1982 // colNumber: 4, 1983 // direction: 'vertical' 1984 // }); 1985 // $('.li1.Courts .div2 .ul2').easyListSplitter({ 1986 // colNumber: 4, 1987 // direction: 'vertical' 1988 // }); 1989 // $('.li1.Property.Info .div2 .ul2').easyListSplitter({ 1990 // colNumber: 4, 1991 // direction: 'vertical' 1992 // }); 1993 // $('.li1.County.Board .div2 .ul2').easyListSplitter({ 1994 // colNumber: 4, 1995 // direction: 'vertical' 1996 // }); 1997 // $('.li1.Elected.Offices .div2 .ul2').easyListSplitter({ 1998 // colNumber: 4, 1999 // direction: 'vertical' 2000 // }); 2001 // $('.li1.Departments .div2 .ul2').easyListSplitter({ 2002 // colNumber: 4, 2003 // direction: 'vertical' 2004 // }); 2005 $('#govt_trans .ul1').easyListSplitter({ 2006 colNumber: 3, 2007 direction: 'vertical' 2008 }); 2009 /* Add span tag for menu toggle */ 2010 $('ul.panel.selected .li2.haschildren').append("<span></span>"); 2011 /* Expand Menu for section */ 2012 $('ul.panel.selected .li2.haschildren.selected span').addClass('open').prev().show(); 2013 /* Toggle menu and close any expanded menus */ 2014 $('ul.panel.selected .li2.haschildren span').click(function () { 2015 var btn = $(this); 2016 var menu = $(this).prev(); 2017 if (btn.hasClass('open')) { 2018 btn.removeClass('open'); 2019 menu.slideUp('fast'); 2020 } else { 2021 $('ul.panel.selected .li2.haschildren span').removeClass('open').prev().hide(); 2022 btn.addClass('open'); 2023 menu.slideDown('fast'); 2024 } 2025 }); 2026 }); 2027 2028}); 2029 2030//# sourceMappingURL=main.js.map 2031(function ($) { 2032 $.fn.menusKeyboard = function () { 2033 2034 var menus = $(this); 2035 var curr = menus.find(":focus"); 2036 var keyCode; 2037 var shiftKey; 2038 var role ; 2039 var clickdisplay = menus.data("clickdisplay"); 2040 var keydown = false; 2041 2042 menus.children("li").each(function(){ 2043 if($(this).children("div").length){ 2044 $(this).addClass("dir"); 2045 } 2046 2047 }) 2048 2049 menus.attr("role","menubar"); 2050 menus.find("a").attr("role","menuitem"); 2051 2052 var delayPrimary = false; 2053 2054 function primaryMenuShow(i){ 2055 2056 2057 2058 i.addClass("menu_hover"); 2059 if(i.parent().hasClass(".dir")){ 2060 i.children("a").attr("aria-expanded","true"); 2061 } 2062 delayPrimary =setTimeout(function(){ 2063 var sub = i.children("div"); 2064 sub.stop().slideDown(); 2065 2066 /* if(sub.length){ 2067 if(sub.offset().left + sub.width() > $(window).width()){ 2068 i.addClass("reverse"); 2069 } 2070 } */ 2071 },200) 2072 2073 2074 // i.hasClass("dir") && m.clickdisplay && m.masklayer && mask.stop().fadeIn(); 2075 2076 } 2077 function primaryMenuHide(i){ 2078 if(i.length){ 2079 i.removeClass("menu_hover"); 2080 if(i.parent().hasClass(".dir")){
2081 i.children("a").attr("aria-expanded","false"); 2082 } 2083 2084 clearTimeout(delayPrimary); 2085 2086 i.children("div").stop().slideUp(function(){ 2087 // i.removeClass("reverse"); 2088 }); 2089 2090 2091 2092 2093 // i.hasClass("dir") && m.clickdisplay && m.masklayer && mask.stop().fadeOut(); 2094 } 2095 } 2096 2097 2098 2099 2100 menus.children("li").on("mouseenter",function () { 2101 primaryMenuHide(menus.children("li.menu_hover")); 2102 primaryMenuShow($(this)); 2103 }).on("mouseleave",function () { 2104 primaryMenuHide($(this)); 2105 }) 2106 2107 2108 function menusondownkey(e, key) { 2109 switch (key) { 2110 case 9: 2111 menusonfocus("tab"); 2112 break; 2113 case 13: 2114 case 32: 2115 if (curr.parent("li").hasClass("dir") && curr.siblings("div").is(":hidden")) { 2116 e.preventDefault(); 2117 menusonfocus("enter"); 2118 } 2119 break; 2120 case 37: 2121 e.preventDefault(); 2122 menusonfocus("left"); 2123 break; 2124 case 38: 2125 e.preventDefault(); 2126 menusonfocus("up"); 2127 break; 2128 case 39: 2129 e.preventDefault(); 2130 menusonfocus("right"); 2131 break; 2132 case 40: 2133 e.preventDefault(); 2134 menusonfocus("down"); 2135 break; 2136 case 27: 2137 e.preventDefault(); 2138 menusonfocus("end"); 2139 break; 2140 } 2141 2142 } 2143 2144 function menusonup() { 2145 if(role=="menubar" && curr.siblings("div").length){ 2146 2147 clickdisplay ? curr.parent().click():curr.parent().mouseenter(); 2148 2149 curr.siblings("div").find("a").last().focus(); 2150 2151 }else if(role=="menu"){ 2152 if (curr.parent("li").prev().length) { 2153 curr.parent("li").prev().children("a").focus(); 2154 } else { 2155 curr.parent("li").siblings().last().children("a").focus(); 2156 } 2157 } 2158 2159 } 2160 2161 function menusondown() { 2162 if(role=="menubar" && curr.siblings("div").length){ 2163 clickdisplay ? curr.parent().click():curr.parent().mouseenter(); 2164 curr.siblings("div").find("a").eq(0).focus(); 2165 }else if(role=="menu"){ 2166 if (curr.parent("li").next().length) { 2167 curr.parent("li").next().children("a").focus(); 2168 } else { 2169 curr.parent("li").siblings().first().children("a").focus(); 2170 } 2171 } 2172 2173 } 2174 2175 function menusonright() { 2176 if(role=="menubar"){ 2177 if (curr.parent("li").next().length) { 2178 curr.parent("li").next().children("a").focus(); 2179 } else { 2180 curr.parent("li").siblings().first().children("a").focus(); 2181 } 2182 clickdisplay && menus.trigger("blur"); 2183 }else if(role=="menu" && curr.siblings("div").length){ 2184 curr.parent().mouseenter(); 2185 curr.siblings("div").find("a").eq(0).focus(); 2186 } 2187 } 2188 2189 function menusonleft() { 2190 if(role=="menubar"){ 2191 if (curr.parent("li").prev().length) { 2192 curr.parent("li").prev().children("a").focus(); 2193 } else { 2194 curr.parent("li").siblings().last().children("a").focus(); 2195 } 2196 clickdisplay && menus.trigger("blur"); 2197 }else if(role=="menu"){ 2198 var p = curr.parent().parents("li.dir").first(); 2199 p.mouseleave().children("a").focus(); 2200 p.parents("li.dir").first().mouseenter(); 2201 } 2202 } 2203 2204 function menusonfocus(action) { 2205 switch (action) { 2206 case "first": 2207 menus.find("a").eq(0).focus(); 2208 break; 2209 case "down": 2210 menusondown(); 2211 break; 2212 case "up": 2213 menusonup(); 2214 break; 2215 case "right": 2216 menusonright(); 2217 break;
2218 case "left": 2219 menusonleft(); 2220 break; 2221 case "enter": 2222 curr.parent().mouseenter(); 2223 2224 break; 2225 case "end": 2226 curr.parents("li.dir").last().mouseenter().children("a").focus(); 2227 clickdisplay ? menus.trigger("blur"):curr.mouseleave(); 2228 drop = false; 2229 break; 2230 2231 curr = menus.find(":focus"); 2232 role = curr.parents("ul").first().attr("role"); 2233 /* if (curr.parents("ul").eq(0).hasClass("ul1")) { 2234 curr.parent().mouseleave(); 2235 } */ 2236 2237 } 2238 } 2239 2240 menus.on("keydown", function (e) { 2241 keyCode = e.keyCode || e.which || e.charCode; 2242 shiftKey = e.shiftKey; 2243 if (menus.find("a").is(":focus") || keyCode == 123) { 2244 //curr.mouseout(); 2245 curr = menus.find(":focus"); 2246 role = curr.parents("ul").first().attr("role"); 2247 if (shiftKey && keyCode == 123) { 2248 e.preventDefault(); 2249 menusonfocus("first"); 2250 } else if (shiftKey && keyCode == 9) { 2251 menusonfocus("backtab"); 2252 } else { 2253 menusondownkey(e, e.keyCode); 2254 } 2255 } 2256 keydown = true; 2257 }).on("keyup", function (e) { 2258 menus.find(":focus").parent().siblings("li.dir").children("div:visible").each(function(){ 2259 $(this).parent("li.dir").mouseleave(); 2260 $(this).parent("li.dir").parents("li.dir").first().mouseenter(); 2261 clickdisplay && menus.trigger("blur"); 2262 }) 2263 keydown = false; 2264 }).find("a").on("blur",function(){ 2265 if(!menus.is(":focus-within") && keydown){ 2266 menus.children("li.menu_hover").eq(0).mouseleave(); 2267 } 2268 keydown = false; 2269 }); 2270 2271 }; 2272 2273 jQuery(document).ready(function() { 2274 $(".nav .ul1.inline-list").data("clickdisplay",false).menusKeyboard(); 2275 }); 2276 2277})(jQuery); 2278 2279 2280//# sourceMappingURL=main.js.map 2281(function ($) { 2282 $.fn.menusKeyboard2 = function () { 2283 2284 var menus = $(this); 2285 var curr = menus.find(":focus"); 2286 var keyCode; 2287 var shiftKey; 2288 var role ; 2289 var clickdisplay = menus.data("clickdisplay"); 2290 var keydown = false; 2291 2292 menus.children("li").each(function(){ 2293 if($(this).children("div").length){ 2294 $(this).addClass("dir"); 2295 } 2296 2297 }) 2298 2299 menus.attr("role","menubar"); 2300 menus.find("a").attr("role","menuitem"); 2301 2302 2303 menus.on("mouseenter",function () { 2304 menus.find(".listContainer1").stop().slideDown(); 2305 }).on("mouseleave",function () { 2306 menus.find(".listContainer1").stop().slideUp(); 2307 }) 2308 2309 2310 menus.on("keydown", function (e) { 2311 keyCode = e.keyCode || e.which || e.charCode; 2312 shiftKey = e.shiftKey; 2313 if (menus.children("a").is(":focus") || keyCode == 123) { 2314 //curr.mouseout(); 2315 curr = menus.find(":focus"); 2316 role = curr.parents("ul").first().attr("role"); 2317 console.log(keyCode) 2318 if (shiftKey && keyCode == 123) { 2319 // e.preventDefault(); 2320 // menusonfocus("first"); 2321 } else if (shiftKey && keyCode == 9) { 2322 // menusonfocus("backtab"); 2323 } else if (keyCode == 13 || keyCode == 32) { 2324 // menusondownkey(e, e.keyCode); 2325 if (menus.find(".listContainer1").is(":hidden")) { 2326 e.preventDefault(); 2327 menus.find(".listContainer1").stop().slideDown(); 2328 } 2329 2330 } 2331 } else if (keyCode == 27) { 2332 // menusondownkey(e, e.keyCode); 2333 e.preventDefault(); 2334 menus.find(".listContainer1").stop().slideUp(); 2335 } 2336 2337 2338 keydown = true; 2339 })/* .on("keyup", function (e) { 2340 menus.find(":focus").parent().siblings("li.dir").children("div:visible").each(function(){
2341 $(this).parent("li.dir").mouseleave(); 2342 $(this).parent("li.dir").parents("li.dir").first().mouseenter(); 2343 clickdisplay && menus.trigger("blur"); 2344 }) 2345 keydown = false; 2346 })*/.find("a").on("blur",function(){ 2347 if(!menus.is(":focus-within") && keydown){ 2348 menus.find(".listContainer1").stop().slideUp(); 2349 } 2350 keydown = false; 2351 }); 2352 2353 }; 2354 2355 jQuery(document).ready(function() { 2356 $("#govt_trans").menusKeyboard2(); 2357 }); 2358 2359})(jQuery); 2360 2361 2362jQuery(document).ready(function() { 2363 $(".fc-prev-button").attr("aria-label","prev").attr("title","prev"); 2364 $(".fc-next-button").attr("aria-label","next").attr("title","next"); 2365})
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.