pari: trunk r453 - /trunk/config/

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Tue Mar 20 08:30:26 MST 2007


Author: pari
Date: Tue Mar 20 10:30:26 2007
New Revision: 453

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=453
Log:
part2 of commit 452. I'm sure, i've introduced atleast a couple of bugs with commit 452 and this commit. I'll be fixing them shortly. thanks

Modified:
    trunk/config/options.html
    trunk/config/record.html
    trunk/config/status.html
    trunk/config/sysinfo.html
    trunk/config/trunks.html

Modified: trunk/config/options.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/options.html?view=diff&rev=453&r1=452&r2=453
==============================================================================
--- trunk/config/options.html (original)
+++ trunk/config/options.html Tue Mar 20 10:30:26 2007
@@ -37,30 +37,34 @@
 var focus_fields = new Array('newpass','newpass_rep','bindaddr','bindport','httptimeout');
 
 function cancel_guisettings(){
-	$('bindaddr').value = default_bindaddress ; $('bindport').value =default_port ; $('httptimeout').value = default_httptimeout ;
-	$('save').disabled=true;
-	$('cancel').disabled=true;
+	_$('bindaddr').value = default_bindaddress ; _$('bindport').value =default_port ; _$('httptimeout').value = default_httptimeout ;
+	_$('save').disabled=true;
+	_$('cancel').disabled=true;
 }
 
 function	update_guisettings_manager(){
-		if($('bindaddr').value==""){
+		var _bindaddr = _$('bindaddr') ;
+		var _bindport = _$('bindport') ;
+		var _httptimeout = _$('httptimeout');
+
+		if( _bindaddr.value==""){
 			gui_alert("Please enter a Bind Address");
-			$('bindaddr').focus();
+			_bindaddr.focus();
 			return true;
 		}
-		if($('bindport').value==""){
+		if( _bindport.value==""){
 			gui_alert("Please enter a Port number");
-			$('bindport').focus();
+			_bindport.focus();
 			return true;
 		}
-		if($('httptimeout').value==""){
+		if(_httptimeout.value==""){
 			gui_alert("Please enter Http TimeOut in seconds");
-			$('httptimeout').focus();
+			_httptimeout.focus();
 			return true
 		}
-
-		$('status_message').style.display="block";
-		setTimeout("$('status_message').style.display='none'",3000);
+		var _sm = $('status_message').style ;
+		_sm.display ="";
+		setTimeout(function(){ _sm.display ='none'; },3000);
 	var opt = {
 			method: 'get',
 			asynchronous: true,
@@ -68,37 +72,41 @@
 				update_guisettings_http();
 			},
 			onFailure: function(t) {
-				$('status_message').style.display='none';
+				_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);
+		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);
+			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 );
+		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);
 }
 
@@ -109,7 +117,7 @@
 			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 ;
+			_$('status').innerHTML= originalRequest.responseText ;
 			return;
 		}
 }
@@ -132,15 +140,16 @@
 }
 
 function changepassword(){
-	if( $('newpass').value!=$('newpass_rep').value ){
+	var _newpass = _$('newpass'); 
+	if( _newpass.value!=_$('newpass_rep').value ){
 		gui_alert( "Passwords do not match  !") ;
-		$('newpass').focus();
+		_newpass.focus();
 		return true;
 	}
 
-	if( $('newpass').value.length < 4 ){
+	if( _newpass.value.length < 4 ){
 		gui_alert( "Password should be at least 4 characters !") ;
-		$('newpass').focus();
+		_newpass.focus();
 		return true;
 	}
 
@@ -155,22 +164,22 @@
 				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 );
+		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;
 }
 
 
 function compare_passwords(){
-	if( $('newpass').value.length < 4 ){
-		$('dopwdsmatch').style.color = "#EE0000";
-		$('dopwdsmatch').innerHTML = "Password should be at least 4 characters !" ;
-	}else if ( $('newpass').value==$('newpass_rep').value){
-		$('dopwdsmatch').style.color = "#005D2E";
-		$('dopwdsmatch').innerHTML = "Passwords Match !" ;
+	if( _$('newpass').value.length < 4 ){
+		_$('dopwdsmatch').style.color = "#EE0000";
+		_$('dopwdsmatch').innerHTML = "Password should be at least 4 characters !" ;
+	}else if ( _$('newpass').value==_$('newpass_rep').value){
+		_$('dopwdsmatch').style.color = "#005D2E";
+		_$('dopwdsmatch').innerHTML = "Passwords Match !" ;
 	}else{
-		$('dopwdsmatch').style.color = "#EE0000";
-		$('dopwdsmatch').innerHTML = "Passwords do not match  !" ;
+		_$('dopwdsmatch').style.color = "#EE0000";
+		_$('dopwdsmatch').innerHTML = "Passwords do not match  !" ;
 	}
 }
 
@@ -183,11 +192,11 @@
 }
 
 managerconf_callbacks.loaded = function() {
-	$('hiddenfield2').selectitem(0);
-	$('message_text').innerHTML = " Saving Changes ... ";
-	default_bindaddress = $('bindaddr').value; default_port = $('bindport').value ; default_httptimeout = $('httptimeout').value;
-	$('save').disabled=true;
-	$('cancel').disabled=true;
+	_$('hiddenfield2').selectitem(0);
+	_$('message_text').innerHTML = " Saving Changes ... ";
+	default_bindaddress = _$('bindaddr').value; default_port = _$('bindport').value ; default_httptimeout = _$('httptimeout').value;
+	_$('save').disabled=true;
+	_$('cancel').disabled=true;
 	parent.loadscreen(this);
 }
 
@@ -200,13 +209,13 @@
 }
 
 httpconf_callbacks.loaded = function() {
-		$('hiddenfield').selectitem(0);
+		_$('hiddenfield').selectitem(0);
 
 		for (var x =0; x < fieldnames2.length; x++) {
-			widgets2[fieldnames2[x]] = $(fieldnames2[x]);
+			widgets2[fieldnames2[x]] = _$(fieldnames2[x]);
 			widgets2[fieldnames2[x]].disabled = true;
 		}
-		parent.astmanEngine.config2list("manager.conf", $('hiddenfield2'), widgets2, managerconf_callbacks);
+		parent.astmanEngine.config2list("manager.conf", _$('hiddenfield2'), widgets2, managerconf_callbacks);
 }
 
 
