PageSourceSearch

https://tvpack.ru/j/jquery/jcode.js?16097685086ac2f0cecf5f10.54098417

js tvpack.ru collected 2026-10-05 00:35:34 UTC 8,037 bytes, 267 lines download raw bytes

1$("html").addClass("js");
2
3$(document).ready(function() {
4	
5	if($("#index_slider").length) {
6		
7		var img = $("#index_slider").find("img");
8
9		$("<img/>").bind("load", function() {
10			img.addClass("loaded");
11			$("#index_slider_source").addClass("loaded")
12		}).attr("src",img.prop("src"));
13
14
15		var options = {
16			timer: 4000,
17			speed: 1000,
18			box: "index_slider_source",
19		};
20
21		$("#index_slider").glebsn_slider(options);
22	}
23	
24	/* modern checkbox */
25	$(".radio label:not(.checked)").live("click", function() {
26		var el = $(this);
27		el.siblings().removeClass("checked").end().addClass("checked").parent().find("input:[type='hidden']").attr("value", el.attr("val"));
28		
29		// для формы расчета
30		if(el.attr("val")=="other") {
31			el.find("input").css("display", "inline-block");
32		} else {
33			$("#cother").hide();
34		}
35	});
36	
37	/* advansed select */
38 	$(".select").bind("focus", function() {
39 		//$(this).trigger("click");
40 	}).bind("blur", function() {
41 	});
42 	
43	$(".select").live("change", function() {
44		$(this).next().text($(this).find("option:selected").text()).removeClass("active").end();
45		//.parent().removeClass('active-field');		
46	}).live("focus", function() {
47		$(this).next().addClass("active").end().parent().addClass('active-field');
48	}).live("blur", function() {
49		//$(this).next().removeClass("active");
50	});
51	
52});
53
54/* AJAX FORM SUBMIT */
55function loadform(alias) {
56	$('#'+alias).ajaxForm({ 
57  		dataType:  'json', 
58  		beforeSubmit: function(arr, $form, options) {
59  			$(".alert").empty().hide();
60  			$(".form-field-notice").removeClass("form-field-notice");
61  			$(".default-field-notice").removeClass("default-field-notice");
62 			$(".post-send-order").empty();
63 			// Очистить предыдущий ответ, подумать, мож где плохую службу свыграть
64  			// http://jquery.malsup.com/form/#options-object
65 			
66  			var alias = $form.prop('id');
67 			var clicked = $("#"+alias).find(".form_submit");
68 		
69 			if(clicked.length) {
70
71 				var params = [];
72 		
73 				params["loader_class"] = alias+"-wheel";
74 				params["disabled_class"] = alias+"-disabled";
75 				params["loader_delta_top"]=0;
76 				params["loader_delta_left"]=0;
77 		
78 				show_indicators(clicked, params);
79 			
80 			}
81  		},
82  		success: function(data) {
83  	
84  			if(!data.time) data.time = 1000;
85  			hide_indicators();
86
87  			/* всплывающая подсказка, если необходимо */
88			if(data.text) {
89				show_informer( submit_clicked, 'informer', 'html', data.text, {v:'bottom',h:'right'}, 1);
90			}
91  	
92  			if(data.items) $(data.items).addClass("form-field-notice");
93  			if(data.divs) $(data.divs).addClass("default-field-notice");
94  	
95  			//выводим все алерты
96  			if(data.notes) {
97  				for(var i in data.notes) {
98  					if($("#"+i+"_alert").length) $("#"+i+"_alert").html("<span>"+data.notes[i]+"</span>").show();
99  				}
100  			} 
101 	
102  			// подумать - не нравится мне эти ифы тут
103			if(data.done==1) {
104  				$("#formajaxloader").show();
105  				setTimeout(function(){window.location = window.location}, data.time);
106  			}
107  			else if(data.done==5) {
108  				//response_from_ajax(data);
109			}
110			else if(data.done==33) {
111				setTimeout(function(){
112					if(data.link) {
113						window.location = data.link;
114						/*
115						if(data.hash) {
116							scroll_to(data.hash)
117						}
118						*/
119					} else {
120						window.location = window.location.pathname=="/registration/" ? "/":window.location.pathname;
121					}
122				}, data.time);
123			}
124  	
125 		}
126 	});	
127}
128
129/* SLIDER */
130(function($) { 
131
132	// Описание параметров 
133	// timer - промежуток между сменой слайдов
134	var defaults = { timer: 1000, speed: 500, type: "fade", box: "some_div", pager_tag: "span" };
135
136	jQuery.fn.glebsn_slider = function(params) {
137		var options = $.extend({}, defaults, params);
138		var el = $(this);
139		var pager = el.find(".pager");
140		var pager_els = pager.find(options.pager_tag);
141		var container = $("#"+options.box);
142		var img = container.find("img");
143		var prev_button = el.find("#prev");
144		var next_button = el.find("#next");
145
146		// время показа фотки не должно быть больше таймера!
147		options.speed = Math.min(options.speed, options.timer);
148
149		function automat(next) {
150			var src = "";	
151			var alt = "";
152
153			next = next || null;
154
155			// определили откуда берем инфу для слеюующей картинки (если жали на пагер, следующую ищем после нажатой)
156			if(!next) {
157				next = pager.find(options.pager_tag+".active").next();
158				if(!next.length) next = pager.find(options.pager_tag+":eq(0)");
159				if(!next.length) return;
160			}
161
162			src = next.data("src");
163			alt = next.data("alt");
164
165			//console.log(next);
166			
167			// по предзагрузке
168			$("<img/>").bind("load", function() {
169				// меняем картинку и ее alt
170				img.fadeOut(options.speed/2, function() { 
171					
172					img.attr({"src": src, "alt": alt}).fadeIn(options.speed/2, function() {
173
174						// далее работаем со ссылкой - 4 варианта: не было - появилась; была, сохранилась; была - ушла;
174 не было и не будет
175						var flag_a = parseInt(container.find("a").length);
176						var flag_b = next.data("link") ? 1:0;
177
178						switch(flag_a+flag_b) {
179							case 2:
180								container.find("a").attr({"href": next.data("link"), "title": next.data("alt")})
181							break;
182							case 1:
183								// смотрим что конкретно, была или не было
184								if(flag_b) {
185									// появилась
186									img.wrap("<a href=\""+next.data("link")+"\" title=\""+next.data("alt")+"\">")
187								} else {
188									// исчезла
189									img.unwrap("a");
190								}
191							break;
192							case 0:
193								// вообще ничего не делаем
194							break;
195						}
196
197						// после дого как сделали - меняем стили у пагера
198						pager_els.removeClass("active");
199						next.addClass("active");
200
201					});
202
203				});
204
205			}).attr("src",src);
206
207		}
208
209		var set_automat = setInterval(automat, options.timer);
210 		var automat_start = true;
211 		
212 		next_button.click(function() {
213 			
214 			var clicked = pager.find("span.active").next();
215 			
216 			if(!clicked.length) {
217 				clicked = pager.find("span:first");
218 			}
219 			
220 			// остановили автомат
221			clearInterval(set_automat);
222			automat_start = false;
223			// запустили функцю вручную
224			automat(clicked);
225			// возобновили автомат
226			set_automat = setInterval(automat, options.timer);	
227 		});
228 		
229 		prev_button.click(function() {
230  			
231 			var clicked = pager.find("span.active").prev();
232 			
233 			if(!clicked.length) {
234 				clicked = pager.find("span:last");
235 				console.log(clicked);
236 			}
237 			
238 			// остановили автомат
239			clearInterval(set_automat);
240			automat_start = false;
241			// запустили функцю вручную
242			automat(clicked);
243			// возобновили автомат
244			set_automat = setInterval(automat, options.timer);	
245						
246 		});
247
248		pager.on("click", options.pager_tag, function() {
249			// остановили автомат
250			clearInterval(set_automat);
251			automat_start = false;
252			// запустили функцю вручную
253			automat($(this));
254			// возобновили автомат
255			set_automat = setInterval(automat, options.timer);
256		});
257
258		img.hover( function() {
259			clearInterval(set_automat);
260			automat_start = false;
261		}, function() {
262			if(automat_start) clearInterval(set_automat);
263			set_automat = setInterval(automat, options.timer);
264		});
265	}	
266
267})(jQuery);

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.