// Hide object text box var queueOriginEl = document.getElementById('ao-ccss-queue' ); if (queueOriginEl) { queueOriginEl.style.display = 'none'; // Get queue object and call table renderer jQuery(document).ready(function() { // Instance and parse queue object var aoCssQueueRaw = document.getElementById('ao-ccss-queue').value; var aoCssQueue = aoCssQueueRaw.indexOf('{"') === 0 ? JSON.parse(aoCssQueueRaw) : ""; var aoCssQueueLog = aoCssQueue === "" ? "empty" : aoCssQueue; // hook up "remove all jobs" button to the JS action. jQuery("#removeAllJobs").click(function(){removeAllJobs();}); // Render queue table drawQueueTable(aoCssQueue); // Make queue table sortable if there are any elements var queueBodyEl = jQuery('#queue > tr').length; if (queueBodyEl > 0) { jQuery('#queue-tbl').tablesorter({ sortList: [[0,0]], headers: {6: {sorter: false}} }); } }); } // Render the queue in a table function drawQueueTable(queue) { jQuery('#queue').empty(); rowNumber=0; jQuery.each(queue, function(path, keys) { // Prepare commom job values ljid = keys.ljid; targetArr = keys.rtarget.split('|' ); target = targetArr[1]; type = keys.ptype; ctime = EpochToDate(keys.jctime); rbtn = false; dbtn = false; hbtn = false; // Prepare job statuses if (keys.jqstat === 'NEW') { // Status: NEW (N, sort order 1) status = 'N'; statusClass = 'new'; title = '