pari: trunk r543 - in /trunk/config: scripts/astman.js setup/1.html

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Thu Mar 29 10:45:18 MST 2007


Author: pari
Date: Thu Mar 29 12:45:18 2007
New Revision: 543

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=543
Log:
cleanup - setup/1.html, more commits follow for the rest of the pages in the setup wizard

Modified:
    trunk/config/scripts/astman.js
    trunk/config/setup/1.html

Modified: trunk/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/scripts/astman.js?view=diff&rev=543&r1=542&r2=543
==============================================================================
--- trunk/config/scripts/astman.js (original)
+++ trunk/config/scripts/astman.js Thu Mar 29 12:45:18 2007
@@ -29,6 +29,7 @@
 var asterisk_menusRecord_path = "/var/lib/asterisk/sounds/record/";
 var asterisk_guiSysInfo = "sh /etc/asterisk/gui_sysinfo" ;
 var asterisk_guiSysInfo_output = "./sysinfo_output.html";
+var asterisk_guiZapscan = "/sbin/zapscan.bin" ;
 var asterisk_rawmanPath = "../../rawman" ;
 
 var sortbynames = false;

Modified: trunk/config/setup/1.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/setup/1.html?view=diff&rev=543&r1=542&r2=543
==============================================================================
--- trunk/config/setup/1.html (original)
+++ trunk/config/setup/1.html Thu Mar 29 12:45:18 2007
@@ -26,8 +26,8 @@
 </HEAD>
 <script src="../scripts/prototype.js"></script>
 <script src="../scripts/astman.js"></script>
-<SCRIPT LANGUAGE="JavaScript">
-<!--
+<SCRIPT>
+
 var rawman_url;
 var zapcallbacks = new Object;
 var asterisk_guitools = "asterisk_guitools";
@@ -43,28 +43,27 @@
 	ping();
 }
 
