pari: trunk r921 - /trunk/config/

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Mon May 14 15:24:37 MST 2007


Author: pari
Date: Mon May 14 17:24:36 2007
New Revision: 921

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=921
Log:
Moved Advanced options from the main panel to a select box 
in the top page (cfgbasic.html). This gives us room
to add a lot more advanced options in the GUI.

Also this way - we are not reloading the whole GUI while
toggling between advanced and basic options.


Modified:
    trunk/config/cfgbasic.html
    trunk/config/home.html
    trunk/config/localexts.html
    trunk/config/options.html
    trunk/config/timerules.html

Modified: trunk/config/cfgbasic.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/cfgbasic.html?view=diff&rev=921&r1=920&r2=921
==============================================================================
--- trunk/config/cfgbasic.html (original)
+++ trunk/config/cfgbasic.html Mon May 14 17:24:36 2007
@@ -205,6 +205,7 @@
 }
 
 function registerajax() {
+	pao();
 	astmanEngine = new Astman();
 	astmanEngine.setURL(asterisk_rawmanPath );
 
@@ -252,6 +253,49 @@
 	opt.parameters="action=updateconfig&reload=yes&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
 	var tmp = new Ajax.Request(asterisk_rawmanPath , opt);
 }
+
+
+function pao(){
+	var acb = _$('dimg');
+	var tmp_left = acb.offsetLeft -1;
+	var tmp_top = acb.offsetTop -1 ;
+	var tmp_parent = acb;
+	while(tmp_parent.offsetParent != document.body){
+		tmp_parent = tmp_parent.offsetParent;
+		tmp_left += tmp_parent.offsetLeft;
+	}
+	_$('AdvancedOptions').style.left = tmp_left + 700 ;
+	_$('AdvancedOptions').style.top = 1 ;
+	_$('AdvancedOptionsSelect').selectedIndex=-1;
+}
+
+function hide_advops(){
+	_$('AdvancedOptions').style.display='none';
+
+	if ( _$('mainscreen').contentWindow.flipadvbasic  ){
+		_$('mainscreen').contentWindow.flipadvbasic();
+	}
+
+}
+
+function goto_advancedoption(){ 
+	//<select id="AdvancedOptionsSelect" class="input9" onchange="goto_advancedoption()">
+	_$('mainscreen').style.display = "none";
+	if( _$('AdvancedOptionsSelect').value == 'TOSETUP'){top.window.location.href = "./setup/install.html";}
+
+	var t;
+	var panels = returnpanels();
+	for( var r=0; r < panels.length; r++ ){
+		t = panels[r].page.split(".html")[0];
+		_$( t + "_U" ).style.height = "1px";
+		_$( t + "_U" ).style.display = "none";
+	}
+	_$( "localexts_U" ).style.height = _$('configpanel').pheight + "px";
+	_$( "localexts_U" ).style.display = "";
+
+	_$('mainscreen').src = _$('AdvancedOptionsSelect').value ;
+	//_$('AdvancedOptionsSelect').selectedIndex=-1;
+}
 </script>
 <head>
 	<title>Asterisk Configuration GUI (Beta)</title>
@@ -261,7 +305,7 @@
 <table align="center" bgcolor="#dddddd" border="0" cellpadding="0" cellspacing="0" height="570" width="950">
 <tbody>
 	<tr height="47">
-		<td align="right" bgcolor="white" height="47" valign="bottom"><img src="images/digiumlogo.gif" align="left"></td>
+		<td align="right" bgcolor="white" height="47" valign="bottom" id="dimg"><img src="images/digiumlogo.gif" align="left"></td>
 		<td align="center" bgcolor="white" valign="middle">
 		<div id="feedback_round" style="background-color: #FFFFFF; width: 400px; display: none;">
 			<div id="feedback" style="font-family: Arial,sans-serif,Helvetica,Trebuchet MS; font-size: 13px; font-weight: bold;"></div>
@@ -300,4 +344,26 @@
 		</td>
 </tr>
 </tbody></table>
+<div id="AdvancedOptions" style="display:none; position:absolute; z-index:1004; width:220px; background-color : #EFEFEF; padding : 2px 2px 4px 2px;">
+	<table cellpadding=1 cellspacing=0 border=0 width=220>
+		<tr>	<td align=right>Goto:&nbsp;</td>
+			<td align="center">
+			<select id="AdvancedOptionsSelect" class="input9" onchange="goto_advancedoption()">
+				<option value="feditor.html">File Editor</option>
+				<option value="cli.html">Asterisk CLI</option>
+				<option value="moh.html">Music on Hold</option>
+				<option value="timerules.html">Time Based Rules</option>
+				<option value="sip.html">SIP</option>
+				<option value="iax.html">IAX</option>
+			<!--	<option value="jabber.html">Jabber</option>
+				<option value="jingle.html">Jingle</option>
+				<option value="zapata.html">Zap Channel</option>	-->
+				<option value="options.html">Change Password</option>
+				<option value="TOSETUP">Setup Wizard</option>
+			</select>
+			</td>
+			<td align="right" valign="top"><span style="color: #909090; font-size: 8pt;cursor:pointer;" onclick="hide_advops();">X</span></td>
+		</tr>
+	</table>
+</div>
 </body>

