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

asterisk-gui-commits at lists.digium.internal asterisk-gui-commits at lists.digium.internal
Wed Oct 11 11:32:02 CDT 2006


Author: pari
Date: Wed Oct 11 11:32:01 2006
New Revision: 61

URL: http://svn.digium.com/view/asterisk-gui?rev=61&view=rev
Log:
multiple checkboxes instead of multiselect select box in trunks(service providers)

Modified:
    trunk/config/menus.html
    trunk/config/scripts/astman.js
    trunk/config/trunks.html
    trunk/config/users.html

Modified: trunk/config/menus.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/menus.html?rev=61&r1=60&r2=61&view=diff
==============================================================================
--- trunk/config/menus.html (original)
+++ trunk/config/menus.html Wed Oct 11 11:32:01 2006
@@ -162,7 +162,7 @@
 }
 
 function add_newstep(){
-	$('saving_changes').style.display="block";
+	$('status_message').style.display="block";
 	if( !$('newstep_action').value ){
 		alert("Please select an action for this step");
 		$('newstep_action').focus();
@@ -181,7 +181,7 @@
 			method: 'get',
 			asynchronous: true,
 			onSuccess: function() { 
-				setTimeout("$('saving_changes').style.display='none'",500);
+				setTimeout("$('status_message').style.display='none'",sc_displaytime);
 				// if request successfull then add this to the steps select box
 				var newoption = document.createElement("option"); 
 				newoption.text = format_step(action_string ); 
@@ -203,7 +203,7 @@
 				update_updown();
 			},
 			onFailure: function(t) {
-				$('saving_changes').style.display='none';
+				$('status_message').style.display='none';
 				alert("Config Error: " + t.status + ": " + t.statusText);
 			},
 	};
@@ -269,12 +269,12 @@
 
 
 function save_vmenu(){
-	$('saving_changes').style.display="block";
+	$('status_message').style.display="block";
 	var opt = {
 			method: 'get',
 			asynchronous: true,
 			onSuccess: function() { 
-					setTimeout("$('saving_changes').style.display='none'",500);
+					setTimeout("$('status_message').style.display='none'",sc_displaytime);
 					$('status').innerHTML = "<i>Updated.</i>";
 					$('savevmenu').disabled = true;
 					$('save').disabled = true;
@@ -312,7 +312,7 @@
 
 			},
 			onFailure: function(t) {
-				$('saving_changes').style.display='none';
+				$('status_message').style.display='none';
 				alert("Config Error: " + t.status + ": " + t.statusText);
 			},
 	};
@@ -486,12 +486,12 @@
 
 function delete_step(){
 	// delete the selected step and update voicemenusdata and update 'select' object - steps
-	$('saving_changes').style.display="block";
+	$('status_message').style.display="block";
 	var opt = {
 			method: 'get',
 			asynchronous: true,
 			onSuccess: function() { 
-						setTimeout("$('saving_changes').style.display='none'",500);
+						setTimeout("$('status_message').style.display='none'",sc_displaytime);
 						// Update voicemenusdata
 						for(var p=0; p< voicemenusdata[$('vmenus').value].extensions['s'].length; p++){
 							if( voicemenusdata[$('vmenus').value].extensions['s'][p] == $('steps').value )
@@ -504,7 +504,7 @@
 
 			},
 			onFailure: function(t) {
-				$('saving_changes').style.display='none';
+				$('status_message').style.display='none';
 				alert("Config Error: " + t.status + ": " + t.statusText);
 			},
 	};	
@@ -746,6 +746,7 @@
 
 
 function localajaxinit() {
+		$('message_text').innerHTML ="Saving Changes...";
 		for (x =0 ; x<fieldnames.length; x++){
 			widgets[fieldnames[x]] = $(fieldnames[x]);
 			widgets[fieldnames[x]].disabled = true;
@@ -1132,7 +1133,7 @@
 </div>
 <SCRIPT LANGUAGE="JavaScript">
 <!--
-showdiv_savingchanges();
+showdiv_statusmessage();
 //-->
 </SCRIPT>
 </body>

Modified: trunk/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/scripts/astman.js?rev=61&r1=60&r2=61&view=diff
==============================================================================
--- trunk/config/scripts/astman.js (original)
+++ trunk/config/scripts/astman.js Wed Oct 11 11:32:01 2006
@@ -18,12 +18,14 @@
  * 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;\">");
+
+ var sc_displaytime = 1000;
+function showdiv_statusmessage(){
+		document.write ("<div ID=\"status_message\"  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 ("								<TD valign=\"middle\" align=\"center\">&nbsp;&nbsp;<div id=\"message_text\"></div></TD>");
 		document.write ("					</TR>");
 		document.write ("		</TABLE>");
 		document.write ("	</div>");

Modified: trunk/config/trunks.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/trunks.html?rev=61&r1=60&r2=61&view=diff
==============================================================================
--- trunk/config/trunks.html (original)
+++ trunk/config/trunks.html Wed Oct 11 11:32:01 2006
@@ -216,12 +216,43 @@
 		parent.astmanEngine.config2list("providers.conf", $('provider'), provwidgets, providercallbacks);
 	}
 	
+
+	function update_zapchan(){
+		$('save').disabled = false;
+		$('cancel').disabled = false;
+
+		for (k=0;k< $('zapchan').length ;k++ ){
+				var selectedline = "selectedline" + k;
+				if( $(selectedline).checked  ){
+					$('zapchan').options[k].selected = true;
+				}else{
+					$('zapchan').options[k].selected = false;
+				}
+		}
+	}
+
+
+
 	function activateanalogvoip() {
-		if ($('trunkstyleanalog').checked) 
-			new Rico.Effect.Size('analog', null, 450, 120, 8);
-		else if ($('trunkstylevoip').checked) {
-			new Rico.Effect.Size('analog', null, 1, 120, 8, {complete:function() { $('analog').style.height = '0'; }});
-			$('voip').style.height = 450;
+		if ($('trunkstyleanalog').checked) {
+				new Rico.Effect.Size('analog', null, 450, 120, 8);
+				$('zapchan').style.display = "none";
+				$('zapchan_analoglines').style.display = "block";
+				$('zapchan_analoglines').innerHTML ="";
+				for (k=0;k< $('zapchan').length ;k++ ){
+						var selectedline = "selectedline" + k;
+						if($('zapchan').options[k].selected){
+							$('zapchan_analoglines').innerHTML += '<INPUT id="' + selectedline + '" TYPE="CHECKBOX" VALUE="'+ $('zapchan').options[k].value+ '" checked onclick="update_zapchan()">' + $('zapchan').options[k].text + '<BR>';
+						}else{
+							$('zapchan_analoglines').innerHTML += '<INPUT id="' + selectedline + '" TYPE="CHECKBOX" VALUE="'+ $('zapchan').options[k].value+ '" onclick="update_zapchan()">' + $('zapchan').options[k].text + '<BR>';
+						}
+				}
+		}else if ($('trunkstylevoip').checked) {
+				new Rico.Effect.Size('analog', null, 1, 120, 8, {complete:function() { $('analog').style.height = '0'; }});
+				$('voip').style.height = 450;
+				$('zapchan').style.display = "block";
+				$('zapchan_analoglines').style.display = "none";
+				$('zapchan_analoglines').innerHTML ="";		
 		}
 			
 	}
@@ -294,10 +325,14 @@
 				<div id='analogvoipcontainer' style='height:450;overflow:hidden'>
 				<div id='analog' style='height:0;overflow:hidden'>
 				<table>
-				<tr><td style='width:80px' valign='top'>Lines:</td><td><select size="12" multiple='true' id='zapchan' style='width:200px'></select></td></tr>
+				<tr><td style='width:80px' valign='top'>Lines:</td>
+						<td><select size="12" multiple='true' id='zapchan' style='width:200px'></select>
+								<div id="zapchan_analoglines" style='height:110px; width: 200px; overflow :auto; display:none'></div>
+						</td>
+				</tr>
 				<tr><td colspan='2' style='width:80px' valign='top' align='center'>
 					<div style='width:250'>
-						<i>Use CTRL+click and/or SHIFT+click to select more than one port.</i>
+						<!-- <i>Use CTRL+click and/or SHIFT+click to select more than one port.</i> -->
 					</div>
 				</td></tr>
 				</table>

Modified: trunk/config/users.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/users.html?rev=61&r1=60&r2=61&view=diff
==============================================================================
--- trunk/config/users.html (original)
+++ trunk/config/users.html Wed Oct 11 11:32:01 2006
@@ -35,7 +35,6 @@
 	var extencallbacks = new Object;
 	var numcallbacks = new Object;
 	var fieldnames = new Array( 'delete', 'status', 'new', 'save', 'cancel','name','fullname','secret','email','cid_number','zapchan','context', 'hasvoicemail','hasdirectory','hassip','hasiax','hasmanager','callwaiting','threewaycalling','mailbox','hasagent','group');
-	var tooltip_fields = new Array('name,0','fullname,1','secret,2','email,3','cid_number,4','zapchan,5','context,6', 'hasvoicemail,8','hasdirectory,9','hassip,10','hasiax,11','hasmanager,12','callwaiting,13','threewaycalling,14','hasagent,15');
 
 	extencallbacks.format = function(t, x) {
 		if ((t.name != specialcontext))



More information about the asterisk-gui-commits mailing list