pari: trunk r155 - in /trunk/config: menus.html trunks.html

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Thu Dec 7 19:04:22 MST 2006


Author: pari
Date: Thu Dec  7 20:04:21 2006
New Revision: 155

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=155
Log:
Deleting the voicemenusdata[deleted_voicmenu] object On a voicemenu delete and also simplified next_freevmenu function

Modified:
    trunk/config/menus.html
    trunk/config/trunks.html

Modified: trunk/config/menus.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/menus.html?view=diff&rev=155&r1=154&r2=155
==============================================================================
--- trunk/config/menus.html (original)
+++ trunk/config/menus.html Thu Dec  7 20:04:21 2006
@@ -186,6 +186,7 @@
 					method: 'get',
 					asynchronous: true,
 					onSuccess: function(t) { 									
+						delete voicemenusdata[deleted_voicmenu];
 					},
 					onFailure: function(t) {
 						alert("Config Error: " + t.status + ": " + t.statusText);
@@ -196,6 +197,7 @@
 			opt.parameters="action=updateconfig&reload=yes&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
 			var tmp = new Ajax.Request("../../rawman", opt);
 	}
+	delete voicemenusdata[deleted_voicmenu];
 }
 
 function change_vmenuname_inlistofmenus(oldname,newname){
@@ -310,7 +312,7 @@
 	// algorithm 4 calculate new priority
 	if(voicemenusdata[$('vmenus').value].extensions['s'] && voicemenusdata[$('vmenus').value].extensions['s'].length > 0 ){
 		for( var p=0; p < voicemenusdata[$('vmenus').value].extensions['s'].length; p ++){
-			var temp  = voicemenusdata[$('vmenus').value].extensions['s'][p].split(',');			
+			var temp  = voicemenusdata[$('vmenus').value].extensions['s'][p].split(',');
 			priorities.push(temp[1]);
 		}
 		priorities = priorities.sort(sortNumber);
@@ -352,20 +354,9 @@
 
 
 function next_freevmenu(){	 // return the next smallest available voicemenu name
-	var current_names = new Array;
-	for(var i=0; i < $('vmenus').length; i++ ){
-		if ( $('vmenus').options[i].value.match('voicemenu-custom-') )
-			current_names.push( $('vmenus').options[i].value.replace( /voicemenu-custom-/ ,"") );
-	}
-	if ( current_names.length ){
-		for(var i=0; i<current_names.length-1; i++){
-			if( current_names[i+1] -  current_names[i] > 1 )
-				break;
-		}
-		var temp =  parseInt(current_names[i]) +1;
-		return 'voicemenu-custom-' + temp ;
-	}
-	return 'voicemenu-custom-1' ;
+	var x=1;
+	while(typeof voicemenusdata['voicemenu-custom-'+x] != 'undefined' ) x++;
+	return 'voicemenu-custom-'+x ;
 }
 
 

Modified: trunk/config/trunks.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/trunks.html?view=diff&rev=155&r1=154&r2=155
==============================================================================
--- trunk/config/trunks.html (original)
+++ trunk/config/trunks.html Thu Dec  7 20:04:21 2006
@@ -475,7 +475,7 @@
 function deleteSP(trunk){
 	for(var i=0; i< $('devices').length; i++){
 				if($('devices').options[i].value == trunk){
-							$('devices').selectedIndex = i ;
+							$('devices').selectitem(i) ;
 							$('delete').disabled = 0;
 							if( !$('delete').click() ){
 								return;
@@ -511,7 +511,7 @@
 <center>
 <font size="+1">List of Service Providers</font>
 <table class="table_black" cellpadding=2 cellspacing=2 border=0 align=center width=500 id="table_one">
-	<tr>	<td width=40>S.no</td>
+	<tr>	<td width=40>S.No</td>
 			<td width="200">Service Provider</td>
 			<td>Type</td>
 			<td width="120" align="center">Options</td>
@@ -524,12 +524,20 @@
 </center>
 
 <div id="userscontent" STYLE="display:none; position: absolute; left: 20; top: 40; width:500; height:400;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid;">
+	<table width="100%" cellpadding=0 cellspacing=0>
+		<TR bgcolor="#7E5538" ><TD Height="20" align="right">
+					<A href="#" onclick="$('cancel').click();"><font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">X</font></A>
+				</TD>
+				<TD width=4></TD>
+		</TR>
+	</table>
 
 <table align="center" width=450>
 <tr>
 <td onmouseover="show_tooltip('en', 'trunks', 0);"  class="field_text" width=130 valign="top" align="left">
 <!-- Provider type -->
 				<div id='cabinet' style='height:0;width:0;overflow:hidden'><select id='hiddenglobals'></select></div>
+				<B>Provider Type:</B><BR>
 				<LABEL FOR="trunkstyleanalog"><input name='trunkstyle' type='radio' id='trunkstyleanalog' onclick='activateanalogvoip()' value='analog'>Analog</LABEL><BR>
 				<LABEL FOR="trunkstylevoip"><input name='trunkstyle' type='radio' id='trunkstylevoip' onclick='activateanalogvoip()' value='voip'>VoIP</LABEL><BR>
 				<LABEL FOR="trunkstylecustomvoip"><input name='trunkstyle' type='radio' id='trunkstylecustomvoip' onclick='activateanalogvoip()' value='customvoip'>Custom VoIP</LABEL>



More information about the asterisk-gui-commits mailing list