pari: trunk r205 - in /trunk/config: ./ scripts/ setup/

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Tue Jan 2 13:56:54 MST 2007


Author: pari
Date: Tue Jan  2 14:56:53 2007
New Revision: 205

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=205
Log:
Modal windows can now be moved around by dragging the title bars

Modified:
    trunk/config/incoming.html
    trunk/config/numberplan.html
    trunk/config/scripts/astman.js
    trunk/config/setup/4.html
    trunk/config/setup/5.html
    trunk/config/setup/7.html
    trunk/config/trunks.html

Modified: trunk/config/incoming.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/incoming.html?view=diff&rev=205&r1=204&r2=205
==============================================================================
--- trunk/config/incoming.html (original)
+++ trunk/config/incoming.html Tue Jan  2 14:56:53 2007
@@ -30,7 +30,6 @@
 var editstatus ;
 var old_incomingrule, old_fromprovider ;
 var  edit_pattern, edit_DIDtrunk, edit_action, edit_priority ;
-
 
 user_callbacks.format = function(t, x) {
 	var tmp = 'DID_' + t.name;
@@ -154,6 +153,7 @@
 	$('save_a').disabled = true;
 	$('thatmatch').style.display = "none" ;
 	$('userscontent').style.display = "";
+	$('bg_transparent').style.display = "";
 }
 
 function edit_incomingrule(a,b,c,d){// a is pattern, b is DID_trunk, c is action, d is priority
@@ -189,6 +189,7 @@
 	}
 
 	$('userscontent').style.display = "";
+	$('bg_transparent').style.display ='';
 }
 
 
@@ -247,6 +248,7 @@
 				didtrunks[temp_provider][newpattern].action = temp_action ;
 				addrowtotable(newpattern,temp_provider,temp_action,temp_priority) ; // a is pattern, b is DID_trunk, c is action, d is priority
 				$('userscontent').style.display = "none";
+				$('bg_transparent').style.display ='none';
 			},
 			onFailure: function(t) {
 				alert("Config Error: " + t.status + ": " + t.statusText);
@@ -301,6 +303,7 @@
 			didtrunks[temp_provider][newpattern].priority = temp_priority;
 			didtrunks[temp_provider][newpattern].action = temp_action ;
 			$('userscontent').style.display = "none";
+			$('bg_transparent').style.display ='none';
 			refreshtable();
 		},
 		onFailure: function(t) {
@@ -376,7 +379,6 @@
 function localajaxinit() {
 	parent.astmanEngine.config2list("users.conf", $('users'), new Array(), user_callbacks);
 }
-
 </script>
 <body id="foo" onload="localajaxinit()"  bgcolor="EFEFEF">
 <div class="mainscreenTitleBar">
@@ -403,9 +405,9 @@
 		<BR>
 		<center><input type="button" id="adddid" value="Add a Incoming Rule" onclick="add_incomingrule();"></center>
 
-		<div id="userscontent" STYLE="display:none; position: absolute; left: 20; top: 40; width:475; height:190;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid;">
-			<table width="100%" cellpadding=0 cellspacing=0>
-			<TR bgcolor="#7E5538" ><TD Height="20" align="right">
+		<div id="userscontent" STYLE="display:none; position: absolute; left: 20; top: 40; width:475; height:190;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid;z-index:5">
+			<table width="100%" cellpadding=0 cellspacing=0 onmousedown="startDrag(event , 'userscontent');">
+			<TR bgcolor="#7E5538"><TD Height="20" align="right" style="cursor: move">
 						<A href="#" onclick="$('cancel_a').click();"><font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">X</font></A>
 					</TD>
 					<TD width=4></TD>
@@ -428,11 +430,13 @@
 			<TR>
 				<TD align=center height=50 valign=middle>  
 						<input type="button" id="save_a" value="Save" onclick="save_incomingrule();">&nbsp;&nbsp;
-						<input type="button" id="cancel_a" value="Cancel" onclick="$('userscontent').style.display='none';" >
+						<input type="button" id="cancel_a" value="Cancel" onclick="$('userscontent').style.display='none'; $('bg_transparent').style.display ='none';" >
 				</TD>
 			</TR>
 			</TABLE>
 		</div>
+</div>
+<div id="bg_transparent" STYLE="display:none; position: absolute; left: 0; top: 24; width:100%; height:100%;  background-color:#FFFFFF; filter:alpha(opacity=50); -moz-opacity:.50;opacity:.50; border-width: 1px; border-color: #7E5538; border-style: solid; z-index:4">
 </div>
 <SCRIPT LANGUAGE="JavaScript">
 <!--

Modified: trunk/config/numberplan.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/numberplan.html?view=diff&rev=205&r1=204&r2=205
==============================================================================
--- trunk/config/numberplan.html (original)
+++ trunk/config/numberplan.html Tue Jan  2 14:56:53 2007
@@ -138,6 +138,7 @@
 			}
 	}
 	// now show this object in a table.
