pari: trunk r100 - in /trunk/config: home.html homeapp.html options.html

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Thu Nov 2 11:12:31 MST 2006


Author: pari
Date: Thu Nov  2 12:12:30 2006
New Revision: 100

URL: http://svn.digium.com/view/asterisk-gui?rev=100&view=rev
Log:
login form validations

Modified:
    trunk/config/home.html
    trunk/config/homeapp.html
    trunk/config/options.html

Modified: trunk/config/home.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/home.html?rev=100&r1=99&r2=100&view=diff
==============================================================================
--- trunk/config/home.html (original)
+++ trunk/config/home.html Thu Nov  2 12:12:30 2006
@@ -93,6 +93,18 @@
 	}
 
 	function doLogin() {
+		if( $('username').value == "" ){
+				alert("Please enter a Username");
+				$('username').focus();
+				return true;			
+		}
+
+		if( $('secret').value == "" ){
+				alert("Please enter a Secret");
+				$('secret').focus();
+				return true;			
+		}
+
 		$('statusbar').innerHTML = "<i>Logging in...</i>";
 		parent.astmanEngine.sendRequest('action=login&username=' + $('username').value + "&secret=" + $('secret').value, demo.logins);
 	}
@@ -109,9 +121,14 @@
 		localajaminit();
 	}
 
+
+function submitOnEnter(e){ 
+		if(e.keyCode == 13){ 
+			doLogin();
+			return false;
+		}
+}
 </script>
-
-
 <body id="foo" onload="localinit()" topmargin=0  bgcolor="EFEFEF">
 <div class="mainscreenTitleBar">
 	<span style="margin-left: 4px;font-weight:bold">Welcome to the Asterisk Configuration Panel</span>
@@ -123,7 +140,7 @@
 			<table align="center">
 				<tr><td colspan="2"><h2>Asterisk&trade; Configuration Engine</h2></td>
 				<tr><td>Username:</td><td><input disabled=1 id="username"  class="input9" size=12></td></tr>
-				<tr><td>Secret:</td><td><input disabled=1 type="password" id="secret" class="input9" size=12></td></tr>
+				<tr><td>Secret:</td><td><input disabled=1 type="password" id="secret" class="input9" size=12 onKeyPress="submitOnEnter(event)"></td></tr>
 				<tr><td colspan=2 align="center">
 				  <div id="statusbar">
 					<span style="margin-left: 4px;font-weight:bold">&nbsp;</span>
@@ -135,24 +152,8 @@
 							&nbsp;&nbsp;&nbsp;&nbsp;
 							<input type="submit" id="logoff" value="Logoff" disabled=1 onClick="doLogoff()" class="input">
 
-
-
-
-
-
-
-
 							<div style="display:none">
-									<TABLE cellpadding=2 cellspacing=1 border=0 bgcolor="#D7D7D7" width=400>
-									<TR><TD bgcolor="#F3F5F6" height="25"><font face="arial" size="2" color="#727986"><B>&nbsp;&nbsp;&nbsp;Welcome to Asterisk GUI</B></font></TD></TR>
-									<TR><TD bgcolor="#FFFFFF">
-												<div ><font face="arial" size="2" color="#727986">Welcome to Asterisk Configuration GUI - You can do blah blah blah using this tool. If you need help or further explanation about anything, just move your mouse on to the field and a brief description about the item will be displayed in the tooltip area.</font>
-												</div>
-												</TD>
-									</TR>
-									</TABLE>
 							</div>
-
 
 						</td>
 				</tr>

Modified: trunk/config/homeapp.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/homeapp.html?rev=100&r1=99&r2=100&view=diff
==============================================================================
--- trunk/config/homeapp.html (original)
+++ trunk/config/homeapp.html Thu Nov  2 12:12:30 2006
@@ -118,6 +118,18 @@
 	}
 
 	function doLogin() {
+		if( $('username').value == "" ){
+				alert("Please enter a Username");
+				$('username').focus();
+				return true;			
+		}
+
+		if( $('secret').value == "" ){
+				alert("Please enter a Secret");
+				$('secret').focus();
+				return true;			
+		}
+
 		$('statusbar').innerHTML = "<i>Logging in...</i>";
 		parent.astmanEngine.sendRequest('action=login&username=' + $('username').value + "&secret=" + $('secret').value, demo.logins);
 	}
@@ -133,6 +145,13 @@
 		localajaxinit();
 		localajaminit();
 	}
+
+	function submitOnEnter(e){ 
+			if(e.keyCode == 13){ 
+				doLogin();
+				return false;
+			}
+	}
 </script>
 <body id="foo" onload="localinit()"  bgcolor="EFEFEF">
 <div class="mainscreenTitleBar">
@@ -144,8 +163,8 @@
 		<td colspan=2>
 			<table align="center">
 				<tr><td colspan="2"><h2>Asterisk&trade; Configuration Engine</h2></td>
-				<tr><td>Username:</td><td><input disabled=1 id="username"></td></tr>
-				<tr><td>Secret:</td><td><input disabled=1 type="password" id="secret"></td></tr>
+				<tr><td>Username:</td><td><input disabled=1 id="username" class="input9" size=12></td></tr>
+				<tr><td>Secret:</td><td><input disabled=1 type="password" id="secret" class="input9" size=12  onKeyPress="submitOnEnter(event)"></td></tr>
 				<tr><td colspan=2 align="center">
 				  <div id="statusbar">
 					<span style="margin-left: 4px;font-weight:bold">&nbsp;</span>

Modified: trunk/config/options.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/options.html?rev=100&r1=99&r2=100&view=diff
==============================================================================
--- trunk/config/options.html (original)
+++ trunk/config/options.html Thu Nov  2 12:12:30 2006
@@ -96,6 +96,8 @@
 				$('save').disabled=true;
 				$('cancel').disabled=true;
 				default_bindaddress = $('bindaddr').value; default_port = $('bindport').value ; default_httptimeout = $('httptimeout').value;
+				// Inform the user that he is being redirected to the new URL : PORT : 
+
 			},
 			onFailure: function(t) {
 				$('status_message').style.display='none';



More information about the asterisk-gui-commits mailing list