pari: trunk r19 - in /trunk/config: ./ scripts/ stylesheets/
asterisk-gui-commits at lists.digium.internal
asterisk-gui-commits at lists.digium.internal
Fri Sep 8 18:43:38 CDT 2006
Author: pari
Date: Fri Sep 8 18:43:37 2006
New Revision: 19
URL: http://svn.digium.com/view/asterisk-gui?rev=19&view=rev
Log:
added a advanced.html with additional tabs but could not do much after that as I spent the whole afternoon till evening debugging and what was missing is that the new iframe's seturl was not there.
Added:
trunk/config/advanced.html
trunk/config/sip.html
trunk/config/sip_general.html
Modified:
trunk/config/options.html
trunk/config/scripts/astman.js
trunk/config/stylesheets/rico.css
Added: trunk/config/advanced.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/advanced.html?rev=19&view=auto
==============================================================================
--- trunk/config/advanced.html (added)
+++ trunk/config/advanced.html Fri Sep 8 18:43:37 2006
@@ -1,0 +1,215 @@
+<!--
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Top level for configuration GUI
+ *
+ * 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>
+ PanelDef = Class.create();
+ PanelDef.prototype = {
+ initialize: function(name, label, icon, content) {
+ this.name = name;
+ this.label = label;
+ this.icon = icon;
+ this.content = content;
+ }
+ }
+ var panels = new Array;
+ var eventeater = new Object;
+ var loggedon = -1;
+ var started = 0;
+ var accordion;
+ var copyright = "Copyright ©2006 Digium, Inc. All Rights Reserved. "
+
+
+ eventeater.eventcb = function(msgs) {
+ if (loggedon == 1)
+ astmanEngine.pollEvents();
+ }
+
+ panels.push(
+
+ new PanelDef("home", "Home", "home.png",
+ "Welcome to the Asterisk Business Edition configuration portal! This portal " +
+ "is designed to simplify Asterisk configuration for new users of Asterisk " +
+ "Business Edition."),
+
+ new PanelDef("users", "Users", "accordion-icon.gif",
+ "Users is a short cut for quickly adding and removing all the necessary " +
+ "configuration components for any new phone."),
+
+ new PanelDef("meetme", "Conferencing", "accordion-icon.gif",
+ "MeetMe conference bridging allow quick, ad-hoc conferences with or without " +
+ "security."),
+
+ new PanelDef("voicemail", "Voicemail", "accordion-icon.gif",
+ "General settings for voicemail"),
+
+ new PanelDef("queues", "Call Queues", "accordion-icon.gif",
+ "Call queues allow calls to be sequenced to one or more agents."),
+
+ new PanelDef("trunks", "Trunks", "accordion-icon.gif",
+ "Trunks are outbound lines used to allow the system to make calls to the " +
+ "real world. Trunks can be VoIP lines or traditional telephony lines."),
+
+ new PanelDef("numberplan", "Number Plan", "accordion-icon.gif",
+ "The number plan defines dialing permissions and least cost routing rules."),
+
+// new PanelDef("musiconhold", "Music On Hold", "accordion-icon.gif",
+// "Music on hold sometimes keeps people less angry while they wait for an answer."),
+
+ new PanelDef("menus", "Voice Menus", "accordion-icon.gif",
+ "Menus allow for more efficient routing of calls from incoming callers."),
+
+ new PanelDef("sip", "SIP", "accordion-icon.gif", "SIP (Session Initiation Protocol) Configuration"),
+
+ new PanelDef("iax", "IAX", "accordion-icon.gif", "IAX (Inter-Asterisk eXchange Protocol) Configuration"),
+
+ new PanelDef("jabber", "Jabber", "accordion-icon.gif", "Jabber users configuration"),
+
+ new PanelDef("jingle", "Jingle", "accordion-icon.gif", "Jingle configuration lets users connect to google talk networks"),
+
+ new PanelDef("status", "Status", "accordion-icon.gif", "Monitor active channels."),
+
+ new PanelDef("options", "Options", "accordion-icon.gif", "Admin Settings")
+
+ );
+
+ astmanEngine.setURL('../../rawman');
+ astmanEngine.setEventCallback(eventeater.eventcb);
+</script>
+<head>
+<title>Schwing</title>
+</head>
+
+<body onload="javascript:registerajax()">
+
+<script>
+
+ function setLoggedOn(onoff) {
+ loggedon = onoff;
+ if (loggedon == 1) {
+ for (var i = 0; i < panels.length; i++) {
+ if (panels[i].name == 'home')
+ continue;
+ $(panels[i].name).onclick = $(panels[i].name).realonclick;
+ $(panels[i].name).onmouseover = $(panels[i].name).realonmouseover;
+ $(panels[i].name).style.visibility = 'inherit';
+ }
+ } else {
+ for (var i = 0; i < panels.length; i++) {
+ if (panels[i].name == 'home')
+ continue;
+ $(panels[i].name).onclick = false;
+ $(panels[i].name).onmouseover = false;
+ $(panels[i].name).style.visibility = 'hidden';
+ }
+ }
+ }
+
+ function loadscreen(srcbody) {
+ $('mainscreen').style.display = '';
+ new Rico.Effect.FadeTo($('mainscreen'), 1, 100, 1);
+ if (loggedon == 1)
+ astmanEngine.pollEvents();
+ }
+
+ function finishfade(page) {
+ $('mainscreen').style.display = "none";
+ }
+
+ function setstatus(status) {
+ $('status').innerHTML = copyright + status;
+ }
+
+ function showmainscreen(page) {
+ if (started) {
+ $('mainscreen').innerHTML = "Loading active screen...";
+ $('mainscreen').src = page.titleBar.id + ".html";
+ }
+ }
+
+ function fademainscreen(page, newpage) {
+ new Rico.Effect.FadeTo($('mainscreen'), 0, 100, 5, {complete:finishfade(page)});
+ }
+
+ function registerajax() {
+ accordion = new Rico.Accordion( $('configpanel'), { panelHeight:360,onHideTab:fademainscreen,onShowTab:showmainscreen });
+ $('borderbox').style.height = $('screenholder').clientHeight;
+ $('titlebar').style.width = $('borderbox').clientWidth - 12;
+ for (var i = 0; i < panels.length; i++) {
+ if (panels[i].name == 'home')
+ continue;
+ $(panels[i].name).realonclick = $(panels[i].name).onclick;
+ $(panels[i].name).realonmouseover = $(panels[i].name).onmouseover;
+ }
+
+ started = 1;
+ }
+</script>
+<table border="0" align="center" cellspacing="0" cellpadding="0" bgcolor="#dddddd">
+
+<tr>
+ <td bgcolor='white'></td>
+ <td width='80' bgcolor='white'></td>
+ <td bgcolor='white'></td>
+</tr>
+<tr><td valign="bottom" align='right' colspan="2" bgcolor='white'>
+<img align='left' src="images/digiumlogo.gif" align="left">
+</td><td valign='bottom' align='right' bgcolor='white'>
+<a target='_guido' href="http://www.digium.com/guido/about">About Digium</a> |
+<a target='_guido' href="http://www.digium.com/guido/help">Help</a>
+</td></tr>
+
+<tr><td>
+<div id="configpanel" style="width:150px;">
+ <script>
+ for (var i = 0; i < panels.length; i++) {
+ document.write("<div>");
+ document.write(" <div id='" + panels[i].name + "' class='accordionTabTitleBar'>");
+ document.write(" <img style='vertical-align:middle' src='images/" + panels[i].icon + "'>");
+ document.write(" <span style='margin-left: 4px;font-weight:bold'>" + panels[i].label + "</span>");
+ document.write(" </div>");
+ document.write(" <div class='accordionTabContentBox' style='background-image:url(images/panel.png)'>");
+ document.write(panels[i].content);
+ document.write(" </div>");
+ document.write("</div>");
+ }
+ </script>
+</div>
+</td>
+<td colspan='2' width="600" bgcolor="#eeeeef" valign="top" id="screenholder">
+ <div id="titlebar" class="mainscreenTitleBar" style="position:absolute;top:56px">
+ <span style="margin-left: 4px;font-weight:bold">Loading Screen <img src='images/dots.gif'></span>
+ </div>
+ <div id="borderbox" class="mainscreenBorderBox" style="height:100px">
+ </div>
+ <iframe width="600" height="600" frameborder="0" border="0" marginheight="0" marginwidth="0" src="home.html" id="mainscreen" style="position:absolute;top:56px">
+ </iframe>
+</td>
+</tr>
+<tr><td colspan="3">
+ <div id="status" class="statusbar">Copyright ©2006 Digium, Inc. Digium® and Asterisk® are registered <a href="http://www.digium.com/trademarks">trademarks</a> of Digium, Inc. All Rights Reserved. <i><a href="http://www.digium.com/gui_legal">Legal Information</a></i></div>
+</td></tr>
+</table>
+</body>
Modified: trunk/config/options.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/options.html?rev=19&r1=18&r2=19&view=diff
==============================================================================
--- trunk/config/options.html (original)
+++ trunk/config/options.html Fri Sep 8 18:43:37 2006
@@ -112,6 +112,7 @@
parent.loadscreen(this);
parent.astmanEngine.sendRequest('action=ping', options.pongs);
$('pwdbutton').disabled = true;
+ document.cookie = "var2=something;"
return;
}
@@ -139,31 +140,26 @@
<tr>
<td align="center" valign="top">
<div id="channellist" class="chanlist">
- <TABLE>
+ <table>
<!-- Till we find out a way to retrieve the current username -->
- <TR>
- <TD>Username</TD>
- <TD><input type="text" id="username" size=16></TD>
- </TR>
+ <tr> <td>Username</td>
+ <td><input type="text" id="username" size=16></td>
+ </tr>
<!-- wish I had sessions :) -->
- <TR>
- <TD>Current Password:</TD>
- <TD><input type="password" id="currentpass" size=16></TD>
- </TR>
- <TR>
- <TD>New Password:</TD>
- <TD><input type="password" id="newpass" size=16 onkeyup="compare_passwords()"> ( min 4 characters )</TD>
- </TR>
- <TR>
- <TD>Retype New Password:</TD>
- <TD><input type="password" id="newpass_rep" size=16 onkeyup="compare_passwords()"></TD>
- </TR>
- <TR>
- <TD align=center colspan=2>
+ <tr> <td>Current Password:</td>
+ <td><input type="password" id="currentpass" size=16></td>
+ </tr>
+ <tr> <td>New Password:</td>
+ <td><input type="password" id="newpass" size=16 onkeyup="compare_passwords()"> ( min 4 characters )</td>
+ </tr>
+ <tr> <td>Retype New Password:</td>
+ <td><input type="password" id="newpass_rep" size=16 onkeyup="compare_passwords()"></td>
+ </tr>
+ <tr> <td align=center colspan=2>
<input type="button" id="pwdbutton" value="Update" onclick="askfor_updatepassword()">
- </TD>
- </TR>
- </TABLE>
+ </td>
+ </tr>
+ </table>
</div>
</td>
</tr>
Modified: trunk/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/scripts/astman.js?rev=19&r1=18&r2=19&view=diff
==============================================================================
--- trunk/config/scripts/astman.js (original)
+++ trunk/config/scripts/astman.js Fri Sep 8 18:43:37 2006
@@ -292,7 +292,7 @@
},
onFailure: function(t) {
alert("Config Error: " + t.status + ": " + t.statusText);
- },
+ }
};
var tmp, uri;
var x,y;
@@ -542,7 +542,7 @@
},
onFailure: function(t) {
alert("Config Error: " + t.status + ": " + t.statusText);
- },
+ }
};
var tmp;
@@ -587,7 +587,7 @@
},
onFailure: function(t) {
alert("Config Error: " + t.status + ": " + t.statusText);
- },
+ }
};
var uri;
var tmp;
@@ -1310,7 +1310,7 @@
onSuccess: this.managerResponse,
onFailure: function(t) {
alert("Error: " + t.status + ": " + t.statusText);
- },
+ }
};
me.callback = callback;
opt.parameters = request;
@@ -1324,7 +1324,7 @@
onSuccess: this.eventResponse,
onFailure: function(t) {
alert("Event Error: " + t.status + ": " + t.statusText);
- },
+ }
};
opt.parameters="action=waitevent";
tmp = new Ajax.Request(this.url, opt);
@@ -1340,7 +1340,7 @@
},
onFailure: function(t) {
alert("Config Error: " + t.status + ": " + t.statusText);
- },
+ }
};
if (!callbacks.identifier)
callbacks.identifier = "name";
@@ -1393,7 +1393,7 @@
if (widgets['status']) {
widgets['status'].disabled = false;
}
-
+
tmp = new Ajax.Request(this.url, opt);
};
Added: trunk/config/sip.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/sip.html?rev=19&view=auto
==============================================================================
--- trunk/config/sip.html (added)
+++ trunk/config/sip.html Fri Sep 8 18:43:37 2006
@@ -1,0 +1,72 @@
+<!--
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Configuration for "Users" generally
+ *
+ * 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 tabs = new Array('tab1', 'tab2', 'tab3', 'tab4');
+var tabwindows = new Array('sip_general.html', 'sip_2.html', 'sip_3.html', 'sip_4.html');
+
+
+function localajaxinit(){
+ parent.loadscreen(this);
+ show_window(1);
+ return;
+}
+
+
+function show_window(x){
+ for(i=0; i < tabwindows.length ; i++){
+ document.getElementById(tabs[i]).style.background = '#DDE';
+ document.getElementById(tabs[i]).style['border-bottom'] = '1px solid #778';
+ document.getElementById(tabs[i]).style['font'] = 'bold 12px Verdana, sans-serif';
+
+ }
+ document.getElementById(tabs[x-1]).style.background = 'white';
+ document.getElementById(tabs[x-1]).style['border-bottom'] = '1px solid white';
+ document.getElementById(tabs[x-1]).style['font'] = 'bold 15px Verdana, sans-serif';
+ document.getElementById('tabwindow').src= tabwindows[x-1];
+
+ return false;
+}
+
+</script>
+<body id="foo" onload="localajaxinit()">
+<div class="mainscreenTitleBar">
+ <span style="margin-left: 4px;font-weight:bold">SIP Configuration</span>
+</div>
+<div class="mainscreenContentBox" id="userscontent">
+<table class="mainscreenTable" align="center">
+<tr><td align="center">
+ <BR>
+ <a href="" class="tab" onclick="return show_window(1);" id="tab1">General</a>
+ <a href="" class="tab" onclick="return show_window(2);" id="tab2">Tab 2</a>
+ <a href="" class="tab" onclick="return show_window(3);" id="tab3">Tab 3</a>
+ <a href="" class="tab" onclick="return show_window(4);" id="tab4">Tab 4</a>
+
+ <iframe style=" border: solid 1px black; background-color: white; padding: 4px; height:95%; width:95%; overflow: auto;" src="" id="tabwindow"></iframe>
+ </td>
+</tr>
+</table>
+</div>
+</body>
Added: trunk/config/sip_general.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/sip_general.html?rev=19&view=auto
==============================================================================
--- trunk/config/sip_general.html (added)
+++ trunk/config/sip_general.html Fri Sep 8 18:43:37 2006
@@ -1,0 +1,85 @@
+<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>
+/*
+allowguest = yes/no
+allowoverlap=no
+allowtransfer=no
+srvlookup=yes
+videosupport=yes
+
+
+context = default
+bindport=5060
+bindaddr=0.0.0.0
+domain=mydomain.tld
+realm=mydomain.tld
+maxexpiry=3600
+minexpiry=60
+defaultexpiry=120
+t1min=100
+disallow=all
+allow=ulaw
+allow=ilbc
+maxcallbitrate=384
+
+*/
+var phonecallbacks = new Object;
+var widgets = new Array;
+
+
+phonecallbacks.format = function(t) {
+// if( t.name =='general'){
+ //alert ( t.fieldbyname['context'] );
+// }
+
+ $('hiddenfield').stored_config.catbyname[t.name].fields[]
+
+ if (t.fieldbyname['fullname'] && t.fieldbyname['fullname'].length) {
+ return t.name + " -- " + t.fieldbyname['fullname'];
+ } else
+ return t.name;
+}
+
+
+
+
+
+phonecallbacks.postselect = function(box, val) {
+
+ alert ( val );
+}
+
+
+
+
+
+
+phonecallbacks.loaded = function() {
+// alert ("Loaded");
+}
+
+
+
+function localajaxinit(){
+ astmanEngine.setURL('../../rawman');
+ astmanEngine.config2list("sip.conf", $('hiddenfield'), widgets, phonecallbacks);
+}
+</script>
+<body onload="localajaxinit()">
+<div class="mainscreenContentBox" id="userscontent">
+<table>
+<tr><td>Allow Guest:</td><td><input type='checkbox' id='allowguest'></td></tr>
+<tr><td>Allow Overlap:</td><td><input type='checkbox' id='allowoverlap'></td></tr>
+<tr><td>Allow Transfer:</td><td><input type='checkbox' id='allowtransfer'></td></tr>
+<tr><td>SRV Lookups:</td><td><input type='checkbox' id='srvlookup'></td></tr>
+<tr><td>Video Support:</td><td><input type='checkbox' id='videosupport'></td></tr>
+</table>
+
+ <select size="5" id="hiddenfield" style="width:220px">
+ </select>
+</div>
+</body>
Modified: trunk/config/stylesheets/rico.css
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/stylesheets/rico.css?rev=19&r1=18&r2=19&view=diff
==============================================================================
--- trunk/config/stylesheets/rico.css (original)
+++ trunk/config/stylesheets/rico.css Fri Sep 8 18:43:37 2006
@@ -43,7 +43,7 @@
.accordionTabTitleBar {
font-size : 12px;
- padding : 4px 6px 4px 6px;
+ padding : 2px 2px 2px 2px;
border-style : solid none solid none;
border-top-color : #BDC7E7;
border-bottom-color : #182052;
@@ -247,3 +247,27 @@
font-size: 14px;
margin: 6px 0px 6px 0px;
}
+
+/* for DHTML tabs */
+ a.tab {
+ border-bottom: 1px solid #778;
+ font: bold 12px Verdana, sans-serif;
+ margin: 0;
+ display: inline;
+ padding: 3px 0.5em;
+ margin-left: 3px;
+ border: 1px solid #778;
+ background: #DDE;
+ text-decoration: none;
+ color: #448;
+ }
+
+a.tab:visited {
+ color: #448;
+}
+
+a.tab:hover {
+ color: #000;
+ background: #AAE;
+ border-color: #227;
+}
More information about the asterisk-gui-commits
mailing list