PageSourceSearch

https://pmuy.gov.in/assets/js/custom.js

js pmuy.gov.in collected 2026-10-02 07:24:08 UTC 3,977 bytes, 134 lines download raw bytes

1$(".site-nav ul").append('<li id="language-container"><select name="language" id="language" class="form-control" onchange="myFunction()"><option value="en" selected>English</option><option value="hi" >हिंदी</option><option value="bn" >বাংলা </option><option value="pa" >ਪੰਜਾਬੀ </option><option value="kn" >ಕನ್ನಡ</option><option value="ml">മലയാളം</option><option value="ur">اردو</option><option value="te">తెలుగు</option><option value="or">ଓଡ଼ିଆ </option><option value="mr">मराठी</option><option value="gu">ગુજરાતી</option><option value="ta">தமிழ்</option><option value="as" >অসমীয়া</option></select></li>');
2
3function myFunction() {
4  var x =  document.getElementById("language").value;
5  if (x == "en")
6  {
7  xValue = ''
8  }
9  else{
10 xValue = '/'+ x
11  }
12  var url = xValue + document.location.pathname;
13  
14  window.open(url, "_self");
15}
16
17
18$('.hero-carousal').owlCarousel({
19  smartSpeed: 500,
20  items: 1,
21  margin: 0,
22  nav: true,
23  dots: true,
24    loop: 1,
25    rewind: 1,
26    autoplay: 1,
27    autoplayTimeout:5000
28});
29
30
31$('.marquee').marquee({
32  allowCss3Support: true,
33  pauseOnHover:true,
34  duration: 15000
35});
36
37
38$('.counter').counterUp({
39    delay: 10,
40    time: 2000
41});
42
43
44$(window).scroll(function(){
45  var sticky = $('.site-header'),
46      scroll = $(window).scrollTop();
47  if (scroll >= 100) sticky.addClass('fixed');
48  else sticky.removeClass('fixed');
49});
50
51
52$(document).on('click', 'a[href^="#"]', function(e) {
53    var id = $(this).attr('href');
54    var $id = $(id);
55    if ($id.length === 0) {
56        return;
57    }
58    e.preventDefault();
59    var pos = $id.offset().top;
60    $('body, html').animate({scrollTop: pos});
61});
62
63
64$('#nav').onePageNav({
65	currentClass: 'active',
66	changeHash: false,
67	scrollSpeed: 750,
68	scrollThreshold: 0.5,
69	filter: '',
70	easing: 'swing',
71});
72
73
74$('.mobClick').click(function(){
75  $(this).toggleClass('open');
76  $('body').toggleClass('navOpen');
77  $('.navOverlay').toggleClass('act');
78  $('.site-nav').toggleClass('act');
79});
80
81
82$('.site-nav > ul > li > a').click(function(){
83  $('.mobClick').removeClass('open');
84  $('body').removeClass('navOpen');
85  $('.navOverlay').removeClass('act');
86  $('.site-nav').removeClass('act');
87});
88
89
90(function() {
91  const FROM = "Pradhan Mantri Ujjwala Yojana 2.0";
92  const TO   = "Pradhan Mantri Ujjwala Yojana";
93  function replaceInTextNodes(root) {
94    const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT, {
95      acceptNode: node => node.nodeValue && node.nodeValue.indexOf(FROM) > -1
96        ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT
97    }, false);
98
99    const nodes = [];
100    let n;
101    while (n = walker.nextNode()) nodes.push(n);
102    nodes.forEach(t => {
103      t.nodeValue = t.nodeValue.split(FROM).join(TO);
104    });
105  }
106
107  function runOnce() {
108    replaceInTextNodes(document.body);
109  }
110
111  document.addEventListener("DOMContentLoaded", runOnce);
112  // observe dynamic changes
113  const observer = new MutationObserver(muts => {
114    muts.forEach(m => {
115      m.addedNodes && m.addedNodes.forEach(node => {
116        if (node.nodeType === 3) { // text node
117          if (node.nodeValue && node.nodeValue.indexOf(FROM) > -1) {
118            node.nodeValue = node.nodeValue.split(FROM).join(TO);
119          }
120        } else if (node.nodeType === 1) { // element
121          replaceInTextNodes(node);
122        }
123      });
124      // sometimes attributes or text of existing nodes change:
125      if (m.type === "characterData" && m.target.nodeValue && m.target.nodeValue.indexOf(FROM) > -1) {
126        m.target.nodeValue = m.target.nodeValue.split(FROM).join(TO);
127      }
128    });
129  });
130  observer.observe(document.body, { childList: true, subtree: true, characterData: true });
131
132  // fallback
133  setTimeout(runOnce, 800);
134})();

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.