pari: trunk r954 - /trunk/config/numberplan.html

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Thu May 17 10:34:28 MST 2007


Author: pari
Date: Thu May 17 12:34:28 2007
New Revision: 954

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=954
Log:
reverting the stupid hack in r570 and handling 0 or more digits the proper way (usin !)

Modified:
    trunk/config/numberplan.html

Modified: trunk/config/numberplan.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/numberplan.html?view=diff&rev=954&r1=953&r2=954
==============================================================================
--- trunk/config/numberplan.html (original)
+++ trunk/config/numberplan.html Thu May 17 12:34:28 2007
@@ -108,17 +108,12 @@
 	pattern = "_" + pattern;
 	// append 'followedby' number of X's
  	var s = _$('followedby').value ;
-	
+       for (var r=0; r < s ; r++){
+               pattern = pattern + "X" ;
+       }
 	// append a '.' if 'ormore' is checked
 	if( _$('ormore').checked ){
-		for (var r=0; r < s-1 ; r++){
-			pattern = pattern + "X" ;
-		}
-		pattern = pattern + "." ;
-	}else{
-		for (var r=0; r < s ; r++){
-			pattern = pattern + "X" ;
-		}
+		pattern = pattern + "!" ;
 	}
 	// assign this to the field 'pattern'
 	_$('pattern').value = pattern;
@@ -294,7 +289,7 @@
 	var temp = a.substr(1);
 	// if there is a dot at the end 
 	//		check ormore and remove the trailing dot
-	if( temp.substr(-1,1) == "." ){
+	if( temp.substr(-1,1) == "!" ){
 		temp = temp.slice(0, -1);
 		returnstring = "or more";
 		if(e == 1){ _$('ormore').checked = true; }
@@ -305,7 +300,7 @@
 	//		and followedby = length of string from somewhere till end
 	if(posofx == -1){ 	
 		if(returnstring == "or more"){
-			returnstring = "Begins with " + temp + " and followed by 1 or more digits" ;
+			returnstring = "Begins with " + temp + " and followed by 0 or more digits" ;
 		}else{
 			returnstring = "Exactly matches " + temp  ;
 		}
@@ -315,20 +310,16 @@
 		}
 	}else{
 		if(returnstring == "or more"){
-			if(e == 1){
-				_$('beginswith').value = temp.substr(0,posofx);
-				_$('followedby').value = (temp.length - posofx + 1);
-			}
-			returnstring = "Begins with " + temp.substr(0,posofx) + " and followed by "+(temp.length - posofx + 1)+" or more digits" ;
+			returnstring = "Begins with " + temp.substr(0,posofx) + " and followed by "+(temp.length - posofx)+" or more digits" ;
 		}else{
-			if(e == 1){
-				_$('beginswith').value = temp.substr(0,posofx);
-				_$('followedby').value = (temp.length - posofx );
-			}
 			returnstring = "Begins with " + temp.substr(0,posofx) + " and followed by "+(temp.length - posofx) + " digits";
 		}
-	}
-	disable_ormore();
+		if(e == 1){
+			_$('beginswith').value = temp.substr(0,posofx);
+			_$('followedby').value = (temp.length - posofx);
+		}
+	}
+
 return returnstring;
 }
 
@@ -552,18 +543,6 @@
 
 	config2json('users.conf', 1, trunks_loaded ) ;
 	//parent.astmanEngine.config2list("users.conf", $('trunks'), new Array(), trunkcallbacks);
-
-	add_event( _$('followedby'), 'change', disable_ormore );
-	add_event( _$('followedby'), 'keyup', disable_ormore );
-}
-
-function disable_ormore(){
-	if( !parseInt(_$('followedby').value ,10)){ 
-		_$('ormore').checked = false;
-		_$('ormore').disabled = true; 
-	}else{
-		_$('ormore').disabled = false;
-	}
 }
 
 function trunks_loaded(b){



More information about the asterisk-gui-commits mailing list