PageSourceSearch

https://www.lawpreptutorial.com/blog/assets/js/custom.js?v=2.2

js lawpreptutorial.com collected 2026-09-28 12:33:21 UTC 9,869 bytes, 367 lines download raw bytes

1document.querySelectorAll('.tab-btn').forEach(btn => {
2    btn.addEventListener('click', function () {
3        document.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active'));
4        this.classList.add('active');
5    });
6});
7
8$('.recent-news-slider').slick({
9  dots: false,
10  infinite: true,
11  speed: 300,
12  slidesToShow: 2,
13  slidesToScroll: 2,
14	autoplay: true,
15  autoplaySpeed: 6000,
16  responsive: [
17    {
18      breakpoint: 1024,
19      settings: {
20        slidesToShow: 2,
21        slidesToScroll: 2,
22        infinite: true,
23        dots: false
24      }
25    },
26    {
27      breakpoint: 600,
28      settings: {
29        slidesToShow: 2,
30        slidesToScroll: 2
31      }
32    },
33    {
34      breakpoint: 480,
35      settings: {
36        slidesToShow: 1,
37        slidesToScroll: 1
38      }
39    }
40    // You can unslick at a given breakpoint now by adding:
41    // settings: "unslick"
42    // instead of a settings object
43  ]
44});
45
46$('.experts-slider').slick();
47$('.latest-post-slider').slick();
48
49
50document.addEventListener("DOMContentLoaded", function () {
51
52    function initScrollableTabs(navId, leftClass, rightClass, scrollAmount = 230) {
53
54        const nav = document.getElementById(navId);
55        const leftBtn = document.querySelector(leftClass);
56        const rightBtn = document.querySelector(rightClass);
57
58        if (!nav || !leftBtn || !rightBtn) return;
59
60        function updateArrows() {
61
62            const scrollLeft = nav.scrollLeft;
63            const maxScroll = nav.scrollWidth - nav.clientWidth;
64
65            // Left Arrow
66            if (scrollLeft <= 5) {
67                leftBtn.style.display = "none";
68            } else {
69                leftBtn.style.display = "flex";
70            }
71
72            // Right Arrow
73            if (scrollLeft >= maxScroll - 5) {
74                rightBtn.style.display = "none";
75            } else {
76                rightBtn.style.display = "flex";
77            }
78        }
79
80        // Right Click
81        rightBtn.addEventListener("click", function () {
82            nav.scrollBy({
83                left: scrollAmount,
84                behavior: "smooth"
85            });
86        });
87
88        // Left Click
89        leftBtn.addEventListener("click", function () {
90            nav.scrollBy({
91                left: -scrollAmount,
92                behavior: "smooth"
93            });
94        });
95
96        // Scroll Event
97        nav.addEventListener("scroll", updateArrows);
98
99        // Initial Load
100        updateArrows();
101
102        // Resize Support
103        window.addEventListener("resize", updateArrows);
104    }
105
106    // First Tabs
107    initScrollableTabs(
108        "cbNavScroll",
109        ".cb-left",
110        ".cb-right",
111        200
112    );
113
114    // Second Tabs
115    initScrollableTabs(
116        "examTabs",
117        "#leftArrow",
118        "#rightArrow",
119        180
120    );
121
122});
123
124
125
126$(document).ready(function(){
127  toc("en");
128});
129
130function toc(lng) {
131    var toc = document.getElementById("ToC_" + lng);
132    var headers = $(".content_" + lng).find("h2");
133    var tocList = "";
134
135    headers.each(function () {
136
137        let heading = $(this).text().trim();
138
139        // Skip empty headings
140        if (!heading) {
141            return;
142        }
143
144        let name = heading.replace(/ /g, "_");
145
146        $(this).attr("id", name);
147
148        tocList += `
149            <li class="cm-clat-item">
150                <a href="#${name}">
151                    ${heading}
152                    <i class="fa-solid fa-angle-right float-end mt-1 text-primary"></i>
153                </a>
154            </li>
155        `;
156    });
157
158    $(toc).html(tocList);
159}
160
161/*
162function toc_old(lng) {
163
164    var toc = document.getElementById("ToC_" + lng);
165    // var headers = $(".content_" + lng).children("h1,h2,h3,h4");
166    var headers = $(".content_" + lng).children("h2");
167    var tocList = "";
168
169    for (let i = 0; i < headers.length; i++) {
170
171        let heading = headers[i].innerText;
172
173        // Create ID
174        let name = heading.replace(/ /g, "_");
175
176        headers[i].id = name;
177
178        let tocEntry = `
179            <a href="#${name}">
180                ${heading}
181                <i class="fa-solid fa-angle-right float-end mt-1 text-primary"></i>
182            </a>
183        `;
184
185        tocList += `
186            <li class="cm-clat-item">
187                ${tocEntry}
188            </li>
189        `;
190    }
191
192    if (tocList != "") {
193        tocList = `
194            ${tocList}
195        `;
196
197        $(toc).html(tocList);
198    }
199}
200*/
201
202$(document).on("click",".enquiry_now_button",function(){
203	const enquiryData = JSON.parse(localStorage.getItem('enquiry_verified'));
204
205	if (
206		enquiryData &&
207		enquiryData.value === '1' &&
208		Date.now() <= enquiryData.expiry
209	) {
210		window.open($(this).data('file_url'), '_blank');
211		return;
212	}
213
214	// Expired hone par remove kar do
215	if (enquiryData && Date.now() > enquiryData.expiry) {
216		localStorage.removeItem('enquiry_verified');
217	}
218	
219
220	let $btn = $(this);
221	$('.modal').modal('hide');
222	$('.page_url').val(window.location.href);
223	$('.file_url').val($(this).data('file_url'));
224	$('.data_master').val($(this).attr('data-master'));
225	$('.event_name').val($(this).data('event_name'));
226	$('.page_name').val($(this).data('page_name'));
227	$('.enq_franchise_id').val($(this).data('franchise_id') !== undefined ? $(this).data('franchise_id') : 0);
228	$('.enq_course_id').val($(this).data('course_id') !== undefined ? $(this).data('course_id') : 0);
229	$('.enq_course_name').val($(this).data('course_name') !== undefined ? $(this).data('course_name') : "");
230	$(".enq_modal_main_category").closest('.input-form').removeClass('hide');
231	$('.modal_title_append').text($(this).text());
232	$('.cateID').val($('.categoryId').val());
233	if($(this).data('form-heading')){
234		$('.modal_title_append').text($(this).data('form-heading'));
235	}
236
237	if($(this).data('form-tagline')){
238		$('.modal_tagline_append').text($(this).data('form-tagline'));
239	}
240	
241	if($(this).data('form-thankyou')){
242		$('.thankyou_msg').val($(this).data('form-thankyou'));
243	}
244
245	form_message = "";
246	if($(this).data('form-message')){
247		form_message = $(this).data('form-message');
248	}
249	
250	if($(this).data('master')){
251		if($(this).data('master')==1){
252			$(".enq_modal_main_category").val('Law Entrance');
253			$(".enq_modal_main_category").change();
254			$(".enq_modal_main_category").closest('.input-form').addClass('hide');
255		}else if($(this).data('master')==2){
256			$(".enq_modal_main_category").val('Judiciary Exams');
257			$(".enq_modal_main_category").change();
258			$(".enq_modal_main_category").closest('.input-form').addClass('hide');
259		}
260	}else{
261		$(".enq_modal_main_category").val('')
262	}
263	
264	
265	let lead = localStorage.getItem('check_fees_lead');
266	if ($(this).data('event_name') === "Check Fees" && lead === "yes") {
267		$(".check_fees_show").removeClass("hide");
268		$(".check_fees_hide").addClass("hide");
269		
270		$(".mobile_two_btn").addClass("hide-mobile-important");
271	} else {		
272		$("#enquire_form_modal").modal('show');
273	}
274});
275
276
277$(document).on("click", ".blogBtn", function (e) {
278    e.preventDefault();
279
280    let enquiryVerified = localStorage.getItem('enquiry_verified');
281    let fileUrl = $(this).data('file_url') || $(this).attr('href');
282
283    // User already verified -> direct redirect
284    if (enquiryVerified === '1') {
285        window.open(fileUrl, '_blank');
286        return;
287    }
288
289    // Existing functionality
290    let $btn = $(this);
291
292    $('.modal').modal('hide');
293    $('.page_url').val(window.location.href);
294    $('.file_url').val(fileUrl);
295    $('.data_master').val($('.cb-breadcrumb .breadcrumb-item').eq(2).find('a').text());
296    $('.event_name').val('Blog Details Page Custom Button');
297    $('.page_name').val('Blog Details Page');
298    $('.enq_franchise_id').val($btn.data('franchise_id') || 0);
299    $('.enq_course_id').val($btn.data('course_id') || 0);
300    $('.enq_course_name').val($btn.data('course_name') || "");
301    $('.cateID').val($('.categoryId').val());
302
303    $(".enq_modal_main_category").closest('.input-form').removeClass('hide');
304
305    $('.modal_title_append').text('Register To Check!');
306    $('.modal_tagline_append').text('Get instant access to the resource, you are looking for…');
307    $('.thankyou_msg').text("The resource you are looking for is Not available as of now!... We will update the Resource soon…");
308    
309    $("#enquire_form_modal").modal('show');
310});
311	
312	
313
314$(document).ready(function() {
315	$(".mobile_menu").simpleMobileMenu({
316		onMenuLoad: function(menu) {
317			console.log(menu)
318			console.log("menu loaded")
319		},
320		onMenuToggle: function(menu, opened) {
321			console.log(opened)
322		},
323		"menuStyle": "slide"
324	});
325})
326
327 
328filterSelection("all")
329function filterSelection(c) {
330  var x, i;
331  x = document.getElementsByClassName("course-list-one");
332  if (c == "all") c = "";
333  for (i = 0; i < x.length; i++) {
334    w3RemoveClass(x[i], "show");
335    if (x[i].className.indexOf(c) > -1) w3AddClass(x[i], "show");
336  }
337}
338
339function w3AddClass(element, name) {
340  var i, arr1, arr2;
341  arr1 = element.className.split(" ");
342  arr2 = name.split(" ");
343  for (i = 0; i < arr2.length; i++) {
344    if (arr1.indexOf(arr2[i]) == -1) {element.className += " " + arr2[i];}
345  }
346}
347
348function w3RemoveClass(element, name) {
349  var i, arr1, arr2;
350  arr1 = element.className.split(" ");
351  arr2 = name.split(" ");
352  for (i = 0; i < arr2.length; i++) {
353    while (arr1.indexOf(arr2[i]) > -1) {
354      arr1.splice(arr1.indexOf(arr2[i]), 1);     
355    }
356  }
357  element.className = arr1.join(" ");
358}
359
360
361
362
363document.addEventListener('contextmenu', function (e) {
364    if (e.target.closest('.editorContent a')) {
365        e.preventDefault();
366    }
367});

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.