PageSourceSearch

https://dilbazi.org/assets/js/custom.js?ver=1791053563

js dilbazi.org collected 2026-10-03 18:52:55 UTC 3,482 bytes, 133 lines download raw bytes

1$(document).ready(function () {
2    $.ajaxSetup({
3        headers: {
4            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
5        }
6    });
7
8    $(".subs_submit").on('click',function (){
9
10        notifLoad()
11
12        var email = $(".subs_email").val();
13
14        $(".content_subs").hide();
15        $(".content_subs").html('')
16
17        if(!validateEmail(email)){
18            notifErrorPop("Düzgün email daxil edin")
19        }else {
20            $.ajax({
21                type: "POST",
22                url: "/subscribe",
23                data: {email},
24                success: function (result) {
25                    if(result['type']==0){
26                       // notifErrorPop(result['content'])
27                        $(".content_subs").html(result['content'])
28                        $(".content_subs").show()
29                    }
30                    else if(result['type']==1){
31                       // notifSuccesPop(result['content'])
32                        $(".content_subs").html(result['content'])
33                        $(".content_subs").show()
34                        $(".subs_email").val('')
35                    }
36                }
37            })
38        }
39    })
40
41    $(".cat_select").on('change',function (){
42
43        var id = parseInt($(this).val());
44
45        window.location="/famous?cat="+id;
46    })
47
48    $(".show__more").on('click',function (){
49
50        ajax_popular();
51    })
52
53    $(".search_name").on('keyup',function (){
54        var key = $(this).val();
55        console.log({key})
56        var cat = $(".cat_select").val();
57        if(key.length>=2){
58            ajax_with_name(key,cat)
59        }
60        else if(key.length<2){
61            ajax_with_name('all',cat)
62        }
63    })
64
65    function ajax_with_name(key,cat){
66        $.ajax({
67            type: "GET",
68            url: "/famousmore/name/search/"+key+"/"+cat,
69            success: function (result) {
70                $(".more_data").html(result['content'])
71                if(result['count']==0){
72                    $(".show__more").hide();
73                }else{
74                    $(".show__more").show();
75                }
76            }
77        })
78    }
79
80    function ajax_popular(){
81
82        var cat = $(".cat_select").val();
83        var count = parseInt($(".hide_count").val());
84        var key = $(".search_name").val();
85        if(key.length<=2){
86            key = "no";
87        }
88
89        $.ajax({
90            type: "GET",
91            url: "/famousmore/"+cat+"/"+key+"/"+count,
92            success: function (result) {
93
94                //console.log(result['ferq'])
95                $(".hide_count").val(count+8)
96                $(".more_data").append(result['content'])
97                console.log(result['ferq'])
98                if(result['ferq']<=0){
99                    $(".show__more").hide();
100                }
101            }
102        })
103    }
104
105})
106
107
108function notifLoad(type){
109    Notiflix.Loading.Circle('Please wait...');
110    Notiflix.Loading.Remove(600);
111}
112
113function notifSuccesPop(title){
114    Notiflix.Notify.Success(title,
115        {cssAnimationStyle:'zoom', cssAnimationDuration:500},
116        {position:'center',});
117}
118function notifErrorPop(title){
119    Notiflix.Notify.Failure(title,
120        {cssAnimationStyle:'zoom', cssAnimationDuration:500,});
121}
122
123function validateEmail(emailField){
124    var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
125
126    if (reg.test(emailField) == false)
127    {
128        return false;
129    }
130
131    return true;
132
133}

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.