+	var rules_nosp = new Array ;
 	for( var x in  default_np_data ){	// x is the pattern
 			// sort the priorities
 			if ( x == "extend"){ break;}
@@ -159,8 +160,7 @@
 						}
 				}				
 				if ( default_np_data[x][sorted_priorities[z]].trunk  == "" ){
-							alert("Note: A Service Provider is not defined for this Rule ("+default_np_data[x][sorted_priorities[z]].rulename+")\n");
-							$('trunks').selectedIndex = -1;
+						rules_nosp.push(default_np_data[x][sorted_priorities[z]].rulename) ;
 						//editcallingrule(x , sorted_priorities[z]);
 						//return true;
 						addrowtotable( x , sorted_priorities[z] , "undefined" , default_np_data[x][sorted_priorities[z]].digits2strip );
@@ -173,6 +173,10 @@
 				}
 			}
 	} 
+	if(rules_nosp.length > 0 ){
+		$('status').innerHTML = "Note: A Service Provider is not defined for the Rules <BR>" + rules_nosp ;
+		$('trunks').selectedIndex = -1;
+	}
 }
 
 numplan_callbacks.eachline = true;
@@ -243,6 +247,7 @@
 		};
 		opt.parameters= "action=updateconfig&reload=yes&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
 		$('userscontent').style.display="none";
+		$('bg_transparent').style.display ='none';
 		$('status_message').style.display="block";
 		var tmp = new Ajax.Request("../../rawman", opt);
 }
@@ -281,6 +286,7 @@
 	}
 
 	$('userscontent').style.display="";
+	$('bg_transparent').style.display ='';
 	$('addrule').disabled =1;
 }
 
@@ -348,6 +354,7 @@
 	$('define_advanced').style.display="none";
 	$('define_usual').style.display="";
 	$('userscontent').style.display="";
+	$('bg_transparent').style.display ='';
 	$('addrule').disabled =1;
 	$('beginswith').value = "";
 	$('followedby').value ="";
@@ -380,6 +387,7 @@
 					};
 					opt.parameters= "action=updateconfig&reload=yes&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
 					$('userscontent').style.display="none";
+					$('bg_transparent').style.display ='none';
 					$('status_message').style.display="block";
 					var tmp = new Ajax.Request("../../rawman", opt);
 }
@@ -456,9 +464,9 @@
 		<BR>
 		<center><input type="button" id="addrule" value="Add a Calling Rule" onclick="add_callingrule();"></center>
 		
-		<div id="userscontent" STYLE="display:none; position: absolute; left: 20; top: 40; width:500; height:290;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid;">
-		<table width="100%" cellpadding=0 cellspacing=0>
-		<TR bgcolor="#7E5538" ><TD Height="20" align="right">
+		<div id="userscontent" STYLE="display:none; position: absolute; left: 20; top: 40; width:500; height:290;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid; z-index:5">
+		<table width="100%" cellpadding=0 cellspacing=0  onmousedown="startDrag(event , 'userscontent');">
+		<TR bgcolor="#7E5538" ><TD Height="20" align="right" style="cursor: move">
 					<A href="#" onclick="$('cancel_a').click();"><font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">X</font></A>
 				</TD>
 				<TD width=4></TD>
