pari: trunk r97 - in /trunk/config: ./ scripts/

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Wed Nov 1 13:44:07 MST 2006


Author: pari
Date: Wed Nov  1 14:44:06 2006
New Revision: 97

URL: http://svn.digium.com/view/asterisk-gui?rev=97&view=rev
Log:
couple of important bug fixes in voicemenus

Added:
    trunk/config/setup.html
Modified:
    trunk/config/homeapp.html
    trunk/config/menus.html
    trunk/config/scripts/astman.js

Modified: trunk/config/homeapp.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/homeapp.html?rev=97&r1=96&r2=97&view=diff
==============================================================================
--- trunk/config/homeapp.html (original)
+++ trunk/config/homeapp.html Wed Nov  1 14:44:06 2006
@@ -133,12 +133,8 @@
 		localajaxinit();
 		localajaminit();
 	}
-
 </script>
-
-
 <body id="foo" onload="localinit()"  bgcolor="EFEFEF">
-
 <div class="mainscreenTitleBar">
 	<span style="margin-left: 4px;font-weight:bold">Welcome to the Asterisk Configuration Panel</span>
 </div>

Modified: trunk/config/menus.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/menus.html?rev=97&r1=96&r2=97&view=diff
==============================================================================
--- trunk/config/menus.html (original)
+++ trunk/config/menus.html Wed Nov  1 14:44:06 2006
@@ -120,8 +120,47 @@
 		newoption.text = tmp1[0] ; 
 		newoption.value = tmp1[0] ;
 		$(my_field_options).options.add(newoption);
+		$(my_field_options).options[y].style.fontWeight = 'bold';
 		$(my_field_options).options[y].selected = true;