Modified: trunk/config/home.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/home.html?view=diff&rev=921&r1=920&r2=921
==============================================================================
--- trunk/config/home.html (original)
+++ trunk/config/home.html Mon May 14 17:24:36 2007
@@ -46,7 +46,6 @@
 		onComplete: function(t){
 			var f = t.responseText;
 			if( f.match("Pong")){
-				console.log("L1");
 				_$('statusbar').innerHTML = "<img src='images/tick.gif'><i>Connected!</i>";
 				loggedOn();
 				parent.loadscreen(this);

Modified: trunk/config/localexts.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/localexts.html?view=diff&rev=921&r1=920&r2=921
==============================================================================
--- trunk/config/localexts.html (original)
+++ trunk/config/localexts.html Mon May 14 17:24:36 2007
@@ -30,10 +30,6 @@
 var fieldnames = ['allow_aliasextns', 'allow_an_extns', 'callwaiting', 'cancel', 'hasagent', 'hasdirectory', 'hasiax', 'hasmanager', 'hassip', 'hasvoicemail', 'localextenlength', 'save', 'threewaycalling', 'userbase', 'vmsecret', 'login_exten', 'login_callback_exten'];
 var widgets = {};
 var agent_extens={};
-
-function tosetup(){
-	parent.window.location.href = "./setup/install.html";
-}
 
 usercallbacks.format =  function(t) {
 	if(t.name == "general" ){ return t.name; }
@@ -114,6 +110,12 @@
 
 
 function localajaxinit(){
+	if (top._$('AdvancedOptions').style.display == "none"){
+		_$('advbasic').innerHTML = '(Show Advanced Options)';
+	}else{
+		_$('advbasic').innerHTML = '(Hide Advanced Options)';
+	}
+
 	setWindowTitle("Local Extension Settings");
 	for (var x =0 ; x < fieldnames.length ; x++ ) {
 		widgets[fieldnames[x]] = _$(fieldnames[x]);
@@ -140,6 +142,7 @@
 		while ( lel.value != ub.value.length  ){ ub.value = ub.value + "0" ; }
 	}
 }
+
 
 function free_mem( ){
 	if( navigator.userAgent.indexOf("MSIE") == -1 ){ return true; }
@@ -150,35 +153,35 @@
 	} catch(e){ }
 }
 
-function basicadvanced(){
-	var _url = "";
-	if(top.window.location.href.match("advanced=yes") ){ _url = "./cfgbasic.html"; }else{ _url = "./cfgbasic.html?advanced=yes" }
-	parent.window.location.href = _url ;
-}
+
+function flipadvbasic(){
+	if(_$('advbasic').innerHTML.toLowerCase().match('show') ){
+		_$('advbasic').innerHTML = '(Hide Advanced Options)';
+		top._$('AdvancedOptions').style.display = '';
+		top._$('AdvancedOptionsSelect').selectedIndex=-1;
+		return;
+	}
+
+	if(_$('advbasic').innerHTML.toLowerCase().match('hide') ){
+		_$('advbasic').innerHTML = '(Show Advanced Options)';
+		top._$('AdvancedOptions').style.display = 'none';
+		return;
+	}
+}
+
 
 </script>
 <body id="foo" onload="localajaxinit()" bgcolor="EFEFEF"  onunload="free_mem()">
-<div class="mainscreenTitleBar"><span style="margin-left: 4px;font-weight:bold">Admin Options - Local Extension Settings</span></div>
+<div class="mainscreenTitleBar">
+	<span style="margin-left: 4px;font-weight:bold">Admin Settings</span>
+	<span style="margin-left: 14px;font-weight:bold; cursor: pointer" id="advbasic" onclick="flipadvbasic();">(Show Advanced Options)</span>
+</div>
 <div class="mainscreenContentBox" id="userscontent">
-<TABLE align=center width="520" cellpadding=0 cellspacing=0 style="margin: 5px 0 0 0;">
-<TR>
-	<TD valign="bottom" align="center" class="tab"><a href="#" class="tabselected">Local Extension settings</a></TD>
-	<TD><a href="options.html" class="tab">Change Password</a></TD>
-	<TD valign="bottom" align="left">
-		<a href="#" class="tab" onclick="basicadvanced();">
-		<script>
-			if( top.window.location.href.match("advanced=yes") ){ document.write("Basic"); }else{ document.write("Advanced"); }
-		</script>
-		</a>
-	</TD>
-	<TD valign="bottom" align="left"><a href="#" class="tab" onclick="tosetup();">Setup Wizard</a></TD> 
-</TR>
-</TABLE>
-<BR>
 <table class="mainscreenTable" align="center">
 <tr>	
 <td align="center" valign="top">
-	<select id="devices" style="display:none"></select> 
+	<select id="devices" style="display:none"></select>
+	<BR> 
 	<fieldset  style="width: 400px">
 		<legend>&nbsp;Local Extension Settings:&nbsp;</legend>
 		<table align='center'  width='390'  cellpadding=2 cellspacing=1>
@@ -193,11 +196,19 @@
 			</select>&nbsp;</td>
 		</tr>
 		<tr><td class="field_text" align=left>First Extension Number : <input type=text id="userbase" size=5  class="input9"></td></tr>
-		<tr><td onmouseover="show_tooltip('en', 'users', 18);" class="field_text" align=left>Agent Login Extension :  <input type=text id="login_exten" size=5  class="input9"></td></tr>
-		<tr><td onmouseover="show_tooltip('en', 'users', 19);" class="field_text" align=left>Agent Callback Login Extension :  <input type=text id="login_callback_exten" size=5  class="input9"></td></tr>
-
 		<tr><td class="field_text" align="left"><input type=checkbox id="allow_aliasextns">Allow analog phones to be assigned to multiple extensions</td></tr>
 		<tr><td class="field_text" align="left"><input type=checkbox id="allow_an_extns">Allow extensions to be AlphaNumeric (SIP/IAX users)</td></tr>
+		</table>
+	</fieldset><BR>
+	<fieldset  style="width: 400px">
+		<legend>&nbsp;Agent Login Settings:&nbsp;</legend>
+		<table align='center'  width='390'  cellpadding=2 cellspacing=1>
+			<tr>	<td onmouseover="show_tooltip('en', 'users', 18);" class="field_text" align=right>Agent Login Extension : </td>
+				<td><input type=text id="login_exten" size=5  class="input9"></td>
+			</tr>
+			<tr>	<td onmouseover="show_tooltip('en', 'users', 19);" class="field_text" align=right>Agent Callback Login Extension : </td>
+				<td><input type=text id="login_callback_exten" size=5  class="input9"></td>
+			</tr>
 		</table>
 	</fieldset><BR>
 	<fieldset style="width: 400px">

Modified: trunk/config/options.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/options.html?view=diff&rev=921&r1=920&r2=921
==============================================================================
--- trunk/config/options.html (original)
+++ trunk/config/options.html Mon May 14 17:24:36 2007
@@ -79,10 +79,6 @@
 	}
 }
 
