PageSourceSearch

https://www.nsws.gov.in/themes/sws/js/pages.js?v=9.2.3

js nsws.gov.in collected 2026-10-02 05:02:10 UTC 7,831 bytes, 257 lines download raw bytes

1(function ($, Drupal, window, document, drupalSettings) {
2  'use strict';
3  var executedOnce = false;
4  Drupal.behaviors.pages = {
5    attach: function (context, settings) {
6      // Function calls.
7      if (!executedOnce) {
8        activatePolicytab();
9        slickMultiDomain();
10        executedOnce = true;
11      }
12
13      // Add jquery tabs to faqs & website policies.
14      jQuery("#tabs, #tabs .tab-content").tabs();
15
16      //tab traverse in faqs page
17      jQuery(".content-li").attr("tabindex","0");
18      jQuery(".ui-icon").attr("tabindex","0");
19
20      //tab traverse in website-policies page
21       jQuery(".ui-tab").attr("tabindex","0");
22       jQuery(".ui-tabs-anchor").attr("tabindex","-1");
23
24        jQuery(".open").attr("tabindex","0");
25      // Make policy tab active on click of footer links.
26      function activatePolicytab() {
27        if (document.location.pathname == '/website-policies') {
28          jQuery("body a").on('click', function (e) {
29            var hashValue = this.hash;
30            if (hashValue) {
31              var target = 'a[href=\"' + hashValue + '\"]';
32              if (document.querySelector(target)) {
33                document.querySelector(target).click();
34                // Scroll to top.
35                scrollToTop();
36              }
37            }
38          });
39          scrollToTop();
40        }
41      }
42
43      // Scroll to top.
44      function scrollToTop() {
45        $('html, body').stop().animate({
46          'scrollTop': 0
47        }, 100, 'swing', function () { });
48      }
49
50      // Background image Lazy Load
51      if(jQuery('.contact-detail.lazy-background').length) {
52        var imageUrls = jQuery('.bg-lazyLoading').text();
53
54        // Changes in css class
55        function callback(mutationList, observer) {
56          mutationList.forEach(function (mutation) {
57            jQuery('.contact-detail.lazy-background.visible').css('background-image', imageUrls);
58          })
59        }
60        const contact = document.querySelector('.contact-detail.lazy-background');
61        const options = {attributes: true};
62        const observer = new MutationObserver(callback);
63        observer.observe(contact, options);
64      }
65      // Slick MultiDomain
66      function slickMultiDomain() {
67        var $slider = jQuery('#cover-slider');
68        if ($slider.length) {
69          var currentSlide;
70          var slidesCount;
71          var sliderCounter = document.createElement('div');
72          sliderCounter.classList.add('slider__counter');
73
74          var updateSliderCounter = function (slick, currentIndex) {
75            currentSlide = slick.slickCurrentSlide() + 1;
76            slidesCount = slick.slideCount;
77            if (slidesCount == 1) {
78              jQuery(".slider__counter").css("display", "none");
79            }
80            jQuery(sliderCounter).text(currentSlide + '/' + slidesCount)
81
82          };
83
84          $slider.on('init', function (event, slick) {
85            $slider.append(sliderCounter);
86            updateSliderCounter(slick);
87          });
88
89          $slider.on('afterChange', function (event, slick, currentSlide) {
90            updateSliderCounter(slick, currentSlide);
91          });
92
93          $slider.not('.slick-initialized').slick({
94            infinite: true,
95            slidesToShow: 1,
96            slidesToScroll: 1,
97            responsive: [
98              {
99                breakpoint: 991,
100                settings: {
101                  slidesToShow: 1,
102
103                }
104              },
105              {
106                breakpoint: 767,
107                settings: {
108                  slidesToShow: 1,
109                }
110              },
111              {
112                breakpoint: 555,
113                settings: {
114                  slidesToShow: 1,
115                }
116              }
117            ]
118          });
119        }
120
121        jQuery('#important-links').not('.slick-initialized').slick({
122          infinite: false,
123          slidesToShow: 3,
124          rows: 2,
125          slidesToScroll: 1,
126          responsive: [
127            {
128              breakpoint: 991,
129              settings: {
130                slidesToShow: 2,
131                slidesToScroll: 1,
132
133              }
134            },
135            {
136              breakpoint: 767,
137              settings: {
138                slidesToShow: 1,
139                slidesToScroll: 1,
140              }
141            },
142            {
143              breakpoint: 555,
144              settings: {
145                slidesToShow: 1,
146                slidesToScroll: 1,
147              }
148            }
149          ]
150        });
151
152        jQuery('#policies').not('.slick-initialized').slick({
153          infinite: false,
154          slidesToShow: 3,
155          slidesToScroll: 3,
156          rows: 2,
157          responsive: [
158            {
159              breakpoint: 991,
160              settings: {
161                slidesToShow: 2,
162                slidesToScroll: 2,
163
164              }
165            },
166            {
167              breakpoint: 767,
168              settings: {
169                slidesToShow: 2,
170                slidesToScroll: 2,
171              }
172            },
173            {
174              breakpoint: 555,
175              settings: {
176                slidesToShow: 1,
177                slidesToScroll: 1,
178              }
179            }
180          ]
181        });
182
183        jQuery('#contact-slick').not('.slick-initialized').slick({
184          infinite: false,
185          slidesToShow: 3,
186          slidesToScroll: 1,
187          responsive: [
188            {
189              breakpoint: 991,
190              settings: {
191                slidesToShow: 3,
192
193              }
194            },
195            {
196              breakpoint: 767,
197              settings: {
198                slidesToShow: 1,
199              }
200            },
201            {
202              breakpoint: 555,
203              settings: {
204                slidesToShow: 1,
205              }
206            }
207          ]
208        });
209        jQuery('#ministry-association .slick-slide > a,#cover-slider .slick-slide > a, #important-links .slick-slide > a, #policies .slick-slide > a, #contact-slick .slick-slide > a, #state-association .slick-slide > a, #central-department .slick-slide > a, #state-department .slick-slide > a').attr('target', '_blank');
210      }
211    },
212  };
213})(jQuery, Drupal, this, this.document, drupalSettings);
214
215jQuery(document).ready(function(){
216  //  About new js
217  if(jQuery('.page_node_about_us_new').length) {
218    var videoLink = jQuery(".file").text();
219    jQuery('.features .feature-video .play-btn').on('click', function () {
220      jQuery('.features .feature-video').append("<div class='cross-abt'></div><video id='video' class='video' controls autoplay preload='none' type='video/mp4'></video>");
221      jQuery('.features .feature-video .media').css("display", "none");
222      var video = document.getElementById('video');
223      var source = document.createElement('source');
224      source.setAttribute('src', videoLink);
225      video.appendChild(source);
226      jQuery('.features .feature-video .play-btn').css('display', 'none');
227    });
228    jQuery(document).on('click', '.feature-video .cross-abt', function () {
229      jQuery('.feature-video .video').trigger("pause");
230      jQuery('.features .feature-video .video,.features .feature-video .cross-abt').remove();
231      jQuery('.features .feature-video .media').css("display", "block");
232      jQuery('.features .feature-video .play-btn').css('display', 'block');
233    });
234    jQuery('.team-wrapper').slick({
235      infinite: false,
236      rows: 2,
237      slidesToScroll: 1,
238      slidesPerRow: 4,
239      responsive: [
240        {
241          breakpoint: 1199,
242          settings: {
243            slidesToScroll: 1,
244            slidesPerRow: 3,
245          }
246        },
247        {
248          breakpoint: 767,
249          settings: {
250            slidesToScroll: 1,
251            slidesPerRow: 2,
252          }
253        }
254      ]
255    });
256  }
257})

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.