1$(document).ready(function() 2{ 3 /*Modal*/ 4 $(".dish-item").on("click", function() 5 { 6 var params = "product=" + $(this).attr("data-dish"); 7 8 $("#overlay").fadeIn(500, function() 9 { 10 $.ajax({ 11 type: "POST", 12 dataType: "html", 13 url: rootPath + "views/ajax/modal.php", 14 data: params, 15 success: function(data) 16 { 17 $("#modal-dish").html(data); 18 $("#modal-dish").fadeIn(300); 19 } 20 }); 21 }); 22 }); 23 24 $(document).on("click", ".modal-close, #overlay", function() 25 { 26 $("div.modal-window").fadeOut(300); 27 $("#overlay").fadeOut(500); 28 }); 29 30 var selectors = "#modal-dish div.next, #modal-dish div.prev"; 31 32 $(document).on("click", selectors, function() 33 { 34 var current_id = $("#modal-dish div.name").attr("data-dish"); 35 var index = list_products.indexOf(current_id); 36 37 if($(this).hasClass("next")) 38 index = (index == (list_products.length - 1)) ? 0 : index + 1; 39 else 40 index = index ? index - 1 : (list_products.length - 1); 41 42 $.ajax({
43 type: "POST", 44 dataType: "html", 45 url: rootPath + "views/ajax/modal.php", 46 data: "product=" + list_products[index], 47 success: function(data) 48 { 49 $("#modal-dish").html(data); 50 } 51 }); 52 return false; 53 }); 54 55 /*Select side menu*/ 56 $("div.left-column select").change(function() 57 { 58 var url = $(this).val(); 59 $(location).attr("href", url); 60 }); 61 62 /*Input mask*/ 63 $("input[name='phone']").mask("+7(999) 999-99-99", {placeholder: "_"}); 64 65 /*Mobile menu*/ 66 $("#menu-button").on("click", function() 67 { 68 $("#overlay").fadeIn(500, function() 69 { 70 $("#mobile-menu").addClass("showed"); 71 }); 72 }); 73 74 $("#menu-close, #overlay").on("click", function() 75 { 76 $("#mobile-menu").removeClass("showed"); 77 $("#overlay").fadeOut(500); 78 }); 79 80 $("#mobile-menu li:has(ul), .main-menu li:has(ul)").children("a").addClass("arrow"); 81 $("#mobile-menu li:has(ul), .main-menu li:has(ul)").children("span").addClass("arrow"); 82 83 $("#mobile-menu a.arrow").on("click", function (event) 84 { 85 $(this).toggleClass("active"); 86 87 if(!$(this).hasClass("active")) 88 $(this).parent().siblings().children("ul").hide(400).prev("a.active").removeClass("active"); 89 90 $(this).next("ul").slideToggle(); 91 return false; 92 }); 93 94 $("#mobile-menu span.arrow").on("click", function(event) 95 { 96 $(this).toggleClass("active"); 97 98 if(!$(this).hasClass("active")) 99 $(this).parent().siblings().children("ul").hide(400).prev("span.active").removeClass("active"); 100 101 $(this).next("ul").slideToggle(); 102 103 }); 104 105 /*To anchors*/ 106 $(".anchor").on("click", function (event) 107 { 108 event.preventDefault(); 109 var id = $(this).attr("href"), 110 top = $(id).offset().top; 111 $("body,html").animate({scrollTop: top-80}, 1000); 112 }); 113 114 /*To-top*/ 115 $(window).scroll(function () 116 { 117 if ($(window).width() > 800 && $(this).scrollTop() > 200) 118 $("div.to-top").fadeIn(); 119 else 120 $("div.to-top").fadeOut(); 121 }); 122 123 $("div.to-top, div.mobile-to-top").on("click", function () 124 { 125 $("body,html").animate({scrollTop: 0}, 800); 126 }); 127 128 $(window).resize(); 129 130 /*Menu*/ 131 $(".weeks-numbers li").on("click", function() 132 { 133 $(this).addClass("active").siblings().removeClass("active"); 134 }); 135 136 /*Hidden text*/ 137 $(".hidden-text-toggle").on("click", function() 138 { 139 $(".hidden-text").toggleClass("showed"); 140 141 if($(".hidden-text").hasClass("showed")) 142 $(".hidden-text-toggle").html("<span>СвеÑнÑÑÑ<span>"); 143 else 144 $(".hidden-text-toggle").html("<span>ЧиÑаÑÑ Ð¿Ð¾Ð»Ð½Ð¾ÑÑÑÑ<span>"); 145 }); 146 147 /* display product for search url */ 148 function GetURLParameter(sParam) 149 { 150 var sPageURL = window.location.search.substring(1); 151 var sURLVariables = sPageURL.split('&'); 152 for (var i = 0; i < sURLVariables.length; i++) { 153 var sParameterName = sURLVariables[i].split('='); 154 155 if (sParameterName[0] == sParam) { 156 return sParameterName[1]; 157 } 158 } 159 } 160 161 var dish = GetURLParameter('dish'); 162 163 if(dish !== undefined) 164 { 165 $("div.dish-item").each(function() 166 { 167 if($(this).data("dish") == dish) 168 $(this).trigger("click"); 169 }) 170 } 171 172 $(".sb-icon-search").on("click", function() 173 { 174 $("#sb-search").toggleClass("sb-search-open") 175 }); 176 177 $(document).on('click', 'button[name=btnSendStudentFormAjax]', function (ev) { 178 let Frm = $('#VerifyCodeForm'); 179 let Data = Frm.serializeObject(); 180 let ErrorDiv = $('#VerifyCodeError'); 181 ErrorDiv.css('display', 'none'); 182 $.ajax({
183 type: 'POST', 184 url: rootPath + 'views/ajax/student-form.php', 185 data: Data, 186 beforeSend: function () { 187 $('.preloader').fadeIn('fast', function () {}); 188 }, 189 success: function (response) { 190 let Obj; 191 try { 192 Obj = JSON.parse(response); 193 if ( Obj.result > 0 ) { 194 window.location.href = window.location.href + "?sent=1"; 195 } else { 196 ErrorDiv.css('display', 'block'); 197 ErrorDiv.html(`<b>${Obj.message}</b>`); 198 } 199 } catch (e) { 200 // console.log('Error:'); 201 // console.log(e); 202 alert_a('ÐÑибка полÑÑÐµÐ½Ð¸Ñ Ð´Ð°Ð½Ð½ÑÑ '); 203 } 204 }, 205 error: function () { 206 alert_a('ÐÑибка ÑвÑзи Ñ ÑеÑвеÑом'); 207 }, 208 complete: function () { 209 $('.preloader').fadeOut('fast', function () {}); 210 } 211 }); 212 }); 213 214});
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.