/*main.js*/ jQuery(document).ready(function(){ jQuery('[data-toggle="tooltip"]').tooltip(); jQuery('#ca-remove').click(function(){ jQuery(this).parent().fadeOut(); }); jQuery('#site_comment_action').click(function(){ var id = jQuery(this).data('id'); jQuery('#site_comment_main_wrap_action_'+id).toggleClass('site_comment_main_wrap_action_margin'); }); jQuery('.post-link-open').click(function(){ var ref = jQuery(this).data('href'); window.location.href= ref; }); if(window.location.hash == '#comment' || window.location.hash.split('-')[0] == '#comment') { if(jQuery('.site_comment_main_wrap').length != 0) { jQuery('.site_comment_main_wrap').addClass('site_comment_main_wrap_action_margin'); } } if(window.location.hash == '#report') { if(jQuery('#post_report_popup').length != 0) { $('#post_report_popup').modal('show'); } } jQuery('#post_report_popup').on('shown.bs.modal', function () { jQuery('form#post_report').validator().on('submit', function (e) { if (e.isDefaultPrevented()) { // handle the invalid form... } else { // everything looks good! e.preventDefault(); var data = $('form#post_report').serialize(); jQuery.post( ajaxurl, { 'action': 'frontend_post_report', 'data': data }, function(response){ alert('Your report has been sent to admin!'); } ); } }) }) jQuery('.site_search_form_text_box').focus(function(){ jQuery(this).parent().addClass('expend_site_search_form_text'); }); jQuery('.site_search_form_text_box').blur(function(){ jQuery(this).parent().removeClass('expend_site_search_form_text'); }); jQuery('form.post_request').validator().on('submit', function (e) { if (e.isDefaultPrevented()) { // handle the invalid form... } else { // everything looks good! e.preventDefault(); var data = $('form#post_request').serialize(); jQuery.post( ajaxurl, { 'action': 'frontend_post_req', 'data': data }, function(response){ alert('Your Post Request Has Been Sent To Admin!'); } ); } }) var cubuk_seviye = $(document).scrollTop(); var header_yuksekligi = $('.site_header').outerHeight(); jQuery(window).scroll(function() { var kaydirma_cubugu = jQuery(document).scrollTop(); if (kaydirma_cubugu > header_yuksekligi){jQuery('.site_header').addClass('sticky');} else {jQuery('.site_header').removeClass('sticky');} if (kaydirma_cubugu > cubuk_seviye){jQuery('.site_header').removeClass('unsticky');} else {jQuery('.site_header').addClass('unsticky');} cubuk_seviye = jQuery(document).scrollTop(); }); });