{"size": 2190, "ext": "js", "max_stars_repo_path": "content/modjs/category.js", "max_stars_repo_name": "dediapudin1453/moneymarket", "max_stars_repo_stars_event_min_datetime": "2019-10-24T10:58:06.000Z", "max_stars_repo_stars_event_max_datetime": "2019-10-24T10:58:06.000Z", "max_issues_repo_path": "content/modjs/category.js", "max_issues_repo_name": "dediapudin1453/moneymarket", "max_issues_repo_issues_event_min_datetime": "2022-03-10T17:37:40.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-10T17:37:40.000Z", "max_forks_repo_path": "content/modjs/category.js", "max_forks_repo_name": "dediapudin1453/moneymarket", "max_forks_repo_forks_event_min_datetime": "2021-01-05T17:56:27.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-20T12:56:30.000Z"}
{"max_stars_count": 1, "max_issues_count": 1, "max_forks_count": 3, "avg_line_length": 24.606741573, "max_line_length": 84, "alphanum_fraction": 0.5849315068}

$('#DataTable').DataTable({
	'language': {
		'url': datatable_lang,
	},
	// 'stateSave': true,
	'autoWidth': false,
	'responsive': true,
	'processing': true,
	'serverSide': true,
	'order': [
		//[1, 'desc']
	],
	'columnDefs': [
		{'targets': 'no-sort', 'orderable': false, 'searchable': false},
		{'targets': 'th-action', 'orderable': false, 'searchable': false},
		{ 'targets': [0], 'width': '20px'},
		{ 'targets': [5], 'width': '70px'}
	],
	'lengthMenu': [
		[10, 30, 50, 100, -1],
		[10, 30, 50, 100, 'All']
	],
	'ajax': {
		'type': 'POST',
		'url': window.location.href
	},
	'drawCallback': function( settings ) {
		var api_table = this.api();
		dataTableDrawCallback();

		$('.delete_single').on('click', function(i) {
			var data_pk = [];
			data_pk = [$(this).attr('data-pk')];
			var url = window.location.href + '/delete';
			cfSwalDelete(data_pk, api_table, url);
		});

		$('.delete_multi').on('click', function() {
			var data_pk = [];
			var url = window.location.href + '/delete';
			$('.row_data:checked').each(function(i) {
				data_pk[i] = $(this).val();
			});
			if (data_pk != '' && data_pk != 'on') {
				cfSwalDelete(data_pk,api_table,url);
			}
		});
	}
});


$('#form_add').on('submit',function(event){
	event.preventDefault()
	$('.submit_add').find('i').removeClass().addClass('icon-spinner2 spinner mr-2');
	var form = $('#form_add');
	$.ajax({
		url: window.location.href + '/add-new',
		type: 'POST',
		data: form.serialize(),
		dataType: 'json',
		cache: false,
		success:function(data){
			if (data['success']==true) {
				$(location).attr('href',admin_url + a_mod);
			} else {
				cfNotif(data['alert']);
				$('.submit_add').find('i').removeClass().addClass('fa fa-check mr-2');
			}
		}
	})
});

$('#form_update').on('submit',function(event){
	event.preventDefault()
	$('.submit_update').find('i').removeClass().addClass('icon-spinner2 spinner mr-2');
	var form = $('#form_update');
	$.ajax({
		type: 'POST',
		data: form.serialize(),
		dataType: 'json',
		cache: false,
		success:function(data){
			cfNotif(data['alert']);
			$('.submit_update').find('i').removeClass().addClass('fa fa-save mr-2');
			$('html, body').animate({scrollTop:0});
		}
	})
});