-
 function ping(){
-		var opt = {
-			method: 'get',
-			asynchronous: true,
-			onComplete: isloggedin
-		};
-		opt.parameters="action=ping" ;
-		var tmp = new Ajax.Request(rawman_url , opt);
+	var opt = {
+		method: 'get',
+		asynchronous: true,
+		onComplete: isloggedin
+	};
+	opt.parameters="action=ping" ;
+	var tmp = new Ajax.Request(rawman_url , opt);
 }
 
 function isloggedin(originalRequest){
-		if ( originalRequest.responseText.match("Error") ) {
-			// User is not logged in , show him the login screen
-			$('loginform').style.display = "block";
-			$('username').focus();
-			return true;
-		}
-		if ( originalRequest.responseText.match("Pong") ) {
-			// install [asterisk_guitools] if not installed
-			getextconf();
-		}
+	if ( originalRequest.responseText.match("Error") ) {
+		// User is not logged in , show him the login screen
+		_$('loginform').style.display = "";
+		_$('username').focus();
+		return true;
+	}
+	if ( originalRequest.responseText.match("Pong") ) {
+		// install [asterisk_guitools] if not installed
+		getextconf();
+	}
 }
 
 function getextconf(){
@@ -84,14 +83,14 @@
 	// now parse the output and search for [gui-tools]
 	var lines = originalRequest.responseText.split("\n");
 	for( var i=0 ; i < lines.length ; i++){
-			if ( lines[i].substr(0,9) == "Category-"  ){
-				var tmp = lines[i].split(": ");
-				if( tmp[1].match(asterisk_guitools) ){
-					scan_zapteldevices();
-					return false;
-				}
-				cats.push(tmp[1]);
+		if ( lines[i].substr(0,9) == "Category-"  ){
+			var tmp = lines[i].split(": ");
+			if( tmp[1].match(asterisk_guitools) ){
+				scan_zapteldevices();
+				return false;
 			}
+			cats.push(tmp[1]);
+		}
 	}
 	// Install the [asterisk_guitools] section in extensions.conf
 	installguitools();
@@ -99,57 +98,57 @@
 
 
 function installguitools(){
-		var opt = {
-			method: 'get',
-			asynchronous: true,
-			onComplete: scan_zapteldevices
-		};
-		opt.parameters="action=updateconfig&reload=yes&srcfilename=extensions.conf&dstfilename=extensions.conf&"  +
-
-		"Action-000000=newcat&Cat-000000=" + asterisk_guitools + "&Var-000000=&Value-000000=" + "&" + 
-		
-		"Action-000001=append&Cat-000001=" + asterisk_guitools + "&Var-000001=exten&Value-000001=" +
-		encodeURI(		'executecommand,1,System(${command})' 	) + "&" + 
-
-		"Action-000002=append&Cat-000002=" + asterisk_guitools + "&Var-000002=exten&Value-000002=" +
-		encodeURI(		'executecommand,n,Hangup()' 	) + "&" + 
-
-		"Action-000003=append&Cat-000003=" + asterisk_guitools + "&Var-000003=exten&Value-000003=" +
-		encodeURI(		'record_vmenu,1,Answer' 	) + "&" + 
-
-		"Action-000004=append&Cat-000004=" + asterisk_guitools + "&Var-000004=exten&Value-000004=" +
-		encodeURI(		'record_vmenu,n,Playback(vm-intro)' 	) + "&" + 
-
-		"Action-000005=append&Cat-000005=" + asterisk_guitools + "&Var-000005=exten&Value-000005=" +
-		encodeURI(		'record_vmenu,n,Record(${var1})' 	) + "&" + 
-
-		"Action-000006=append&Cat-000006=" + asterisk_guitools + "&Var-000006=exten&Value-000006=" +
-		encodeURI(		'record_vmenu,n,Playback(vm-saved)' 	) + "&" + 
-
-		"Action-000007=append&Cat-000007=" + asterisk_guitools + "&Var-000007=exten&Value-000007=" +
-		encodeURI(		'record_vmenu,n,Playback(vm-goodbye)' 	) + "&" + 
-
-		"Action-000008=append&Cat-000008=" + asterisk_guitools + "&Var-000008=exten&Value-000008=" +
-		encodeURI(		'record_vmenu,n,Hangup' 	) + "&" + 
-
-		"Action-000009=append&Cat-000009=" + asterisk_guitools + "&Var-000009=exten&Value-000009=" +
-		encodeURI(		'play_file,1,Answer' 	) + "&" + 
-
-		"Action-000010=append&Cat-000010=" + asterisk_guitools + "&Var-000010=exten&Value-000010=" +
-		encodeURI(		'play_file,n,Playback(${var1})' 	) + "&" + 
-
-		"Action-000011=append&Cat-000011=" + asterisk_guitools + "&Var-000011=exten&Value-000011=" +
-		encodeURI(		'play_file,n,Hangup' 	) + "&" + 
-
-		"Action-000012=append&Cat-000012=" + asterisk_guitools + "&Var-000012=hasbeensetup&Value-000012=" + 'N';
-
-		var tmp = new Ajax.Request(rawman_url, opt);
+	var opt = {
+		method: 'get',
+		asynchronous: true,
+		onComplete: scan_zapteldevices
+	};
+	opt.parameters="action=updateconfig&reload=yes&srcfilename=extensions.conf&dstfilename=extensions.conf&"  +
+
+	"Action-000000=newcat&Cat-000000=" + asterisk_guitools + "&Var-000000=&Value-000000=" + "&" + 
+	
+	"Action-000001=append&Cat-000001=" + asterisk_guitools + "&Var-000001=exten&Value-000001=" +
+	encodeURI(		'executecommand,1,System(${command})' 	) + "&" + 
+
+	"Action-000002=append&Cat-000002=" + asterisk_guitools + "&Var-000002=exten&Value-000002=" +
+	encodeURI(		'executecommand,n,Hangup()' 	) + "&" + 
+
+	"Action-000003=append&Cat-000003=" + asterisk_guitools + "&Var-000003=exten&Value-000003=" +
+	encodeURI(		'record_vmenu,1,Answer' 	) + "&" + 
+
+	"Action-000004=append&Cat-000004=" + asterisk_guitools + "&Var-000004=exten&Value-000004=" +
+	encodeURI(		'record_vmenu,n,Playback(vm-intro)' 	) + "&" + 
+
+	"Action-000005=append&Cat-000005=" + asterisk_guitools + "&Var-000005=exten&Value-000005=" +
+	encodeURI(		'record_vmenu,n,Record(${var1})' 	) + "&" + 
+
+	"Action-000006=append&Cat-000006=" + asterisk_guitools + "&Var-000006=exten&Value-000006=" +
+	encodeURI(		'record_vmenu,n,Playback(vm-saved)' 	) + "&" + 
+
+	"Action-000007=append&Cat-000007=" + asterisk_guitools + "&Var-000007=exten&Value-000007=" +
+	encodeURI(		'record_vmenu,n,Playback(vm-goodbye)' 	) + "&" + 
+
+	"Action-000008=append&Cat-000008=" + asterisk_guitools + "&Var-000008=exten&Value-000008=" +
+	encodeURI(		'record_vmenu,n,Hangup' 	) + "&" + 
+
+	"Action-000009=append&Cat-000009=" + asterisk_guitools + "&Var-000009=exten&Value-000009=" +
+	encodeURI(		'play_file,1,Answer' 	) + "&" + 
+
+	"Action-000010=append&Cat-000010=" + asterisk_guitools + "&Var-000010=exten&Value-000010=" +
+	encodeURI(		'play_file,n,Playback(${var1})' 	) + "&" + 
+
+	"Action-000011=append&Cat-000011=" + asterisk_guitools + "&Var-000011=exten&Value-000011=" +
+	encodeURI(		'play_file,n,Hangup' 	) + "&" + 
+
+	"Action-000012=append&Cat-000012=" + asterisk_guitools + "&Var-000012=hasbeensetup&Value-000012=" + 'N';
+
+	var tmp = new Ajax.Request(rawman_url, opt);
 }
 
 function scan_zapteldevices(){
-	parent.astmanEngine.run_tool("/sbin/zapscan.bin", onSuccess = function() { 
-					parent.astmanEngine.config2list("zapscan.conf", $('zapchan'), new Array(), zapcallbacks);
-				}
+	parent.astmanEngine.run_tool(asterisk_guiZapscan, onSuccess = function() { 
+		parent.astmanEngine.config2list("zapscan.conf", _$('zapchan'), new Array(), zapcallbacks);
+		}
 	);
 	return;
 }
@@ -167,108 +166,108 @@
 }
 
 zapcallbacks.loaded = function(){
-	for(var x=0; x< $('zapchan').length ; x++){
-			$('zapscan_info').innerHTML+= $('zapchan').options[x].text + "<BR>";
-	}
-	if($('zapchan').length ==0 ){
-		$('detected_info').style.display = "none";
-		$('zapscan_info').innerHTML = " <B>No Analog ports have been detected on your system</B> <BR><BR>"
+	for(var x=0; x< _$('zapchan').length ; x++){
+		_$('zapscan_info').innerHTML+= _$('zapchan').options[x].text + "<BR>";
+	}
+	if( _$('zapchan').length ==0 ){
+		_$('detected_info').style.display = "none";
+		_$('zapscan_info').innerHTML = " <B>No Analog ports have been detected on your system</B> <BR><BR>"
 		+" If you do not have any analog hardware please click Next to proceed";
 	}
 
-	$('loginform').style.display = "none";
-	$('zapinfo').style.display = "block";
+	_$('loginform').style.display = "none";
+	_$('zapinfo').style.display = "";
 	parent.$('next').disabled = false;
 	parent.$('next').onclick = function(){	 window.location.href="3.html"; };
-	$('menu').style.display = "block";
-}
-
+	_$('menu').style.display = "";
+}
 
 function showResponse(originalRequest){
-			$('status_message').style.display="none";
-			if ( originalRequest.responseText.match("Success") || originalRequest.responseText.match("Invalid/unknown command")  ) {
-					getextconf();
-			}else{
-
-				alert("Invalid Password");
-				$('secret').focus();
-			}
-
-}
-
+	_$('status_message').style.display="none";
+	if ( originalRequest.responseText.match("Success") || originalRequest.responseText.match("Invalid/unknown command")  ) {
+		getextconf();
+	}else{
+		alert("Invalid Password");
+		_$('secret').focus();
+	}
+
+}
 
 function login(){
-	$('message_text').innerHTML =" Logging in ...";
-	$('status_message').style.display="block";
-		var opt = {
-			method: 'get',
-			asynchronous: true,
-			onComplete: showResponse
-		};
-		opt.parameters="action=login&username="+ $('username').value + "&secret=" + $('secret').value ;
-		var tmp = new Ajax.Request(rawman_url , opt);
-}
-
+	_$('message_text').innerHTML =" Logging in ...";
+	_$('status_message').style.display="";
+	var opt = {
+		method: 'get',
+		asynchronous: true,
+		onComplete: showResponse
+	};
+	opt.parameters="action=login&username="+ _$('username').value + "&secret=" + _$('secret').value ;
+	var tmp = new Ajax.Request(rawman_url , opt);
+}
 
 function submitOnEnter(e){ 
-		if(e.keyCode == 13){ 
-			login();
-			return false;
-		}
-}
-
-//-->
+	if(e.keyCode == 13){ 
+		login();
+		return false;
+	}
+}
+
 </SCRIPT>
 <BODY bgcolor="#FFFFFF" onload="localinit()" topmargin=0 leftmargin=0>
 <table width="100%" height="100%" border=0 cellpadding=0 cellspacing=0>
