pari: trunk r59 - in /trunk/config: ./ images/ scripts/

asterisk-gui-commits at lists.digium.internal asterisk-gui-commits at lists.digium.internal
Tue Oct 10 11:44:54 CDT 2006


Author: pari
Date: Tue Oct 10 11:44:53 2006
New Revision: 59

URL: http://svn.digium.com/view/asterisk-gui?rev=59&view=rev
Log:
cool saving_changes dialog that tells the user that something is going between the client and server and the browser is waiting for a response

Added:
    trunk/config/images/loading.gif   (with props)
Modified:
    trunk/config/menus.html
    trunk/config/scripts/astman.js

Added: trunk/config/images/loading.gif
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/images/loading.gif?rev=59&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/config/images/loading.gif
------------------------------------------------------------------------------
    svn:executable = *

Propchange: trunk/config/images/loading.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: trunk/config/menus.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/menus.html?rev=59&r1=58&r2=59&view=diff
==============================================================================
--- trunk/config/menus.html (original)
+++ trunk/config/menus.html Tue Oct 10 11:44:53 2006
@@ -162,7 +162,7 @@
 }
 
 function add_newstep(){
-
+	$('saving_changes').style.display="block";
 	if( !$('newstep_action').value ){
 		alert("Please select an action for this step");
 		$('newstep_action').focus();
@@ -181,6 +181,7 @@
 			method: 'get',
 			asynchronous: true,
 			onSuccess: function() { 
+				setTimeout("$('saving_changes').style.display='none'",500);
 				// if request successfull then add this to the steps select box
 				var newoption = document.createElement("option"); 
 				newoption.text = format_step(action_string ); 
@@ -202,6 +203,7 @@
 				update_updown();
 			},
 			onFailure: function(t) {
+				$('saving_changes').style.display='none';
 				alert("Config Error: " + t.status + ": " + t.statusText);
 			},
 	};
@@ -267,10 +269,12 @@
 
 
 function save_vmenu(){
+	$('saving_changes').style.display="block";
 	var opt = {
 			method: 'get',
 			asynchronous: true,
 			onSuccess: function() { 
+					setTimeout("$('saving_changes').style.display='none'",500);
 					$('status').innerHTML = "<i>Updated.</i>";
 					$('savevmenu').disabled = true;
 					$('save').disabled = true;
@@ -308,6 +312,7 @@
 
 			},
 			onFailure: function(t) {
+				$('saving_changes').style.display='none';
 				alert("Config Error: " + t.status + ": " + t.statusText);
 			},
 	};
@@ -481,10 +486,12 @@
 
 function delete_step(){
 	// delete the selected step and update voicemenusdata and update 'select' object - steps
+	$('saving_changes').style.display="block";
 	var opt = {
 			method: 'get',
 			asynchronous: true,
 			onSuccess: function() { 
+						setTimeout("$('saving_changes').style.display='none'",500);
 						// Update voicemenusdata
 						for(var p=0; p< voicemenusdata[$('vmenus').value].extensions['s'].length; p++){
 							if( voicemenusdata[$('vmenus').value].extensions['s'][p] == $('steps').value )
@@ -497,6 +504,7 @@
 
 			},
 			onFailure: function(t) {
+				$('saving_changes').style.display='none';
 				alert("Config Error: " + t.status + ": " + t.statusText);
 			},
 	};	
@@ -802,7 +810,6 @@
 
 
 <body id="foo" onload="localajaxinit()">
-
 <div class="mainscreenTitleBar">
 	<span style="margin-left: 4px;font-weight:bold">Voice Menus Configuration</span>
 </div>
@@ -1068,7 +1075,7 @@
 								</td>
 						</tr>
 						
-						<tr><td colspan=2>&nbsp;<input type=checkbox id=allowexten disabled> Dial other Extensions?&nbsp;
+						<tr><td colspan=2>&nbsp;<input type=checkbox id=allowexten disabled onclick="$('savevmenu').disabled=false;$('cancel').disabled=false;"> Dial other Extensions?&nbsp;
 								</td>
 						</tr>
 						<tr><td colspan=2 height=6></td></tr>
@@ -1123,4 +1130,9 @@
 	</tr>
 </table>
 </div>
+<SCRIPT LANGUAGE="JavaScript">
+<!--
+showdiv_savingchanges();
+//-->
+</SCRIPT>
 </body>

Modified: trunk/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/scripts/astman.js?rev=59&r1=58&r2=59&view=diff
==============================================================================
--- trunk/config/scripts/astman.js (original)
+++ trunk/config/scripts/astman.js Tue Oct 10 11:44:53 2006
@@ -18,6 +18,18 @@
  * at the top of the source tree.
  *
  */
+function showdiv_savingchanges(){
+		document.write ("<div ID=\"saving_changes\"  STYLE=\"display:none; position: absolute; left: 170; top: 190; width:350; height:115;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid;\">");
+		document.write ("<BR><BR>");
+		document.write ("		<TABLE border=0 cellpadding=0 cellspacing=3 align=\"center\">");
+		document.write ("					<TR>	<TD><img src=\"images/loading.gif\"></TD>");
+		document.write ("								<TD valign=\"middle\" align=\"center\">&nbsp;&nbsp;Saving Changes ...</TD>");
+		document.write ("					</TR>");
+		document.write ("		</TABLE>");
+		document.write ("	</div>");
+}
+
+
 
 function combo_box(a, b, c ){	
 		var combo_text = document.getElementById(a);



More information about the asterisk-gui-commits mailing list