rbrindley: branch rbrindley/features_revamp r4738 - in /team/rbrindley/featur...

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Mon Apr 13 15:10:34 CDT 2009


Author: rbrindley
Date: Mon Apr 13 15:10:31 2009
New Revision: 4738

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

- added application map table row html
- added application map css
- adjusted a few option html ids to better match .conf variables
- added application map events
- now loading call parking, feature options and application maps


Modified:
    team/rbrindley/features_revamp/config/features2.html
    team/rbrindley/features_revamp/config/js/features2.js

Modified: team/rbrindley/features_revamp/config/features2.html
URL: http://svn.digium.com/svn-view/asterisk-gui/team/rbrindley/features_revamp/config/features2.html?view=diff&rev=4738&r1=4737&r2=4738
==============================================================================
--- team/rbrindley/features_revamp/config/features2.html (original)
+++ team/rbrindley/features_revamp/config/features2.html Mon Apr 13 15:10:31 2009
@@ -75,6 +75,39 @@
 
 		.ui-tabs-panel {
 			text-align: left;
+		}
+
+		#application_map_list {
+			margin-top 5px;
+			margin-bottom 10px;
+			padding: 1px;
+			text-align: center;
+			width: 96%;
+		}
+
+		#application_map_list thead tr {
+			background: #6b79a5;
+			color: #ced7ef;
+		}
+
+		#application_map_list thead th {
+			font-weight: bold;
+		}
+
+		#application_map_list tr td {
+			padding: 3px;
+		}
+
+		#application_map_list tr.even {
+			background: #dfdfdf;
+		}
+
+		#application_map_list tr.odd {
+			background: #ffffff;
+		}
+
+		.template {
+			display: none;
 		}
 	</style>
 </head>
@@ -122,26 +155,26 @@
 		<div id="feature_options" class="section">
 			<span class="title"><img class="title_img" src="images/asterisk_red.gif"/>Feature Options</span>
 			<div class="feature disabled">
-				<label for="feature_digittimeout">Feature Digit Timeout:</label>
-				<input type="text" id="feature_digittimeout" size="4" />
+				<label for="feature_featuredigittimeout">Feature Digit Timeout:</label>
+				<input type="text" id="feature_featuredigittimeout" size="4" />
 				<span class="update"></span>
 			</div>
 		</div>
 		<div id="call_parking" class="section">
 			<span class="title"><img class="title_img" src="images/asterisk_red.gif"/>Call Parking</span>
 			<div class="feature disabled">
-				<label for="park_exten">Extension to Dial to Park a Call:</label>
-				<input type="text" id="park_exten" size="4"/>
-				<span class="update"></span>
-			</div>
-			<div class="feature disabled">
-				<label for="park_pos">Extensions for Parked Calls:</label>
-				<input type="text" id="park_pos" size="10" /> (Ex: '701-720')
-				<span class="update"></span>
-			</div>
-			<div class="feature disabled">
-				<label for="park_time">Parked Call Timeout (in secs):</label>
-				<input type="text" id="park_time" size="2" />
+				<label for="parkext">Extension to Dial to Park a Call:</label>
+				<input type="text" id="parkext" size="4"/>
+				<span class="update"></span>
+			</div>
+			<div class="feature disabled">
+				<label for="parkpos">Extensions for Parked Calls:</label>
+				<input type="text" id="parkpos" size="10" /> (Ex: '701-720')
+				<span class="update"></span>
+			</div>
+			<div class="feature disabled">
+				<label for="parkingtime">Parked Call Timeout (in secs):</label>
+				<input type="text" id="parkingtime" size="2" />
 				<span class="update"></span>
 			</div>
 		</div>
@@ -172,8 +205,54 @@
 	<div id="bottom_container" class="container">
 		<div id="application_map" class="section">
 			<span class="title"><img class="title_img" src="images/asterisk_red.gif"/>Application Map</span>
