PageSourceSearch

https://dehgardi.ir/js/custom.js

js dehgardi.ir collected 2026-10-02 23:51:11 UTC 12,250 bytes, 336 lines download raw bytes

1
2
3$(".search-input-autocomplete").autocomplete({
4    source: function (request, response) {
5        $.ajax({
6            url: "/Home/SearchLoadLocation",
7            type: "GET",
8            data:
9            {
10                term: request.term,
11            },
12            success: function (data) {
13                var item = '';
14
15                for (var i = 0; i < data.length; i++) {
16                    item += '<li class="suggest-item"><a class="suggest-link" onClick="ChangeAllLocationAjax(' +
17                        data[i].zoneId + ', ' + data[i].type + ', \'' + data[i].zoneName +
18                        '\')"><span class="d-flex"><i class="icon-location-pin icomoon"></i><span class="title_text">' +
19                        data[i].name + '</span></span></a></li>';
20                }
21
22                var html = '<ul id="search__results" class="hidden-element guestbut1 search-result-item" style="display: block;">' +
23                    item
24                '</ul>';
25
26                $("#all-header_search_location").css("border-radius", "20px 20px 0 0");
27                
28
29                $(".result-items").html(html);
30                $('.result-items').show();
31
32                $("#search__results").css(
33                    {
34                        "display": "block",
35                        "border-top": "0",
36                        "border-radius": "0 0 20px 20px",
37                        "padding": "0 9px"
38                    });
39            }
40        });
41    },
42    minLength: 2,
43});
44
45function ChangeAllLocationAjax(locationId, type, text) {
46
47    $(".search-input-autocomplete").val(text);
48    $('.result-items').hide();
49
50    $(".search-location-id").val(locationId);
51
52    $("#search-form--sm-btn").prop("href", "/Search/" + locationId + "/" + type + "/" + text 
52+ "");
53    $("#all-header_search_location").css("border-radius", "40px");
54
55    //$.ajax({
56    //    url: "/Search/SearchLoadLocation",
57    //    type: "GET",
58    //    data: { locationId: locationId },
59    //    success: function (data) {
60    //        $(".search-box-item").html(data);
61    //    }
62    //})
63}
64
65$('body').click(function (evt) {
66    $("#all-header_search_location").css("border-radius", "40px");
67});
68
69//function ChangeBackgroundSearch() {
70//    $(".searchbar-wrapper").addClass("change-background-search"); /*("cssText", "background-color: #fff !important;");*/
71//}
72
73//House
74
75// Start Comments And Like
76
77// Show Modal Like
78function GlobalDisLike(commentId, commentType, name, isLogined) {
79
80    if (isLogined == 'False') {
81        toastr.error("برای ثبت نظر ابتدا وارد سایت شوید", null, {
82            "timeOut": 7000,
83            "progressBar": true,
84            "positionClass": "toast-top-left"
85        });
86        return;
87    }
88
89    $.ajax({
90        url: "/Home/LoadDisLikeReasonType",
91        type: "GET",
92        data: {
93            commentType: commentType
94        },
95        success: function (data) {
96
97            $(".comment-like-value").val(commentId);
98            $(".comment-like-type-value").val(commentType);
99            $(".comment-name-value").text(name);
100
101            var html = '';
102
103            for (var i = 0; i < data.length; i++) {
104                html += '<li>'+
105                            '<input id="check'+data[i].disLikeTypeId+'" type="checkbox" class="form-control disliketype-id" value="'+ data[i].disLikeTypeId +'" />'+
106                            '<label for="check'+data[i].disLikeTypeId+'" style="display:inline-block;">'+ data[i].description +'</label>'+
107                        '</li>';
108            }
109
110            html += '<li>'+
111                        '<label for="check3">توضیحات</label>'+
112                        '<input id="check3" type="text" class="form-control disliketype-description" placeholder="توضیحات اضافه را در این قسمت وارد کنید" />'+
113                '</li>';
114
115            html += '<li>'+
116                        '<button class="btn btn-success" onClick="InsertDislike()">ثبت</button>'+
117                    '</li>';
118
119            $(".dislikereasontype-content").html("<ul>" + html + "</ul>");
120
121            $("#service-modal").css("display", "block");
122            $(".modal-content-custom").css("opacity", "1");
123        }
124    })
125}
126
127function InsertDislike() {
128
129    var commentId = $(".comment-like-value").val();
130    var commentType = $(".comment-like-type-value").val();
131    var disLikeDescription = $(".disliketype-description").val();
132
133    var disLikeReaonTypeIds = [];
134    $('.disliketype-id:checked').each(function () {
135        var typeValue = $(this).val();
136        disLikeReaonTypeIds.push($(this).val());
137    });
138
139    if (disLikeReaonTypeIds.length == 0 & disLikeDescription == '') {
140        toastr.error("توضیح را وارد کنید", null, {
141            "timeOut": 7000,
142            "progressBar": true,
143            "positionClass": "toast-top-left"
144        });
145        return;
146    }
147    if (disLikeReaonTypeIds.length == 0) {
148        if (disLikeDescription.length < 20) {
149            toastr.error("حداقل 20 حرف بنویسید", null, {
150                "timeOut": 7000,
151                "progressBar": true,
152                "positionClass": "toast-top-left"
153            });
154            return;
155        }
156    }
157
158    $.ajax({
159        url: "/Home/InsertGlobalDisLike",
160        type: "POST",
161        data: {
162            TargetCommentId: commentId,
163            CommentType: commentType,
164            Description: disLikeDescription,
165            DisLikeReasonTypeIds: disLikeReaonTypeIds
166        },
167        success: function (data) {
168            if (data.isFailure == true) {
169
170                var getCurrentDisLikeCount = parseInt($(".Dislike-" + commentId + "-" + commentType + "").text());
171                getCurrentDisLikeCount--;
172                $(".Dislike-" + commentId + "-" + commentType + "").text(getCurrentDisLikeCount);
173                $(".IDislike-" + commentId + "-" + commentType + "").css("color", "#fff");
174
175                $("#service-modal").css("display", "none");
176
177                //toastr.error(data.error, null, {
178                //    "timeOut": 5000,
179                //    "progressBar": true,
180                //    "positionClass": "toast-top-left"
181                //});
182                return;
183            }
184
185            if (data.value.isRemoveExistDislike == true) {
186
187                // aftre like show increase Like ++
188                var getCurrentLikeCountAfterLike = parseInt($(".Dislike-" + commentId + "-" + commentType + "").text());
189                getCurrentLikeCountAfterLike--;
190                $(".like-" + commentId + "-" + commentType + "").text(getCurrentLikeCountAfterLike);
191                $(".Ilike-" + commentId + "-" + commentType + "").css("color", "#fff");
192
193                // aftre like show increase Dislike --
194                var getCurrentDisLikeCount = parseInt($(".Dislike-" + commentId + "-" + commentType + "").text());
195                getCurrentDisLikeCount++;
196                $(".Dislike-" + commentId + "-" + commentType + "").text(getCurrentDisLikeCount);
197                $(".IDislike-" + commentId + "-" + commentType + "").css("color", "#ff5959");
198
199                $("#service-modal").css("display", "none");
200
201                return;
202            }
203
204            $("#service-modal").css("display", "none");
205
206            // aftre like show increase like ++
207            var getCurrentLikeCount = parseInt($(".Dislike-" + commentId + "-" + commentType + "").text());
208            getCurrentLikeCount++;
209
210            $(".Dislike-" + commentId + "-" + commentType + "").text(getCurrentLikeCount);
211            $(".IDislike-" + commentId + "-" + commentType + "").css("color", "#ff5959");
212
213        }, error: function () {
214            toastr.error("امتیازدهی با مشکل مواجه شد", null, {
215                "timeOut": 7000,
216                "progressBar": true,
217                "positionClass": "toast-top-left"
218            });
219        }
220    })
221}
222
223// Close Modal DisLikeLike
224$(".comment-modal-close").click(function () {
225    $("#service-modal").css("display", "none");
226})
227
228function GlobalLike(commentId, commentType,color) {
229
230    $.ajax({
231        url: "/Home/InsertGlobalLike",
232        type: "POST",
233        data: {
234            commentId: commentId,
235            commentType: commentType
236        },
237        success: function (data) {
238
239            var getCurrentLikeCount;
240
241            if (data.isFailure == true) {
242
243                // aftre like show increase like ++
244                getCurrentLikeCount = parseInt($(".like-" + commentId + "-" + commentType + "").text());
245                getCurrentLikeCount--;
246
247                $(".like-" + commentId + "-" + commentType + "").text(getCurrentLikeCount);
248                $(".Ilike-" + commentId + "-" + commentType + "").css("color", color);
249
250                //toastr.error(data.error, null, {
251                //    "timeOut": 5000,
252                //    "progressBar": true,
253                //    "positionClass": "toast-top-left"
254                //});
255                return;
256            }
257
258            if (data.value.isRemoveExistDislike == true) {
259                // aftre like show increase like ++
260                var getCurrentDisLikeCount = parseInt($(".Dislike-" + commentId + "-" + commentType + "").text());
261                getCurrentDisLikeCount--;
262
263                $(".Dislike-" + commentId + "-" + commentType + "").text(getCurrentDisLikeCount);
264                $(".IDislike-" + commentId + "-" + commentType + "").css("color", color);
265
266                // aftre like show increase like ++
267                getCurrentLikeCount = parseInt($(".like-" + commentId + "-" + commentType + "").text());
268                getCurrentLikeCount++;
269                $(".like-" + commentId + "-" + commentType + "").text(getCurrentLikeCount);
270                $(".Ilike-" + commentId + "-" + commentType + "").css("color", "#24cc24");
271
272                return;
273            }
274
275            // aftre like show increase like ++
276            getCurrentLikeCount = parseInt($(".like-" + commentId + "-" + commentType + "").text());
277            getCurrentLikeCount++;
278
279            $(".like-" + commentId + "-" + commentType + "").text(getCurrentLikeCount);
280            $(".Ilike-" + commentId + "-" + commentType + "").css("color", "#24cc24");
281
282        }, error: function () {
283            toastr.error("امتیازدهی با مشکل مواجه شد", null, {
284                "timeOut": 5000,
285                "progressBar": true,
286                "positionClass": "toast-top-left"
287            });
288        }
289    })
290
291}
292
293
294//$('body').click(function (event) {
295//    if ($(event.target).hasClass('place-dislike') || $(event.target).hasClass('fa fa-thumbs-o-down')
296//        || $(event.target).hasClass('dislike-comment-text') || $(event.target).hasClass('btn btn-success btn-sm btn-dislike')) {
297//        return;
298//    } else {
299//        $(".dislike-comment-box").css("display", "none");
300//    }
301//})
302
303
304// Get the modal
305//$("#service-show-modal").click(function () {
306//    $("#service-modal").css("display", "block");
307//})
308
309//var modal = document.getElementById("service-modal");
310
311//// Get the button that opens the modal
312//var btn = document.getElementById("service-show-modal");
313
314//// Get the <span> element that closes the modal
315//var span = document.getElementsByClassName("close")[0];
316
317//// When the user clicks the button, open the modal
318
319//btn.onclick = function () {
320//    modal.style.display = "block";
321//    //$(".modal-content-custom").css("opacity", "1");
322//    //$(".modal-content-custom").css("margin-top", "0");
323//}
324
325//// When the user clicks on <span> (x), close the modal
326//span.onclick = function () {
327//    modal.style.display = "none";
328//}
329
330//// When the user clicks anywhere outside of the modal, close it
331//window.onclick = function (event) {
332//    if (event.target == modal) {
333//        modal.style.display = "none";
334//    }
335//}
336// End Comment And Like

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.