-}
+		$(my_field_options).style.color = '#CC0000';
+}
+
+function add_newvmenu_tolistofkeymenus(){
+	for (var k=0; k< keys.length; k++){
+			var current_key_menus='keypress_'+ keys[k] + '_menus';
+			var newoption = document.createElement("option"); 
+			newoption.text = $('comment').value; 
+			newoption.value = $('vmenus').options[$('vmenus').selectedIndex].value ;
+			$(current_key_menus).options.add(newoption);
+	}
+}
+
+function delete_vmenu_fromlistofmenus(){
+	for (var k=0; k< keys.length; k++){
+			var current_key_menus='keypress_'+ keys[k] + '_menus';
+					for(var i=0; i< $(current_key_menus).options.length; i++){
+								if( $(current_key_menus).options[i].text == $('comment').value ){
+										// delete this option from the $(current_key_menus)
+										$(current_key_menus).remove(i);
+										break;
+								}
+					}
+	}
+}
+
+function change_vmenuname_inlistofmenus(oldname,newname){
+	for (var k=0; k< keys.length; k++){
+			var current_key_menus='keypress_'+ keys[k] + '_menus';
+					for(var i=0; i< $(current_key_menus).options.length; i++){
+								if( $(current_key_menus).options[i].text == oldname ){
+										// delete this option from the $(current_key_menus)
+										$(current_key_menus).options[i].text = newname;
+										break;
+								}
+					}
+	}
+}
+
 
 
 function  key_action(a, field){
@@ -297,6 +336,9 @@
 							// update vmenus
 							$('vmenus').options[$('vmenus').selectedIndex].text = "VoiceMenu - " + $('comment').value;
 							$('vmenus').options[$('vmenus').selectedIndex].value = current_vmenu;
+							select_vmenu();
+							// add the new menu to the list of menus being displayed in the keypad options
+							add_newvmenu_tolistofkeymenus();
 
 					}else{ // if editing existing keypress options
 							for (var k=0; k< keys.length; k++){
@@ -334,6 +376,8 @@
 			var current_vmenu = $('vmenus').value;
 			if(  voicemenusdata[current_vmenu].comment != $('comment').value ){
 					uri += build_action('update', p, current_vmenu ,"comment", $('comment').value ); p = p+1;
+					change_vmenuname_inlistofmenus(voicemenusdata[current_vmenu].comment,$('comment').value);
+					 voicemenusdata[current_vmenu].comment = $('comment').value;
 			}
 			
 			 if( voicemenusdata[current_vmenu].include =="default" && !$('allowexten').checked ){
@@ -539,8 +583,7 @@
 }
 
 
-
-menuscallbacks.postselect = function() {
+function select_vmenu(){
 	// show al lthe //s, lines in the select box - 
 	if($('vmenus').selectedIndex	==-1){ return true;}
 	current_context = $('vmenus').value;
@@ -647,6 +690,10 @@
 }
 
 
+menuscallbacks.postselect = function() {
+	select_vmenu();
+}
+
 menuscallbacks.format = function(t, x) {
 		var tmp = t.name.split('general');
 		var exten_fields;
@@ -704,6 +751,20 @@
 menuscallbacks.cancelnewcategory =function(){
 	$('comment').disabled = true;
 	$('keypressoptions').style.display = "none";
+}
+
+menuscallbacks.oncategorydelete =function(){
+	delete_vmenu_fromlistofmenus();
+	$('comment').disabled = true;
+	$('keypressoptions').style.display = "none";
+	$('savevmenu').disabled = true;
+	$('steps').options.length =0;
+	$('newstep_action').disabled = true;
+	$('newstep_var').disabled = true;
+	$('addstep').disabled = true;
+	$('steps').disabled = true;
+	$('stepUp').disabled = true;
+	$('stepDown').disabled = true;
 }
 
 menuscallbacks.cancelchanges =function(){

Modified: trunk/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/scripts/astman.js?rev=97&r1=96&r2=97&view=diff
==============================================================================
--- trunk/config/scripts/astman.js (original)
+++ trunk/config/scripts/astman.js Wed Nov  1 14:44:06 2006
@@ -409,6 +409,8 @@
 		asynchronous: true,
 		onSuccess: function(t) { 
 //			if(action_issuccess(t.responseText) ){
+				if (box.callbacks.oncategorydelete) 
+						box.callbacks.oncategorydelete();
 				if (box.widgets['status']) 
 					box.widgets['status'].innerHTML = "<i>Deleted.</i>";
 				if (box.callbacks.delchanges)

Added: trunk/config/setup.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/setup.html?rev=97&view=auto
==============================================================================
--- trunk/config/setup.html (added)
+++ trunk/config/setup.html Wed Nov  1 14:44:06 2006
@@ -1,0 +1,156 @@
+<!--
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Initial login screen
+ *
+ * Copyright (C) 1999 - 2006, Digium, Inc.
+ *
+ * Mark Spencer <markster at digium.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ *
+-->
+<script src="scripts/prototype.js"></script>
+<script src="scripts/rico.js"></script>
+<script src="scripts/astman.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 demo = new Object;
+	var localloggedon = -1;
+	function updateButtons()
+	{
+		if (parent.loggedon) {
+			$('username').disabled = 1;
+			$('secret').disabled = 1;
+			$('logoff').disabled = 0;
+			$('login').disabled = 1;
+		} else {
+			$('username').disabled = 0;
+			$('secret').disabled = 0;
+			$('logoff').disabled = 1;
+			$('login').disabled = 0;
+			$('username').focus();
+		}
+	}
+	
+	function loggedOn() {
+		if ((parent.loggedon == 1) && (localloggedon == 1))
+			return;
+		parent.setLoggedOn(1);
+		localloggedon = 1;
+		updateButtons();
+		$('statusbar').innerHTML = "<i>Connected!</i>";
+		parent.document.getElementById('logoutlink').innerHTML = "Logout";
+		parent.document.getElementById('logoutlink').onclick = parent.Logoff ;
+		parent.astmanEngine.pollEvents();
+	}
+	
+	function loggedOff() {
+		if ((parent.loggedon == 0) && (localloggedon == 0))
+			return;
+		parent.setLoggedOn(0);
+		parent.document.getElementById('logoutlink').innerHTML = "&nbsp;";
+		localloggedon = 0;
+		updateButtons();
+	}
+	
+	demo.logoffs = function(msgs) {
+		$('statusbar').innerHTML = msgs[0].headers['message'];
+		loggedOff();
+	};
+
+	demo.logins = function(msgs) {
+		$('statusbar').innerHTML = msgs[0].headers['message'];
+		resp = msgs[0].headers['response'];
+		if (resp == "Success")
+			loggedOn();
+		else
+			loggedOff();
+	};
+	
+	demo.pongs  = function(msgs) {
+		resp = msgs[0].headers['response'];
+		if (resp == "Pong") {
+			$('statusbar').innerHTML = "<i>Already connected...</i>";
+			loggedOn();
+		} else {
+			$('statusbar').innerHTML = "<i>Please login...</i>";
+			loggedOff();
+		}
+	}
+
+	function localajaxinit() {
+		parent.loadscreen(this);
+	}
+
+	function doLogin() {
+		$('statusbar').innerHTML = "<i>Logging in...</i>";
+		parent.astmanEngine.sendRequest('action=login&username=' + $('username').value + "&secret=" + $('secret').value, demo.logins);
+	}
+	
+	function doLogoff() {
+		$('statusbar').innerHTML = "<i>Logging off...</i>";
+		parent.astmanEngine.sendRequest('action=logoff', demo.logoffs);
+	}
+	function localajaminit() {	
+		parent.astmanEngine.sendRequest('action=ping', demo.pongs);
+	}
+	function localinit() {
+		localajaxinit();
+		localajaminit();
+	}
+
+</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>
+</div>
+<div class="mainscreenContentBox" id="mailboxcontent">
+<table class="mainscreenTable" width="100%">
+	<tr valign="top">
+		<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"  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 colspan=2 align="center">
+				  <div id="statusbar">
+					<span style="margin-left: 4px;font-weight:bold">&nbsp;</span>
+				  </div>
+				</td></tr>
+
+				<tr><td align='center' colspan='2'>
+							<input type="submit" id="login" value="Login" disabled=1 onClick="doLogin()" class="input">
+							&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>
+			</table>
+		</td>
+	</tr>
+</table>
+</div>
+</body>



More information about the asterisk-gui-commits mailing list