PageSourceSearch

https://cadmusjournal.org/sites/all/themes/adaptivetheme/adaptivetheme/js/at-scripts.js?A

js cadmusjournal.org collected 2026-10-02 06:21:22 UTC 4,007 bytes, 126 lines download raw bytes

1// $Id: at-scripts.js,v 1.1.2.4 2010/03/17 00:57:51 jmburnz Exp $
2/**
3 * Insert WAI-ARIA Landmark Roles (Roles for Accessible Rich Internet Applications)
4 *
5 * http://www.w3.org/TR/2006/WD-aria-role-20060926/
6 * 
7 * Due to validation errors with WAI-ARIA roles we use JavaScript to 
8 * insert the roles. This is a stop-gap measure while the W3C sort 
9 * out the validator.
10 *
11 * This is a starting point, you can copy this and use it in your subtheme for more granular control.
12 */
13if (Drupal.jsEnabled) {
14  $(document).ready(function() {
15
16    // Set role=banner on #branding wrapper div.
17    $("#branding").attr("role","banner");
18
19    // Optionally set role=complementary
20    // Set role=complementary on #main-content blocks, sidebars and regions.
21    // $(".block").attr("role","complementary");
22
23    // Remove role=complementary from system blocks.
24    // $(".block-system, td.block, tr.region, td.region").removeAttr("role","complementary");
25
26    // Set role=main on #main-content div.
27    $("#main-content").attr("role","main");
28
29    // Set role=search on search block and box.
30    $("#search-theme-form, #search-block-form, #search-form").attr("role","search");
31
32    // Set role=contentinfo on the footer message.
33    $("#footer-message").attr("role","contentinfo");
34
35    // Set role=article on nodes.
36    // $(".article").attr("role","article");
37
38    // Set role=nav on navigation-like blocks.
39    $("#nav, .admin-panel, #breadcrumb, .block-menu, #block-user-1, .local-tasks").attr("role","navigation");
40  
41  });
42}
43
44/**
45 * Theme Settings
46 */
47// Breadcrumb settings
48$(document).ready( function() {
49  // Hide the breadcrumb details, if no breadcrumb.
50  $('#edit-breadcrumb-display-wrapper').change(
51    function() {
52      div = $('#div-breadcrumb-collapse');
53      if ($('#edit-breadcrumb-display').val() == 'no') {
54        div.slideUp('slow');
55      } else if (div.css('display') == 'none') {
56        div.slideDown('slow');
57      }
58    }
59  );
60  if ($('#edit-breadcrumb-display').val() == 'no') {
61    $('#div-breadcrumb-collapse').css('display', 'none');
62  }
63  
64  $('#edit-breadcrumb-title').change(
65    function() {
66      checkbox = $('#edit-breadcrumb-trailing');
67      if ($('#edit-breadcrumb-title').attr('checked')) {
68        checkbox.attr('disabled', 'disabled');
69      } else {
70        checkbox.removeAttr('disabled');
71      }
72    }
73  );
74  $('#edit-breadcrumb-title').change();
75});
76
77// Horizontal login block settings
78$(document).ready( function() {
79  $('#edit-horizontal-login-block-overlabel').attr('disabled', true);
80  $('#edit-horizontal-login-block').change(function() {
81    if ($(this).is(':checked')) {
82      $('#edit-horizontal-login-block-overlabel').attr('disabled', false);
83    } else {
84      $('#edit-horizontal-login-block-overlabel').attr('disabled', true);
85    }
86  }); 
87});
88
89/**
90 * In most instances this will be called using the built in theme settings.
91 * However, if you want to use this manually you can call this file
92 * in the info file and user the ready function e.g.:
93 * 
94 * This will set sidebars and the main content column all to equal height:
95 *  if (Drupal.jsEnabled) {
96 *    $(document).ready(function() {
97 *    $('#content-column, .sidebar').equalHeight();
98 *   });
99 *  }
100 *  
101 * This will set all blocks in regions (not sidebars) to equal height:
102 *  if (Drupal.jsEnabled) {
103 *    $(document).ready(function() {
104 *    $('#region-name .block-inner').equalHeight();
105 *   });
106 *  }
107 */
108jQuery.fn.equalHeight = function () {
109  var height = 0;
110  var maxHeight = 0;
111
112  // Store the tallest element's height
113  this.each(function () {
114    height = jQuery(this).outerHeight();
115    maxHeight = (height > maxHeight) ? height : maxHeight;
116  });
117
118  // Set element's min-height to tallest element's height
119  return this.each(function () {
120    var t = jQuery(this);
121    var minHeight = maxHeight - (t.outerHeight() - t.height());
122    var property = jQuery.browser.msie && jQuery.browser.version < 7 ? 'height' : 'min-height';
123    
124    t.css(property, minHeight + 'px');
125 });
126};

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.