pari: trunk r454 - /trunk/config/

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Tue Mar 20 13:09:15 MST 2007


Author: pari
Date: Tue Mar 20 15:09:15 2007
New Revision: 454

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=454
Log:
part3 of commit 452 

Modified:
    trunk/config/meetme.html
    trunk/config/menus.html
    trunk/config/moh.html
    trunk/config/numberplan.html
    trunk/config/options.html
    trunk/config/record.html
    trunk/config/sip.html
    trunk/config/trunks.html
    trunk/config/users.html

Modified: trunk/config/meetme.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/meetme.html?view=diff&rev=454&r1=453&r2=454
==============================================================================
--- trunk/config/meetme.html (original)
+++ trunk/config/meetme.html Tue Mar 20 15:09:15 2007
@@ -100,7 +100,7 @@
 	
 	callbacks.loaded = function() {
 		var _ext = _$('extensions');
-		merge_extensions( _ext , $('hiddenusers'));
+		merge_extensions( _ext , _$('hiddenusers'));
 		for (x=0;x< _ext.options.length;x++) {
 			var tmp;
 			tmp = _ext.options[x].value.split(']');

Modified: trunk/config/menus.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/menus.html?view=diff&rev=454&r1=453&r2=454
==============================================================================
--- trunk/config/menus.html (original)
+++ trunk/config/menus.html Tue Mar 20 15:09:15 2007
@@ -231,17 +231,21 @@
 
 function  key_action(a, field){
 	enable_savecancel();
-	_mft = _$('keypress_'+ field + '_text' ).style.display = "none";
-	_mfe = _$('keypress_'+ field + '_exts').style.display = "none";
-	_mfm = _$('keypress_'+ field + '_menus').style.display = "none";
+
+	_mft = _$('keypress_'+ field + '_text' );
+	_mfe = _$('keypress_'+ field + '_exts').style;
+	_mfm = _$('keypress_'+ field + '_menus').style
+	_mft.style.display = "none";
+	_mfe.display = "none";
+	_mfm.display = "none";
 
 	if(a=='gotomenu'){ //show menus dropdown
-		_mfm = "";
+		_mfm.display = "";
 	}else if(a=='gotoextension'){ //show extensions dropdown
-		_mfe = "";
+		_mfe.display = "";
 	}else if(a=='Custom'){ //show a  text box
-		_mft = "";
-		_$('keypress_'+ field + '_text').focus();
+		_mft.style.display = "";
+		_mft.focus();
 	}else if(a=='disabled' || a=='Hangup' || a=='PlayInvalid'){	//show nothing
 
 	}
@@ -255,24 +259,22 @@
 function add_newstep(){
 	var _vmv = _$('vmenus').value ;
 	var _nsa = _$('newstep_action');
-	var _nsa_v = _nsa.value ;
 	var _nsv = _$('newstep_var') ;
-	var _nsv_v = _nsv.value;
-
-	if( !_nsa_v ){
+
+	if( !_nsa.value ){
 		gui_alert("Please select an action for this step");
 		_nsa.focus();
 		return;
 	}
 
-	if( _nsa_v != "Answer" &&   _nsa_v != "Hangup" && !_nsv_v ){
-		gui_alert("Please enter a value for '" + _nsa_v +"'");
+	if( _nsa.value != "Answer" &&   _nsa.value != "Hangup" && !_nsv .value ){
+		gui_alert("Please enter a value for '" + _nsa.value +"'");
 		_nsv.focus();
 		return;
 	}
 
-	var _sm = _$('status_message').style.display;
-	_sm = "";
+	var _sm = _$('status_message').style;
+	_sm.display = "";
 
 	// prepare a request to add the new step to the voicemenu
 	// make a request to append
@@ -280,7 +282,7 @@
 		method: 'get',
 		asynchronous: true,
 		onSuccess: function() { 
-			setTimeout(function(){ _sm = 'none'; },sc_displaytime);
+			setTimeout(function(){ _sm.display = 'none'; },sc_displaytime);
 			// if request successfull then add this to the steps select box
 			var newoption = document.createElement("option"); 
 			newoption.text = format_step(action_string ); 
@@ -300,7 +302,7 @@
 			_steps.selectedIndex = _steps.length - 1 ;
 			_$('status').innerHTML = "<i>New step added !</i>";
 			update_updown();
-			_nsv_v= "";
+			_nsv.value = "";
 			_nsv.style.display = "none" ;
 			_$('add_newstep_extensions').style.display = "none";
 			_$('add_newstep_menus').style.display = "none";
@@ -310,7 +312,7 @@
 			_nsvd.style.display= "none" ;
 		},
 		onFailure: function(t) {
-			_sm='none';
+			_sm.display = 'none';
 			gui_alert("Config Error: " + t.status + ": " + t.statusText);
 		}
 	};
@@ -330,33 +332,33 @@
 		newpriority = 1;
 	}
 
-	switch ( _nsa_v ){
+	switch ( _nsa.value ){
 	case 'Answer':
 		action_string = "s,"+ newpriority+ ",Answer";
 		break;
 	case 'Background':
-		action_string = "s,"+ newpriority+ ",Background(" + _nsv_v + ")";
+		action_string = "s,"+ newpriority+ ",Background(" + _nsv.value + ")";
 		break;
 	case 'DigitTimeout':
-		action_string = "s,"+ newpriority+ ",DigitTimeout(" + _nsv_v + ")";
+		action_string = "s,"+ newpriority+ ",DigitTimeout(" + _nsv.value + ")";
 		break;
 	case 'ResponseTimeout':
-		action_string = "s,"+ newpriority+ ",ResponseTimeout(" + _nsv_v + ")";
+		action_string = "s,"+ newpriority+ ",ResponseTimeout(" + _nsv.value + ")";
 		break;
 	case 'Playback':
-		action_string = "s,"+ newpriority+ ",Playback(" + _nsv_v + ")";
+		action_string = "s,"+ newpriority+ ",Playback(" + _nsv.value + ")";
 		break;
 	case 'Wait':
-		action_string = "s,"+ newpriority+ ",Wait(" + _nsv_v + ")";
+		action_string = "s,"+ newpriority+ ",Wait(" + _nsv.value + ")";
 		break;
 	case 'WaitExten':
-		action_string = "s,"+ newpriority+ ",WaitExten(" + _nsv_v + ")";
+		action_string = "s,"+ newpriority+ ",WaitExten(" + _nsv.value + ")";
 		break;
 	case 'GotoMenu':
-		action_string = "s,"+ newpriority+ ",Goto(" + _nsv_v + "|s|1)";
+		action_string = "s,"+ newpriority+ ",Goto(" + _nsv.value + "|s|1)";
 		break;
 	case 'GotoExtension':
-		action_string = "s,"+ newpriority+ ",Goto(default|" + _nsv_v + "|1)";
+		action_string = "s,"+ newpriority+ ",Goto(default|" + _nsv.value + "|1)";
 		break;
 	case 'Hangup':
 		action_string = "s,"+ newpriority+ ",Hangup";
@@ -372,6 +374,7 @@
 }
 
 
+
 function next_freevmenu(){	 // return the next smallest available voicemenu name
 	var x=1;
 	while(typeof voicemenusdata['voicemenu-custom-'+x] != 'undefined' ) x++;
@@ -393,15 +396,15 @@
 		return false;
 	}
 
-	var _sm = _$('status_message').style.display ; 
-	_sm="";
+	var _sm = _$('status_message').style ; 
+	_sm.display ="" ;
 	var _cmv = _$('comment').value ;
 
 	var opt = {
 		method: 'get',
 		asynchronous: true,
 		onSuccess: function() { 
-			setTimeout(function(){ _sm="none"; },sc_displaytime);
+			setTimeout( function(){ _sm.display="none"; },sc_displaytime );
 			_$('status').innerHTML = "<i>Updated.</i>";
 			_$('savevmenu').disabled = true;
 			_$('save').disabled = true;
@@ -438,17 +441,17 @@
 							voicemenusdata[current_vmenu].extensions[keys[k]] = [];
 						}
 					}
-				}							
+				}
 			}
 
 		},
 		onFailure: function(t) {
-			_sm='none';
+			_sm.display='none';
 			gui_alert("Config Error: " + t.status + ": " + t.statusText);
 		}
 	};
 	var uri = "" ;