-			<div><span id="new" class="guiButtonNew">New Application Map</span></div>
-			<table id="application_map_list" align="center" cellpadding="0" cellspacing="2" border="0"></table>
+			<span class="guiButtonNew">New Application Map</span>
+			<table id="application_map_list" align="center" cellpadding="0" cellspacing="1" border="0">
+			<thead>
+			<tr>
+				<th>Enabled</th>
+				<th>Feature Name</th>
+				<th>Digits</th>
+				<th>ActiveOn/By</th>
+				<th>App Name</th>
+				<th>Arguments</th>
+				<th></th>
+			</tr>
+			</thead>
+			<tbody>
+			<tr class="template">
+				<td class="enabled">
+					<input type="checkbox" />
+				</td>
+				<td class="name">
+					<input type="text" size="10" />
+				</td>
+				<td class="digits">
+					<input type="text" size="2" />
+				</td>
+				<td class="active">
+					<select>
+						<option value="self">Self</option>
+						<option value="peer">Peer</option>
+						<option value="self/caller">Self/Caller</option>
+						<option value="peer/caller">Peer/Caller</option>
+						<option value="self/callee">Self/Callee</option>
+						<option value="peer/callee">Peer/Callee</option>
+						<option value="self/both">Self/Both</option>
+						<option value="peer/both">Peer/Both</option>
+					</select>
+				</td>
+				<td class="app_name">
+					<input type="text" size="20" />
+				</td>
+				<td class="app_args">
+					<input type="text" size="10" />
+				</td>
+				<td class="buttons">
+					<span class="guiButton">Delete</span>
+				</td>
+			</tr>
+			</tbody>
+			</table>
 
 		</div>
 	</div>
@@ -195,6 +274,12 @@
 
 		$('.refresh_icon').click( function() {
 			window.location.reload();
+		});
+		$('#application_map > span.guiButtonNew').click(function() {
+			newAmap();
+		});
+		$('#application_map_list').delegate('click', 'span.guiButton', function() {
+				$(this).parents('tr').remove();
 		});
 		$('#feature_map, #call_parking, #feature_options, #dial_options')
 			.delegate('click', ':text', function() {

Modified: team/rbrindley/features_revamp/config/js/features2.js
URL: http://svn.digium.com/svn-view/asterisk-gui/team/rbrindley/features_revamp/config/js/features2.js?view=diff&rev=4738&r1=4737&r2=4738
==============================================================================
--- team/rbrindley/features_revamp/config/js/features2.js (original)
+++ team/rbrindley/features_revamp/config/js/features2.js Mon Apr 13 15:10:31 2009
@@ -74,7 +74,7 @@
 		return;
 	}
 
-	var app_map = feat_conf['applicationmap'];
+	/* look through the features in feature_map and get the values from features.conf */
 	$('#feature_map > .feature > :text').each(function() {
 		var vari = $(this).attr('id').split('_')[1];
 		$(this).val(feat_conf['featuremap'][vari]);
@@ -82,7 +82,63 @@
 			$(this).parents('.feature').removeClass('disabled');
 		}
 	});
+	/* look through the features in call_parking and get the values from features.conf */
+	$('#call_parking > .feature > :text').each(function() {
+		var vari = $(this).attr('id');
+		$(this).val(feat_conf['general'][vari]);
+		if (feat_conf['general'][vari]) {
+			$(this).parents('.feature').removeClass('disabled');
+		}
+	});
+	/* look through the features in feature_options and get the values from features.conf */
+	$('#feature_options > .feature > :text').each(function() {
+		var vari = $(this).attr('id').split('_')[1];
+		$(this).val(feat_conf['general'][vari]);
+		if (feat_conf['general'][vari]) {
+			$(this).parents('.feature').removeClass('disabled');
+		}	
+	});
+
+	var amap = feat_conf['applicationmap'];
+	var table = $('#application_map_list tbody');
+	for (var name in amap) {
+		if (!amap.hasOwnProperty(name)) {
+			continue;
+		}
+
+		if (name) {
+			var amap_fields = amap[name].split(',');
+		} else {
+			name = '';
+			var amap_fields = ['', 'self', '', ''];
+		}
+
+		if (!table.find('tr').length || (table.find('tr').length && table.find('tr:first').hasClass('noapps'))) {
+			table.find('tr:not(.template)').remove();
+		}
+
+		var row = $('#application_map_list > tbody > tr.template').clone();
+		row.find('.enabled :checkbox').attr('checked', (enabled_apps.contains(name)?true:false));
+		row.find('.name :text').attr('value', name);
+		row.find('.digits :text').attr('value', amap_fields[0]);
+		row.find('.app_name :text').attr('value', amap_fields[2]);
+		row.find('.app_args :text').attr('value', amap_fields[3]);
+		table.append(row);
+		row.removeClass('template');
+	}
+
+	if (table.find('tr:not(.template)').length === 0) {
+		var row = $('<tr>').attr('colspan', '7').html('No Application Maps Defined.');
+		table.append(row);
+	}
 }
+
+/**
+ * create a new application map row
+ */
+var newAmap = function() {
+	
+};
 
 /**
  * function to removing options




More information about the asterisk-gui-commits mailing list