pari: branch asterisknow r571 - in /branches: aadk/ aadk/config/ asterisknow/...

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Fri Mar 30 11:59:34 MST 2007


Author: pari
Date: Fri Mar 30 13:59:33 2007
New Revision: 571

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=571
Log:
Merged revisions 570 via svnmerge from 
https://svn.digium.com/svn/asterisk-gui/trunk

........
r570 | pari | 2007-03-30 13:57:02 -0500 (Fri, 30 Mar 2007) | 1 line

Proper handling of 'or more' 
........

Modified:
    branches/aadk/   (props changed)
    branches/aadk/config/numberplan.html
    branches/asterisknow/   (props changed)
    branches/asterisknow/config/numberplan.html

Propchange: branches/aadk/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Mar 30 13:59:33 2007
@@ -1,1 +1,1 @@
-/trunk:1-430,433-448,501,505,512,519,532,536,538,543,545,547,549,551,553,555,561,563,567-568
+/trunk:1-430,433-448,501,505,512,519,532,536,538,543,545,547,549,551,553,555,561,563,567-568,570

Modified: branches/aadk/config/numberplan.html
URL: http://svn.digium.com/view/asterisk-gui/branches/aadk/config/numberplan.html?view=diff&rev=571&r1=570&r2=571
==============================================================================
--- branches/aadk/config/numberplan.html (original)
+++ branches/aadk/config/numberplan.html Fri Mar 30 13:59:33 2007
@@ -96,18 +96,23 @@
 return true;
 }
 
-function	buildpatternstring(){
+function buildpatternstring(){
 	var pattern = $('beginswith').value;
 	// Add an underscore
 	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" ;
+		}
 	}
 	// assign this to the field 'pattern'
 	_$('pattern').value = pattern;
@@ -292,7 +297,7 @@
 	//		and followedby = length of string from somewhere till end
 	if(posofx == -1){ 	
 		if(returnstring == "or more"){
-			returnstring = "Begins with " + temp + " and followed by 0 or more digits" ;
+			returnstring = "Begins with " + temp + " and followed by 1 or more digits" ;
 		}else{
 			returnstring = "Exactly macthes " + temp  ;
 		}
@@ -302,16 +307,20 @@
 		}
 	}else{
 		if(returnstring == "or more"){
-			returnstring = "Begins with " + temp.substr(0,posofx) + " and followed by "+(temp.length - posofx)+" or more digits" ;
+			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" ;
 		}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";
 		}
-		if(e == 1){
-			_$('beginswith').value = temp.substr(0,posofx);
-			_$('followedby').value = (temp.length - posofx);
-		}
-	}
-
+	}
+	disable_ormore();
 return returnstring;
 }
 
@@ -539,6 +548,18 @@
 
 	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){

Propchange: branches/asterisknow/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Mar 30 13:59:33 2007
@@ -1,1 +1,1 @@
-/trunk:1-448,501-505,507,511-512,519,532,536,538,543,545,547,549,551,553,555,561,563,567-568
+/trunk:1-448,501-505,507,511-512,519,532,536,538,543,545,547,549,551,553,555,561,563,567-568,570

Modified: branches/asterisknow/config/numberplan.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/numberplan.html?view=diff&rev=571&r1=570&r2=571
==============================================================================
--- branches/asterisknow/config/numberplan.html (original)
+++ branches/asterisknow/config/numberplan.html Fri Mar 30 13:59:33 2007
@@ -96,18 +96,23 @@
 return true;
 }
 
-function	buildpatternstring(){
+function buildpatternstring(){
 	var pattern = $('beginswith').value;
 	// Add an underscore
 	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" ;
+		}
 	}
 	// assign this to the field 'pattern'
 	_$('pattern').value = pattern;
@@ -292,7 +297,7 @@
 	//		and followedby = length of string from somewhere till end
 	if(posofx == -1){ 	
 		if(returnstring == "or more"){
-			returnstring = "Begins with " + temp + " and followed by 0 or more digits" ;
+			returnstring = "Begins with " + temp + " and followed by 1 or more digits" ;
 		}else{
 			returnstring = "Exactly macthes " + temp  ;
 		}
@@ -302,16 +307,20 @@
 		}
 	}else{
 		if(returnstring == "or more"){
-			returnstring = "Begins with " + temp.substr(0,posofx) + " and followed by "+(temp.length - posofx)+" or more digits" ;
+			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" ;
 		}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";
 		}
-		if(e == 1){
-			_$('beginswith').value = temp.substr(0,posofx);
-			_$('followedby').value = (temp.length - posofx);
-		}
-	}
-
+	}
+	disable_ormore();
 return returnstring;
 }
 
@@ -539,6 +548,18 @@
 
 	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