PageSourceSearch

https://dhule.gov.in/wp-content/plugins/awaas-accessibility/js/external.js

js dhule.gov.in collected 2026-10-02 21:19:52 UTC 15,569 bytes, 516 lines download raw bytes

1jQuery(document).ready(function ($) {
2  // adding status to gallery caption
3  jQuery(".flexslider .slide-caption").attr("role", "status");
4
5  // Adding aria-current to pegination active a
6  jQuery(".pegination ul li.current a").attr({ "aria-current": "page", "tabindex": "-1", "aria-disabled": "true" });
7  jQuery(".pegination ul li a").attr({ "tabindex": "0", "aria-disabled": "false" });
8
9
10  //Adding span to sitemap menu
11  jQuery(".sitemap-menu ul > li").append('<span aria-hidden="true"></span>');
12
13  //Breadcrumb add attribute current page
14  jQuery(".breadcrumbs").find("li").append('<em class="fa fa-angle-right" aria-hidden="true"></em>');
15  //Breadcrumb add attribute current page
16    jQuery(".breadcrumbs").find("li").last().addClass("current");
17    jQuery(".breadcrumbs").find("li.current").attr("aria-current", "page");
18
19  jQuery(".printShare ol li").attr("aria-hidden", "true");
20  jQuery(".vc_tta-panel-body .tableWrapperResponsive").attr("tabindex", "0");
21});
22
23// Public Utility Tabs js starts
24
25(function () {
26  'use strict';
27
28  let initialized = false;
29  const mq = window.matchMedia('(min-width: 640px)');
30  const FOCUSABLE = 'a, button, input, select, textarea';
31  //Adding role="none" on Tabs <li>
32  function normalizeLiRoles(container) {
33    container.querySelectorAll('.resp-tabs-list li').forEach(li => {
34      if (li.getAttribute('role') !== 'none') {
35        li.setAttribute('role', 'none');
36      }
37    });
38  }
39  // Set tab-content container focusable elements tabindex="0"
40  function restoreActivePanelTabindex(container) {
41    const panel = container.querySelector(
42      '.resp-tab-content.resp-tab-content-active'
43    );
44    if (!panel) return;
45
46    panel.querySelectorAll(FOCUSABLE).forEach(el => {
47      el.setAttribute('tabindex', '0');
48    });
49  }
50
51  function applyPatch(container) {
52    setTimeout(() => {
53      normalizeLiRoles(container);
54      restoreActivePanelTabindex(container);
55    }, 0);
56  }
57
58  function attachPatchHandlers(container) {
59    const tablist = container.querySelector('.resp-tabs-list');
60    if (!tablist) return;
61
62    const delayedPatch = () => applyPatch(container);
63
64    tablist.addEventListener('focusin', delayedPatch);
65    tablist.addEventListener('click', delayedPatch);
66    tablist.addEventListener('keydown', delayedPatch);
67  }
68
69  function init() {
70    if (initialized) return;
71    initialized = true;
72
73    document.querySelectorAll('.utilityTabContainer').forEach(container => {
74      attachPatchHandlers(container);
75      setTimeout(() => applyPatch(container), 50);
76    });
77  }
78
79  function destroy() {
80    initialized = false;
81
82  }
83
84  function check() {
85    mq.matches ? init() : destroy();
86  }
87
88  window.addEventListener('load', check);
89  mq.addEventListener('change', check);
90
91})();
92
93
94(function () {
95  'use strict';
96
97  let initialized = false;
98  const mq = window.matchMedia('(min-width: 640px)');
99  const FOCUSABLE = 'a, button, input, select, textarea';
100  let syncScheduled = false;
101
102  function normalizeStructure(container) {
103    container.querySelectorAll('.resp-tabs-list li').forEach(li => {
104      li.setAttribute('role', 'none');
105      li.removeAttribute('tabindex');
106      li.removeAttribute('aria-selected');
107      li.removeAttribute('aria-controls');
108    });
109
110    container.querySelectorAll('.resp-tabs-list li > button').forEach(btn => {
111      btn.setAttribute('role', 'tab');
112    });
113  }
114
115  function syncState(container) {
116    syncScheduled = false;
117
118    const tabs = container.querySelectorAll('.resp-tabs-list button[role="tab"]');
119    const panels = container.querySelectorAll('.resp-tab-content');
120
121    tabs.forEach(tab => {
122      const isActive = tab.closest('li')?.classList.contains('resp-tab-active');
123      tab.setAttribute('aria-selected', isActive ? 'true' : 'false');
124      tab.setAttribute('tabindex', isActive ? '0' : '-1');
125    });
126
127    panels.forEach(panel => {
128      const isActive = panel.classList.contains('resp-tab-content-active');
129      //   panel.setAttribute('aria-hidden', isActive ? 'false' : 'true');
130
131      panel.querySelectorAll(FOCUSABLE).forEach(el => {
132        el.setAttribute('tabindex', isActive ? '0' : '-1');
133      });
134    });
135  }
136
137  function scheduleSync(container) {
138    if (syncScheduled) return;
139    syncScheduled = true;
140    requestAnimationFrame(() => syncState(container));
141  }
142
143  function initKeyboard(container) {
144    const tabs = Array.from(
145      container.querySelectorAll('.resp-tabs-list button[role="tab"]')
146    );
147
148    tabs.forEach((tab, index) => {
149      tab.addEventListener('keydown', e => {
150        let i = null;
151
152        switch (e.key) {
153          case 'ArrowRight':
154          case 'ArrowDown': i = (index + 1) % tabs.length; break;
155          case 'ArrowLeft':
156          case 'ArrowUp': i = (index - 1 + tabs.length) % tabs.length; break;
157          case 'Home': i = 0; break;
158          case 'End': i = tabs.length - 1; break;
159
160          case 'Enter':
161          case ' ':
162            e.preventDefault();
163            tab.click();
164            scheduleSync(container);
165            return;
166
167          default:
168            return;
169        }
170
171        e.preventDefault();
172        tabs[i].focus();
173      });
174
175      tab.addEventListener('click', () => scheduleSync(container));
176    });
177  }
178
179  function enableTabIntoPanel(container) {
180    const tablist = container.querySelector('.resp-tabs-list');
181    if (!tablist) return;
182
183    tablist.addEventListener('keydown', e => {
184      if (e.key !== 'Tab' || e.shiftKey) return;
185
186      const activeTab = document.activeElement;
187      if (!activeTab.matches('[role="tab"][tabindex="0"]')) return;
188
189      const panel = container.querySelector('.resp-tab-content-active');
190      const first = panel?.querySelector(FOCUSABLE);
191      if (!first) return;
192
193      e.preventDefault();
194      first.focus();
195    });
196  }
197
198  function stabilize(container) {
199    setTimeout(() => scheduleSync(container), 0);
200  }
201
202  function attachStabilizers(container) {
203    const tablist = container.querySelector('.resp-tabs-list');
204    if (!tablist) return;
205
206    ['focusin', 'click', 'keydown'].forEach(evt =>
207      tablist.addEventListener(evt, () => stabilize(container))
208    );
209  }
210
211  function init() {
212    if (initialized) return;
213    initialized = true;
214
215    document.querySelectorAll('.utilityTabContainer').forEach(container => {
216      normalizeStructure(container);
217      initKeyboard(container);
218      enableTabIntoPanel(container);
219      stabilize(container);
220      attachStabilizers(container);
221    });
222  }
223
224  function destroy() {
225    initialized = false;
226  }
227
228  function check() {
229    mq.matches ? init() : destroy();
230  }
231
232  document.addEventListener('DOMContentLoaded', check);
233  mq.addEventListener('change', check);
234
235})();
236
237
238//  Public Utility Tabs js ends //
239
240jQuery(document).ready(function ($) {
241  $('ul.sub-menu ').each(function () {
242    if ($(this).children('li').length > 15) {
243      $(this).addClass('megamenu');
244    }
245  });
246
247  $('.icon-pdf.pdf-icon').attr('aria-hidden', 'true');
248});
249
250jQuery(document).ready(function ($) {
251  document.onkeydown = function (evt) {
252    evt = evt || window.event;
253    if (evt.keyCode == 27) {
254      jQuery(":focus").each(function () {
255        if (jQuery(this).parents('.wpb_column').next('div').length === 1) {
256          jQuery(this).parents('.wpb_column').next().find('a:first').focus();
257        }
258
259        if (jQuery(this).parents('.wpb_column').next('div').length === 0) {
260          // if (jQuery(this).parents('.vc_row').next('div').length === 0) {
261          //     jQuery('.footerMenu').find(':focusable').eq(0).focus();
262          // }
263          if (jQuery(this).parents('.vc_row').next('div').length === 1) {
264            jQuery(this).parents('.vc_row').next('div').find('a:first').focus();
265          }
266
267        }
268      });
269    }
270  };
271
272  //jQuery('body').addClass('show-focus-outlines');
273  document.addEventListener('keydown', function (e) {
274    if (e.keyCode === 9) {
275
276      jQuery('body').addClass('show-focus-outlines');
277
278    }
279
280  });
281
282  //jQuery('body').addClass('show-focus-outlines');
283  document.addEventListener('keydown', function (e) {
284    if (e.keyCode === 9) {
285      jQuery('body').addClass('show-focus-outlines');
286
287    }
288
289  });
290
291
292  document.addEventListener('mousedown', function (e) {
293    //e.preventDefault();
294    jQuery('body').removeClass('show-focus-outlines');
295  });
296
297  //header accessibility search show hide (safari)
298  jQuery("#accessibilityMenu li.searchbox a").click(function (e) {
299        e.preventDefault();
300        jQuery('.goiSearch').css("visibility", "visible");
301    });
302    jQuery('html').click(function (e) {
303        if (e.target.id == 'accessibilityMenu' || jQuery(e.target).parents('#accessibilityMenu').length > 0) { } else {
304            jQuery('.goiSearch').css("visibility", "hidden");
305        }
306    });
307
308  //search end
309
310  jQuery(".skip-to-content").click(function (e) {
311    e.preventDefault();
312    jQuery('#SkipContent').focus();
313  });
314
315  jQuery(".read-text").click(function (t) {
316    t.preventDefault();
317    jQuery('#show-description').focus();
318  });
319
320  //code for collaps/expand start
321  jQuery(".colspexp_header").click(function () {
322    jQuerycolspexp_header = jQuery(this);
323    jQuerycolspexp_content = jQuerycolspexp_header.next();
324    jQuerycolspexp_content.slideToggle(500, function () {
325      jQuerycolspexp_header.text(function () {
326        return jQuerycolspexp_content.is(":visible") ? "Hide Code" : "Show Code";
327      });
328    });
329
330  });
331  //code for collaps/expand end
332  //less than 4 column table layout fixed start
333  jQuery('table').each(function () {
334    var numCols = jQuery(this).find('tr')[0].cells.length
335    if (numCols < 4) {
336      jQuery(this).css('table-layout', 'fixed');
337    }
338  });
339  //less than 4 column table layout fixed end
340
341  //VC Tabs keyboard accessibility start
342  jQuery('.vc_tta-tabs-list').attr('role', 'tablist');
343  jQuery('.vc_tta-panel').attr('role', 'tabpanel');
344  jQuery('.vc_tta-tab a').attr('role', 'tab');
345
346  //Parmod code start
347  jQuery(".vc_tta-panels .vc_active").siblings().attr("hidden", true);
348  jQuery("li a[role='tab']").click(function () {
349    jQuery("li a[role='tab']").attr("hidden", false);
350    var tabpanid = jQuery(this).attr("aria-controls");
351    var tabpan = jQuery("#" + tabpanid);
352    jQuery("div[role='tabpanel']").attr("hidden", true);
353    tabpan.attr("hidden", false);
354  });
355
356  jQuery('[data-vc-tabs]').each(function () {
357    var id = jQuery(this).attr('href');
358    id = id.replace('#', '');
359    jQuery(this).attr('aria-controls', id);
360    if (jQuery(this).parent().hasClass('vc_active')) {
361      jQuery(this).attr('aria-selected', true)
362    } else {
363      jQuery(this).attr('aria-selected', false)
364    }
365  });
366  jQuery('[data-vc-tabs]').click(function () {
367    jQuery(this).parent().siblings().find('a').attr('aria-selected', false);
368    jQuery(this).attr('aria-selected', true);
369  });
370
371
372  $('ul.vc_tta-tabs-list li.vc_tta-tab').not(".vc_active").each(function () {
373    let jQueryToggleButtons = $(this).find('a');
374
375    jQueryToggleButtons.on('click.flexSetup', function () {
376
377      let flex = $(this).parents('.vc_tta-tabs-container')
378        .next('.vc_tta-panels-container').find('.vc_tta-panel' + jQueryToggleButtons.attr('href'))
379        .find('.flexslider');
380      if (flex.length > 0) {
381        flex.data('flexslider').setup();
382      }
383    });
384  });
385
386  let $tabAtags = null;
387  let $thisTab = null;
388
389  $('ul.vc_tta-tabs-list li.vc_tta-tab a').on('keyup', function (event) {
390
391    $thisTab = $(this);
392    let $thisTabParent = $thisTab.parent();
393    let $tabId = $thisTab.attr('href');
394    $tabAtags = $($tabId).find('.vc_tta-panel-body a');
395    let $tabsListATags = $thisTab.parents('.vc_tta-tabs-list').find('a');
396
397    $($tabId).find('a').removeAttr('tabindex');
398    $thisTab.removeAttr('tabindex');
399    $($tabId).find('a:last').off('focusout');
400    $thisTabParent.nextAll().find('a').attr('tabindex', -1);
401    $thisTabParent.prevAll().find('a').removeAttr('tabindex');
402
403    if ($tabsListATags.length == $tabsListATags.index($thisTab) + 1) {
404      let $activePrevSibling = $thisTabParent.siblings('li.vc_active');
405      if ($activePrevSibling.length > 0) {
406        let $visibleTab = $activePrevSibling.find('a').attr('href');
407        $($visibleTab).find('a').attr('tabindex', -1);
408      }
409    }
410
411    if ($tabAtags.length == 0 || !$($tabId).find('.vc_tta-panel-body').is(':visible')) {
412      $thisTab.parent().next('li').find('a').removeAttr('tabindex')
413    }
414
415  });
416  $('div.vc_tta-panel-body').on('keydown', 'a', function (event) {
417
418    let itemIndex = $tabAtags.index($(this)) + 1;
419    if ($tabAtags.length === itemIndex && event.key === 'Tab' && event.shiftKey === false) {
420      $(this).focusout(function () {
421        $thisTab.parent().next('li').find('a').focus();
422      })
423    }
424  })
425
426  $('div.vc_tta-panel-body').on('keyup', 'ul.flex-direction-nav a', function (event) {
427    if (event.key === 'Tab' && event.shiftKey === false) {
428      if ($(this).hasClass('flex-next')) {
429        $(this).css({ 'opacity': '0.7', 'right': '10px', 'text-align': 'center' });
430      }
430 else if ($(this).hasClass('flex-prev')) {
431        $(this).removeClass('flex-disabled').css({ 'opacity': '0.7', 'left': '10px', 'text-align': 'center' });
432      }
433    }
434  })
435  $('div.vc_tta-panel-body').on('keydown', 'ul.flex-direction-nav a', function (event) {
436    if (event.key === 'Tab' && event.shiftKey === false) {
437      $(this).removeAttr('style');
438    }
439  })
440
441  //Code for Public Utilities keyboard tab accessible
442
443  let $thisUtilityTab = null;
444  let $thisTabContentId = null;
445
446  $('ul.resp-tabs-list li').on('keyup', function (event) {
447
448    $thisUtilityTab = $(this);
449    let $thisTabParent = $thisUtilityTab.parent();
450    $thisTabContentId = $thisTabParent.attr('data');
451    let $tabAtags = $thisUtilityTab.parents('ul').find('a');
452    let $tabUtilityAtags = $('#' + $thisTabContentId).find('a:visible');
453
454    $thisTabParent.nextAll().find('a').attr('tabindex', -1);
455    $thisTabParent.prevAll().find('a').removeAttr('tabindex');
456
457    $('#' + $thisTabContentId).find('a:last').off('focusout');
458    $tabUtilityAtags.removeAttr('tabindex');
459    $thisUtilityTab.removeAttr('tabindex');
460
461    if ($tabAtags.length == $tabAtags.index($thisUtilityTab) + 1) {
462      let $activePrevSibling = $thisTabParent.siblings('li.resp-tab-active');
463
464      if ($activePrevSibling.length > 0) {
465        let $visibleTab = $activePrevSibling.attr('data');
466        $('#' + $visibleTab).find('a').attr('tabindex', -1);
467      }
468    }
469
470    if ($tabUtilityAtags.length == 0 || !$('#' + $thisTabContentId).is(':visible')) {
471      $thisTabParent.next('li').find('a').removeAttr('tabindex');
472    }
473
474  })
475  jQuery("ul.resp-tabs-list li").attr("role", "none");
476  $('div.resp-tabs-container').on('keydown', 'a:visible', function (event) {
477
478    let $thiATag = $(this);
479    let $tabUtilityAtags = $thiATag.parents('#' + $thisTabContentId).find('a:visible');
480    let itemIndex = $tabUtilityAtags.index($thiATag) + 1;
481    if ($tabUtilityAtags.length === itemIndex && event.key === 'Tab' && event.shiftKey === false) {
482      $(this).focusout(function () {
483        $thisUtilityTab.parent().next('li').find('a').focus();
484      })
485    }
486  })
487  //VC Tabs keyboard accessibility end
488
489});
490
491
492
493// Scroll back to top start
494jQuery(document).ready(function ($) {
495  var gototop = $("#gototop-btn");
496
497  $(window).scroll(function () {
498    if ($(window).scrollTop() > 200) {
499      gototop.addClass("show");
500    } else {
501      gototop.removeClass("show");
502    }
503  });
504
505  gototop.on("click", function (e) {
506    e.preventDefault();
507    $("html, body").animate({
508      scrollTop: 0
509    }, "300");
510  });
511});
512
513// Scroll back to top end
514
515
516

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.