-function tosetup(){
-	parent.window.location.href = "./setup/install.html";
-}
-
 function localajaxinit(){
 	showdiv_statusmessage();
 	setWindowTitle("Options");
@@ -96,32 +92,10 @@
 	_$('newpass').focus();
 }
 
-
-function basicadvanced(){
-	var _url = "";
-	if(top.window.location.href.match("advanced=yes") ){ _url = "./cfgbasic.html"; }else{ _url = "./cfgbasic.html?advanced=yes" }
-	parent.window.location.href = _url ;
-}
-
 </script>
 <body id="foo" onload="localajaxinit()" bgcolor="EFEFEF">
-<div class="mainscreenTitleBar"><span style="margin-left: 4px;font-weight:bold">Admin Options</span></div>
+<div class="mainscreenTitleBar"><span style="margin-left: 4px;font-weight:bold">Change Password</span></div>
 <div class="mainscreenContentBox" id="userscontent">
-
-<TABLE align=center width="520" cellpadding=0 cellspacing=0 style="margin: 5px 0 0 0;">
-<TR>
-	<TD valign="bottom" align="center"><a href="localexts.html" class="tab">Local Extension settings</a></TD>
-	<TD><a href="#" class="tabselected">Change Password</a></TD>
-	<TD valign="bottom" align="left">
-		<a href="#" class="tab" onclick="basicadvanced();">
-		<script>
-			if(top.window.location.href.match("advanced=yes") ){ document.write("Basic"); }else{ document.write("Advanced"); }
-		</script>
-		</a>
-	</TD>
-	<TD valign="bottom" align="left"><a href="#" onclick="tosetup();" class="tab">Setup Wizard</a></TD> 
-</TR>
-</TABLE>
 <BR>
 <table class="mainscreenTable" align="center">
 	<tr valign="top" height="18"><td align="center"></td></tr>

Modified: trunk/config/timerules.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/timerules.html?view=diff&rev=921&r1=920&r2=921
==============================================================================
--- trunk/config/timerules.html (original)
+++ trunk/config/timerules.html Mon May 14 17:24:36 2007
@@ -78,12 +78,12 @@
 
 	for( l in n ){
 		if(n.hasOwnProperty(l)){
-			if( l =='general'){ continue;}
+			if( l =='general'){ continue;} // ignore 'general' context
 			if ( n[l]['context'] && unescape(n[l]['context']) == asterisk_guiTDPrefix + l ) {
 				continue;
 			}
 
-			if( n[l]['context'] ){
+			if( !n[l]['trunkstyle'] ){ // all entries from users.conf other than trunks
 				var p = {};
 				p.username = (n[l]['fullname'])? unescape(n[l]['fullname'])+" ("+l+")" : "Local Extension ("+l+")";
 				p.usercontextstring = "default,"+l+",1" ;



More information about the asterisk-gui-commits mailing list