// When document is ready jQuery(document).ready(function() { // Prepare for setup the datatable. var dataTableOptions = { "sAjaxSource": sAjaxSource, "fnInitComplete" : function() { initPageSelect(); }, "bAutoWidth": false, "aoColumnDefs": [ { "sClass": "center", "aTargets": [ 6 ] } ], "aoColumns": [ { "sWidth": "3%"}, // Id null, // Title { "sWidth": "15%"}, // Short Name { "sWidth": "10%"}, // Script Type Name { "sWidth": "15%"}, // Application Schedules { "sWidth": "15%"}, // Last Queued At { "sWidth": "5%"} // Actions ], "fnServerData": function ( sSource, aoData, fnCallback ) { _.each(jQuery('.datatable_variable').serializeArray(), function(dv) { aoData.push(dv); }); jQuery.getJSON( sSource, aoData, function (json) { fnCallback(json); initPaging(); addTitles(); }); }, "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { addLinkToApplication(nRow, aData); colorizationDeletedOrHidden(nRow, aData); checkTimeFormat(nRow, aData); return nRow; }, "sDom": "Rlfrtip" }; // Setup the datatable jQuery('#datatable').addDataTable(dataTableOptions); jQuery(document).delegate('.enqueue', "click", function(){ var answer = confirm("Adding application as a job on the queue?"); if (!answer) { return false; } jQuery.post(postSource, { "historical_job[application_id]": jQuery(this).attr('id') }, function(data) { if (data.success) { jQuery("
Congratulations, a Job " + data.title + " was added!
"). appendTo('#flash_message').slideDown().delay(5000).slideUp(); jQuery('#datatable').dataTable().fnDraw(); } else { jQuery("