PageSourceSearch

https://www.linders.ie/js/search.js

js linders.ie collected 2026-10-07 16:47:22 UTC 4,044 bytes, 125 lines download raw bytes

1var slCookieName = 'shortlist';
2var depositCookieName = 'deposit';
3
4function deposit_save(deposit) {
5  $.cookie(depositCookieName, deposit);
6}
7function deposit_get() {
8  return $.cookie(depositCookieName);
9}
10
11
12
13function sl_save(e) {
14  e.preventDefault();
15  // try{
16  //   var count_saved = parseInt(document.getElementsByClassName("saved_ads_count")[0].innerHTML);
17  //   count_saved = count_saved + 1;
18  //   document.getElementsByClassName("saved_ads_count")[0].innerHTML = count_saved;
19  // } catch(e) {
20  //   document.getElementsByClassName("saved_ads_content")[0].innerHTML = '(<span class="saved_ads_count">1</span>)';
21  // }
22  var cookie_val = $.cookie(slCookieName);
23  if (cookie_val == null || cookie_val == '') {
24    cookie_val = $(this).data("id");
25  } else {
26    cookie_val += (',' + $(this).data("id"));
27  }
28  $.cookie(slCookieName, cookie_val, {path: '/', expires: 365, domain: root_domain});
29  $(this).removeClass('shortlist-save').addClass('shortlist-remove').html('<img src="images/car-details/heart-filled.svg" alt=""/>');
30  $(this).on('click', sl_remove);
31  event.stopPropagation();
32}
33
34function sl_remove(e) {
35  e.preventDefault();
36  // var count_saved = parseInt(document.getElementsByClassName("saved_ads_count")[0].innerHTML);
37  // count_saved = count_saved - 1;
38  //   document.getElementsByClassName("saved_ads_count")[0].innerHTML = count_saved;
39  var cookie_val = $.cookie(slCookieName), new_cookie_val = '';
40  var ids = cookie_val.split(',');
41  for (var i=0; i<ids.length; i++) {
42    if (ids[i] != $(this).data("id")) {
43      new_cookie_val += (ids[i] + ',');
44    }
45  }
46  new_cookie_val = new_cookie_val.slice(0, -1);
47  $.cookie(slCookieName, new_cookie_val, {path: '/', expires: 365, domain: root_domain});
48  if($(window).width() < 769){
49    $(this).removeClass('shortlist-remove').addClass('shortlist-save').html('<img src="images/car-details/heart-empty.svg" alt=""/>');
50  } else {
51    $(this).removeClass('shortlist-remove').addClass('shortlist-save').html('<img src="images/car-details/heart-empty.svg" alt=""/>');
52  }
53  
54  $(this).on('click', sl_save);
55  event.stopPropagation();
56}
57
58function sl_remove1() {
59  var cookie_val = $.cookie(slCookieName), new_cookie_val = '';
60  var ids = cookie_val.split(',');
61  for (var i=0; i<ids.length; i++) {
62    if (ids[i] != $(this).data("id")) {
63      new_cookie_val += (ids[i] + ',');
64    }
65  }
66  new_cookie_val = new_cookie_val.slice(0, -1);
67  $.cookie(slCookieName, new_cookie_val, {path: '/', expires: 365, domain: root_domain});
68
69  $(this).parent().parent().replaceWith($(this).parent().parent().next());
70  // $(this).parent().parent().fadeOut();
71}
72
73function custom_click(obj, msg){
74  if(msg == "like"){
75    var class_name = $(obj).attr('class');
76    if(class_name == "shortlist-save"){
77      sl_slave();
78    } else {
79      sl_remove();
80    }
81  } else {
82    location.href=msg;
83  }
84}
85
86$(function() {
87  // $('.shortlist-save').on('click', sl_save);
88  
89  // $('.shortlist-remove').on('click', sl_remove);
90  // $('.shortlist-remove1').on('click', sl_remove1);
91
92  $(document).on('click','.shortlist-save', sl_save);
93  $(document).on('click','.shortlist-remove', sl_remove);
94
95  $(document).on('click','.shortlist-remove1', sl_remove1);
96  // $(".search-select").select2({
97  //   placeholder: $('#select_place_holder').val(),
98  //   allowClear: false,
99  //   theme: "classic",
100  //   width: '100%',
101  // });
102
103
104    // $('#make_id').on('change', function()
105    // {
106    //   $('#sb_loading').show();
107    //   $('#select_modal').hide();
108    //   $('#select_modals').hide();
109    //   $('#select_forth_div').hide();
110    //   $.post('models-list',  {make_id:$('#make_id').val(), }).done( function(response)
111    //   {
112    //     $('#sb_loading').hide();
113    //     $('#select_modal').show();
114    //     $('#select_modal').html(response);
115    //     $(".search-select").select2({
116    //       placeholder: $('#select_place_holder').val(),
117    //       allowClear: false,
118    //       theme: "classic",
119    //       width: '100%',
120    //     });
121    //   });
122    // });
123    
124    
125});

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.