var window_width = parseFloat($(window).width()), window_height = parseFloat($(window).height()); $(document).ready(function () { root = $('#root').attr('href'); setTimeout(function () { $.ajax({ type: 'POST', url: root + 'home/checkcookies', data: { check_cookies: 1 } }).done(function (data) { if (data == '1') { $('#biskvitki').remove(); } else { $('#biskvitki').show(); } }); }, 5000); $(document).on('click', '#ok',function () { $('#biskvitki').remove(); $.ajax({ type: 'POST', url: root + 'home/setcookies', data: { set_cookies: 1 } }); }); /** * Без кавички */ $(this).on('keyup click', 'input[type=text],textarea.noqu', function () { this.value = this.value.replace(/["'`]/g, ''); }); $(document).on('click', '.close_djam,.djam,.djam_prodex', function () { close_djam(); }); }); /** * * @description Опресняване на страницата * @returns {undefined} */ function refresh(url) { if (url) { window.location.href = url; } else { window.location.href = window.location.href; } } function djam2(text) { var w = parseFloat($(window).width()), h = parseFloat($(window).height()); $('body').append('
'); $('.djam1').css({ 'top': 0, 'left': 0, 'max-height': h - 30 }); $('body').css('overflow', 'hidden'); $('.djam').css('bacground', null); $('.djam1').show(250); } /** * * @description Затваряне на псевдо alert() * @returns {undefined} */ function close_djam() { $('.djam1').hide(); $('.djam').animate({ 'opacity': 0 }, function () { $('body').css('overflow', 'inherit'); $('.djam,.djam1').remove(); }); } /** * Проверява, дали е JSON * @param {string} str * @returns {Boolean} */ function IsJson(str) { try { JSON.parse(str); } catch (e) { return false; } return true; } function hover_focus() { $('input,textarea,select').hover(function () { $(this).focus(); }); }