var contactStatu = 1; var scrHeight = $(window).height(); var scrWidth = $(window).width(); var excelActivePage = []; var excelPageCount = []; var excelRowCount = []; var excelPageVisibleRow = []; $(document).ready(function() { $('.contact_icon').click(function(e) { if(contactStatu == 0){ contactStatu = 1; $('.contact_icon').css({ transform : 'rotate(0deg)' }); if(scrWidth >= 1024){ $('.contact_data').css({ height : '55%' }); }else{ $('.contact_data').css({ height : '100%', marginBottom : '20px' }); } }else{ contactStatu = 0; $('.contact_icon').css({ transform : 'rotate(180deg)' }); $('.contact_data').css({ height : '0' }); } }); $('[class *= "extab_"]').each(function(e) { var cls = $(this).attr('class').split(' ')[1]; excelActivePage[cls] = 0; excelPager(cls); if(excelPageCount[cls] > 0){ $('.' + cls + ' .excel_forvert_btn').addClass("active"); } $('.' + cls + ' .excel_search').keyup(function(e) { excelSearch(cls, this); }); $('.' + cls + ' .excel_colon_lengt').change(function(e) { excelActivePage[cls] = 0; excelPager(cls); }); $('.' + cls + ' .excel_forvert_btn').click(function(e) { excelNextPage(cls); }); $('.' + cls + ' .excel_back_btn').click(function(e) { excelBackPage(cls); }); }); }); function excelPager(cls) { var pageRowSelect = $('.' + cls + ' .excel_colon_lengt'); excelRowCount[cls] = $('.' +cls+ ' .rows[searchs = "active"]').length; excelPageVisibleRow[cls] = (pageRowSelect.val() * 1) + 2; excelPageCount[cls] = Math.ceil(excelRowCount[cls] / excelPageVisibleRow[cls]) - 1; console.log(excelPageCount[cls] + '//--//' + excelRowCount[cls] +' / '+ excelPageVisibleRow[cls]); var startRovsId = excelActivePage[cls] * excelPageVisibleRow[cls]; var endRovsId = startRovsId + (excelPageVisibleRow[cls] * 1); $('.' +cls+ ' .rows').attr('statu', 'passive'); var ixi = 0; $('.' +cls+ ' .rows').each(function(e) { if($(this).attr('searchs') == 'active' && ixi >= startRovsId && ixi <= endRovsId ){ $(this).attr('statu', 'active'); } if($(this).attr('searchs') == 'active'){ ixi++; } }); } function excelSearch(cls, idx) { var value = $(idx).val().toLowerCase(); var iak = 1; $('.' + cls + ' .rows').filter(function() { if($(this).find('.field').text().toLowerCase().indexOf(value) > -1){ if(iak < excelPageVisibleRow[cls]){ $(this).attr('statu', 'active'); } iak++; $(this).attr('searchs', 'active'); }else{ $(this).attr('statu', 'passive'); $(this).attr('searchs', 'passive'); } }); $('.' + cls + ' .rows:nth-child(2)').attr('statu', 'active'); $('.' + cls + ' .rows:nth-child(3)').attr('statu', 'active'); } function excelNextPage(cls) { if((excelPageCount[cls] ) > excelActivePage[cls]){ excelActivePage[cls]++; $('.' + cls + ' .excel_back_btn').addClass("active"); excelPager(cls); }else{ $('.' + cls + ' .excel_forvert_btn').removeClass("passive"); } console.log(excelActivePage[cls] + '//--//' + excelPageCount[cls]); } function excelBackPage(cls) { if(0 < (excelActivePage[cls])){ excelActivePage[cls]--; $('.' + cls + ' .excel_forvert_btn').addClass("active"); excelPager(cls); }else{ $('.' + cls + ' .excel_back_btn').removeClass("passive"); } } var secret_menu = 0; function openSecret() { if(secret_menu == 0){ secret_menu = 1; $('.header').css({ right : '0' }); $('.slider_right_icon').css({ right : '230px' }); }else{ secret_menu = 0; $('.header').css({ right : '-185px' }); $('.slider_right_icon').css({ right : '45px' }); } } $().ready(function () { console.log(window.location.pathname); var page_url = window.location.pathname; var kvkk = getCookie('dms_kvkk'); if(page_url != '/kvkk-genel-aydinlatma-metni'){ if(kvkk != 'accept' || kvkk == ''){ $('.cerez_politikasi_contant').css({ height : 'auto', padding : '10px' }); }else{ setCookie('dms_kvkk', 'accept', 365); } } }); function acceptKvkk() { console.log('kabul'); setCookie('dms_kvkk', 'accept', 365); $('.cerez_politikasi_contant').css({ height : '0', padding : '0' }); } "use strict"; function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); var expires = "expires=" + d.toGMTString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function getCookie(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; }