@@ -502,13 +510,15 @@
 		<TR>
 			<TD colspan=2 align=center height=50 valign=middle>  
 					<input type="button" id="save_a" value="Save" onclick="saverule();">&nbsp;&nbsp;
-					<input type="button" id="cancel_a" value="Cancel" onclick="$('userscontent').style.display='none';	$('addrule').disabled =0;" >
+					<input type="button" id="cancel_a" value="Cancel" onclick="$('userscontent').style.display='none'; $('bg_transparent').style.display ='none'; $('addrule').disabled =0;">
 			</TD>
 		</TR>
 		</TABLE>
 
 		</div>
 
+</div>
+<div id="bg_transparent" STYLE="display:none; position: absolute; left: 0; top: 24; width:100%; height:100%;  background-color:#FFFFFF; filter:alpha(opacity=50); -moz-opacity:.50;opacity:.50; border-width: 1px; border-color: #7E5538; border-style: solid; z-index:4">
 </div>
 <SCRIPT LANGUAGE="JavaScript">
 <!--

Modified: trunk/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/scripts/astman.js?view=diff&rev=205&r1=204&r2=205
==============================================================================
--- trunk/config/scripts/astman.js (original)
+++ trunk/config/scripts/astman.js Tue Jan  2 14:56:53 2007
@@ -24,6 +24,31 @@
  var asterisk_guitoolsversion = "0.7";
  var asterisk_guiversion = "$Revision$";
 var sortbynames = false;
+var dragdata = new Object;
+
+function startDrag(event, movethis ){
+	dragdata.movethis = movethis ;
+	dragdata.initialcursorX = event.clientX + window.scrollX;
+	dragdata.initialcursorY = event.clientY + window.scrollY;
+	dragdata.initialwindowleft = parseInt( $(dragdata.movethis).style.left) ;
+	dragdata.initialwindowtop = parseInt($(dragdata.movethis).style.top) ;
+	document.addEventListener("mousemove", movewindow, false);
+	document.addEventListener("mouseup", stopDrag, false);
+}
+
+
+function stopDrag(){
+	document.removeEventListener("mousemove", movewindow, false);
+	document.removeEventListener("mouseup", stopDrag, false);
+}
+
+function movewindow(event){
+  x = event.clientX + window.scrollX;
+  y = event.clientY + window.scrollY;
+  $(dragdata.movethis).style.left = (dragdata.initialwindowleft + x - dragdata.initialcursorX) + "px";
+  $(dragdata.movethis).style.top  = (dragdata.initialwindowtop  + y - dragdata.initialcursorY) + "px";
+}
+
 
 function check_patternonfields(fields){
 	// for checking validity of field contents before form submitting 

Modified: trunk/config/setup/4.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/setup/4.html?view=diff&rev=205&r1=204&r2=205
==============================================================================
--- trunk/config/setup/4.html (original)
+++ trunk/config/setup/4.html Tue Jan  2 14:56:53 2007
@@ -495,11 +495,13 @@
 
 function hideSPdetails(){
 		$('userscontent').style.display = "none";
+		$('bg_transparent').style.display = "none";
 }
 
 function showSPdetails(){
 		$('cancel').disabled = false;
 		$('userscontent').style.display = "block";
+		$('bg_transparent').style.display = "block";
 }
 
 function deleteSP(trunk){
@@ -566,9 +568,9 @@
 <input type='button' id='new' value='Add Service Provider'>
 </center>
 
-<div id="userscontent" STYLE="display:none; position: absolute; left: 230; top: 5; width:500; height:375;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid;">
-	<table width="100%" cellpadding=0 cellspacing=0>
-		<TR bgcolor="#7E5538" ><TD Height="20" align="right">
+<div id="userscontent" STYLE="display:none; position: absolute; left: 230; top: 5; width:500; height:375;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid;z-index:5">
+	<table width="100%" cellpadding=0 cellspacing=0  onmousedown="startDrag(event , 'userscontent');">
+		<TR bgcolor="#7E5538" ><TD Height="20" align="right"  style="cursor: move">
 					<A href="#" onclick="$('cancel').click();"><font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">X</font></A>
 				</TD>
 				<TD width=4></TD>
@@ -671,6 +673,8 @@
 			</td>
 		</tr>
 </table>
+<div id="bg_transparent" STYLE="display:none; position: absolute; left: 0; top: 0; width:100%; height:100%;  background-color:#FFFFFF; filter:alpha(opacity=50); -moz-opacity:.50;opacity:.50; border-width: 0px; z-index:4">
+</div>
 </BODY>
 </HTML>
 

Modified: trunk/config/setup/5.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/setup/5.html?view=diff&rev=205&r1=204&r2=205
==============================================================================
--- trunk/config/setup/5.html (original)
+++ trunk/config/setup/5.html Tue Jan  2 14:56:53 2007
@@ -257,6 +257,7 @@
 		};
 		opt.parameters= "action=updateconfig&reload=yes&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
 		$('userscontent').style.display="none";
+		$('bg_transparent').style.display='none';
 		$('status_message').style.display="block";
 		var tmp = new Ajax.Request(rawman_url, opt);
 }
