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.