PageSourceSearch

https://www.oliveboard.in/js/coursecommon.js?v=25

js oliveboard.in collected 2026-10-01 11:58:12 UTC 19,371 bytes, 555 lines download raw bytes

1// login signup
2$("#btn-loginsignup").on("click", function(){
3    showLoginRegister();
4});
5$(".btn-showloginregister").on("click", function(){
6    showLoginRegister();
7});
8function showLoginRegister(){
9    boxurl = "";
10    $("#display-register-text").html("Sign Up");
11    $(".errormsg").html("");
12    $("#modal-signup").addClass("is-active");
13    $("#course-uemail").focus();
14    showregloginpup = 0;
15}
16function showLoginRegisterwl(){
17    boxurl = "";
18    $("#display-register-text").html("Register for a Free Mock Test");
19    $(".errormsg").html("");
20    $("#modal-signup").addClass("is-active");
21    $("#course-uemail").focus();
22}
23
24function oblsModalClose(){
25    $("#modal-signup").removeClass("is-active");
26    $("#modal-login").removeClass("is-active");
27    $("#forgotpwd-group-abc").hide();
28    $("#success-msg-group").hide();
29    $("#obls-group2").css("display","flex");
30    $("#login-group-abc").css("display","flex");
31    $("#loginnext-group").hide();
32    $("#coursein").hide();
33    $("#coursein1").html("Next");
34    $("#coursein1").show();
35    //revert disable login email field
36    $("#course-email").attr("readonly", false);
37    $(".disable-loginemail").css("background-color","#FFF");
38    $("#course-email").css("background-color","#FFF");
39    //empty the success msg
40    $("#fpwd-success-msg-text").html(" ");
41    $("#fpwd-success-msg-title").html(" ");
42
43}
44$(".modal-obls-close").on("click", function(){
45    oblsModalClose();
46});
47$("#btn-show-modal-signup").on("click", function(){
48    $("#modal-login").removeClass("is-active");
49    $("#modal-signup").addClass("is-active");
50    $("#course-uemail").focus();
51});
52$(".btn-show-modal-login").on("click", function(){
53    $("#forgotpwd-group-abc").hide();
54    $("#login-group-abc").css("display","flex");
55    $("#modal-signup").removeClass("is-active");
56    $("#modal-login").addClass("is-active");
57    $("#course-email").focus();
58});
59$("#btn-show-modal-login_ei").on("click", function(){
60    $("#forgotpwd-group-abc").hide();
61    $("#login-group-abc").css("display","flex");
62    $("#modal-signup").removeClass("is-active");
63    $("#modal-login").addClass("is-active");
64    $("#course-email").focus();
65});
66
67
68$("#btn-show-modal-login").on("click", function(){
69    $("#forgotpwd-group-abc").hide();
70    $("#login-group-abc").css("display","flex");
71    $("#modal-signup").removeClass("is-active");
72    $("#modal-login").addClass("is-active");
73    $("#course-email").focus();
74});
75$(document).on('keydown', function(event) {
76    if (event.key == "Escape") {
77        oblsModalClose();
78     }
79});
80//dropdown
81$("#trigger-mitem").on("click", function(){
82    if($(this).hasClass("in")){
83        $("#dd-mitem-menu").slideUp("fast");
84        $(this).removeClass("in");
85
86    }else{
87        $("#dd-mitem-menu").slideDown("fast");
88        $(this).addClass("in");
89    }
90});
91$(document).on("click", function(e){
92    if ($(e.target).closest('#trigger-mitem').length === 0) {
93        $("#dd-mitem-menu").slideUp("fast");
94        $("#trigger-mitem").removeClass("in");
95    }
96});
97/* hamburger */
98$(window).on("load", function(){
99    $("#dmenu-catitems-2").css("display","flex");
100    $(".dmenu-catitems").hide();
101});
102$(".dmenu-main-header").on("click",function(){
103    var mid = $(this).attr("id").split("-");
104    var catid = mid[3];
105    $(".dmenu-catitems").hide();
106    $("#dmenu-catitems-"+catid).css("display","flex");
107
108});
109$("#ic-hamburger").on("click",function(){
110    $("#dmenu-background").show();
111    $("#dmenu-group").show();
112});
113$(".dmenu-catitem").on("click",function(){
114    var mid = $(this).attr("id").split("-");
115    var mblkid = mid[2];
116    var catid = mid[3];
117    $("#dmenu-main-conetnt").hide();
118    $(".dmenu-subitems").hide();
119    $("#dmenu-back").css("display","flex");
120    $("#dmenu-subitems-"+mblkid+"-"+catid).show();
121    $("#dmenu-sub-content").show();
122});
123$("#dmenu-back").on("click",function(){
124    $("#dmenu-sub-content").hide();
125    $(this).hide();
126    $("#dmenu-main-conetnt").show();
127});
128$("#dmenu-close").on("click",function(){
129    $("#dmenu-group").hide();
130    $("#dmenu-background").hide();
131
132});
133$("#dmenu-background").on("click",function(){
134    $("#dmenu-group").hide();
135    $("#dmenu-background").hide();
136});
137//footer
138$(".footer-tab").on("click",function(){
139    if($(this).hasClass("in")){
140        $(this).next(".footer-group").removeClass("fg-active");
141        $(this).children(".footer-tab-indicator").html('+');
142        $(this).removeClass("in");
143    }else{
144        $(this).next(".footer-group").addClass("fg-active");
145        $(this).children(".footer-tab-indicator").html('−');
146        $(this).addClass("in");
147    }
148});
149
150//search
151$("#mob-ic-search").on("click", function(){
152    if($(this).hasClass("in")){
153        $("#sec-search").slideUp("fast");
154        $(".wrapper").animate({top: "0"},400);
155        $(".sec-examdetails-tabs").animate({top: "48px;"},400);
156        $(this).removeClass("in");
157    }else{
158        $("#sec-search").slideDown("fast");
159        $(".wrapper").animate({top: "50px"},400);
160        $(".sec-examdetails-tabs").animate({top: "98px"},400);
161        $(this).addClass("in");
162    }
163});
164$("#input-search").focus(function(){
165    $("#obsearch-results-blk").slideDown("fast");
166});
167$(document).on("click", function(e){
168    if ($(e.target).closest('#input-search').length === 0) {
169        $("#obsearch-results-blk").slideUp("fast");
170        $("#input-search").val('');
171        $("#obrelated-search-list").hide()
172        $("#obsuggested-search-list").show();
173    }
174});
175$("#input-search").keyup(function(){
176    var kw = $(this).val().trim();
177    if(kw != ''){
178        $.get("/getsearch.php", {"s": kw}, function(data){
179            try{
180                var data = JSON.parse(data);
181                $("#obsuggested-search-list").hide();
182                $("#obrelated-search-list").html(data['result']);
183                $("#obrelated-search-list").show()
184            }
185            catch(e){
186            }
187        });
188    }else{
189        $("#obrelated-search-list").hide()
190        $("#obsuggested-search-list").show();
191    }
192});
193/* forgotpwd */
194$("#btn-forgotpwd").on("click", function(){
195    $("#login-group-abc").hide();
196    $("#forgotpwd-group-abc").css("display","flex");
197    $("#remail").focus();
198});
199$("#btn-fpwd-cancel").on("click", function(){
200    $("#forgotpwd-group-abc").hide();
201    $("#login-group-abc").css("display","flex");
202});
203/* show login and register form or redirect to postlogin url*/
204$(".btn-showloginregister1").on("click", function(){
205    boxurl = $(this).attr("data-url");
206    if(parseInt(islogin) >= 0){
207        window.open(boxurl, "_blank");
208    }else{
209        $(".errormsg").html("");
210        $("#course-uemail").focus();
211        $("#modal-signup").addClass("is-active");
212        showregloginpup = 0;
213    }
214});
215
216
217// old js
218String.prototype.trim = function() { 
219        return this.replace(/^\s+|\s+$/g,""); 
220}
221
222function getCmatScore(email){
223    var rollnum=$('#rnumber').val();
224    if(rollnum=='')
225    {
226    $('#rollMsg').html('Please Enter a roll number');
227    }
228    else
229    {
230
231        var params = {};
232        params['roll']  = rollnum;
233        params['email']  = email;
234        var url = '/pyscripts/getcmatscore.py';
235        $('#lrnumber').html('Please Wait..');
236        $.post(url,params, function(data) {
237            $('#cmatsc-data').show();
238            $('#cmatsc-data').html(data);
239            $('#rollMsg').hide();
240            $('html').getNiceScroll().resize();
241            $('#lrnumber').html('Submit');
242        });
243    }
244}
245
246//reset password
247    function resetPassword()
248    {
249
250        var email = $("#remail").val();
251        if(email!='')
252        {
253            var filter = /^((\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*?)\s*;?\s*)+/;
254            if(!filter.test(email))
255            {
256                $('.rePassMsg').html('Enter Valid Email Address');
257            }
258            else
259            {
260                var url  = "/pyscripts/forgotpass.py";
261                var params = {};
262                params['email'] = email;
263                $('#lreset').html('Please Wait...');
264                $.post(url,params, function(data) {
265                    if(data.trim() == '0')
266                    {
267                        $('.rePassMsg').html('Email ID not registered.');
268                        $('#lreset').html('Submit');
269                    }
270                    else
271                    { 
272                        $("#fpwd-success-msg-title").html("Email Sent");
273                        $("#fpwd-success-msg-text").html("Password reset details have been mailed to you.");
274                        $("#obls-group2").hide();
275                        $("#success-msg-group").css("display","flex");
276                        $('.rePassMsg').html('');
277                        $('#lreset').html('Submit');
278                    }
279                });
280
281
282
283
284            }
285        }
286        else
287        {
288            $('.rePassMsg').html('Please Enter your email');
289        }
290    }
291    $('#remail').keypress(function(e){
292        if(e.which==13){
293            $("#lreset").trigger("click");
294        }
295    });
296//update passowrd
297    function updatepassword(email,e)
298    {
299        var newpass =$('#updatepass').val();
300        if(newpass == '')
301        {
302            $('#updMsg').html('Please Enter a Password');
303        }
304        else
305        {
306
307            var params = {};
308            params['newpass']  = newpass;
309            params['email']  = email;
310            params['auth']  = e;
311            var url = '/pyscripts/updatepassword.py';
312            $('#updatesubmit').html('Please Wait..');
313            $.post(url,params, function(data) {
314                if(data.trim() == '0')
315                {
316                    $('#updMsg').html('Invalid Passowrd/auth code.');
317                    $('#updatesubmit').html('Submit');
318                }
319                else
320                {
321                    $("#fpwd-success-msg-title").html("Password Reset");
322                    $("#fpwd-success-msg-text").html("We have successfully reseted the password, please login again with the new password.");
323                    $("#resetpwd-group").hide();
324                    $("#updatepwd-success-msg-group").css("display","flex");
325                    $('#updMsg').html('');
326                }
327            });
328       }
329    }
330
331    $('#updatepass').keypress(function(e){
332        if(e.which==13){
333            $("#updatesubmit").trigger("click");
334        }
335    });
336    function gq(p) {
337        var query = window.location.search.substring(1);
338        var vars = query.split("&");
339        for (var i=0;i<vars.length;i++) {
340            var pair = vars[i].split("=");
341            if (pair[0] == p) {
342                return decodeURIComponent(pair[1]);
343            }
344        } 
345        return "0";
346    }
347// login 
348 function courseInValidation(courseurl)
349        {
350            if(boxurl != ""){
351                courseurl = boxurl;
352            }
353            var email = $("#course-email").val();
354            var pwd = $("#course-password").val();
355            var capt = $("#lcaptcha-code").val();
356            
357            if(email!='' && pwd!='' && capt != '') {
358                var filter = /^((\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*?)\s*;?\s*)+/;
359                if(!filter.test(email)){
360                    $('.courseIn').html('Enter Valid Email Address');
361                     }
362                 else {
363
364                       $('.courseIn').html('');
365                       $('#coursein').html('Please Wait');
366                        var url = "/pyscripts/loginnext.php";
367                        var params = {};
368                        params['lemail'] = email;
369                        params['lpwd'] = pwd;
370                        params['lpwd1'] = capt;
371                        $.post(url,params, function(data) {    
372                            if(data.trim() == '0') {
373                                $('.courseIn').html('Invalid Credentials');
374                                $('#coursein').html('Submit');
375                            }
376                            else
377                            {
378                                    var next = gq('next');
379                                    
380                                    if (next == "0")
381                                        window.location = courseurl;
382                                    else
383                                        window.location = next;
384                                    
385                                    $('.courseIn').html('');  
386                            }
387                        });
388
389                }
390            }
391            else
392            {
393                $('.courseIn').html('Fields cannot be empty');  
394            }
395        }
396
397    $('#course-password,#lcaptcha-code').keypress(function(e){
398        if(e.which==13){
399            $("#coursein").trigger("click");
400        }
401    });
402//register 
403        function courseUpValidation(ref,course,courseurl)
404        {
405            if(boxurl != ""){
406                courseurl = boxurl;
407            }
408            var email = $("#course-uemail").val();
409            var pwd = $("#course-upassword").val();
410            var mob = $('#course-uphone').val();
411
412            if(email!='' && pwd!='' && mob!='') {
413                var filter = /^((\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*?)\s*;?\s*)+/;
414                if(!filter.test(email)){
415                    $('.courseUp').html('Enter Valid Email Address');
416                     }
417                 else {
418
419                        var mfilter = /^\d{10}$/; 
420                        if (!mfilter.test(mob))
421                        {
422                            $('.courseUp').html('Enter Valid phone number');
423                        }
424                        else
425                        {
426                            $('#courseup').html('Please Wait');
427                            var url  = "/pyscripts/courseregister.py";
428                            var params = {};
429                            params['e'] = email;
430                            params['p'] = pwd;
431                            params['m'] = mob;
432                            params['r'] = ref;
433                            params['c'] = course;
434                            $.post(url,params, function(data) {       
435                                if(data.trim() == '0')
436                                {
437                                    $('#courseup').html('REGISTER');
438                                    $('.courseUp').html('Email already registered');
439                                }
440                                else
441                                {
442                                    var next = gq('next');
443                                    var nexturl = '';
444                                    if (next == "0")
445                                        nexturl = courseurl;
446                                    else
447                                        nexturl = next;
448
449                                    var googref = gq('ref');
450                                    if (typeof gtag_report_conversion === "function" && googref.startsWith("Goog")) {
451                                        gtag_report_conversion(nexturl + "&nuser=1");
452                                    }
453                                    else
454                                    {
455                                        window.location = nexturl;
456                                    }
457                                    $('.courseUp').html('');
458                                }
459                            });
460                        }
461
462                }
463            }
464            else
465            {
466                $('.courseUp').html('Fields cannot be empty');
467            }
468        }
469
470    $('#course-uemail,#course-upassword,#course-uphone').keypress(function(e){
471        if(e.which==13){
472            $("#courseup").trigger("click");
473        }
474    });
475
476function goto(url){ window.location = url; }
477//next
478        function courseInValidation1()
479        {
480            var email = $("#course-email").val();
481            
482            if(email!='') {
483                var filter = /^((\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*?)\s*;?\s*)+/;
484                if(!filter.test(email)){
485                    $('.courseIn').html('Enter Valid Email Address');
486                     }
487                 else {
488                        $('.courseIn').html('');
489                        $('#coursein1').html('Please Wait');
490                        params = {};
491                        params['email'] = email;
492
493                        $.post("/pyscripts/next.php", params, function(captchaurl){
494                            $("#img-oblcaptcha").html("<img src='"+captchaurl+"' alt=''>");
495                            $("#course-email").attr("readonly", true);
496                            $(".disable-loginemail").css("background-color","#F1F3F9");
497                            $("#course-email").css("background-color","#F1F3F9");
498                            $("#course-email").siblings(".floating-label").hide();
499                            $("#loginnext-group").show();
500                            $("#coursein").show();
501                            $('#lemailnext').val(email);
502                            $('#coursein1').hide();
503                            $('.courseIn').html('');  
504                            $("#course-password").focus();
505
506                        });
507                        
508                }
509            }
510            else
511            {
512                $('.courseIn').html('Fields cannot be empty');  
513            }
514        }
515    $('#course-email').keypress(function(e){
516        if(e.which==13){
517            $("#coursein1").trigger("click");
518        }
519    });
520//floating label
521$(".ob-inputfield").focusout(function(){
522    var infval = $(this).val();
523    if(infval != ''){
524        $(this).next(".floating-label").css("top","4px");
525        $(this).next(".floating-label").css("font-size","8px");
526    }else{
527        $(this).next(".floating-label").css("top","19px");
528        $(this).next(".floating-label").css("font-size","12px");
529    }
530});
531$(".ob-inputfield").focus(function(){
532        $(this).next(".floating-label").css("top","4px");
533        $(this).next(".floating-label").css("font-size","8px");
534});
535//set cookie register popup
536function setCookie(cname, cvalue, exhours) {
537    var d = new Date();
538    d.setTime(d.getTime() + (exhours*60*60*1000));
539    var expires = "expires="+ d.toUTCString();
540    document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/;domain=.oliveboard.in";
541}
542/*
543var showregloginpup = 1;
544$(window).load(function(){
545    var isregcookie = document.cookie.indexOf("registerpopup");
546    if(isregcookie == -1){
547        setTimeout(function(){ 
548            if(showregloginpup){
549                showLoginRegisterwl(); 
550            }
551        }, 30000);
552        setCookie('registerpopup','1',1);
553    }
554});
555*/

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.