1/** 2 * @file 3 * JS from Radix. 4 * 5 * To enable mouseover for menus, see code in oa_toolbar/js/oa_toolbar.js 6 */ 7(function ($, Drupal, window, document, undefined) { 8 // Allow dropdown links to be clickable by showing dropdowns on hover/focus. 9 Drupal.behaviors.radix_dropdown = { 10 attach: function(context, setting) { 11 $('.dropdown').once('radix-dropdown', function(){ 12 var dropdown = this; 13 14 // Helper function to show the dropdown. 15 function show() { 16 if (!$(dropdown).hasClass('open') && !$(dropdown).hasClass('radix-showing')) { 17 $(dropdown).addClass('radix-showing'); 18 $('>[data-toggle="dropdown"]', dropdown).trigger('click.bs.dropdown'); 19 $(dropdown).removeClass('radix-showing'); 20 } 21 } 22 23 // Helper function to hide the dropdown. 24 function hide() { 25 if ($(dropdown).hasClass('open')) { 26 $('>[data-toggle="dropdown"]', dropdown).trigger('click.bs.dropdown'); 27 } 28 } 29 30 // Show dropdown on hover and focus. 31 $(this).on('mouseenter.radix.dropdown', function(e) { 32 show(); 33 }); 34 $(this).on('mouseleave.radix.dropdown', function(e) { 35 hide(); 36 }); 37 $(this).on('focusin.radix.dropdown', function(e) { 38 if (typeof e.isSimulated == 'undefined') { 39 // don't trigger on simulated event, like when window gets focused 40 show(); 41 } 42 }); 43 $('body').once('radix-dropdown').on('focusout.radix.dropdown', function(e) { 44 var parent = $(e.target).closest('li.radix-dropdown-processed.open').get(0); 45 if (parent) { 46 // Defer to after all handlers so we can see where focus landed. 47 setTimeout(function () { 48 // Don't do anything if no element is focused - that can only 49 // happen with the mouse and this is meant to close the menu 50 // when the keyboard is used to change focus. 51 if (!document.activeElement || document.activeElement === document.body) { 52 return; 53 } 54 // Hide the parent if it doesn't contain the now focused element 55 // and is still open. 56 if (!parent.contains(document.activeElement) && $(parent).hasClass('open')) { 57 $(parent).trigger('click.bs.dropdown'); 58 } 59 }, 0); 60 } 61 }); 62 63 $(this).on('keydown.radix.dropdown', function(e) { 64 // Prevent up/down arrow from doing anything -- they conflict with 65 // using focus to show the dropdown, and the default Bootstrap keydown 66 // handler will trigger our click handler to visit the link. 67 if (e.keyCode == 38 || e.keyCode == 40) { 68 return false; 69 } 70 // Show/hide dropdown with spacebar. 71 if (e.keyCode == 32) { 72 $('>[data-toggle="dropdown"]', dropdown).trigger('click.bs.dropdown'); 73 return false; 74 } 75 // Hide the dropdown with the escape hey. 76 if (e.keyCode == 27) { 77 // Leave focus on the parent after it's hidden. 78 $('>[data-toggle="dropdown"]', dropdown).focus(); 79 hide(); 80 return false; 81 } 82 }); 83 84 // Allow a.dropdown-toggle to be clickable. 85 if ($(this).has('> a.dropdown-toggle')) { 86 $(this).on('click.radix.dropdown', function(e) { 87 var $target = $(e.target); 88 if ($target.parent().get(0) == dropdown && $target.is('a.dropdown-toggle') && $target.attr('href')) { 89 e.preventDefault(); 90 window.location.href = $target.attr('href'); 91 } 92 }); 93 } 94 }); 95 } 96 } 97 98 // Bootstrap tooltip. 99 Drupal.behaviors.radix_tooltip = { 100 attach: function(context, setting) { 101 if ($.fn.tooltip) { 102 $("[data-toggle='tooltip']").tooltip(); 103 } 104 } 105 } 106 107 // Bootstrap popover. 108 Drupal.behaviors.radix_popover = { 109 attach: function(context, setting) { 110 if ($.fn.popover) { 111 $("[data-toggle='popover']").popover(); 112 } 113 } 114 } 115 116 $(document).ready(function() { 117 // Show first tab by default. 118 // Ignore the "primary" tabs on the node edit page. 119 if ($.fn.tab) { 120 var tabs = $('.nav-tabs').not('.primary'); 121 tabs.children('li').first().find('a').tab('show'); 122 123 if (hash = window.location.hash) { 124 $('.nav-tabs > li > a[href$="' + hash + '"]').tab('show'); 125 } 126 } 127 }); 128})(jQuery, Drupal, this, this.document); 129; 130'use strict'; 131 132(function ($) { 133 $(document).ready(function () { 134 // Handle toolbar collapse. 135 $('.oa-navigation .btn-navbar-menu').click(function (e) { 136 e.preventDefault(); 137 var navMenuCollapse = $('.oa-navigation .nav-menu-collapse'); 138 var height = navMenuCollapse.height() == 0 ? 'auto' : 0; 139 navMenuCollapse.height(height); 140 }); 141 142 // adjust the position of the IPE buttons 143 var $ipe = $('#panels-ipe-control-container'); 144 if ($ipe.length) {
145 var $main = $('#main'); 146 var $element = $ipe.detach(); 147 $main.prepend($element); 148 } 149 150 var toggleLeft = $('.oa-responsive-regions-toggle-left:visible'); 151 if (toggleLeft.length > 0) { 152 $('body').addClass('oa-responsive-left'); 153 } 154 155 $(window).resize(function () { 156 // Fix for positioning of save button on modules page. 157 if ($('#module-filter-submit.fixed-bottom') && $('.oa-layout-footer')) { 158 $('html.js #module-filter-submit.fixed-bottom').css('bottom', $('.oa-layout-footer').outerHeight()); 159 } 160 }).resize(); 161 }); 162 163 Drupal.behaviors.oa_wysiwyg = { 164 attach: function attach(context, settings) { 165 // Tweak the WYSIWYG selector on text fields 166 $('.format-toggle', context).once("description-processed", function () { 167 var parent = $(this).parents('.text-format-wrapper'); 168 var hasLabel = parent.find('.form-type-textarea:visible label'); 169 var visible = hasLabel.is(':visible') && !hasLabel.hasClass('element-invisible'); 170 var hasDescription = parent.find('.description'); 171 if (hasDescription.length > 0) { 172 hasDescription.insertAfter(hasLabel); 173 } 174 if (visible) { 175 if (hasDescription.length > 0) { 176 $(this).insertAfter(hasDescription); 177 $(this).addClass('has-description'); 178 hasDescription.addClass('has-wysiwyg'); 179 $(this).css('top', hasDescription.height() - $(this).height() + 20 + 'px'); 180 } 181 } 182 }); 183 } 184 }; 185 186 Drupal.behaviors.fieldset_collapse = { 187 attach: function attach(context, settings) { 188 // allow chosen dropdowns within fieldsets to be visible 189 if ('chosen' in settings) { 190 var selector = settings.chosen.selector; 191 $(selector, context).not('#field-ui-field-overview-form select, #field-ui-display-overview-form select, .wysiwyg, .draggable select[name$="[weight]"], .draggable select[name$="[position]"]') //disable chosen on field ui 192 .each(function () { 193 $(this).parents('.panel-body.fieldset-wrapper, .form-item.form-type-select').first().addClass('chosen-fieldset-wrapper'); 194 }); 195 } 196 } 197 }; 198 199 if (Drupal.CTools && typeof Drupal.CTools.CollapsibleCallbacksAfterToggle != 'undefined') { 200 Drupal.CTools.CollapsibleCallbacksAfterToggle[Drupal.CTools.CollapsibleCallbacksAfterToggle.length] = function ($container, handle, content, toggle) { 201 // Older versions of jquery leave behind a overflow:hidden; 202 // @see https://www.drupal.org/node/2408807 203 if (content.css("overflow") == "hidden") { 204 content.css("overflow", ""); 205 } 206 }; 207 } 208 209 Drupal.behaviors.fixModulesButton = { 210 attach: function attach(context) { 211 $(window).resize(function () { 212 // Fix for positioning of save button on modules page. 213 if ($('#module-filter-submit.fixed-bottom') && $('.oa-layout-footer')) { 214 $('html.js #module-filter-submit.fixed-bottom').css('bottom', $('.oa-layout-footer').outerHeight()); 215 } 216 }); 217 } 218 }; 219 220 Drupal.behaviors.scrollingMenus = { 221 attach: function attach(context, settings) { 222 var viewport = null; 223 $('.oa_toolbar .dropdown-menu', context).not('.oa-no-scroll').once('oa-scroll', function () { 224 // Compute max height for menus to scroll 225 if (viewport === null) { 226 viewport = $(window).height(); 227 } 228 229 var $menu = $(this); 230 231 // Cannot compute top of hidden objects, so briefly show the menu 232 // This shouldn't cause flicker in most browsers these days. 233 // Also need to show any parent menus 234 if ($menu.parent().hasClass('dropdown-submenu')) { 235 $menu.parents('.dropdown-menu').css('display', 'block'); 236 } 237 $menu.css('display', 'block'); 238 var max_height = viewport - $menu.offset().top - 20; 239 $menu.css('display', ''); 240 if ($menu.parent().hasClass('dropdown-submenu')) { 241 $menu.parents('.dropdown-menu').css('display', ''); 242 } 243 $menu.css('max-height', max_height + 'px'); 244 }); 245 } 246 }; 247})(jQuery); 248//# sourceMappingURL=oa_basetheme.script.min.js.map 249; 250'use strict'; 251 252/** 253 * @file 254 * Custom scripts for theme. 255 */ 256(function ($) { 257 Drupal.behaviors.hideEmptyPanes = { 258 attach: function attach(context, settings) { 259 $('#main-wrapper .panel-pane, .pane-pane-oa-form-actions', context).each(function () { 260 // Look for empty panels that also don't contain input fields 261 // Action Network embed widgets, images, or iframes 262 // (input fields don't generate text() 263 if ($(this).find('input,img,iframe,.geofieldMap,[id^="can"]').length == 0 && $(this).text().trim().length == 0) { 264 $(this).css('display', 'none'); 265 } 266 }); 267 // Check the edit panel at bottom AFTER we have done the above hiding 268 $('.pane-oa-edit-minipanel .radix-layouts-content', context).each(function () { 269 var text = $(this).find('.panel-pane:visible').text(); 270 if (text.trim().length == 0) { 271 $(this).css('display', 'none'); 272 } 273 }); 274 $('.oa-responsive-regions-toggle-left', context).each(function () { 275 $(this).bind('click', function () { 276 $('.navbar-tray').removeClass('active'); 277 }); 278 }); 279 } 280 }; 281 Drupal.behaviors.mobileNavAccordions = { 282 attach: function attach(context, settings) { 283 // Accordionate main menu subnav on mobile 284 $('.chapter-menu .pane-og-menu-single-menu .menu > li > .menu').each(function () { 285 $(this).before('<span class="subnav-trigger">+</span>'); 286 }); 287 $('.subnav-trigger').each(function () { 288 $(this).on('click', function () { 289 $(this).siblings('ul.menu').toggleClass('subnav-show'); 290 }); 291 }); 292 } 293 }; 294 Drupal.behaviors.fitVids = { 295 attach: function attach(context, settings) { 296 // Make videos resize responsively 297 $('#main-wrapper').fitVids({ 298 customSelector: 'iframe[src*="facebook.com\/plugins\/video.php"]' 299 }); 300 } 301 }; 302})(jQuery); 303'use strict'; 304 305/*global jQuery */ 306/*jshint browser:true */ 307/*! 308* FitVids 1.1 309*
310* Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com 311* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/ 312* Released under the WTFPL license - http://sam.zoy.org/wtfpl/ 313* 314*/ 315 316(function ($) { 317 318 "use strict"; 319 320 $.fn.fitVids = function (options) { 321 var settings = { 322 customSelector: null 323 }; 324 325 if (!document.getElementById('fit-vids-style')) { 326 // appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js 327 var head = document.head || document.getElementsByTagName('head')[0]; 328 var css = '.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}'; 329 var div = document.createElement('div'); 330 div.innerHTML = '<p>x</p><style id="fit-vids-style">' + css + '</style>'; 331 head.appendChild(div.childNodes[1]); 332 } 333 334 if (options) { 335 $.extend(settings, options); 336 } 337 338 return this.each(function () { 339 var selectors = ["iframe[src*='player.vimeo.com']", "iframe[src*='youtube.com']", "iframe[src*='youtube-nocookie.com']", "iframe[src*='kickstarter.com'][src*='video.html']", "object", "embed"]; 340 341 if (settings.customSelector) { 342 selectors.push(settings.customSelector); 343 } 344 345 var $allVideos = $(this).find(selectors.join(',')); 346 $allVideos = $allVideos.not("object object"); // SwfObj conflict patch 347 348 $allVideos.each(function () { 349 var $this = $(this); 350 if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { 351 return; 352 } 353 var height = this.tagName.toLowerCase() === 'object' || $this.attr('height') && !isNaN(parseInt($this.attr('height'), 10)) ? parseInt($this.attr('height'), 10) : $this.height(), 354 width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(), 355 aspectRatio = height / width; 356 if (!$this.attr('id')) { 357 var videoID = 'fitvid' + Math.floor(Math.random() * 999999); 358 $this.attr('id', videoID); 359 } 360 $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', aspectRatio * 100 + "%"); 361 $this.removeAttr('height').removeAttr('width'); 362 }); 363 }); 364 }; 365 // Works with either jQuery or Zepto 366})(window.jQuery || window.Zepto); 367//# sourceMappingURL=oa_kobol.script.min.js.map 368;
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.