rbrindley: branch rbrindley/welcome_revamp r4290 - /team/rbrindley/welcome_re...

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Fri Dec 5 10:31:12 CST 2008


Author: rbrindley
Date: Fri Dec  5 10:31:12 2008
New Revision: 4290

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=4290
Log:

- added colspan=4 attr to 'No Parked Calls' tr
- id'd parked call tr's with 'plot_<exten>'
- added 'event: parkedcallgiveup' to parseOutput's main event switchcase
- implemented parkedcallgiveup and unparkedcall cases
- added manager_events.unparkedcall to handle two newly implemented cases


Modified:
    team/rbrindley/welcome_revamp/config/js/welcome2.js

Modified: team/rbrindley/welcome_revamp/config/js/welcome2.js
URL: http://svn.digium.com/view/asterisk-gui/team/rbrindley/welcome_revamp/config/js/welcome2.js?view=diff&rev=4290&r1=4289&r2=4290
==============================================================================
--- team/rbrindley/welcome_revamp/config/js/welcome2.js (original)
+++ team/rbrindley/welcome_revamp/config/js/welcome2.js Fri Dec  5 10:31:12 2008
@@ -493,18 +493,19 @@
 			if( !chunk.hasOwnProperty('Event') || !chunk.hasOwnProperty('Exten') ) {
 				return;
 			}
-
-			pushRow(plot_tbody, [
-				$("<td></td>").html(chunk.CallerID),
-				$("<td></td>").html(chunk.Channel),
-				$("<td></td>").html(chunk.Exten),
-				$("<td></td>").html(chunk.Timeout).addClass('count_down')
-			]);
+			var new_row = $('<tr></tr>').attr('id','plot_'+chunk.Exten.toString())
+	
+			$("<td></td>").html(chunk.CallerID).appendTo(new_row);
+			$("<td></td>").html(chunk.Channel).appendTo(new_row);
+			$("<td></td>").html(chunk.Exten).appendTo(new_row);
+			$("<td></td>").html(chunk.Timeout).addClass('count_down').appendTo(new_row);
+
+			new_row.appendTo(plot_tbody);
 		});
 
 		if( $("#parking_lot_list > tbody > tr").length < 1 ) {
 			pushRow(plot_tbody, [
-				$("<td></td>").html("No Parked Calls")
+				$("<td></td>").attr('colspan','4').html("No Parked Calls")
 			]);
 		}
 	});
@@ -589,7 +590,10 @@
 			var cid = event[6].split(' ')[1];	/* CallerID: <cid> */
 			this.parkedCall(exten, chan, from, timeout, cid);
 			break;
+		case 'event: parkedcallgiveup':
 		case 'event: unparkedcall':
+			var exten = event[2].split(' ')[1];	/* Exten: <parkexten> */
+			this.unparkedCall(exten);
 			break;
 		case 'event: queuememberstatus':
 			var agent = event[4].split(' ')[1].split('/')[1];	//MemberName: 6000
@@ -789,7 +793,7 @@
 		plot_tbody.empty();
 	}
 
-	var new_row = $('<tr></tr>');
+	var new_row = $('<tr></tr>').attr('id','plot_'+exten.toString());
 
 	$('<td></td>').html(cid).appendTo(new_row);
 	$('<td></td>').html(chan).appendTo(new_row);
@@ -797,6 +801,20 @@
 	$('<td></td>').html(timeout).addClass('count_down').appendTo(new_row);
 
 	plot_tbody.append(new_row);
+};
+
+manager_events.unparkedCall = function(exten) {
+	var plot_tbody = $('#parking_lot_list > tbody');
+
+	$('#plot_'+exten.toString()).remove();
+
+	if (plot_tbody.children('tr').length == 0) {
+		plot_tbody.append(
+			$('<tr></tr>').append(
+				$('<td></td>').attr('colspan','4').html('No Parked Calls')
+			)
+		);
+	}
 };
 
 var countHtml = function() {




More information about the asterisk-gui-commits mailing list