-	<tr><td width="170" valign=top align=left>
-					<div id="menu" style="display:none">
-					<table cellpadding=3 cellspacing=2 border=0 id="sidelist">
-						<tr><td width=3></td><td>Start</td></tr>
-						<tr><td></td><td class="slselected">Verify Analog Ports</td></tr>
-						<!-- <tr><td></td><td>Date & Time</td></tr> -->
-						<tr><td></td><td>Local Extension Settings</td></tr>
-						<tr><td></td><td>Service Providers</td></tr>
-						<tr><td></td><td>Calling Rules</td></tr>
-						<tr><td></td><td>VoiceMail Settings</td></tr>
-						<tr><td></td><td>User Extensions</td></tr>
-						<tr><td></td><td>Incoming Calls</td></tr>
-						<!-- <tr><td></td><td>VoiceMenus</td></tr> -->
-						<tr><td></td><td>Finish</td></tr>
-					</table>
-					</div>
-			</td>
-			<td valign=top align=center>
-			<!--  this page -->
-							<select id='zapchan' style="display:none"></select>
-							<div id="loginform" style="display:none">
-										<div class="heading">Pleae enter your admin Username and Password </div>
-										<table align="center">
-													<tr><td>Username:</td>										<td><input id="username"  size=12></td>							</tr>
-													<tr><td>Password:</td>												<td><input type="password" id="secret" size=12 onKeyPress="submitOnEnter(event)"></td>		</tr>
-													<tr><td align='center' colspan='2' height=40 valign=bottom>
-																<input type="button" id="login" value="Login" onClick="login()" >
-															</td>
-													</tr>
-										</table>
-						</div>
-						<div id="zapinfo" style="display:none">
-										<div class="heading">Step 1 of <script>document.write(parent.numberofsteps);</script>&nbsp;&nbsp;- Verify Analog Ports</div>
-										<div id="detected_info" class="subheading">The following analog ports have been detected on your system</div>
-										<div id="zapscan_info" class="subheading"></div>
-						</div>
-			<!--  this page -->
-			</td>
-		</tr>
+	<tr>
+	<td width="170" valign=top align=left>
+		<div id="menu" style="display:none">
+		<table cellpadding=3 cellspacing=2 border=0 id="sidelist">
+			<tr><td width=3></td><td>Start</td></tr>
+			<tr><td></td><td class="slselected">Verify Analog Ports</td></tr>
+			<!-- <tr><td></td><td>Date & Time</td></tr> -->
+			<tr><td></td><td>Local Extension Settings</td></tr>
+			<tr><td></td><td>Service Providers</td></tr>
+			<tr><td></td><td>Calling Rules</td></tr>
+			<tr><td></td><td>VoiceMail Settings</td></tr>
+			<tr><td></td><td>User Extensions</td></tr>
+			<tr><td></td><td>Incoming Calls</td></tr>
+			<!-- <tr><td></td><td>VoiceMenus</td></tr> -->
+			<tr><td></td><td>Finish</td></tr>
+		</table>
+		</div>
+	</td>
+	<td valign=top align=center>
+	<!--  this page -->
+		<select id='zapchan' style="display:none"></select>
+		<div id="loginform" style="display:none">
+		<div class="heading">Pleae enter your admin Username and Password </div>
+		<table align="center">
+			<tr>	<td>Username:</td>
+				<td><input id="username"  size=12></td>
+			</tr>
+			<tr>	<td>Password:</td>
+				<td><input type="password" id="secret" size=12 onKeyPress="submitOnEnter(event)"></td>
+			</tr>
+			<tr>	<td align='center' colspan='2' height=40 valign=bottom>
+					<input type="button" id="login" value="Login" onClick="login()" >
+				</td>
+			</tr>
+		</table>
+		</div>
+		<div id="zapinfo" style="display:none">
+			<div class="heading">Step 1 of <script>document.write(parent.numberofsteps);</script>&nbsp;&nbsp;- Verify Analog Ports</div>
+			<div id="detected_info" class="subheading">The following analog ports have been detected on your system</div>
+			<div id="zapscan_info" class="subheading"></div>
+		</div>
+	<!--  this page -->
+	</td>
+	</tr>
 </table>
 <div ID="status_message"  STYLE="display:none; position: absolute; left: 170; top: 100; width:350; height:115;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid;">
-<BR><BR>
-<TABLE border=0 cellpadding=0 cellspacing=3 align="center">
-	<TR>
-	<TD><img src="../images/loading.gif"></TD>
-	<TD valign="middle" align="center">&nbsp;&nbsp;<div id="message_text"></div></TD>
-	</TR>
-</TABLE>
+	<BR><BR>
+	<TABLE border=0 cellpadding=0 cellspacing=3 align="center">
+		<TR>
+		<TD><img src="../images/loading.gif"></TD>
+		<TD valign="middle" align="center">&nbsp;&nbsp;<div id="message_text"></div></TD>
+		</TR>
+	</TABLE>
 </div>
 </BODY>
-</HTML>
+</HTML>



More information about the asterisk-gui-commits mailing list