-	var p =0 ;
+	var p = 0 ;
 	var buildstring = new Object ;
 
 	if( _vms.options[_vms.selectedIndex].innerHTML=='New Entry' ){
@@ -537,6 +540,35 @@
 }
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 function  enable_savecancel(){
 	_$('save').disabled=false;
 	_$('savevmenu').disabled = false;
@@ -637,30 +669,35 @@
 
 function delete_step(){
 	// delete the selected step and update voicemenusdata and update 'select' object - steps
-	$('status_message').style.display="block";
+	var _sm = _$('status_message').style; 
+	_sm.display="";
+	var _vmenus = _$('vmenus');
+	var _steps = _$('steps');
+
 	var opt = {
 		method: 'get',
 		asynchronous: true,
 		onSuccess: function() { 
-			setTimeout("$('status_message').style.display='none'",sc_displaytime);
+			setTimeout(function(){ _sm.display='none';} ,sc_displaytime);
 			// Update voicemenusdata
-			for(var p=0; p< voicemenusdata[$('vmenus').value].extensions['s'].length; p++){
-				if( voicemenusdata[$('vmenus').value].extensions['s'][p] == $('steps').value )
-					voicemenusdata[$('vmenus').value].extensions['s'].splice(p,1);
+			for(var p=0; p< voicemenusdata[_vmenus.value].extensions['s'].length; p++){
+				if( voicemenusdata[_vmenus.value].extensions['s'][p] == _steps.value ){ 
+					voicemenusdata[_vmenus.value].extensions['s'].splice(p,1); 
+				}
 			}
 
-			$('steps').remove( $('steps').selectedIndex);
-			$('status').innerHTML = "<i>Step Deleted !</i>";
-			$('deletestep').disabled = true;
+			_steps.remove( _steps.selectedIndex);
+			_$('status').innerHTML = "<i>Step Deleted !</i>";
+			_$('deletestep').disabled = true;
 
 		},
 		onFailure: function(t) {
-			$('status_message').style.display='none';
+			_sm.display='none';
 			gui_alert("Config Error: " + t.status + ": " + t.statusText);
 		}
 	};	
 	var uri = "";
-	uri += build_action('delete', 0, $('vmenus').value,"exten", "", $('steps').value); 
+	uri += build_action('delete', 0, _vmenus.value,"exten", "", _steps.value); 
 	opt.parameters="action=updateconfig&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
 	tmp = new Ajax.Request('../../rawman', opt);
 }
@@ -669,37 +706,36 @@
 function update_newstep_var(){
 	var _nsv = _$('newstep_var') ;
 	var _nsa = _$('newstep_action');
-	var _nsa_v = _nsa.value;
 	var _ane = _$('add_newstep_extensions') ;
 	var _anm = _$('add_newstep_menus') ;
 
-	_anm.style.display = "none";
-	_nsv_v = "";
+	_nsv.value = "";
 	_nsv.style.display = "none";
-	_ane.style.display = "none";
 	_$('newstep_var_digit').style.display= "none" ;
 	_$('combodiv_sounds').style.display = "none" ;
-
-	if( _nsa_v == "" || _nsa_v == "Answer"  || _nsa_v == "Hangup"  ){
-
-	}else if( _nsa_v == "Background"  || _nsa_v == "Playback" ){
-		_nsv.style.display = "";
-		_nsv.size= 12;
-	}else if( _nsa_v== "DigitTimeout" || _nsa_v== "ResponseTimeout" || _nsa_v == "Wait" ||  _nsa_v == "WaitExten" ){
-		_$('newstep_var_digit').style.display= "" ;
-	}else if( _nsa_v== "GotoMenu" ){
+	_ane.style.display = "none";
+	_anm.style.display = "none";
+
+        if( _nsa.value== "" || _nsa.value== "Answer"  || _nsa.value== "Hangup"  ){
+
+        }else if( _nsa.value== "Background"  || _nsa.value== "Playback" ){
+                _nsv.style.display = "";
+                _nsv.size= 12;
+        }else if( _nsa.value== "DigitTimeout"  || _nsa.value== "ResponseTimeout" ||  _nsa.value== "Wait"  ||  _nsa.value== "WaitExten" ){
+                _$('newstep_var_digit').style.display= "" ;
+        }else if(_nsa.value== "GotoMenu"  ){
 		_nsv.value = _anm.value;
 		_anm.style.display = "";
-	}else if( _nsa_v == "GotoExtension"  ){
+        }else if(_nsa.value== "GotoExtension"  ){
 		_nsv.value = _ane.value;
 		_ane.style.display = "";
-	}
+        }
 }
 
 
 function select_vmenu(){
 	// show all the //s, lines in the select box -
-	if($('vmenus').selectedIndex ==-1){ return true;}
+	if(_$('vmenus').selectedIndex ==-1){ return true;}
 
 	var _steps = _$('steps');
 	current_context = _$('vmenus').value;
@@ -967,7 +1003,7 @@
 
 
 rfilescallbacks.format = function(t) {
-		return t.name;
+	return t.name;
 }
 
 rfilescallbacks.loaded= function() {

Modified: trunk/config/moh.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/moh.html?view=diff&rev=454&r1=453&r2=454
==============================================================================
--- trunk/config/moh.html (original)
+++ trunk/config/moh.html Tue Mar 20 15:09:15 2007
@@ -31,7 +31,7 @@
 var fieldnames = ['application', 'cancel', 'delete', 'directory', 'format', 'mode', 'name', 'new', 'random', 'save', 'status']; 
 
 mohcallbacks.format = function(t) {
-			return t.name;
+	return t.name;
 }
 
 mohcallbacks.postselect = function(box, val) {
@@ -43,15 +43,15 @@
 }
 
 function localajaxinit() {
-			setWindowTitle("Music on Hold");
-			// Load the jabber.conf->users into the Users, associate the field to other fields
-			parent.loadscreen(this);
-			for (var x =0; x < fieldnames.length; x++) {
-				widgets[fieldnames[x]] = $(fieldnames[x]);
-				widgets[fieldnames[x]].disabled = true;
-			}
-			parent.astmanEngine.config2list("musiconhold.conf", $('moh_classes'), widgets, mohcallbacks);
-			return;
+	setWindowTitle("Music on Hold");
+	// Load the jabber.conf->users into the Users, associate the field to other fields
+	parent.loadscreen(this);
+	for (var x =0; x < fieldnames.length; x++) {
+		widgets[fieldnames[x]] = _$(fieldnames[x]);
+		widgets[fieldnames[x]].disabled = true;
+	}
+	parent.astmanEngine.config2list("musiconhold.conf", _$('moh_classes'), widgets, mohcallbacks);
+	return;
 }
 </script>
 <body id="foo" onload="localajaxinit()"  bgcolor="EFEFEF">

Modified: trunk/config/numberplan.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/numberplan.html?view=diff&rev=454&r1=453&r2=454
==============================================================================
--- trunk/config/numberplan.html (original)
+++ trunk/config/numberplan.html Tue Mar 20 15:09:15 2007
@@ -148,9 +148,7 @@
 
 function saverule(){
 	if ( !checkfields() ) return false;
-	if( !iscustom){
-		buildpatternstring();
-	}
+	if( !iscustom){	buildpatternstring();}
 	var _extv = _$('extensions').value ;
 	var _pv = _$('pattern').value ;
 
@@ -188,72 +186,68 @@
 	//			parse "numberplansdata[t.name]['nprules']" and add to "numberplansdata[t.name]['npdata']"
 	//			parse "numberplansdata[t.name]['npcomments']" and add to "numberplansdata[t.name]['npdata']"
 	//	}
-	for(x in numberplansdata){
-		if (numberplansdata.hasOwnProperty(x)) {
-			var z = numberplansdata[x];
-			var y = z['npdata'];
-			for ( k =0 ; k < z['nprules'].length ; k++ ){
-				var temp = z['nprules'][k].split(","); // temp[0] is the pattern, temp[1] is the priority,temp[2] is 'Macro(trunkdial', temp[3] is ${trunkname}/${EXTEN:1})
-				var temp1 = temp[3].split("{");
-				var temp1b = temp1[1].split("/");
-				var temp1c = temp1b[1].split("$") ;
-				var temp2 = temp1[1].split("}");
-				var temp3 = temp1[2].split("}");
-				var temp4 = temp3[0].split(":");
-				temp[4] = temp2[0] ; // temp[4] is trunkname
-				temp[5] = temp4[1] ; // temp[5] is the #digits to strip in the front
-				if ( typeof y[temp[0]] == 'undefined' ) {
-					y[temp[0]] = { };
-				}
-				y[temp[0]][temp[1]] = new ruleinanpdata(temp[4], temp[5],temp1c[0]);
+	for(x in numberplansdata){ if (numberplansdata.hasOwnProperty(x)) {
+		var z = numberplansdata[x];
+		var y = z['npdata'];
+		for ( k =0 ; k < z['nprules'].length ; k++ ){
+			var temp = z['nprules'][k].split(","); // temp[0] is the pattern, temp[1] is the priority,temp[2] is 'Macro(trunkdial', temp[3] is ${trunkname}/${EXTEN:1})
+			var temp1 = temp[3].split("{");
+			var temp1b = temp1[1].split("/");
+			var temp1c = temp1b[1].split("$") ;
+			var temp2 = temp1[1].split("}");
+			var temp3 = temp1[2].split("}");
+			var temp4 = temp3[0].split(":");
+			temp[4] = temp2[0] ; // temp[4] is trunkname
+			temp[5] = temp4[1] ; // temp[5] is the #digits to strip in the front
+			if ( typeof y[temp[0]] == 'undefined' ) {
+				y[temp[0]] = { };
 			}
-			for ( k =0 ; k < z['npcomments'].length ; k++ ){
-				var temp = z['npcomments'][k].split(","); 
-				if( typeof y[temp[0]] == "undefined"){ continue ; }
-				if ( typeof y[temp[0]][temp[1]]  == "undefined" ){  continue ; }
-				y[temp[0]][temp[1]].rulename = temp[2] ;
-				y[temp[0]][temp[1]].ruledesc = ( temp[3] !="custom" ) ? parsepattern(temp[0],0) : "custom" ; 
-			}
-		}
-	}
+			y[temp[0]][temp[1]] = new ruleinanpdata(temp[4], temp[5],temp1c[0]);
+		}
+		for ( k =0 ; k < z['npcomments'].length ; k++ ){
+			var temp = z['npcomments'][k].split(","); 
+			if( typeof y[temp[0]] == "undefined"){ continue ; }
+			if ( typeof y[temp[0]][temp[1]]  == "undefined" ){  continue ; }
+			y[temp[0]][temp[1]].rulename = temp[2] ;
+			y[temp[0]][temp[1]].ruledesc = ( temp[3] !="custom" ) ? parsepattern(temp[0],0) : "custom" ; 
+		}
+	}}
 }
 
 function show_npdata_table(a){
 	// now show m in a table - where m is the npdata of the selected numberplan
 	clear_table();
-	$('table_one').style.display="";
+	_$('table_one').style.display="";
 	var rules_nosp = new Array ;
 	var m = numberplansdata[a]['npdata'];
 	var _trunks = _$('trunks') ;
 
-	for( var x in  m ){ // x is the pattern
-		if (m.hasOwnProperty(x)) {
-			var sorted_priorities = [ ];
-			for ( var y in m[x] ){
-				if (m[x].hasOwnProperty(y)) { sorted_priorities.push(y); }
+	for( var x in  m ){ if (m.hasOwnProperty(x)) {
+		var sorted_priorities = [ ];
+		for ( var y in m[x] ){
+			if (m[x].hasOwnProperty(y)) { sorted_priorities.push(y); }
+		}
+		sorted_priorities.sort();
+		for( var z=0; z < sorted_priorities.length ; z++ ){
+			var trunk_exists = 0;
+			for(var i=0; i < _trunks.length ; i++ ){
+				if( _trunks.options[i].value == m[x][sorted_priorities[z]].trunk ){
+					trunk_exists = 1;
+					break;
+				}
+			}				
+			if ( m[x][sorted_priorities[z]].trunk  == "" ){
+				rules_nosp.push(m[x][sorted_priorities[z]].rulename) ;
+				addrowtotable( x , sorted_priorities[z] , "undefined" , m[x][sorted_priorities[z]].digits2strip );
+			}else if(trunk_exists == 0){
+				rules_nosp.push(m[x][sorted_priorities[z]].rulename) ;
+				//$('trunks').selectedIndex = -1;							
+				addrowtotable( x , sorted_priorities[z] , "invalid" , m[x][sorted_priorities[z]].digits2strip );
+			}else{
+				addrowtotable( x , sorted_priorities[z] , m[x][sorted_priorities[z]].trunk , m[x][sorted_priorities[z]].digits2strip );
 			}
-			sorted_priorities.sort();
-			for( var z=0; z < sorted_priorities.length ; z++ ){
-				var trunk_exists = 0;
-				for(var i=0; i < _trunks.length ; i++ ){
-					if( _trunks.options[i].value == m[x][sorted_priorities[z]].trunk ){
-						trunk_exists = 1;
-						break;
-					}
-				}				
-				if ( m[x][sorted_priorities[z]].trunk  == "" ){
-					rules_nosp.push(m[x][sorted_priorities[z]].rulename) ;
-					addrowtotable( x , sorted_priorities[z] , "undefined" , m[x][sorted_priorities[z]].digits2strip );
-				}else if(trunk_exists == 0){
-					rules_nosp.push(m[x][sorted_priorities[z]].rulename) ;
-					//$('trunks').selectedIndex = -1;							
-					addrowtotable( x , sorted_priorities[z] , "invalid" , m[x][sorted_priorities[z]].digits2strip );
-				}else{
-					addrowtotable( x , sorted_priorities[z] , m[x][sorted_priorities[z]].trunk , m[x][sorted_priorities[z]].digits2strip );
-				}
-			}
-		}
-	}
+		}
+	}}
 
 	if(rules_nosp.length > 0 ){
 		_$('status').innerHTML = "Note: A Service Provider is not defined for the Rule(s) <BR>" + rules_nosp ;
@@ -320,50 +314,45 @@
 
 
 function addrowtotable(a,b,c,d){	// a is pattern, b is priority, c is trunk, d is digits2strip
-		var m = numberplansdata[$('extensions').value]['npdata'];
-		var _crt = _$('callingRulesTable') ;
-		var sno = _crt.rows.length + 1;
-		var newRow = _crt.insertRow(-1);
-		newRow.id = "row" + sno; 
-
-		var newCell0 = newRow.insertCell(0);
-		newCell0.innerHTML = sno ;
-		newCell0.width=35;
-		newCell0.align="center";
-
-		var newCell1 = newRow.insertCell(1);
-		newCell1.innerHTML =  (m[a][b].rulename) ? m[a][b].rulename : "Not Defined" ; 
-		newCell1.width=90;
-
-		var newCell2 = newRow.insertCell(2);
-		newCell2.innerHTML =  (m[a][b].ruledesc) ? m[a][b].ruledesc : a ; 
-		if(newCell2.innerHTML == "custom"){ newCell2.innerHTML = "custom ("+ a + ")"; }
-
-		if(c == "invalid" || c== "undefined"  ){
-			var newCell3 = newRow.insertCell(3);
-			newCell3.innerHTML = "<B><font color=red>invalid trunk</font></B>"  ;
-			newCell3.width=85;
-		}else{
-			var newCell3 = newRow.insertCell(3);
-			newCell3.innerHTML = trunks_desc[c].comment  ;
-			newCell3.width=85;
-		}
-
-		var newCell4 = newRow.insertCell(4);
-		newCell4.innerHTML = "<A href=\"#\" onclick=\"editcallingrule('"+ a +"', '"+ b +"')\"  onmouseover=\"show_tooltip('en', 'callingrules', 2);\">Edit</A>&nbsp;&nbsp;<A href=\"#\" onclick=\"deletecallingrule('"+ a +"', '"+ b +"')\"   onmouseover=\"show_tooltip('en', 'callingrules', 3);\">Delete</A>";
-		newCell4.width=75;
-		newCell4.align="center";
-		return true;
+	var m = numberplansdata[_$('extensions').value]['npdata'];
+	var _crt = _$('callingRulesTable') ;
+	var sno = _crt.rows.length + 1;
+	var newRow = _crt.insertRow(-1);
+	newRow.id = "row" + sno; 
+
+	var newCell0 = newRow.insertCell(0);
+	newCell0.innerHTML = sno ;
+	newCell0.width=35;
+	newCell0.align="center";
+
+	var newCell1 = newRow.insertCell(1);
+	newCell1.innerHTML =  (m[a][b].rulename) ? m[a][b].rulename : "Not Defined" ; 
+	newCell1.width=90;
+
+	var newCell2 = newRow.insertCell(2);
+	newCell2.innerHTML =  (m[a][b].ruledesc) ? m[a][b].ruledesc : a ; 
+	if(newCell2.innerHTML == "custom"){ newCell2.innerHTML = "custom ("+ a + ")"; }
+
+	if(c == "invalid" || c== "undefined"  ){
+		var newCell3 = newRow.insertCell(3);
+		newCell3.innerHTML = "<B><font color=red>invalid trunk</font></B>"  ;
+		newCell3.width=85;
+	}else{
+		var newCell3 = newRow.insertCell(3);
+		newCell3.innerHTML = trunks_desc[c].comment  ;
+		newCell3.width=85;
+	}
+
+	var newCell4 = newRow.insertCell(4);
+	newCell4.innerHTML = "<A href=\"#\" onclick=\"editcallingrule('"+ a +"', '"+ b +"')\"  onmouseover=\"show_tooltip('en', 'callingrules', 2);\">Edit</A>&nbsp;&nbsp;<A href=\"#\" onclick=\"deletecallingrule('"+ a +"', '"+ b +"')\"   onmouseover=\"show_tooltip('en', 'callingrules', 3);\">Delete</A>";
+	newCell4.width=75;
+	newCell4.align="center";
+	return true;
 }
 
 function deletecallingrule(a,b){ // a is pattern, b is priority
-		t=confirm("Are you sure ?")
-		if(t == false)
-			return true;
-		delete_callingrule(a,b, oncomplete = function(){
-				show_npdata_table( _$('extensions').value );
-			} 
-		) ;
+	if(!confirm("Are you sure ?")) { return true; }
+	delete_callingrule(a,b, oncomplete = function(){ show_npdata_table( _$('extensions').value ); } ) ;
 }
 
 function delete_callingrule(a,b,oncomplete){ // a is pattern, b is priority
@@ -491,7 +480,7 @@
 numplan_callbacks.newcategory = function() {
 	var _extns = _$('extensions') ;
 	np_oldselect = _extns.selectedIndex ;
-	$('include').value = "default";
+	_$('include').value = "default";
 	var c = 1 ;
 	for(var u =0 ; u < _extns.length ; u++ ){
 		var tmp =  _extns.options[u].value.split("-") ;
@@ -542,8 +531,8 @@
 		widgets[fieldnames[x]].disabled = true;
 	}
 	for (var x =0; x < focus_fields.length; x++ ) {
-		$(focus_fields[x]).onfocus = function(){this.className = 'input9_hilight';}
-		$(focus_fields[x]).onblur = function(){this.className = 'input9';}
+		_$(focus_fields[x]).onfocus = function(){this.className = 'input9_hilight';}
+		_$(focus_fields[x]).onblur = function(){this.className = 'input9';}
 	}
 	_$('message_text').innerHTML ="Saving Changes...";
 
@@ -585,10 +574,7 @@
 	_$('new').click();
 }
 
-function delete_numberplan(){
-	_$('delete').click();
-}
-
+function delete_numberplan(){	_$('delete').click();	}
 
 function addthe_default_callingplan(){
 	if(!confirm("A default Dial Plan is not found. \n Do you want to create a default Dial Plan ") ){ 

Modified: trunk/config/options.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/options.html?view=diff&rev=454&r1=453&r2=454
==============================================================================
--- trunk/config/options.html (original)
+++ trunk/config/options.html Tue Mar 20 15:09:15 2007
@@ -43,100 +43,95 @@
 }
 
 function	update_guisettings_manager(){
-		var _bindaddr = _$('bindaddr') ;
-		var _bindport = _$('bindport') ;
-		var _httptimeout = _$('httptimeout');
-
-		if( _bindaddr.value==""){
-			gui_alert("Please enter a Bind Address");
-			_bindaddr.focus();
-			return true;
+	var _bindaddr = _$('bindaddr') ;
+	var _bindport = _$('bindport') ;
+	var _httptimeout = _$('httptimeout');
+
+	if( _bindaddr.value==""){
+		gui_alert("Please enter a Bind Address");
+		_bindaddr.focus();
+		return true;
+	}
+	if( _bindport.value==""){
+		gui_alert("Please enter a Port number");
+		_bindport.focus();
+		return true;
+	}
+	if(_httptimeout.value==""){
+		gui_alert("Please enter Http TimeOut in seconds");
+		_httptimeout.focus();
+		return true
+	}
+	var _sm = $('status_message').style ;
+	_sm.display ="";
+	setTimeout(function(){ _sm.display ='none'; },3000);
+	var opt = {
+		method: 'get',
+		asynchronous: true,
+		onSuccess: function() { 
+			update_guisettings_http();
+		},
+		onFailure: function(t) {
+			_sm.display ='none';
+			gui_alert("Config Error: " + t.status + ": " + t.statusText);
 		}
-		if( _bindport.value==""){
-			gui_alert("Please enter a Port number");
-			_bindport.focus();
-			return true;
+	};
+	opt.parameters ="action=updateconfig&srcfilename=manager.conf&dstfilename=manager.conf&Action-000000=update&Cat-000000=general&Var-000000=httptimeout&Value-000000="+ encodeURIComponent(_httptimeout.value);
+	var tmp = new Ajax.Request("../../rawman", opt);
+	return;
+}
+
+
+function update_guisettings_http(){
+	var _bindaddr = _$('bindaddr') ;
+	var _bindport = _$('bindport') ;
+	var _httptimeout = _$('httptimeout');
+
+	var opt = {
+		method: 'get',
+		asynchronous: true,
+		onSuccess: function() { 
+			_$('status_message').style.display='none';
+			_$('status').innerHTML = " <I> Configuration Saved ! </I>";
+			_$('save').disabled=true;
+			_$('cancel').disabled=true;
+			if( default_bindaddress != _bindaddr.value || default_port != _bindport.value ){
+				gui_alert("Port/IP settings of the GUI have been updated !! \n\n You will now be redirected to the new IP/Port ");
+				var previousurl =  parent.window.location.href.split("/");
+				parent.window.location.href = location.protocol + "//" + _bindaddr.value + ":" + _bindport.value + "/asterisk/static/config/" + previousurl[previousurl.length-1] ;
+			}
+			default_port = _bindport.value ;
+		},
+		onFailure: function(t) {
+			gui_alert("Config Error: " + t.status + ": " + t.statusText);
 		}
-		if(_httptimeout.value==""){
-			gui_alert("Please enter Http TimeOut in seconds");
-			_httptimeout.focus();
-			return true
-		}
-		var _sm = $('status_message').style ;
-		_sm.display ="";
-		setTimeout(function(){ _sm.display ='none'; },3000);
-	var opt = {
-			method: 'get',
-			asynchronous: true,
-			onSuccess: function() { 
-				update_guisettings_http();
-			},
-			onFailure: function(t) {
-				_sm.display ='none';
-				gui_alert("Config Error: " + t.status + ": " + t.statusText);
-			}
-		};
-		opt.parameters ="action=updateconfig&srcfilename=manager.conf&dstfilename=manager.conf&Action-000000=update&Cat-000000=general&Var-000000=httptimeout&Value-000000="+ encodeURIComponent(_httptimeout.value);
-		var tmp = new Ajax.Request("../../rawman", opt);
+	};
+	opt.parameters ="action=updateconfig&srcfilename=http.conf&dstfilename=http.conf&Action-000000=update&Cat-000000=general&Var-000000=bindport&Value-000000="+ encodeURIComponent(_bindport.value) + "&Action-000001=update&Cat-000001=general&Var-000001=bindaddr&Value-000001=" + encodeURIComponent( _bindaddr.value );
+	var tmp = new Ajax.Request("../../rawman", opt);
+}
+
+
+function showResponse(originalRequest)	{
+	var v = originalRequest.responseText.split("Success");
+	if( v.length > 1 ){
+		alert("Password Updated!!  \n\n You will be now redirected to the login page \n You must relogin using your new password") ;
+		window.location.href=window.location.href;
+	}else{
+		_$('status').innerHTML= originalRequest.responseText ;
 		return;
-}
-
-
-function update_guisettings_http(){
-		var _bindaddr = _$('bindaddr') ;
-		var _bindport = _$('bindport') ;
-		var _httptimeout = _$('httptimeout');
-
-		var opt = {
-			method: 'get',
-			asynchronous: true,
-			onSuccess: function() { 
-				_$('status_message').style.display='none';
-				_$('status').innerHTML = " <I> Configuration Saved ! </I>";
-				_$('save').disabled=true;
-				_$('cancel').disabled=true;
-				if( default_bindaddress != _bindaddr.value || default_port != _bindport.value ){
-					gui_alert("Port/IP settings of the GUI have been updated !! \n\n You will now be redirected to the new IP/Port ");
-					var previousurl =  parent.window.location.href.split("/");
-					parent.window.location.href = location.protocol + "//" + _bindaddr.value + ":" + _bindport.value + "/asterisk/static/config/" + previousurl[previousurl.length-1] ;
-				}
-				default_port = _bindport.value ;
-			},
-			onFailure: function(t) {
-				gui_alert("Config Error: " + t.status + ": " + t.statusText);
-			}
-		};
-		opt.parameters ="action=updateconfig&srcfilename=http.conf&dstfilename=http.conf&Action-000000=update&Cat-000000=general&Var-000000=bindport&Value-000000="+ encodeURIComponent(_bindport.value) + "&Action-000001=update&Cat-000001=general&Var-000001=bindaddr&Value-000001=" + encodeURIComponent( _bindaddr.value );
-		var tmp = new Ajax.Request("../../rawman", opt);
-}
-
-
-function showResponse(originalRequest)	{
-		var v = originalRequest.responseText.split("Success");
-		if( v.length > 1 ){
-			gui_alert("Password Updated!!  \n\n You will be now redirected to the login page \n You must relogin using your new password") ;
-			window.location.href=window.location.href;
-		}else{
-			_$('status').innerHTML= originalRequest.responseText ;
-			return;
-		}
+	}
 }
 
 function askforRelogin(){
-			gui_alert("Password Updated Successfully!!  \n\n You will now be redirected to the login page \n You must relogin using your new password") ;
-			var opt2 = {
-				method: 'get',
-				asynchronous: true,
-				onSuccess: function() {	 
-						// reload the browser URL
-						parent.window.location.href=parent.window.location.href;
-				},
-				onFailure: function(t) {
-					gui_alert("Config Error: " + t.status + ": " + t.statusText);
-				}
-			};
-			opt2.parameters ="action=logoff";
-			var tmp2 = new Ajax.Request("../../rawman", opt2);
+	alert("Password Updated Successfully!!  \n\n You will now be redirected to the login page \n You must relogin using your new password") ;
+	var opt2 = {
+		method: 'get',
+		asynchronous: true,
+		onSuccess: function() { parent.window.location.href = parent.window.location.href; },
+		onFailure: function(t) { gui_alert("Config Error: " + t.status + ": " + t.statusText); }
+	};
+	opt2.parameters ="action=logoff";
+	var tmp2 = new Ajax.Request("../../rawman", opt2);
 }
 
 function changepassword(){
@@ -154,19 +149,14 @@
 	}
 
 	var opt = {
-			method: 'get',
-			asynchronous: true,
-			//onComplete: showResponse		// this is the better way to do it but http server is returning a 500 error
-			onSuccess: function() { 
-						askforRelogin();
-			},
-			onFailure: function(t) {
-				gui_alert("Config Error: " + t.status + ": " + t.statusText);
-			}
-		};
-		opt.parameters ="action=updateconfig&srcfilename=manager.conf&dstfilename=manager.conf&Action-000000=update&Cat-000000=" + current_username + "&Var-000000=secret&Value-000000="+ encodeURIComponent( _newpass.value );
-		var tmp = new Ajax.Request("../../rawman", opt);
-		return;
+		method: 'get',
+		asynchronous: true,
+		onSuccess: function() { askforRelogin(); },
+		onFailure: function(t) { gui_alert("Config Error: " + t.status + ": " + t.statusText); }
+	};
+	opt.parameters ="action=updateconfig&srcfilename=manager.conf&dstfilename=manager.conf&Action-000000=update&Cat-000000=" + current_username + "&Var-000000=secret&Value-000000="+ encodeURIComponent( _newpass.value );
+	var tmp = new Ajax.Request("../../rawman", opt);
+	return;
 }
 
 
@@ -184,11 +174,8 @@
 }
 
 managerconf_callbacks.format = function(t) {
-		var tmp = t.name.split('general');
-		if(tmp.length>1)
-			return t.name;
-		else
-			return false;
+	var tmp = t.name.split('general');
+	if(tmp.length>1){ return t.name; } else { return false; }
 }
 
 managerconf_callbacks.loaded = function() {
@@ -201,21 +188,17 @@
 }
 
 httpconf_callbacks.format = function(t) {
-		var tmp = t.name.split('general');
-		if(tmp.length>1)
-			return t.name;
-		else
-			return false;
+	var tmp = t.name.split('general');
+	if(tmp.length>1){ return t.name; } else { return false; }
 }
 
 httpconf_callbacks.loaded = function() {
-		_$('hiddenfield').selectitem(0);
-
-		for (var x =0; x < fieldnames2.length; x++) {
-			widgets2[fieldnames2[x]] = _$(fieldnames2[x]);
-			widgets2[fieldnames2[x]].disabled = true;
-		}
-		parent.astmanEngine.config2list("manager.conf", _$('hiddenfield2'), widgets2, managerconf_callbacks);
+	_$('hiddenfield').selectitem(0);
+	for (var x =0; x < fieldnames2.length; x++) {
+		widgets2[fieldnames2[x]] = _$(fieldnames2[x]);
+		widgets2[fieldnames2[x]].disabled = true;
+	}
+	parent.astmanEngine.config2list("manager.conf", _$('hiddenfield2'), widgets2, managerconf_callbacks);
 }
 
 
@@ -256,40 +239,53 @@
 </TABLE>
 <BR>
 <table class="mainscreenTable" align="center">
-	<tr valign="top" height="18">	
-			<td align="center">
-			</td>
-	</tr>
+	<tr valign="top" height="18"><td align="center"></td></tr>
 	<tr>	<td align="center" valign="top">
-					<div id="channellist" class="chanlist_small" style="width: 320px; height:110">
-					<table cellpadding=2 cellspacing=2 border=0>
-									<tr>	<td colspan=2 height=5></td></tr>
-									<tr  onmouseover="show_tooltip('en', 'options', 1);"><td class="field_text">Enter New Password:</td><td><input type="password" id="newpass" size=16 onkeyup="compare_passwords()"  class="input9"></td></tr>
-									<tr  onmouseover="show_tooltip('en', 'options', 2);"><td class="field_text">Retype New Password:</td><td><input type="password" id="newpass_rep" size=16 onkeyup="compare_passwords()"  class="input9"></td></tr>
-									<tr>	<td colspan=2 align="center" height=20><div id="dopwdsmatch" style="font-size : 10px;"></div></td></tr>
-									<tr>	<td align=center colspan=2><input type="button" id="pwdbutton" value="Update" onclick="changepassword()" class="buttonbold"></td></tr>
-					</table>
-					</div>
-			</td>
+		<div id="channellist" class="chanlist_small" style="width: 320px; height:110">
+		<table cellpadding=2 cellspacing=2 border=0>
+			<tr>	<td colspan=2 height=5></td></tr>
+			<tr  onmouseover="show_tooltip('en', 'options', 1);">
+				<td class="field_text">Enter New Password:</td>
+				<td><input type="password" id="newpass" size=16 onkeyup="compare_passwords()"  class="input9"></td></tr>
+			<tr  onmouseover="show_tooltip('en', 'options', 2);">
+				<td class="field_text">Retype New Password:</td>
+				<td><input type="password" id="newpass_rep" size=16 onkeyup="compare_passwords()"  class="input9"></td>
+			</tr>
+			<tr>	<td colspan=2 align="center" height=20><div id="dopwdsmatch" style="font-size : 10px;"></div></td></tr>
+			<tr>	<td align=center colspan=2><input type="button" id="pwdbutton" value="Update" onclick="changepassword()" class="buttonbold"></td></tr>
+		</table>
+		</div>
+		</td>
 	</tr>
 	<tr valign="top" height="18">	<td></td></tr>
 	<tr>	<td align="center" valign="top">
-					<div id="gui_accesssettings" class="chanlist_small"  style="width: 320px; height:135">
-					<table>	
-					<TR><TD colspan=2 align=center><B>GUI - access settings: </B></TD></TR>
-					<tr>	<td colspan=2 height=5></td></tr>
-									<tr  onmouseover="show_tooltip('en', 'options', 3);">
-											<td class="field_text">Bind Address:</td>		<td><input size=14 id='bindaddr' dfalt="127.0.0.1" onkeydown="$('save').disabled=false; $('cancel').disabled=false;"  class="input9"></td>
-									</tr>
-									<tr  onmouseover="show_tooltip('en', 'options', 4);"><td class="field_text">Port:</td>						<td><input size=14 id='bindport' dfalt=80  onkeydown="$('save').disabled=false; $('cancel').disabled=false;"  class="input9"></td></tr>
-									<tr  onmouseover="show_tooltip('en', 'options', 5);"><td class="field_text">HTTP Timeout:</td>	<td><input size=14 id='httptimeout'  onkeydown="$('save').disabled=false; $('cancel').disabled=false;"  class="input9"></td></tr>
-									<tr><td colspan=2 height=6> </td></tr>
-									<tr><td colspan=2 align=center><input type=button id=save value="Save"  onclick="update_guisettings_manager()" class="buttonbold">&nbsp;<input type=button id=cancel value="Cancel" onclick="cancel_guisettings()" class="buttonbold"></td></tr>
-					</table>
-					<select  size="5" id="hiddenfield" style="display:none;"></select>
-					<select  size="5" id="hiddenfield2" style="display:none; width:220px"></select>
-					</div>
+		<div id="gui_accesssettings" class="chanlist_small"  style="width: 320px; height:135">
+		<table>	
+		<TR><TD colspan=2 align=center><B>GUI - access settings: </B></TD></TR>
+		<tr><td colspan=2 height=5></td></tr>
+		<tr  onmouseover="show_tooltip('en', 'options', 3);">
+			<td class="field_text">Bind Address:</td>
+			<td><input size=14 id='bindaddr' dfalt="127.0.0.1" onkeydown="$('save').disabled=false; $('cancel').disabled=false;"  class="input9"></td>
+		</tr>
+		<tr  onmouseover="show_tooltip('en', 'options', 4);">
+			<td class="field_text">Port:</td>
+			<td><input size=14 id='bindport' dfalt=80  onkeydown="$('save').disabled=false; $('cancel').disabled=false;"  class="input9"></td>
+		</tr>
+		<tr  onmouseover="show_tooltip('en', 'options', 5);">
+			<td class="field_text">HTTP Timeout:</td>
+			<td><input size=14 id='httptimeout'  onkeydown="$('save').disabled=false; $('cancel').disabled=false;"  class="input9"></td>
+		</tr>
+		<tr><td colspan=2 height=6> </td></tr>
+		<tr><td colspan=2 align=center>
+			<input type=button id=save value="Save"  onclick="update_guisettings_manager()" class="buttonbold">&nbsp;
+			<input type=button id=cancel value="Cancel" onclick="cancel_guisettings()" class="buttonbold">
 			</td>
+		</tr>
+		</table>
+		<select  size="5" id="hiddenfield" style="display:none;"></select>
+		<select  size="5" id="hiddenfield2" style="display:none; width:220px"></select>
+		</div>
+		</td>
 	</tr>
 	<tr><td valign="top" align=center><div  id='status'></div></td></tr>
 	<tr><td></td></tr>

Modified: trunk/config/record.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/record.html?view=diff&rev=454&r1=453&r2=454
==============================================================================
--- trunk/config/record.html (original)
+++ trunk/config/record.html Tue Mar 20 15:09:15 2007
@@ -37,12 +37,8 @@
 	var opt = {
 		method: 'get',
 		asynchronous: true,
-		onSuccess: function(t) { 
-			_$('status').innerHTML = " <I> Play Request Successfull ! </I>";
-		},
-		onFailure: function(t) {
-			gui_alert("Config Error: " + t.status + ": " + t.statusText);
-		}
+		onSuccess: function(t) { _$('status').innerHTML = " <I> Play Request Successfull ! </I>"; },
+		onFailure: function(t) { gui_alert("Config Error: " + t.status + ": " + t.statusText); }
 	};
 	opt.parameters ="action=originate&channel=Local/"+extension + "&context="+asterisk_guitools+"&exten=play_file&priority=1&Variable=var1%3d"+ encodeURIComponent( filename );
 	var tmp = new Ajax.Request("../../rawman", opt);
@@ -103,12 +99,10 @@
 		onSuccess: function(t) {	 
 			addrow_totable(filename_torecord);
 			var _trf = _$('table_recordefileslist'); 
-			$('maintable').style.display = ( _trf.rows.length == 0) ? 'none' : '';
-			$('no_rvmns').style.display = ( _trf.rows.length == 0) ? '':'none';
+			_$('maintable').style.display = ( _trf.rows.length == 0) ? 'none' : '';
+			_$('no_rvmns').style.display = ( _trf.rows.length == 0) ? '':'none';
 		},
-		onFailure: function(t) {
-			gui_alert("Config Error: " + t.status + ": " + t.statusText);
-		}
+		onFailure: function(t) { gui_alert("Config Error: " + t.status + ": " + t.statusText); }
 	};
 
 	var uri = build_action('newcat', 0, filename_torecord ,"", ""); 
@@ -117,12 +111,13 @@
 }
 
 function originate_recordrequest(should_save, newvmenu_ext, filename_torecord){
-	_$('status_message').style.display="";
+	var _sm = _$('status_message').style ; 
+	_sm.display="";
 	var opt = {
 		method: 'get',
 		asynchronous: true,
 		onSuccess: function(t) { 
-			setTimeout( function(){ $('status_message').style.display='none'; },sc_displaytime);
+			setTimeout( function(){ _sm.display='none'; },sc_displaytime);
 			if ( t.responseText.indexOf("Originate successfully queued") == -1 ){
 					// Request Failed
 			}else{
@@ -137,7 +132,7 @@
 			}				
 		},
 		onFailure: function(t) {
-			_$('status_message').style.display='none';
+			_sm.display='none';
 			gui_alert("Config Error: " + t.status + ": " + t.statusText);
 		}
 	};
@@ -242,7 +237,7 @@
 
 function check_filexists(originalRequest){

[... 591 lines stripped ...]


More information about the asterisk-gui-commits mailing list