var topModal = false, listData = { page: '1' }; // Select ile seçim Fonksiyonu function select(data, selected, shown) { var select = $('#' + selected).val(); var show = shown.split(','); var i = 0; for (i = 0; i < show.length; i++) { if (select == data) { $('#' + show[i]).removeClass('d-none').addClass('d-block'); } else { $('#' + show[i]).removeClass('d-block').addClass('d-none'); } } }; // Checkbox ile seçim Fonksiyonu function show(action, secilen, gosterilenler) { var gosterilen = gosterilenler.split(','); if (action == '0') { var i = 0; for (i = 0; i < gosterilen.length; i++) { if ($('#' + secilen).is(':checked')) { $('#' + gosterilen[i]).removeClass('d-block').addClass('d-none'); } else { $('#' + gosterilen[i]).removeClass('d-none').addClass('d-block'); } } } else if (action == '1') { var i = 0; for (i = 0; i < gosterilen.length; i++) { if ($('#' + secilen).is(':checked')) { $('#' + gosterilen[i]).removeClass('d-none').addClass('d-block'); } else { $('#' + gosterilen[i]).removeClass('d-block').addClass('d-none'); } } } }; // Payment 3D Iframe function payment3DIframe(modal_id, url, data = null, callback = null, tModal = false) { topModal = tModal; $('#' + modal_id).find('.modal-content').find('[data-plugin-popover][popover-opened="true"]').popover('hide'); $('#' + modal_id).find('.modal-content').empty(); $('#' + modal_id).removeData('bs.modal'); $('#' + modal_id).modal({ show: true, backdrop: 'static', keyboard: false }); $('#' + modal_id).find('.modal-content').html(''); $('#' + modal_id).find('.modal-content').find('.modal-body').mCustomScrollbar({ advanced: { updateOnContentResize: true }, mouseWheelPixels: 100, scrollInertia: 250, theme: 'inset-dark' }); $('#' + modal_id).find('.modal-content').find('.modal-body').find('.mCustomScrollBox .mCSB_container').html(''); if(data){ var iframeForm = $(''); $('').appendTo(iframeForm); $('').appendTo(iframeForm); $('#' + modal_id).find('.modal-content').find('.modal-body').find('.mCustomScrollBox .mCSB_container').append(iframeForm); $('#' + modal_id + '_form').on('submit', function () { setTimeout(function(){ $('#' + modal_id + '_form').remove(); $('#' + modal_id).find('.modal-content').find('.modal-body').find('.mCustomScrollBox .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar').attr('style', 'background-color:#202325 !important'); }, 500); }); }else{ $('#' + modal_id + '_iframe').on('load', function () { setTimeout(function(){ $('#' + modal_id).find('.modal-content').find('.modal-body').find('.mCustomScrollBox .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar').attr('style', 'background-color:#202325 !important'); }, 500); }); } if(callback){ callback(); } $(window).on('beforeload', function (e) { console.log(e); }); $.fn.modal.Constructor.prototype._enforceFocus = function() {}; if (topModal == true) { setTimeout(function(){ $('#' + modal_id).css('z-index', '1101'); $('.modal-backdrop:last').css('z-index', '1100'); }, 100); } if (topModal == false && $('.modal-backdrop').length > 1) { $('.modal-backdrop:last').remove(); } if(data){ $('#' + modal_id + '_form').submit(); }else{ $('#' + modal_id + '_iframe').attr('src', url); } } // Payment 3D Iframe function payment3DIframe2(modal_id, url, data = null, callback = null, tModal = false) { topModal = tModal; $('#' + modal_id).find('.modal-content').find('.modal-body').mCustomScrollbar({ advanced: { updateOnContentResize: true }, mouseWheelPixels: 100, scrollInertia: 250, theme: 'inset-dark' }); $('#' + modal_id).find('.modal-content').find('.modal-body').find('.mCustomScrollBox .mCSB_container').html(''); if(data){ var iframeForm = $(''); $('').appendTo(iframeForm); $('').appendTo(iframeForm); $('#' + modal_id).find('.modal-content').find('.modal-body').find('.mCustomScrollBox .mCSB_container').append(iframeForm); $('#' + modal_id + '_form').on('submit', function () { setTimeout(function(){ $('#' + modal_id + '_form').remove(); $('#' + modal_id).find('.modal-content').find('.modal-body').find('.mCustomScrollBox .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar').attr('style', 'background-color:#202325 !important'); }, 500); }); }else{ $('#' + modal_id + '_iframe').on('load', function () { setTimeout(function(){ $('#' + modal_id).find('.modal-content').find('.modal-body').find('.mCustomScrollBox .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar').attr('style', 'background-color:#202325 !important'); }, 500); }); } if(callback){ callback(); } if(data){ $('#' + modal_id + '_form').submit(); }else{ $('#' + modal_id + '_iframe').attr('src', url); } } // Modal function modal(btn, modal_id, address, tModal = false, data = null, metod = 'GET') { topModal = tModal; $('#' + modal_id).find('.modal-content').find('[data-plugin-popover][popover-opened="true"]').popover('hide'); $('#' + modal_id).find('.modal-content').empty(); $('#' + modal_id).removeData('bs.modal'); $('#' + modal_id).modal({ show: true, backdrop: 'static', keyboard: false }); var json, status; $.ajax({ url: ADDRESS_SITE + address, type: metod, data: data, beforeSend: function() { $('body .tooltip').tooltip('hide'); $('#' + modal_id).find('.modal-content').html('
'); }, error: function(xhr, errorString, exception) { var message = ''; $('#' + modal_id).find('.modal-content').html(message); }, success: function(response) { try { json = $.parseJSON(response); status = json.status; } catch (err) { status = 'success'; } if (status == 'error') { var message = ''; $('#' + modal_id).find('.modal-content').html(message); } else { $('#' + modal_id).find('.modal-content').html(response); modal_scroll(modal_id); $.fn.modal.Constructor.prototype._enforceFocus = function() {}; } }, complete: function(response) { (function($) { 'use strict'; if ($('#' + modal_id).find('[data-plugin-tooltip]').length > 0) { if ($.isFunction($.fn['tooltip'])) { $(function() { $('#' + modal_id).find('[data-plugin-tooltip]').each(function() { var _this = $(this); _this.tooltip(); _this.click(function(){ $(this).tooltip('hide'); }); }); }); } } }).apply(this, [jQuery]); (function($) { 'use strict'; if ($('#' + modal_id).find('[data-plugin-clipboard]').length > 0) { if (typeof ClipboardJS !== undefined) { $(function() { $('#' + modal_id).find('[data-plugin-clipboard]').each(function() { var _this = this; var copy = new ClipboardJS(_this, { container: $('#' + modal_id).get(0) }); copy.on('error', function(e) { notification('error', 'HATA!', 'Kopyalanamadı.
Lütfen yazılım danışmanınıza başvurun.'); }); }); }); } } }).apply(this, [jQuery]); } }); if (topModal == true) { setTimeout(function(){ $('#' + modal_id).css('z-index', '1101'); $('.modal-backdrop:last').css('z-index', '1100'); }, 100); } if (topModal == false && $('.modal-backdrop').length > 1) { $('.modal-backdrop:last').remove(); } if ($(btn).data('command')) { var command = new Function($(btn).data('command')); return command(); } } function modal_scroll(modal_id) { var _this = $('#' + modal_id); setTimeout(function(){ if (modal_id !== 'modal_file') { if(_this.find('.modal-body').hasClass('mCustomScrollbar')){ _this.find('.modal-body').mCustomScrollbar('destroy'); } _this.find('.modal-body').mCustomScrollbar({ advanced: { updateOnContentResize: true }, mouseWheelPixels: 100, scrollInertia: 250, theme: 'minimal' }); } }, 500); } // Modal Açınca Mobilde Tam Ekran Yap // $('body').on('shown.bs.modal', '.modal', function(e) { // if($(window).innerWidth()<480){ // document.documentElement.webkitRequestFullscreen(); // } // }); // // Modal Kapatınca Tam Ekran'dan Çık // $('body').on('hidden.bs.modal', '.modal', function(e) { // document.webkitExitFullscreen(); // }); // Modal İçeriği Temizleme $('body').on('hidden.bs.modal', '.modal', function(e) { var modal_id = e.target.id; if (topModal == true) { $('body').addClass('modal-open'); topModal = false; } else { $('#' + modal_id).find('.modal-content').html(''); $(this).removeData('bs.modal'); } if (this.f_listModal && (modal_id == 'modal_content' || modal_id == 'modal_file')) { listData = { page: '1' }; listData[CSRFTokenKey] = CSRFToken; } }); // Şifre Yenileme Fonksiyonu function passRefresh(btn, input_id) { var button = $(btn); var input = '#' + input_id; var passRefresh = null; var data = { input: input }; data[CSRFTokenKey] = CSRFToken; $.ajax({ url: ADDRESS_SITE + 'help/password', type: 'POST', data: data, dataType: 'JSON', beforeSend: function() { button.prop('disabled', true); }, error: function(xhr, errorString, exception) { ajaxErrorNotification(xhr, errorString, exception); ajaxResult = false; }, success: function(response) { if (response.status == 'error') { ajaxNullNotification(response); ajaxResult = false; return false; } else { ajaxResult = response; if(response.notification !== null) { if (response.notification.type && response.notification.type !== null) { notification(response.notification.type, response.notification.title, response.notification.message); } } $('').insertAfter(input); passRefresh = $('#' + response.randomId).text(); $(input).val(passRefresh); $(input + '_' + 'again').val(passRefresh); $('#' + response.randomId).remove(); if (response.command) { eval(response.command); } } }, complete: function() { passRefresh = null; button.prop('disabled', false); } }); } // Şifre Göster/Gizle Fonksiyonu function passSH(btn, input_id) { var button = $(btn); button.prop('disabled', true); if (button.find('i').hasClass('fa-eye')) { $('#' + input_id).attr('type', 'text'); button.find('i').removeClass('fa-eye').addClass('fa-eye-slash'); } else { $('#' + input_id).attr('type', 'password'); button.find('i').removeClass('fa-eye-slash').addClass('fa-eye'); } button.prop('disabled', false); } // Toastr Bildirim function notification(type, title, message, isStatic = false) { toastr.clear(); toastr.options = { 'closeButton': false, 'debug': false, 'newestOnTop': false, 'progressBar': true, 'rtl': false, 'positionClass': 'toast-top-center', 'preventDuplicates': false, 'onclick': false, 'tapToDismiss': false, 'showDuration': 300, 'hideDuration': 1000, 'timeOut': (isStatic==true ? 0 : 5000), 'extendedTimeOut': (isStatic==true ? 0 : 5000), 'showEasing': 'swing', 'hideEasing': 'linear', 'showMethod': 'fadeIn', 'hideMethod': 'fadeOut' }; var notification = toastr[type](message, '
' + title + '
'); } // Ajax İşlemleri Bildirim Şablonu function ajaxErrorNotification(xhr, errorString, exception) { var title = 'İŞLEM HATASI!'; var message = 'Bilinmeyen bir nedenle işlem tamamlanamadı. Hata Detayı:
xhr.status = ' + xhr.status + '
xhr.responseText = ' + xhr.responseText + '
error = ' + errorString + '
exception = |' + exception + '|'; notification('error', title, message); } function ajaxNullNotification(response) { var title = 'İŞLEM HATASI!'; var message = (response ? (response.message ? response.message : 'Aradığınız sayfa bulunamadı!') + (response.url ? '
Adres: ' + response.url : '') : 'Bilinmeyen bir nedenle işlem tamamlanamadı.'); notification('error', title, message); if (response.command) { eval(response.command); } } function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); var expires = 'expires=' + d.toUTCString(); document.cookie = cname + '=' + cvalue + ';' + expires + ';path=/'; } function strip_tags(html) { var tmp = document.createElement('DIV'); tmp.innerHTML = html; return tmp.textContent || tmp.innerText || ''; } function unset_GET(parameter, url) { url = url == null ? window.location.href : url; var urlparts = url.split('?'); if (urlparts.length >= 2) { var prefix = encodeURIComponent(parameter) + '='; var pars = urlparts[1].split(/[&;]/g); //reverse iteration as may be destructive for (var i = pars.length; i-- > 0;) { //idiom for string.startsWith if (pars[i].lastIndexOf(prefix, 0) !== -1) { pars.splice(i, 1); } } url = urlparts[0] + (pars.length > 0 ? '?' + pars.join('&') : ''); return url; } else { return url; } } function _GET(name, url) { if (!url) url = window.location.href; name = name.replace(/[\[\]]/g, '\\$&'); var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(results[2].replace(/\+/g, ' ')); } function set_GET(key, value, url) { if (!url) url = window.location.href; var re = new RegExp('([?&])' + key + '=.*?(&|$)', 'i'); var separator = url.indexOf('?') !== -1 ? '&' : '?'; if (url.match(re)) { return url.replace(re, '$1' + key + '=' + value + '$2'); } else { return url + separator + key + '=' + value; } } function setURL(url) { var title = $('title').html(); window.history.pushState('object or string', title, url); } function getJson(str) { var parse; try { parse = JSON.parse(str); } catch (e) { return false; } return parse; } function json_decode(str) { return getJson(str); } function json_encode(obj) { return JSON.stringify(obj); } function in_array(needle, haystack) { var length = haystack.length; for (var i = 0; i < length; i++) { if (haystack[i] == needle) return true; } return false; } function html_entity_decode(str) { var txt = document.createElement('textarea'); txt.innerHTML = str; return txt.value; } function html_entities(str) { return String(str).replace(/&/g, '&').replace(//g, '>').replace(/'/g, '"'); } $('.nav.nav-url .nav-item').click(function() { var tab_href = $(this).find('.nav-link').attr('href'); var link = set_GET('tab', tab_href.replace('#tab-', '')); var title = $('title').html(); window.history.pushState('object or string', title, link); }); var ilter = function() { return { // İşlem Fonksiyonu action: function(btn, content, action, form) { var button = $(btn), buttonText = button.html(), buttonWidth = button.outerWidth(), buttonHeight = button.outerHeight(), ajaxResult, formId = '#' + form, formData = new FormData($(formId)[0]); formData.append(CSRFTokenKey, CSRFToken); $.ajax({ url: ADDRESS_SITE + content + '/' + action, type: 'POST', data: formData, dataType: 'JSON', beforeSend: function() { if (action == 'database' || action == 'update' || action == 'backup') { notification('warning', 'UYARI!', 'İşlem devam ediyor. Lütfen pageyı yenilemeyin veya kapatmayın.'); } button.prop('disabled', true).css('width', buttonWidth + 'px').css('height', buttonHeight + 'px').html(''); }, error: function(xhr, errorString, exception) { ajaxErrorNotification(xhr, errorString, exception); ajaxResult = false; }, success: function(response) { if (response.status == 'error') { ajaxNullNotification(response); ajaxResult = false; return false; } else { ajaxResult = response; if(response.notification !== null) { if (response.notification.type && response.notification.type !== null) { notification(response.notification.type, response.notification.title, response.notification.message); } } if (response.command) { eval(response.command); } } }, complete: function() { if(button){ if (ajaxResult == false || (ajaxResult.notification !== null && ajaxResult.notification.type !== 'success')) { setTimeout(function(){ button.html(buttonText).removeAttr('style').prop('disabled', false); }, 1000); } } }, cache: false, contentType: false, processData: false }); return false; }, // Formsuz İşlem Fonksiyonu actionNF: function(btn, content, action, data, callback = null) { if(btn!==null){ var button = $(btn), buttonText = button.html(), buttonWidth = button.outerWidth(), buttonHeight = button.outerHeight(); } var ajaxResult, formData = new FormData(); formData.append(CSRFTokenKey, CSRFToken); $.each(data, function(key, value){ formData.append(key, value); }); formData.append(CSRFTokenKey, CSRFToken); $.ajax({ url: ADDRESS_SITE + content + '/' + action, type: 'POST', data: formData, dataType: 'JSON', beforeSend: function() { if(button){ button.prop('disabled', true).css('width', buttonWidth + 'px').css('height', buttonHeight + 'px').html(''); } }, error: function(xhr, errorString, exception) { ajaxErrorNotification(xhr, errorString, exception); ajaxResult = false; }, success: function(response) { if (response.status == 'error') { ajaxNullNotification(response); ajaxResult = false; return false; } else { ajaxResult = response; if(response.notification !== null) { if (response.notification.type && response.notification.type !== null) { notification(response.notification.type, response.notification.title, response.notification.message); } } if (response.command) { eval(response.command); } } }, complete: function() { if(button){ if (ajaxResult == false || (ajaxResult.notification !== null && ajaxResult.notification.type !== 'success')) { setTimeout(function(){ button.html(buttonText).removeAttr('style').prop('disabled', false); }, 1000); } } if(ajaxResult !== false && callback){ callback(ajaxResult); } }, cache: false, contentType: false, processData: false }); return false; }, // Checkbox İşlem Fonksiyonu actionCB: function(btn, content, action, data) { var button = $(btn), formData = new FormData(); $.each(data, function(key, value){ formData.append(key, value); }); formData.append('check', (button.is(':checked') ? '1' : '0')); formData.append(CSRFTokenKey, CSRFToken); $.ajax({ url: ADDRESS_SITE + content + '/' + action, type: 'POST', data: formData, dataType: 'JSON', error: function(xhr, errorString, exception) { ajaxErrorNotification(xhr, errorString, exception); ajaxResult = false; }, success: function(response) { if (response.status == 'error') { ajaxNullNotification(response); ajaxResult = false; return false; } else { ajaxResult = response; if(response.notification !== null) { if (response.notification.type && response.notification.type !== null) { notification(response.notification.type, response.notification.title, response.notification.message); } } if (response.command) { eval(response.command); } } }, complete: function() { if (ajaxResult == false || (ajaxResult.notification !== null && ajaxResult.notification.type !== 'success')) { setTimeout(function(){ button.prop('checked', !button.is(':checked')); }, 250); } }, cache: false, contentType: false, processData: false }); return false; }, // Liste Tipine Göre button listButton: function(btn, listType) { var button = $(btn); this.f_listType = listType; if (button.hasClass('active')) { return false; } listData = { page: '1' }; $('#refresh-button').attr('onclick', 'ilter.getList(\'' + this.f_contentType + '\', \'' + listType + '\');'); if($('[data-plugin-popover][popover-opened="true"]').length>0){ $(function(){ $('[data-plugin-popover][popover-opened="true"]').each(function(){ var _this = $(this); _this.popover('hide'); }); }); } switch (this.f_contentType) { default: var btn_list = button.parent().parent('ul').find('li button'); btn_list.removeClass('btn-primary btn-warning active').addClass('btn-default'); if (listType == 'actives') { setURL(ADDRESS_SITE + this.f_contentType + '/list/actives'); button.removeClass('btn-default').addClass('btn-primary active'); } else if (listType == 'trash') { setURL(ADDRESS_SITE + this.f_contentType + '/list/trash'); button.removeClass('btn-default').addClass('btn-warning active'); } break; case 'system/kayit': var btn_list = button.parent().parent('ul').find('li button'); btn_list.removeClass('btn-primary btn-warning active').addClass('btn-default'); if (listType == 'action') { setURL(ADDRESS_SITE + this.f_contentType + '/action'); button.removeClass('btn-default').addClass('btn-primary active'); } else if (listType == 'hata') { setURL(ADDRESS_SITE + this.f_contentType + '/hata'); button.removeClass('btn-default').addClass('btn-warning active'); } break; case 'tools/file-manager': var btn_list = $('#contents > .card-header > #folders'); btn_list.find('button').removeClass('btn-primary btn-warning active').addClass('btn-default'); if (listType == 'recent') { setURL(ADDRESS_SITE + this.f_contentType + '/list/recent'); btn_list.find('[data-list-type="' + listType + '"]').removeClass('btn-default').addClass('btn-primary active'); } else if (listType == 'image') { setURL(ADDRESS_SITE + this.f_contentType + '/list/image'); btn_list.find('[data-list-type="' + listType + '"]').removeClass('btn-default').addClass('btn-primary active'); } else if (listType == 'video') { setURL(ADDRESS_SITE + this.f_contentType + '/list/video'); btn_list.find('[data-list-type="' + listType + '"]').removeClass('btn-default').addClass('btn-primary active'); } else if (listType == 'document') { setURL(ADDRESS_SITE + this.f_contentType + '/list/document'); btn_list.find('[data-list-type="' + listType + '"]').removeClass('btn-default').addClass('btn-primary active'); } else if (listType == 'archive') { setURL(ADDRESS_SITE + this.f_contentType + '/list/archive'); btn_list.find('[data-list-type="' + listType + '"]').removeClass('btn-default').addClass('btn-primary active'); } else if (listType == 'trash') { setURL(ADDRESS_SITE + this.f_contentType + '/list/trash'); button.removeClass('btn-default').addClass('btn-warning active'); } listData['openType'] = 'page'; break; } $.ajax({ url: ADDRESS_SITE + 'help/new_csrf', type: 'POST', data: { url: location.href }, dataType: 'JSON', error: function(xhr, errorString, exception) { ajaxErrorNotification(xhr, errorString, exception); }, success: function(response) { if (response.command) { eval(response.command); } } }); listData[CSRFTokenKey] = CSRFToken; this.getList(this.f_contentType, this.f_listType); }, // İçerik Filtreleri listFilter: function(btn, key, value) { var button = $(btn); if (key == 'token') { notification('error', 'İŞLEM HATASI', 'CSRF Token bilgisi geçersiz.'); return false; } if (key == 'search' && value == '') { notification('error', 'İŞLEM HATASI', 'Arama yapmak için bir şeyler yazmadınız.'); return false; } if (key == 'page' && parseInt(value) < 1) { notification('error', 'İŞLEM HATASI', 'Geçersiz page sayısı girildi.'); return false; } if(key!=='page'){ listData['page'] = '1'; } if (key in listData) { delete listData[key]; } if(value==null){ delete listData[key]; }else{ listData[key] = value; } this.getList(this.f_contentType, this.f_listType); }, // İçerik Listeleme Fonksiyonu getList: function(contentType, listType, modal = null) { var _this = this; _this.f_contentType = contentType; _this.f_listType = listType; if (modal && _this.f_listModal !== modal) { _this.f_listModal = modal; } var htmlId = '#' + (_this.f_listModal ? _this.f_listModal + ' #list-' : 'contents #list-'); var data = listData; $.ajax({ url: ADDRESS_SITE + contentType + '/' + listType, type: 'POST', data: data, dataType: 'JSON', beforeSend: function() { if (_this.f_listModal) { $('#' + _this.f_listModal).find('.modal-body').mCustomScrollbar('destroy'); } $('body .tooltip').tooltip('hide'); $(htmlId + 'body').html('
').fadeIn(2000); }, error: function(xhr, errorString, exception) { ajaxErrorNotification(xhr, errorString, exception); }, success: function(response) { if (response.status == 'error') { ajaxNullNotification(response); ajaxResult = false; return false; } else { if (response.notification == null) { $(htmlId + 'body .loading-list').fadeOut('fast'); if(response.html.header) { $(htmlId + 'header').html(response.html.header).fadeIn('fast'); } $(htmlId + 'body').html(response.html.body); if(response.html.footer) { $(htmlId + 'footer').html(response.html.footer).fadeIn('fast'); } } else if (response.notification.type == 'error') { $(htmlId + 'body .loading-list').fadeOut('fast'); $(htmlId + 'header').html(response.html.header).fadeIn('fast'); $(htmlId + 'body').html(response.html.body); $(htmlId + 'footer').html(response.html.footer).fadeIn('fast'); if(response.notification !== null) { if (response.notification.type && response.notification.type !== null) { notification(response.notification.type, response.notification.title, response.notification.message); } } } if (!_this.f_listModal && contentType == 'tools/file-manager') { fileManager(response.count, listType); } if (response.command) { eval(response.command); } } }, complete: function(response) { if (_this.f_listModal) { modal_scroll(_this.f_listModal, false); } (function($) { 'use strict'; if ($(htmlId + 'body').find('[data-plugin-tooltip]').length > 0) { if ($.isFunction($.fn['tooltip'])) { $(function() { $(htmlId + 'body').find('[data-plugin-tooltip]').each(function() { var _this = $(this); _this.tooltip(); }); }); } } }).apply(this, [jQuery]); (function($) { 'use strict'; if ($(htmlId + 'body').find('[data-plugin-clipboard]').length > 0) { if (typeof ClipboardJS !== undefined) { $(function() { $(htmlId + 'body').find('[data-plugin-clipboard]').each(function() { var _this = $(this).get(0); var copy = new ClipboardJS(_this, { container: $(htmlId + 'body').get(0) }); copy.on('error', function(e) { notification('error', 'HATA!', 'Kopyalanamadı.
Lütfen yazılım danışmanınıza başvurun.'); }); }); }); } } }).apply(this, [jQuery]); (function($) { 'use strict'; $('.scroll-dropdown').each(function () { $(this).css('height', '300px').mCustomScrollbar({ advanced: { updateOnContentResize: true }, theme: 'minimal' }) }) }).apply(this, [jQuery]); iDataTable.start(); } }); }, getCart: function(btn, uri) { if(btn!==null){ var button = $(btn), buttonText = button.html(), buttonWidth = button.outerWidth(), buttonHeight = button.outerHeight(); } $.ajax({ url: ADDRESS_SITE + uri, type: 'POST', data: {}, dataType: 'JSON', beforeSend: function() { if(button){ button.prop('disabled', true).css('width', buttonWidth + 'px').css('height', buttonHeight + 'px').html(''); } $('body .tooltip').tooltip('hide'); $('#products .card-body').html('
'); $('#summary .card-body').html('
'); }, error: function(xhr, errorString, exception) { ajaxErrorNotification(xhr, errorString, exception); }, success: function(response) { if (response.status == 'error') { ajaxNullNotification(response); ajaxResult = false; return false; } else { ajaxResult = response; if (response.products && response.summary) { $('#products .card-body .loading-list').fadeOut('fast'); $('#products .card-body').html(response.products); $('#summary .card-body .loading-list').fadeOut('fast'); $('#summary .card-body').html(response.summary); } else if (response.page) { $('#page').html('
').fadeIn(2000); $('#page .loading-list').fadeOut('fast'); $('#page').html(response.page); } if(response.notification !== null) { if (response.notification.type && response.notification.type !== null) { notification(response.notification.type, response.notification.title, response.notification.message); } } if (response.command) { eval(response.command); } } }, complete: function(response) { if(button){ setTimeout(function(){ button.html(buttonText).removeAttr('style').prop('disabled', false); }, 1000); } (function($) { 'use strict'; if ($('#page').find('[data-plugin-tooltip]').length > 0) { if ($.isFunction($.fn['tooltip'])) { $(function() { $('#page').find('[data-plugin-tooltip]').each(function() { var _this = $(this); _this.tooltip(); }); }); } } }).apply(this, [jQuery]); (function($) { 'use strict'; if ($('#page').find('[data-plugin-clipboard]').length > 0) { if (typeof ClipboardJS !== undefined) { $(function() { $('#page').find('[data-plugin-clipboard]').each(function() { var _this = $(this).get(0); var copy = new ClipboardJS(_this, { container: $('#page').get(0) }); copy.on('error', function(e) { notification('error', 'HATA!', 'Kopyalanamadı.
Lütfen yazılım danışmanınıza başvurun.'); }); }); }); } } }).apply(this, [jQuery]); (function($) { 'use strict'; $('.scroll-dropdown').each(function () { $(this).css('height', '300px').mCustomScrollbar({ advanced: { updateOnContentResize: true }, theme: 'minimal' }) }) }).apply(this, [jQuery]); iDataTable.start(); } }); }, // Ülke seçimi selectCountry: function(btn, cityId){ return this.getOptions(btn, 'help/action/select_country', cityId); }, // İl İlçe seçimi selectCity: function(btn, districtId){ return this.getOptions(btn, 'help/action/select_city', districtId); }, getOptions: function(btn, uri, input_id, customData = null) { var input = $('#' + input_id); var inputId = input.attr('id'), inputName = input.attr('id'); var data = { id: inputId, name: inputName, selected: $(btn).val() }; if(customData!==null){ for(var i in customData){ data[i] = customData[i]; } } data[CSRFTokenKey] = CSRFToken; $.ajax({ url: ADDRESS_SITE + uri, type: 'POST', data: data, dataType: 'JSON', error: function(xhr, errorString, exception) { ajaxErrorNotification(xhr, errorString, exception); }, success: function(response) { if (response.status == 'error') { ajaxNullNotification(response); ajaxResult = false; return false; } else { ajaxResult = response; if(response.notification !== null) { if (response.notification.type && response.notification.type !== null) { notification(response.notification.type, response.notification.title, response.notification.message); } } if (response.command) { eval(response.command); } } } }); return false; } } }();