@@ -218,19 +227,19 @@
 	showdiv_statusmessage();
 	setWindowTitle("Options");
 	for (var x =0; x < fieldnames.length; x++) {
-		widgets[fieldnames[x]] = $(fieldnames[x]);
+		widgets[fieldnames[x]] = _$(fieldnames[x]);
 		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';}
 	}
 	// if not appliance - hide the gui_accesssettings DIV
 	if ( !parent.window.location.href.match("cfgappliance.html") ){
-		$('gui_accesssettings').style.display="none";
-	}
-
-	parent.astmanEngine.config2list("http.conf", $('hiddenfield'), widgets, httpconf_callbacks);
+		_$('gui_accesssettings').style.display="none";
+	}
+
+	parent.astmanEngine.config2list("http.conf", _$('hiddenfield'), widgets, httpconf_callbacks);
 	return;
 }
 </script>

Modified: trunk/config/record.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/record.html?view=diff&rev=453&r1=452&r2=453
==============================================================================
--- trunk/config/record.html (original)
+++ trunk/config/record.html Tue Mar 20 10:30:26 2007
@@ -34,65 +34,60 @@
 
 function play_existing(filename){
 	var extension = prompt("Please enter an Extension on which you want to listen to the file",""); 
+	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);
+		}
+	};
+	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);
+}
+
+function delete_sounds(filename){
+	if ( confirm("Delete recorded file "+ filename +" ?") ){
 		var opt = {
 			method: 'get',
 			asynchronous: true,
 			onSuccess: function(t) { 
-							$('status').innerHTML = " <I> Play Request Successfull ! </I>";
+				_$('status').innerHTML = " <I> Delete Request Successfull ! </I>";
+				// remove file name from stored config file
+				var opt2 = {
+					method: 'get',
+					asynchronous: true,
+					onSuccess: function() { 
+						// Remove this TR
+						var delete_id = "delete_" + filename;
+						var tableRow = _$(delete_id).parentNode.parentNode; //gets TR object
+						 var _trf = _$('table_recordefileslist');
+						for( var i=0; i <  _trf. rows.length; i++){
+							if  ( _trf. rows[i].id == tableRow.id){
+								_trf.deleteRow(i);
+								break;
+							}
+						}
+						_$('maintable').style.display = ( _trf. rows.length == 0) ? 'none' : '' ;
+						_$('no_rvmns').style.display = ( _trf. rows.length == 0) ? '': 'none' ;
+					},
+					onFailure: function(t) {
+						_$('status_message').style.display='none';
+						gui_alert("Config Error: " + t.status + ": " + t.statusText);
+					}
+				};	
+				var uri = build_action('delcat', 0, filename,"", ""); 
+				opt2.parameters = "action=updateconfig&srcfilename=" + encodeURIComponent(custom_voicemenusfile) + "&dstfilename=" + encodeURIComponent(custom_voicemenusfile) + uri;
+				var tmp2 = new Ajax.Request('../../rawman', opt2);
 			},
 			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 );
+		opt.parameters="action=originate&channel=" + encodeURIComponent("Local/removefile@"+asterisk_guitools) + "&Variable=var1%3d"+ encodeURIComponent("/var/lib/asterisk/sounds/" + filename )+"&application=noop&timeout=60000";
 		var tmp = new Ajax.Request("../../rawman", opt);
-}
-
-function delete_sounds(filename){
-	var ans = confirm("Delete recorded file "+ filename +" ?");
-	if (ans){
-			var opt = {
-				method: 'get',
-				asynchronous: true,
-				onSuccess: function(t) { 
-						$('status').innerHTML = " <I> Delete Request Successfull ! </I>";
-						// remove file name from stored config file
-						var opt2 = {
-							method: 'get',
-							asynchronous: true,
-							onSuccess: function() { 
-								// Remove this TR
-								var delete_id = "delete_" + filename;
-								var tableRow = $(delete_id).parentNode.parentNode; //gets TR object
-								for( var i=0; i <  $('table_recordefileslist'). rows.length; i++){
-									if  ( $('table_recordefileslist'). rows[i].id == tableRow.id){
-										 $('table_recordefileslist').deleteRow(i);
-										 break;
-									}
-								}
-								if( $('table_recordefileslist'). rows.length == 0){
-										$('maintable').style.display = 'none';
-										$('no_rvmns').style.display = '';
-								}else{
-										$('no_rvmns').style.display = 'none';
-										$('maintable').style.display = '';
-								}
-							},
-							onFailure: function(t) {
-								$('status_message').style.display='none';
-								gui_alert("Config Error: " + t.status + ": " + t.statusText);
-							}
-						};	
-						var uri = build_action('delcat', 0, filename,"", ""); 
-						opt2.parameters = "action=updateconfig&srcfilename=" + encodeURIComponent(custom_voicemenusfile) + "&dstfilename=" + encodeURIComponent(custom_voicemenusfile) + uri;
-						var tmp2 = new Ajax.Request('../../rawman', opt2);
-				},
-				onFailure: function(t) {
-					gui_alert("Config Error: " + t.status + ": " + t.statusText);
-				}
-			};
-			opt.parameters="action=originate&channel=" + encodeURIComponent("Local/removefile@"+asterisk_guitools) + "&Variable=var1%3d"+ encodeURIComponent("/var/lib/asterisk/sounds/" + filename )+"&application=noop&timeout=60000";
-			var tmp = new Ajax.Request("../../rawman", opt);
 	}
 	else{
 		//
@@ -102,116 +97,106 @@
 
 function save_recordedvmenuname( filename_torecord ){
 	// open custom_voicemenusfile
-		var opt2 = {
-			method: 'get',
-			asynchronous: true,
-			onSuccess: function(t) {	 
-					 addrow_totable(filename_torecord);
-					// var newoption = document.createElement("option"); // realised that we'r not using this select field any where .. so no point in updating this field.
-					// newoption.text = filename_torecord ;
-					// newoption.value = filename_torecord ;
-					// $('recorded_files').options.add ( newoption );
-					if( $('table_recordefileslist'). rows.length == 0){
-							$('maintable').style.display = 'none';
-							$('no_rvmns').style.display = '';
-					}else{
-							$('no_rvmns').style.display = 'none';
-							$('maintable').style.display = '';
-					}
-			},
-			onFailure: function(t) {
-				gui_alert("Config Error: " + t.status + ": " + t.statusText);
-			}
-		};
-					
-		var uri = build_action('newcat', 0, filename_torecord ,"", ""); 
-		opt2.parameters ="action=updateconfig&srcfilename=" + encodeURIComponent(custom_voicemenusfile) + "&dstfilename=" + encodeURIComponent(custom_voicemenusfile) + uri;
-		var tmp2 = new Ajax.Request("../../rawman", opt2);
-}
-
+	var opt2 = {
+		method: 'get',
+		asynchronous: true,
+		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';
+		},
+		onFailure: function(t) {
+			gui_alert("Config Error: " + t.status + ": " + t.statusText);
+		}
+	};
+
+	var uri = build_action('newcat', 0, filename_torecord ,"", ""); 
+	opt2.parameters ="action=updateconfig&srcfilename=" + encodeURIComponent(custom_voicemenusfile) + "&dstfilename=" + encodeURIComponent(custom_voicemenusfile) + uri;
+	var tmp2 = new Ajax.Request("../../rawman", opt2);
+}
 
 function originate_recordrequest(should_save, newvmenu_ext, filename_torecord){
-		$('status_message').style.display="block";
-		var opt = {
-			method: 'get',
-			asynchronous: true,
-			onSuccess: function(t) { 
-					setTimeout("$('status_message').style.display='none'",sc_displaytime);
-					if ( t.responseText.indexOf("Originate successfully queued") == -1 ){
-							// Request Failed
-					}else{
-						// save the filename in a seperate file so that we can display the list of "Recorded file"
-						if(should_save =="YES"){
-							$('status').innerHTML = " <I> Configuration Saved ! </I>";
-							$("newvmenu_name").value="";
-							$("format").selectedIndex =0;
-							$("newvmenu_ext").selectedIndex= -1;
-							save_recordedvmenuname( filename_torecord);
-						}
-					}				
-			},
-			onFailure: function(t) {
-				$('status_message').style.display='none';
-				gui_alert("Config Error: " + t.status + ": " + t.statusText);
-			}
-		};
-		opt.parameters ="action=originate&channel=Local/"+newvmenu_ext + "&context="+asterisk_guitools+"&exten=record_vmenu&priority=1&Variable=var1%3d"+ encodeURIComponent( filename_torecord );
-
-		var tmp = new Ajax.Request("../../rawman", opt);
+	_$('status_message').style.display="";
+	var opt = {
+		method: 'get',
+		asynchronous: true,
+		onSuccess: function(t) { 
+			setTimeout( function(){ $('status_message').style.display='none'; },sc_displaytime);
+			if ( t.responseText.indexOf("Originate successfully queued") == -1 ){
+					// Request Failed
+			}else{
+				// save the filename in a seperate file so that we can display the list of "Recorded file"
+				if(should_save =="YES"){
+					_$('status').innerHTML = " <I> Configuration Saved ! </I>";
+					_$("newvmenu_name").value="";
+					_$("format").selectedIndex =0;
+					_$("newvmenu_ext").selectedIndex= -1;
+					save_recordedvmenuname( filename_torecord);
+				}
+			}				
+		},
+		onFailure: function(t) {
+			_$('status_message').style.display='none';
+			gui_alert("Config Error: " + t.status + ": " + t.statusText);
+		}
+	};
+	opt.parameters ="action=originate&channel=Local/"+newvmenu_ext + "&context="+asterisk_guitools+"&exten=record_vmenu&priority=1&Variable=var1%3d"+ encodeURIComponent( filename_torecord );
+
+	var tmp = new Ajax.Request("../../rawman", opt);
 }
 
 function record_new(){
-	if($('newvmenu_name').value == "" ){ 
-			gui_alert("Please Enter a name for the new Voice Menu");
-			$('newvmenu_name').focus();
-			return true;
-	}else if ( $('newvmenu_ext').value == ""){
-			gui_alert("Please Select an extension to record the VoiceMenu");
-			$('newvmenu_ext').focus();
-			return true;
-	}
-
-	var filename_torecord = $('newvmenu_name').value + "." + $('format').value;
-	originate_recordrequest("YES", $('newvmenu_ext').value, filename_torecord);
+	var _nm_n = _$('newvmenu_name');
+	var _nm_e = _$('newvmenu_ext');
+ 
+	if( _nm_n.value == "" ){ 
+		gui_alert("Please Enter a name for the new Voice Menu");
+		_nm_n.focus();
+		return true;
+	}
+	if ( _nm_e.value == ""){
+		gui_alert("Please Select an extension to record the VoiceMenu");
+		_nm_e.focus();
+		return true;
+	}
+
+	var filename_torecord = _nm_n.value + "." + _$('format').value;
+	originate_recordrequest("YES", _nm_e.value, filename_torecord);
 	hide_record();
 }
 
 function record_existing(filename){
-	t=confirm("Are you sure you want to Record over an existing Voicemenu?")
-	if(t == false)
-		return true;
-	var extension = prompt("Please enter an Extension to call ",""); 
-	if(!extension){
-		return false;
-	}
+	if(!confirm("Are you sure you want to Record over an existing Voicemenu?")){ return true; }
+	var extension = prompt("Please enter an Extension to call ","");
+	if(!extension){ return false; }
 	originate_recordrequest("NO", extension, filename);
 }
 
 function addrow_totable(filename){
-		var newRow = $('table_recordefileslist').insertRow(-1);
-		newRow.id = "row" + filename; 
-
-		var newCell1 = newRow.insertCell(0);
-		newCell1 .innerHTML = filename ;
-
-		var newCell2 = newRow.insertCell(1);
-		newCell2 .innerHTML = "<input "+ "type=\"button\"" + " id=\"recordover_" + filename +"\""+ " value='Record Again'"+  " onclick='record_existing(\"" + filename + "\")'>" 
-		+ "&nbsp;"+ "<input type=button id=\"play_"+filename+"\""+ " value='Play'" + " onclick='play_existing(\"" + filename.substr(0,(filename.length - 4) )+ "\")'>" 
-		+ "&nbsp;"+ "<input type=\"button\" id='delete_" + filename + "' onclick='delete_sounds(\""+ filename + "\")'  value=\"Delete\">" ;
+	var newRow = _$('table_recordefileslist').insertRow(-1);
+	newRow.id = "row" + filename; 
+
+	var newCell1 = newRow.insertCell(0);
+	newCell1 .innerHTML = filename ;
+
+	var newCell2 = newRow.insertCell(1);
+	newCell2 .innerHTML = "<input "+ "type=\"button\"" + " id=\"recordover_" + filename +"\""+ " value='Record Again'"+  " onclick='record_existing(\"" + filename + "\")'>" 
+	+ "&nbsp;"+ "<input type=button id=\"play_"+filename+"\""+ " value='Play'" + " onclick='play_existing(\"" + filename.substr(0,(filename.length - 4) )+ "\")'>" 
+	+ "&nbsp;"+ "<input type=\"button\" id='delete_" + filename + "' onclick='delete_sounds(\""+ filename + "\")'  value=\"Delete\">" ;
 }
 
 callbacks.format = function(t) {
 	if ((t.name == 'general'))
 		return null;
-	//if (t.name.substring(0,6) == 'trunk_')
-	//	return null;
+
 	if ( t.fieldbyname['context'] == asterisk_guiTDPrefix + t.name ) {
-			return null;
+		return null;
 	}
 	if (t.fieldbyname['fullname'] && t.fieldbyname['fullname'].length) {
 		return t.name + " -- " + t.fieldbyname['fullname'];
 	} else
-		return t.name;
+	return t.name;
 }
 
 callbacks.loaded = function(){
@@ -219,39 +204,35 @@
 }
 
 rfilescallbacks.format = function(t) {
-		return t.name;
+	return t.name;
 }
 
 rfilescallbacks.loaded= function() {
-	for (var i=0; i < $('recorded_files').length; i++){
-		addrow_totable($('recorded_files').options[i].value);
-	}
-	if($('recorded_files').length == 0){
-		$('maintable').style.display = 'none';
-		$('no_rvmns').style.display = '';
-	}else{
-		$('no_rvmns').style.display = 'none';
-		$('maintable').style.display = '';
-	}
+	var _rf = _$('recorded_files');
+	for (var i=0; i < _rf.length; i++){
+		addrow_totable( _rf.options[i].value);
+	}
+	_$('maintable').style.display = ( _rf.length == 0) ? 'none' : '';
+	_$('no_rvmns').style.display = ( _rf.length == 0) ? '' : 'none' ;
 }
 
 function show_record(){
-	$('bg_transparent').style.display = "";
-	$('recordnew_content').style.display = "";
-	$('newvmenu_name').focus();
+	_$('bg_transparent').style.display = "";
+	_$('recordnew_content').style.display = "";
+	_$('newvmenu_name').focus();
 }
 
 function hide_record(){
-	$('bg_transparent').style.display = "none";
-	$('recordnew_content').style.display = "none";
+	_$('bg_transparent').style.display = "none";
+	_$('recordnew_content').style.display = "none";
 }
 
 function localajaxinit() {
 	showdiv_statusmessage();
 	setWindowTitle("Record a Menu");
 	for (var x =0; x < focus_fields.length; x++ ) {
-		$(focus_fields[x]).onfocus = function(){this.className = 'input8_hilight';}
-		$(focus_fields[x]).onblur = function(){this.className = 'input8';}
+		_$(focus_fields[x]).onfocus = function(){this.className = 'input8_hilight';}
+		_$(focus_fields[x]).onblur = function(){this.className = 'input8';}
 	}
 
 	var opt = { method: 'get', asynchronous: true, onComplete: check_filexists };
@@ -268,9 +249,9 @@
 }
 
 function load_page(){
-	parent.astmanEngine.config2list(custom_voicemenusfile, $('recorded_files'), new Array, rfilescallbacks);
-	parent.astmanEngine.config2list("users.conf", $('newvmenu_ext'), new Array, callbacks);
-	$('message_text').innerHTML = "Please wait while the system <BR> Calls the specified Extension ... ";
+	parent.astmanEngine.config2list(custom_voicemenusfile, _$('recorded_files'), new Array, rfilescallbacks);
+	parent.astmanEngine.config2list("users.conf", _$('newvmenu_ext'), new Array, callbacks);
+	_$('message_text').innerHTML = "Please wait while the system <BR> Calls the specified Extension ... ";
 }
 
 function free_mem(){

Modified: trunk/config/status.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/status.html?view=diff&rev=453&r1=452&r2=453
==============================================================================
--- trunk/config/status.html (original)
+++ trunk/config/status.html Tue Mar 20 10:30:26 2007
@@ -38,7 +38,7 @@
 
 function afterHangup(){
 	refreshChannelsList();
-	$('status').innerHTML = "Hungup " + hungupchan;
+	_$('status').innerHTML = "Hungup " + hungupchan;
 }
 
 
@@ -63,14 +63,14 @@
 
 function afterTransfer(){
 	refreshChannelsList();
-	$('status').innerHTML = "Transferred " + transferredchan;
+	_$('status').innerHTML = "Transferred " + transferredchan;
 }
 
 function refreshChannelsList() {
 	selectedchan = null;
-	$('transfer').disabled = 1;
-	$('hangup').disabled = 1;
-	$('status').innerHTML = "<i>Updating channel status...</i>";
+	_$('transfer').disabled = 1;
+	_$('hangup').disabled = 1;
+	_$('status').innerHTML = "<i>Updating channel status...</i>";
 	parent.astmanEngine.channelClear();
 	parent.astmanEngine.sendRequest('action=status', onStatusCheck);
 	updateButtons();
@@ -83,21 +83,21 @@
 
 	for (i=1;i<msgs.length - 1;i++) 
 		parent.astmanEngine.channelUpdate(msgs[i]);
-	$('channellist').innerHTML = parent.astmanEngine.channelTable(channelsCallback);
-	$('status').innerHTML = "Ready";
+	_$('channellist').innerHTML = parent.astmanEngine.channelTable(channelsCallback);
+	_$('status').innerHTML = "Ready";
 }
 
 
 function updateButtons(){
 	if ($(selectedchan)) {
-		$('transfer').disabled = 0;
-		$('hangup').disabled = 0;
+		_$('transfer').disabled = 0;
+		_$('hangup').disabled = 0;
 	} else {
-		$('transfer').disabled = 1;
-		$('hangup').disabled = 1;
+		_$('transfer').disabled = 1;
+		_$('hangup').disabled = 1;
 		selectedchan = null;
 	}
-		$('refresh').disabled = 0;
+	_$('refresh').disabled = 0;
 }
 
 channelsCallback = function(target) {
@@ -106,25 +106,25 @@
 }
 
 parent.eventeater.eventcd = function (msgs) {
-		for (i=1;i<msgs.length - 1;i++) 
-			parent.astmanEngine.channelUpdate(msgs[i]);
-		$('channellist').innerHTML = parent.astmanEngine.channelTable(channelsCallback);
-		parent.astmanEngine.pollEvents();
+	for (i=1;i<msgs.length - 1;i++) 
+		parent.astmanEngine.channelUpdate(msgs[i]);
+	_$('channellist').innerHTML = parent.astmanEngine.channelTable(channelsCallback);
+	parent.astmanEngine.pollEvents();
 }
 
 
 function localajaxinit(){
-		setWindowTitle("Active Channels");
-		refreshChannelsList() ;
-		parent.astmanEngine.setEventCallback(parent.eventeater.eventcd );
-		parent.loadscreen(this);
+	setWindowTitle("Active Channels");
+	refreshChannelsList() ;
+	parent.astmanEngine.setEventCallback(parent.eventeater.eventcd );
+	parent.loadscreen(this);
 }
 
 function localajaxend(){
-		parent.astmanEngine.setEventCallback(parent.eventeater.eventcb );
-		if( navigator.userAgent.indexOf("MSIE") != -1 ){ 
-			try{ purge( document.body ); } catch(e){ }	
-		}
+	parent.astmanEngine.setEventCallback(parent.eventeater.eventcb );
+	if( navigator.userAgent.indexOf("MSIE") != -1 ){ 
+		try{ purge( document.body ); } catch(e){ }	
+	}
 }
 
 </script>

Modified: trunk/config/sysinfo.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/sysinfo.html?view=diff&rev=453&r1=452&r2=453
==============================================================================
--- trunk/config/sysinfo.html (original)
+++ trunk/config/sysinfo.html Tue Mar 20 10:30:26 2007
@@ -31,118 +31,106 @@
 var divs_tohide = new Array('osversion_div', 'uptime_div', 'asterisk_div', 'today_div','hostname_div','ifconfig_div','df_div','memory_div','today_log');
 
 function thisday_log(){
-	$('status_message').style.display="block";
-	if($('log_day').value < 10 ){
-		var tmp_command = "/bin/grep /var/log/asterisk/messages -e '" + $('log_month').value + "  " + $('log_day').value + " ' > /var/lib/asterisk/static-http/config/bkps/today_log.html";
-	}else{
-		var tmp_command = "/bin/grep /var/log/asterisk/messages -e '" + $('log_month').value + " " + $('log_day').value + " ' > /var/lib/asterisk/static-http/config/bkps/today_log.html";
+	var _sm = _$('status_message').style ;
+	_sm.display = "" ;
+	var _ld = _$('log_day').value; 
+	if(  _ld < 10 ){ var space = "  "; }else{ var space = " ";  }
+	var tmp_command = "/bin/grep /var/log/asterisk/messages -e '" + _$('log_month').value + space + _ld 
+						+ " ' > /var/lib/asterisk/static-http/config/bkps/today_log.html" ;
+	parent.astmanEngine.run_tool( tmp_command , onSuccess = function() { _sm.display ='none'; load_todayslog(); } );
+}
+
+function 	load_todayslog(){
+	var _sm = _$('status_message').style ;
+	_sm.display = "" ;	
+	
+	var opt = {
+		method: 'get',
+		asynchronous: true,
+		onComplete: function(originalRequest){
+			_sm.display = 'none' ;
+			_$('todaylog').innerHTML = (originalRequest.responseText) ? "<PRE>"+originalRequest.responseText.escapeHTML() +"</PRE>" : "No log messages found on this Day" ;
+			
+		},
+		onFailure: function(t) {
+			_sm.display = 'none' ;
+			gui_alert("Config Error: " + t.status + ": " + t.statusText);
+		}
+	};
+	opt.parameters="";
+	var tmp = new Ajax.Request("./bkps/today_log.html", opt);
+	return true;
+}
+
+function show_window(x){
+	for(i=0; i < tabs.length ; i++){
+		document.getElementById(tabs[i]).className = "tab";
 	}
-	parent.astmanEngine.run_tool( tmp_command , onSuccess = function() { 
-					$('status_message').style.display='none';
-					load_todayslog();
-				}
-	);
-
-}
-
-function 	load_todayslog(){
-		$('status_message').style.display='block';
-		var opt = {
-			method: 'get',
-			asynchronous: true,
-			onComplete: function(originalRequest){
-				$('status_message').style.display='none';
-				if(originalRequest.responseText.length==0){
-					$('todaylog').innerHTML = "No log messages found on this Day" ;
-				}else{
-					$('todaylog').innerHTML = "<PRE>"+originalRequest.responseText.escapeHTML() +"</PRE>";
-				}
-			},
-			onFailure: function(t) {
-				$('status_message').style.display='none';
-				gui_alert("Config Error: " + t.status + ": " + t.statusText);
-			}
-		};
-		opt.parameters="";
-		var tmp = new Ajax.Request("./bkps/today_log.html", opt);
-		return true;
-}
-
-function show_window(x){
-		for(i=0; i < tabs.length ; i++){
-			document.getElementById(tabs[i]).className = "tab";
+	document.getElementById(tabs[x-1]).className = "tabselected";
+	document.getElementById(tabs[x-1]).blur();
+
+	switch(x){
+		case 1:
+		var divs_toshow = new Array('osversion_div', 'uptime_div', 'asterisk_div', 'today_div','hostname_div');
+		break;
+		case 2:
+		var divs_toshow = new Array('ifconfig_div');
+		break;
+		case 3:
+		var divs_toshow = new Array('df_div','memory_div');
+		break;
+		case 4:
+		var divs_toshow = new Array('today_log');
+		break;
+	}
+	
+	for(var i=0; i < divs_tohide.length; i++ )
+			_$(divs_tohide[i]).style.display = "none";
+	for(var i=0; i < divs_toshow.length; i++ ){
+		_$(divs_toshow[i]).style.display = "";
+		//$(divs_toshow[i]).focus();
+	}
+	return false;
+}
+
+function update_sysinfo(){
+	parent.astmanEngine.run_tool("sh /etc/asterisk/gui_sysinfo", onSuccess = function() {
+			_$('status_message').style.display='none';
+			getsysinfohtml();
 		}
-		document.getElementById(tabs[x-1]).className = "tabselected";
-		document.getElementById(tabs[x-1]).blur();
-		
-
-		switch(x){
-			case 1:
-			var divs_toshow = new Array('osversion_div', 'uptime_div', 'asterisk_div', 'today_div','hostname_div');
-			break;
-			case 2:
-			var divs_toshow = new Array('ifconfig_div');
-			break;
-			case 3:
-			var divs_toshow = new Array('df_div','memory_div');
-			break;
-			case 4:
-			var divs_toshow = new Array('today_log');
-			break;
-		}
-		
-		for(var i=0; i < divs_tohide.length; i++ )
-				$(divs_tohide[i]).style.display = "none";
-		for(var i=0; i < divs_toshow.length; i++ ){
-			$(divs_toshow[i]).style.display = "";
-			//$(divs_toshow[i]).focus();
-		}
-		return false;
-}
-
-function update_sysinfo(){
-	parent.astmanEngine.run_tool("sh /etc/asterisk/gui_sysinfo", onSuccess = function() { 
-					$('status_message').style.display='none';
-					getsysinfohtml();
-				}
 	);
 	return;
 }
 
-
 function getsysinfohtml(){
-		var opt = {
-			method: 'get',
-			asynchronous: true,
-			onComplete: function(originalRequest){
-				$('sysinfohtml').innerHTML = originalRequest.responseText;
-				$('osversion').innerHTML = $('si_uname').innerHTML;
-				$('uptime').innerHTML = $('si_uptime').innerHTML;
-				$('asterisk').innerHTML =$('si_astver').innerHTML + "<BR>" + "Asterisk GUI-version " + asterisk_guiversion.substr(1) ;
-				$('today').innerHTML = $('si_date').innerHTML;
-				$('hostname').innerHTML =$('si_hostname').innerHTML;
-				$('ifconfig').innerHTML =$('si_ifconfig').innerHTML;
-				$('diskusage').innerHTML = $('si_du').innerHTML;
-				$('memoryusage').innerHTML =$('si_free').innerHTML;
-
-				var divs_toshow = new Array('osversion_div', 'uptime_div', 'asterisk_div', 'today_div','hostname_div');
-				for(var i=0; i < divs_toshow.length; i++ ){
-					$(divs_toshow[i]).style.display = "block";
-				}
-
-				document.getElementById(tabs[0]).className = "tabselected";
-
-				load_todayslog();
-
-			},
-			onFailure: function(t) {
-				$('status_message').style.display='none';
-				gui_alert("Config Error: " + t.status + ": " + t.statusText);
-			}
-		};
-		opt.parameters="";
-		var tmp = new Ajax.Request("./bkps/sysinfo_output.html", opt);
-		return true;
+	var opt = {
+		method: 'get',
+		asynchronous: true,
+		onComplete: function(originalRequest){
+			_$('sysinfohtml').innerHTML = originalRequest.responseText;
+			_$('osversion').innerHTML = _$('si_uname').innerHTML;
+			_$('uptime').innerHTML = _$('si_uptime').innerHTML;
+			_$('asterisk').innerHTML =_$('si_astver').innerHTML + "<BR>" + "Asterisk GUI-version " + asterisk_guiversion.substr(1) ;
+			_$('today').innerHTML = _$('si_date').innerHTML;
+			_$('hostname').innerHTML =_$('si_hostname').innerHTML;
+			_$('ifconfig').innerHTML =_$('si_ifconfig').innerHTML;
+			_$('diskusage').innerHTML = _$('si_du').innerHTML;
+			_$('memoryusage').innerHTML =_$('si_free').innerHTML;
+
+			var divs_toshow = new Array('osversion_div', 'uptime_div', 'asterisk_div', 'today_div','hostname_div');
+			for(var i=0; i < divs_toshow.length; i++ ){ _$(divs_toshow[i]).style.display = ""; }
+
+			document.getElementById(tabs[0]).className = "tabselected";
+			load_todayslog();
+		},
+		onFailure: function(t) {
+			_$('status_message').style.display='none';
+			gui_alert("Config Error: " + t.status + ": " + t.statusText);
+		}
+	};
+	opt.parameters="";
+	var tmp = new Ajax.Request("./bkps/sysinfo_output.html", opt);
+	return true;
 }
 
 
@@ -151,10 +139,10 @@
 	// call the tool (sysinfo)
 	var date = new Date() ; 
 	showdiv_statusmessage();
-	$('log_month').selectedIndex = date.getMonth() ;
-	$('log_day').selectedIndex = date.getDate()  - 1 ;
-	$('status_message').style.display="block";
-	$('message_text').innerHTML = "Loading system Information ...";
+	_$('log_month').selectedIndex = date.getMonth() ;
+	_$('log_day').selectedIndex = date.getDate()  - 1 ;
+	_$('status_message').style.display="block";
+	_$('message_text').innerHTML = "Loading system Information ...";
 	parent.loadscreen(this);
 	update_sysinfo();
 }

Modified: trunk/config/trunks.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/trunks.html?view=diff&rev=453&r1=452&r2=453
==============================================================================
--- trunk/config/trunks.html (original)
+++ trunk/config/trunks.html Tue Mar 20 10:30:26 2007
@@ -25,7 +25,6 @@
 <script src="scripts/tooltip.js"></script>
 <link href="stylesheets/rico.css" media="all" rel="Stylesheet" type="text/css" />
 <link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
-
 <script>
 	var origwidth;
 	var widgets = new Array;
@@ -88,8 +87,7 @@
 			asynchronous: true,
 			onSuccess: function(t) { },
 			onFailure: function(t) {
-				gui_alert("Config Error: " + t.status + ": " + t.statusText);
-				gui_alert("Failed to delete DID context for " + trunk);
+				gui_alert("Config Error: " + t.status + ": " + t.statusText + "<BR> Failed to delete DID context for " + trunk);
 			}
 		};
 		opt.parameters= "action=updateconfig&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
@@ -97,18 +95,16 @@
 	}
 
 	providercallbacks.postselect = function() {
-			try{
-				if( $('provider').stored_config.catbyname[ $('provider').value ].fieldbyname['regurl'] ){
-					$('providerlink').href= $('provider').stored_config.catbyname[ $('provider').value ].fieldbyname['regurl'];
-					$('providerlink').target = "_blank";
-				}else{
-					$('providerlink').href= "#";
-					$('providerlink').target = "";
-				}
-			}catch(e){
-					$('providerlink').href= "#";
-					$('providerlink').target = "";
-			}
+		var _pl = _$('providerlink') ;
+		try{
+			var f = _$('provider');
+			var g = f.stored_config.catbyname[f.value].fieldbyname['regurl'] ;
+			_pl.href= ( g ) ? g :'#' ;
+			_pl.target = ( g ) ? '_blank' : '';
+		}catch(e){
+			_pl.href= "#";
+			_pl.target = "";
+		}
 	}
 
 	providercallbacks.format = function(t) {
@@ -125,27 +121,18 @@
 	}
 	
 	globalvars.loaded = function() {
-		parent.astmanEngine.config2list("users.conf", $('devices'), widgets, callbacks);
+		parent.astmanEngine.config2list("users.conf", _$('devices'), widgets, callbacks);
 	}
 
 	providercallbacks.loaded = function() {
-		$('provider').altonchange = $('provider').onchange;
-		$('provider').onchange = null;
-		parent.astmanEngine.config2list("extensions.conf", $('hiddenglobals'), new Array, globalvars);
+		var p = _$('provider');
+		p.altonchange = p.onchange;
+		p.onchange = null;
+		parent.astmanEngine.config2list("extensions.conf", _$('hiddenglobals'), new Array, globalvars);
 	}
 	
 	callbacks.format = function(t) {
-		/*
-		if ((t.name == 'general'))
-			return null;
-		if (t.name.substring(0,6) != 'trunk_')
-			return null;
-		return t.fieldbyname['trunkname'];
-		*/
-		// if t.name is found in dids_array
-		if( InArray(dids_array, t.name) ){
-			return t.fieldbyname['trunkname'];
-		}
+		if( InArray(dids_array, t.name) ){ return t.fieldbyname['trunkname']; }
 		return null;
 	}
 
@@ -158,170 +145,151 @@
 	}
 
 	callbacks.loaded = function() {
-		$('devices').contentEditable = 'true';
-		$('devices').disabled = 0;
-		add_event( $('new') , "click", showSPdetails ) ;
+		var _devices = _$('devices');
+		_devices.contentEditable = 'true';
+		_devices.disabled = 0;
+		add_event( _$('new') , "click", showSPdetails ) ;
 		loadServiceProvidersintotable();
 		preparemenus();
 		parent.loadscreen(this);
 	}
 

[... 1129 lines stripped ...]


More information about the asterisk-gui-commits mailing list