@@ -295,6 +296,7 @@
 	}
 
 	$('userscontent').style.display="";
+	$('bg_transparent').style.display='';
 	$('addrule').disabled =1;
 }
 
@@ -362,6 +364,7 @@
 	$('define_advanced').style.display="none";
 	$('define_usual').style.display="";
 	$('userscontent').style.display="";
+	$('bg_transparent').style.display='';
 	$('addrule').disabled =1;
 	$('beginswith').value = "";
 	$('followedby').value ="";
@@ -394,6 +397,7 @@
 					};
 					opt.parameters= "action=updateconfig&reload=yes&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
 					$('userscontent').style.display="none";
+					$('bg_transparent').style.display='none';
 					$('status_message').style.display="block";
 					var tmp = new Ajax.Request(rawman_url, opt);
 }
@@ -477,9 +481,9 @@
 		<BR>
 		<center><input type="button" id="addrule" value="Add a Calling Rule" onclick="add_callingrule();"></center>
 		
-		<div id="userscontent" STYLE="display:none; position: absolute; left: 225; top: 40; width:500; height:290;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid;">
-		<table width="100%" cellpadding=0 cellspacing=0>
-		<TR bgcolor="#7E5538" ><TD Height="20" align="right">
+		<div id="userscontent" STYLE="display:none; position: absolute; left: 225; top: 40; width:500; height:290;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid; z-index:5">
+		<table width="100%" cellpadding=0 cellspacing=0 onmousedown="startDrag(event , 'userscontent');">
+		<TR bgcolor="#7E5538" ><TD Height="20" align="right" style="cursor: move">
 					<A href="#" onclick="$('cancel_a').click();"><font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">X</font></A>
 				</TD>
 				<TD width=4></TD>
@@ -523,7 +527,7 @@
 		<TR>
 			<TD colspan=2 align=center height=50 valign=middle>  
 					<input type="button" id="save_a" value="Save" onclick="saverule();">&nbsp;&nbsp;
-					<input type="button" id="cancel_a" value="Cancel" onclick="$('userscontent').style.display='none';	$('addrule').disabled =0;" >
+					<input type="button" id="cancel_a" value="Cancel" onclick="$('userscontent').style.display='none'; $('bg_transparent').style.display='none'; $('addrule').disabled =0; " >
 			</TD>
 		</TR>
 		</TABLE>
@@ -533,6 +537,8 @@
 			</td>
 		</tr>
 </table>
+<div id="bg_transparent" STYLE="display:none; position: absolute; left: 0; top: 0; width:100%; height:100%;  background-color:#FFFFFF; filter:alpha(opacity=50); -moz-opacity:.50;opacity:.50; border-width: 0px; z-index:4">
+</div>
 <SCRIPT LANGUAGE="JavaScript">
 <!--
 showdiv_statusmessage();

