PageSourceSearch

https://tgrtlt.ru/js/estate.js

js tgrtlt.ru collected 2026-10-03 23:57:54 UTC 9,114 bytes, 349 lines download raw bytes

1var globalFns = {};
2function globalInit(){
3	for(var i in globalFns)
4	{
5		window[i](globalFns[i]);
6	}
7}
8function assertGlobalFn(key,param)
9{
10	globalFns[key] = param;
11}
12
13$(document).ready(function(){
14	
15	$('.grid_check_all').change(function(){
16		var status=$(this).is(':checked');
17		var checkboxes=$(this).parents('table').eq(0).find('input.grid_check_one');
18		
19		if(status){
20			checkboxes.each(function(){
21				$(this).attr('checked','checked');
22			});
23		}else{
24			checkboxes.each(function(){
25				$(this).attr('checked',false);
26			});
27		}
28	});
29	
30	$('.delete_checked').click(function(){
31		var ids=[];
32		var action=$(this).attr('alt');
33		$(this).parents('table').eq(0).find('input.grid_check_one:checked').each(function(){
34			ids.push($(this).val());
35		});
36		//console.log(ids);
37		window.location.replace(estate_folder+'/admin/index.php?action='+action+'&do=mass_delete&ids='+ids.join(','));
38		//
39	});
40	
41	$('a#getmyfavorites').click(function(){
42		var container=$('#tabs-services-favorites');
43		container.html('Загрузка...');
44		$.ajax({
45	        url: estate_folder + "/js/ajax.php?action=get_my_favorites",
46	        type: "POST",
47	        dataType: "json",
48	        success: function(json){
49				var decoded = $("<div/>").html(json.response.body).text();
50				container.html('');
51				container.append(decoded);
52			}
53	    });
54		return true;
55	});
56	
57	
58
59	$('a#specialoffers').click(function(){
60		var container=$('#tabs-services-special');
61		container.html('Загрузка...');
62		$.ajax({
63	        url: estate_folder + "/js/ajax.php?action=get_specialoffers",
64	        type: "POST",
65	        dataType: "json",
66	        success: function(json){
67				var decoded = $("<div/>").html(json.response.body).text();
68				container.html('');
69				container.append(decoded);
70			}
71	    });
72		return true;
73	});
74	
75	/*$('a.add_to_favorites').on('click',function(){
76		var o=$(this);
77		var id=o.attr('alt');
78		if(id){
79			$.ajax({
80		        url: estate_folder + "/js/ajax.php?action=add_to_favorites",
81		        data: 'id='+id,
82		        type: "POST",
83		        dataType: "json",
84		        beforeSend: function(){
85				
86				},
87		        success: function(json){
88		        	if(json.response.body=='OK'){
89		        		$('span#favorites_count').text(new Number($('span#favorites_count').text())+1);
90		        		o.removeClass('add_to_favorites');
91		        		o.attr('title', 'Удалить из избранных');
92		        		o.attr('class','remove_from_favorites').attr('href','#remove_from_favorites');
93		        	}
94		        },
95		        error: function(xhr, ajaxOptions, thrownError){
96		        	
97				}
98		    });
99		}
100		return false;
101	});*/
102	
103	/*$('a.remove_from_favorites').on('click',function(){
104		var o=$(this);
105		var id=o.attr('alt');
106		if(id){
107			$.ajax({
108		        url: estate_folder + "/js/ajax.php?action=remove_from_favorites",
109		        data: 'id='+id,
110		        type: "POST",
111		        dataType: "json",
112		        beforeSend: function(){
113				
114				},
115		        success: function(json){
116		        	if(json.response.body=='OK'){
117		        		$('span#favorites_count').text(new Number($('span#favorites_count').text())-1);
118		        		o.removeClass('remove_from_favorites');
119		        		o.attr('title', 'Добавить в избранное');
120		        		o.attr('class','add_to_favorites').attr('href','#add_to_favorites');
121		        	}
122		        },
123		        error: function(xhr, ajaxOptions, thrownError){
124		        	
125				}
126		    });
127			
128			
129			
130		}
131		return false;
132	});*/
133	
134	$(document).on('click','a.add_to_favorites',function(){
135		var o=$(this);
136		var id=o.attr('alt');
137		if(id){
138			$.ajax({
139		        url: estate_folder + "/js/ajax.php?action=add_to_favorites",
140		        data: 'id='+id,
141		        type: "POST",
142		        dataType: "json",
143		        beforeSend: function(){
144				
145				},
146		        success: function(json){
147		        	if(json.response.body=='OK'){
148		        		$('#favorites_count').text(new Number($('#favorites_count').text())+1);
149		        		o.removeClass('add_to_favorites');
150		        		o.attr('title', 'Удалить из избранных');
151		        		o.attr('class','remove_from_favorites').attr('href','#remove_from_favorites');
152		        	}
153		        },
154		        error: function(xhr, ajaxOptions, thrownError){
155		        	
156				}
157		    });
158		}
159		return false;
160	});
161	
162	$(document).on('click','a.remove_from_favorites',function(){
163		var o=$(this);
164		var id=o.attr('alt');
165		if(id){
166			$.ajax({
167		        url: estate_folder + "/js/ajax.php?action=remove_from_favorites",
168		        data: 'id='+id,
169		        type: "POST",
170		        dataType: "json",
171		        beforeSend: function(){
172				
173				},
174		        success: function(json){
175		        	if(json.response.body=='OK'){
176		        		$('#favorites_count').text(new Number($('#favorites_count').text())-1);
177		        		o.removeClass('remove_from_favorites');
178		        		o.attr('title', 'Добавить в избранное');
179		        		o.attr('class','add_to_favorites').attr('href','#add_to_favorites');
180		        	}
181		        },
182		        error: function(xhr, ajaxOptions, thrownError){
183		        	
184				}
185		    });
186		}
187		return false;
188	});
189	
190	/*$('#tabs-services-favorites a.remove_from_favorites').on('click',function(){
191		var o=$(this);
192		var id=o.attr('alt');
193		o.parents('tr').eq(0).remove();
194		$('table.content_main a[alt='+id+']').attr('class','add_to_favorites').attr('href','#add_to_favorites');
195	});*/
196	
197	$(document).on('click','#tabs-services-favorites a.remove_from_favorites',function(){
198		var o=$(this);
199		var id=o.attr('alt');
200		o.parents('tr').eq(0).remove();
201		$('table.content_main a[alt='+id+']').attr('class','add_to_favorites').attr('href','#add_to_favorites');
202	});
203	
204});
205
206
207
208
209var streetlist = [];
210function init_streetlist()
211{
212	streetlist = [];
213	$("form select[name=street_id]").children().eq(0).nextAll().each(function(){
214		streetlist.push($(this).html());
215	});
216	
217	$(document).ready(function(){
218	
219	$("#istreet").autocompleteArray(streetlist,
220		{
221			delay:10,
222			minChars:1,
223			matchSubset:1,
224			autoFill:true,
225			maxItemsToShow:10
226		}
227	);
228
229	});
230
231}
232
233
234function addToFavorites(id){
235	$.ajax({
236        url: estate_folder + "/js/ajax.php?action=add_to_favorites",
237        data: 'id='+id,
238        type: "POST",
239        dataType: "json",
240        beforeSend: function(){
241		
242		},
243        success: function(json){
244        	if(json.response.body=='OK'){
245        		$('span#favorites_count').text(new Number($('span#favorites_count').text())+1);
246        		$('#fav_'+id).hide();
247        	}
248        },
249        error: function(xhr, ajaxOptions, thrownError){
250        	
251		}
252    });
253	return false;
254}
255
256function removeFromFavorites(id){
257	$.ajax({
258        url: estate_folder + "/js/ajax.php?action=remove_from_favorites",
259        data: 'id='+id,
260        type: "POST",
261        dataType: "json",
262        beforeSend: function(){
263		
264		},
265        success: function(json){
266        	if(json.response.body=='OK'){
267        		$('span#favorites_count').text(new Number($('span#favorites_count').text())-1);
268        		$('#fav_'+id).hide();
269        	}
270        },
271        error: function(xhr, ajaxOptions, thrownError){
272        	
273		}
274    });
275	return false;
276}
277
278function upd_streetlist()
279{
280}
281
282function showYandexMap(){
283	$('#YMapsIDpmap').hide();
284	$('#YMapsID').show();
285}
286
287function showPMap(){
288	$('#YMapsID').hide();
289	$('#YMapsIDpmap').show();
290}
291
292function get_search_form () {
293	$.ajax({
294        url: estate_folder + "/js/ajax.php?action=get_search_form",
295        data: 'text=1',
296        type: "POST",
297        dataType: "json",
298        beforeSend: function(){
299			$("#search_main").html('');
300			$("#search_main").html('<img src="' + estate_folder + '/img/loading.gif">');
301        },
302        success: function(json){
303        	$("#search_main").html('');
304        	//$("#search_main").append('test');
305			var decoded = $("<div/>").html(json.response.body).text();
306        	$("#search_main").append(decoded);
307		},
308        error: function(xhr, ajaxOptions, thrownError){
309			alert(xhr.status);
310        	alert(thrownError);			        
311        }
312    });
313}
314
315function get_favorites(el){
316	var alt=$(el).attr('alt');
317	var panel=$(el).parents('.jv_tablago2').eq(0).find(".jv_tabs_panel div[class=jv_lago2_content][alt='"+alt+"'] .custom");
318	//var panel=$(el).parents('.jv_tablago2');
319	panel.html('Загрузка...');
320	$.ajax({
321        url: estate_folder + "/js/ajax.php?action=get_my_favorites",
322        type: "POST",
323        dataType: "json",
324        success: function(json){
325			var decoded = $("<div/>").html(json.response.body).text();
326			panel.html('');
327			panel.append(decoded);
328		}
329    });
330	return true;
331}
332
333function get_specialoffers(el){
334	var alt=$(el).attr('alt');
335	var panel=$(el).parents('.jv_tablago2').eq(0).find(".jv_tabs_panel div[class=jv_lago2_content][alt='"+alt+"'] .custom");
336	//var panel=$(el).parents('.jv_tablago2');
337	panel.html('Загрузка...');
338	$.ajax({
339        url: estate_folder + "/js/ajax.php?action=get_specialoffers",
340        type: "POST",
341        dataType: "json",
342        success: function(json){
343			var decoded = $("<div/>").html(json.response.body).text();
344			panel.html('');
345			panel.append(decoded);
346		}
347    });
348	return true;
349}

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.