1 2/* MODALS */ 3 4// $('[data-modal]').click(function () { 5// showModal('#' + $(this).attr('data-modal')); 6// }); 7 8function showModal(selector, data) { 9 $('.loading-indicator-overlay').hide(); 10 if (getCookie(selector) == 'no') { 11 return; 12 } 13 var modal_this = (selector); 14 15 if ($(selector).closest('.modal-wrapper').hasClass('modal-wrapper_active')) { 16 17 $(selector).closest('.modal-wrapper') 18 .unbind('click'); 19 20 $(modal_latest) 21 .fadeOut(400) 22 .removeClass('modal-window_active'); 23 24 $(modal_this) 25 .fadeIn(400) 26 .addClass('modal-window_active'); 27 28 modal_latest = modal_this; 29 30 $(selector).closest('.modal-wrapper') 31 .bind('click', { 32 val: modal_latest, 33 }, clickWrapper); 34 35 } else { 36 37 $(selector).closest('.modal-wrapper') 38 .fadeIn(400) 39 .addClass('modal-wrapper_active'); 40 41 $(modal_this) 42 .fadeIn(400) 43 .addClass('modal-window_active'); 44 45 if (data !== undefined) { 46 47 var items = ''; 48 $('#request_password_reset').html(''); 49 for (var value in data) { 50 items += '<li>' + (data[value][0]) + '</li>'; 51 if (value === "registrationstepone-email" && data[value][0] === "ÐаннÑй e-mail Ñже ÑÑÑеÑÑвÑÐµÑ Ð² ÑиÑÑеме."){ 52 $('#request_password_reset').html('<a href="/user/request-password-reset" class="button button_green validation-info_button m-close-button">ÐоÑÑÑановиÑÑ Ð¿Ð°ÑолÑ</a>'); 53 } 54 } 55 56 var errorMessage = '<ul class="error-messages">' + items + '</ul>'; 57 58 $('.validation-info__text').html(errorMessage); 59 } 60 61 62 modal_latest = modal_this; 63 64 var path = $(selector).find('iframe').data('src'); 65 $(selector).find('iframe').attr('src', path); 66 67 $(selector).closest('.modal-wrapper') 68 .bind('click', { 69 val: modal_latest, 70 }, clickWrapper); 71 } 72 73 $('body').addClass('scroll_off'); 74 75 return true; 76} 77 78function clickWrapper(event) { 79 if ($(event.target).hasClass('m-close-button')) { 80 81 if (event.data.val == '#m-validation-error') { 82 mcloseValidate(); 83 return; 84 } 85 86 if ($(event.target).hasClass('closeAlbumVideo')) { 87 stopVideo($(event.target).closest('.modal-video-profile')); 88 89 $(modal_latest) 90 .fadeOut(400) 91 .removeClass('modal-window_active'); 92 $(modal_latest).closest('.modal-wrapper_active').removeClass('modal-wrapper_active').fadeOut(400); 93 94 event.preventDefault(); 95 96 return; 97 } 98 99 mClose(); 100 scrollToError(); 101 102 if ($(event.target).hasClass('close-video')) { 103 stopVideo($(event.target).closest('.modal-video-profile')); 104 } 105 106 $(modal_latest).closest('.modal-wrapper_active').removeClass('modal-wrapper_active').fadeOut(400).unbind('click'); 107 $(modal_latest).fadeOut(400).removeClass('modal-window_active'); 108 109 return; 110 } 111 if ($(event.target).hasClass('m-yes-button')) { 112 deleteAlbum($(event.target).attr('data-id')); 113 mClose(); 114 return; 115 } 116 if ($(event.target).hasClass('m-later-button')) { 117 mClose(); 118 $('#save-unfinished').val(1); 119 $($(event.target).attr('data-button')).click(); 120 return; 121 } 122 if ($(event.target).hasClass('m-later-button-company')) { 123 mClose(); 124 $('#save-unfinished').val(2); 125 $('.form-submit-button').click(); 126 // location.href = '/personal/products'; 127 return; 128 } 129 if ($(event.target).hasClass('m-never-show-again')) { 130 mNever($(event.target).closest('.modal-window').attr('id')); 131 mClose(); 132 return; 133 } 134 135 if ($(event.target).hasClass('button-close') || $(event.target).hasClass('stop-reload')) { 136 137 if ($(event.target).hasClass('delete-upld')) { 138 return; 139 } 140 141 mClose(); 142 event.preventDefault(); 143 return; 144 } 145 146 if ($(event.target).closest($(event.data.val)).length) { 147 console.log('Click on: ' + event.data.val); 148 } else { 149 if ($('#m-send-ok').length && event.data.val === '#m-message-sent') { 150 location.reload(); 151 } 152 console.log('Click around: ' + event.data.val); 153 if (event.data.val !== '#m-validation-error') { 154 mClose(); 155 } 156 } 157
158 if ($(event.target).hasClass('choose-profile-for-message')) { 159 $('#newmessageform-sender_company_id').val($(event.target).data('id')); 160 mClose(); 161 showModal('#m-send-message'); 162 return; 163 } 164 165 if ($(event.target).hasClass('choose-profile-for-request')) { 166 $('#newrequestform-sender_company_id').val($(event.target).data('id')); 167 mClose(); 168 showModal('#m-send-request'); 169 return; 170 } 171 172 if ($(event.target).hasClass('choose-profile-for-review')) { 173 $('#review-sender_id').val($(event.target).data('id')); 174 mClose(); 175 $('#review-button-contractor').hide(); 176 $('#review-button').show().click(); 177 return; 178 } 179} 180 181$('.modal__close').click(function () { 182 mClose(); 183}); 184 185/** 186 * ÑкÑолл к пеÑÐ²Ð¾Ð¼Ñ ÑлеменÑÑ Ñ Ð¾Ñибкой 187 */ 188function scrollToError() { 189 var $element = $(); 190 if ($('.accordion-item_open .input-text_invalid').length) { 191 $element = $('.accordion-item_open .input-text_invalid').first(); 192 } else if ($('.input-text_invalid').length) { 193 $element = $('.input-text_invalid').first(); 194 } else if ($('.invalid-text').length) { 195 $element = $('.invalid-text').first(); 196 $('#message-upload-error').css('color', 'red'); 197 } 198 if ($element.length) { 199 $('html, body').animate({ 200 scrollTop: $element.offset().top - 20 201 }, 1000); 202 } 203} 204 205function mClose() { 206 $('.modal-wrapper') 207 .fadeOut(400) 208 .removeClass('modal-wrapper_active') 209 .unbind('click'); 210 211 $(modal_latest) 212 .fadeOut(400) 213 .removeClass('modal-window_active'); 214 215 $(modal_latest).trigger('close_modal'); 216 $('body').removeClass('scroll_off'); 217} 218 219/** 220 * помеÑка о Ñом, ÑÑо окно по Ð´Ð°Ð½Ð½Ð¾Ð¼Ñ ÑелекÑоÑÑ Ð±Ð¾Ð»ÑÑе не надо показÑваÑÑ 221 * @param selector 222 */ 223function mNever(selector) { 224 setCookie('#' + selector, 'no'); 225} 226 227/* SIGN UP / SIGN IN */ 228 229$('#sign-in-submit').click(function () { 230 $('.modal-form_sign_in').submit(); 231}); 232 233$('#sign-up-submit').click(function () { 234 $('.modal-form_sign_up').submit(); 235}); 236 237$('#sign-up-avatar').click(function () { 238 event.preventDefault(); 239}); 240 241/** 242 * @param selector 243 * @param title 244 * @param fullDescription 245 * @param price 246 * @param code 247 */ 248function showModalFoto(selector, title, fullDescription, price, code, number) { 249 var modal_this = (selector); 250 251 if ($(selector).closest('.modal-wrapper').hasClass('modal-wrapper_active')) { 252 253 $(selector).closest('.modal-wrapper') 254 .unbind('click'); 255 256 $(modal_latest) 257 .fadeOut(400) 258 .removeClass('modal-window_active'); 259 260 $(modal_this) 261 .fadeIn(400) 262 .addClass('modal-window_active'); 263 264 modal_latest = modal_this; 265 266 $(selector).closest('.modal-wrapper') 267 .bind('click', { 268 val: modal_latest, 269 }, clickWrapper); 270 271 } else { 272 273 $(selector).closest('.modal-wrapper') 274 .fadeIn(400) 275 .addClass('modal-wrapper_active'); 276 277 $(modal_this) 278 .fadeIn(400) 279 .addClass('modal-window_active'); 280 281 $('.modal-window-more__title').html(title); 282 $('.modal-window-more__content').html(fullDescription); 283 $('.modal_price__value').html(price); 284 $('.modal_price__top').html(code); 285 $('.modal-window-more__button').attr('data-number', number); 286 287 $('.modal-window-more__content').css({'overflow-y': 'auto'}); 288 $('.modal-window-more__content').scrollTop(0); 289 290 modal_latest = modal_this; 291 292 $(selector).closest('.modal-wrapper') 293 .bind('click', { 294 val: modal_latest, 295 }, clickWrapper); 296 } 297 298 $('body').addClass('scroll_off'); 299} 300 301function mcloseValidate() { 302 $('.modal-wrapper[id="modal"]') 303 .fadeOut(400) 304 .removeClass('modal-wrapper_active') 305 .unbind('click'); 306 307 $(modal_latest) 308 .fadeOut(400) 309 .removeClass('modal-window_active'); 310 311 $('body').removeClass('scroll_off'); 312} 313 314$('.m-close-reload').click(() => { 315 location.reload(); 316});;
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.