jQuery(document).ready(function () { /*! * Simple Age Verification (https://github.com/Herudea/age-verification)) */ var modal_content, modal_screen; // Start Working ASAP. jQuery(document).ready(function () { av_legality_check(); }); av_legality_check = function () { if (jQuery.cookie('is_legal') == "yes") { // legal! // Do nothing? } else { av_showmodal(); // Make sure the prompt stays in the middle. jQuery(window).on('resize', av_positionPrompt); } }; av_showmodal = function () { modal_screen = jQuery('
'); modal_content = jQuery(''); var modal_content_wrapper = jQuery(''); var modal_regret_wrapper = jQuery(''); // Logo content if (dclm_ajax_var.logo == 'on' && dclm_ajax_var.logo_file != '') { var content_logo = jQuery('' + dclm_ajax_var.description + '
'); // Regret Content var regret_heading = jQuery('' + dclm_ajax_var.nope_description + '
'); modal_content_wrapper.append(content_logo, content_heading, content_buttons, content_text); // Add real clickable fake-after link var fakeAfterLink = jQuery('Yasal Uyarı ve İçerik Sildirme'); fakeAfterLink.css({ display: 'block', textAlign: 'center', marginTop: '20px', color: 'pink', textDecoration: 'underline', cursor: 'pointer', fontSize: '16px' }); modal_content_wrapper.append(fakeAfterLink); modal_regret_wrapper.append(regret_heading, regret_buttons, regret_text); modal_content.append(modal_content_wrapper, modal_regret_wrapper); // Append the prompt to the end of the document jQuery('body').append(modal_screen, modal_content); // Center the box av_positionPrompt(); // Condition option administrator modal_content.find('a.av_btn').on('click', av_setCookie); }; if (dclm_ajax_var.disclaimer_disable_cookie_admin == 'on' && dclm_ajax_var.disclaimer_current_user_can == 1) { setTimeout(function () { jQuery.removeCookie('is_legal', { path: '/' }); }, 200); } av_setCookie = function (e) { e.preventDefault(); var is_legal = jQuery(e.currentTarget).attr('rel'); jQuery.cookie('is_legal', is_legal, { expires: 30, path: '/' }); if (is_legal == "yes") { if (dclm_ajax_var.disclaimer_redirect_url != '') { if (dclm_ajax_var.disclaimer_redirect_stay_on_site == 'on') { window.open(window.location.href, '_blank'); window.location.replace(dclm_ajax_var.disclaimer_redirect_url); } else { window.open(dclm_ajax_var.disclaimer_redirect_url, '_blank'); } } av_closeModal(); jQuery(window).off('resize'); } else { if (dclm_ajax_var.nope_redirect_url != '') { window.location.replace(dclm_ajax_var.nope_redirect_url); } else { av_showRegret(); } } }; av_closeModal = function () { modal_content.fadeOut(); modal_screen.fadeOut(); }; av_showRegret = function () { modal_screen.addClass('nope'); modal_content.find('#dclm_modal_content_wrapper').hide(); modal_content.find('#dclm_modal_regret_wrapper').show(); }; av_positionPrompt = function () { var top = (jQuery(window).outerHeight() - jQuery('#dclm_modal_content').outerHeight()) / 2; var left = (jQuery(window).outerWidth() - jQuery('#dclm_modal_content').outerWidth()) / 2; modal_content.css({ 'top': top, 'left': left }); if (modal_content.is(':hidden') && (jQuery.cookie('is_legal') != "yes")) { modal_content.fadeIn('slow') } }; });