pari: branch pari/dahdi_support r4456 - /team/pari/dahdi_support/config/js/

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Tue Jan 20 13:12:45 CST 2009


Author: pari
Date: Tue Jan 20 13:12:45 2009
New Revision: 4456

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

 Missing 'break' statement in the switch/case !!!
 Other minor fixes



Modified:
    team/pari/dahdi_support/config/js/hardware_dahdi.js

Modified: team/pari/dahdi_support/config/js/hardware_dahdi.js
URL: http://svn.digium.com/svn-view/asterisk-gui/team/pari/dahdi_support/config/js/hardware_dahdi.js?view=diff&rev=4456&r1=4455&r2=4456
==============================================================================
--- team/pari/dahdi_support/config/js/hardware_dahdi.js (original)
+++ team/pari/dahdi_support/config/js/hardware_dahdi.js Tue Jan 20 13:12:45 2009
@@ -161,8 +161,11 @@
 	if( SPANS[l]['totchans'] == 3 ){
 		return y + "-" + String(y+1);
 	}
+
 	var z = Number(SPANS[l]['definedchans']);
-	if(z==1){return String(y);}
+	if(z==1){
+		return String(y);
+	}
 
 	if( SPANS[l]['signalling'] && !SPANS[l]['signalling'].beginsWith('pri') ){ // if is an fxo/fxs or e&m
 		return y + "-" + String(y+z);
@@ -440,18 +443,20 @@
 					SPANS[l]['spantype'] = n[l]['type'].split('-')[1]; // part after '-' in 'digital-T1' or 'digital-E1' or 'digital-NT' or 'digital-TE'
 					SPANS[l]['min_ch'] = Number(n[l]['basechan']) ;
 					SPANS[l]['max_ch'] =  Number(n[l]['basechan']) + Number(n[l]['totchans']) - 1 ; 
-
-					var n_tc = Number(n[l]['totchans']) ;
+					var n_tc = Number(n[l]['totchans']);
 					switch(n_tc){
 						case 3:
 							SPANS[l]['definedchans'] = 2;
 							SPANS[l]['reserved_ch'] = Number(n[l]['basechan']) + 2 ;
+							break;
 						case 24:
 							SPANS[l]['definedchans'] = 23;
 							SPANS[l]['reserved_ch'] = Number(n[l]['basechan']) + 23;
+							break;
 						case 31:
 							SPANS[l]['definedchans'] = 30;
 							SPANS[l]['reserved_ch'] = Number(n[l]['basechan']) + 15;
+							break;
 						default:
 							SPANS[l]['definedchans'] = 0; // default values
 					}
@@ -639,6 +644,7 @@
 			if(_$('edit_DefinedChans').selectedIndex == 23 ){ _$('edit_DefinedChans').selectedIndex = 22 ; }
 		}
 	}
+	edit_DefinedChans_changed();
 	return true;
 };
 
@@ -926,6 +932,22 @@
 	}
 };
 
+var edit_DefinedChans_changed = function(){
+	var b = CURRENT_SPAN ;
+	_$('edit_labelReserved').innerHTML = SPANS[b]['reserved_ch'];
+	var y = Number(_$('edit_DefinedChans').value);
+	if( !verify_priChLimit() ){
+		alert("You should leave atleast one channel for signalling");
+		return true;
+	}
+
+	if(SPANS[b]['totchans'] == 3){
+		SPANS[b]['definedchans'] = y = 2;
+	}else{
+		SPANS[b]['definedchans'] = y;
+		_$('edit_labelZapchan').innerHTML = calc_bchan_fxx(b);
+	}
+};
 
 var applyDigitalSettings = function(){
  	// write to applyzap.conf - generate new applyzap.conf
@@ -985,23 +1007,6 @@
 
 	}
 
-	var edit_DefinedChans_changed = function(){
-		var b = CURRENT_SPAN ;
-		var y = Number(_$('edit_DefinedChans').value);
-		if( !verify_priChLimit() ){
-			alert("You should leave atleast one channel for signalling");
-			return true;
-		}
-
-		if(SPANS[b]['totchans'] == 3){
-			SPANS[b]['definedchans'] = y = 2;
-		}else{
-			SPANS[b]['definedchans'] = y;
-			_$('edit_labelZapchan').innerHTML = calc_bchan_fxx(b);
-		}
-		//_$('edit_labelReserved').innerHTML = SPANS[b]['reserved_ch'];
-	};
-
 	ASTGUI.events.add( _$('edit_DefinedChans'), "change", edit_DefinedChans_changed );
 	ASTGUI.Log.Debug("end of function: window.onload()");
 	loadConfigFiles.load_hwcfgfile(); // try to load last detected/configured hardware information




More information about the asterisk-gui-commits mailing list