Modified: trunk/config/setup/7.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/setup/7.html?view=diff&rev=205&r1=204&r2=205
==============================================================================
--- trunk/config/setup/7.html (original)
+++ trunk/config/setup/7.html Tue Jan  2 14:56:53 2007
@@ -203,11 +203,13 @@
 
 function hideuserdetails(){
 		$('usersettings').style.display = "none";
+		$('bg_transparent').style.display='none';
 }
 
 function showuserdetails(){
 		$('cancel').disabled = false;
 		$('usersettings').style.display = "block";
+		$('bg_transparent').style.display='';
 }
 
 
@@ -283,9 +285,9 @@
 						<select id='extensions' style="display:none" ></select>
  						<input type='button' id='delete' value='Delete'>
 				</div>
-				<div ID="usersettings"  STYLE="display:none; position: absolute; left: 240; top: 40; width:530; height:250;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid;">
-						<table width="100%" cellpadding=0 cellspacing=0>
-							<TR bgcolor="#7E5538" ><TD Height="20" align="right">
+				<div ID="usersettings"  STYLE="display:none; position: absolute; left: 240; top: 40; width:530; height:250;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid; z-index:5">
+						<table width="100%" cellpadding=0 cellspacing=0  onmousedown="startDrag(event , 'usersettings');">
+							<TR bgcolor="#7E5538" ><TD Height="20" align="right" style="cursor: move">
 										<A href="#" onclick="$('cancel').click();"><font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">X</font></A>
 									</TD>
 									<TD width=4></TD>
@@ -367,5 +369,7 @@
 			</td>
 		</tr>
 </table>
+<div id="bg_transparent" STYLE="display:none; position: absolute; left: 0; top: 0; width:100%; height:100%;  background-color:#FFFFFF; filter:alpha(opacity=50); -moz-opacity:.50;opacity:.50; border-width: 0px; z-index:4">
+</div>
 </BODY>
 </HTML>

Modified: trunk/config/trunks.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/trunks.html?view=diff&rev=205&r1=204&r2=205
==============================================================================
--- trunk/config/trunks.html (original)
+++ trunk/config/trunks.html Tue Jan  2 14:56:53 2007
@@ -505,11 +505,13 @@
 
 function hideSPdetails(){
 		$('userscontent').style.display = "none";
+		$('bg_transparent').style.display ='none';
 }
 
 function showSPdetails(){
 		$('cancel').disabled = false;
 		$('userscontent').style.display = "block";
+		$('bg_transparent').style.display ='';
 }
 
 function deleteSP(trunk){
@@ -563,9 +565,9 @@
 <input type='button' id='new' value='Add Service Provider'>
 </center>
 
-<div id="userscontent" STYLE="display:none; position: absolute; left: 20; top: 40; width:500; height:400;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid;">
-	<table width="100%" cellpadding=0 cellspacing=0>
-		<TR bgcolor="#7E5538" ><TD Height="20" align="right">
+<div id="userscontent" STYLE="display:none; position: absolute; left: 20; top: 40; width:500; height:400;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid; z-index:5">
+	<table width="100%" cellpadding=0 cellspacing=0  onmousedown="startDrag(event , 'userscontent');">
+		<TR bgcolor="#7E5538" ><TD Height="20" align="right" style="cursor: move">
 					<A href="#" onclick="$('cancel').click();"><font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">X</font></A>
 				</TD>
 				<TD width=4></TD>
@@ -661,4 +663,6 @@
 <tr><td></td><td align="center"><input type='button' id='save' value='Save' class="buttonbold">&nbsp;<input type='button' id='cancel' value='Cancel' class="buttonbold"></td></tr>
 </table>
 </div>
+<div id="bg_transparent" STYLE="display:none; position: absolute; left: 0; top: 24; width:100%; height:100%;  background-color:#FFFFFF; filter:alpha(opacity=50); -moz-opacity:.50;opacity:.50; border-width: 1px; border-color: #7E5538; border-style: solid; z-index:4">
+</div>
 </body>



More information about the asterisk-gui-commits mailing list