Author: pari
Date: Thu Mar 29 13:04:17 2007
New Revision: 545
URL: http://svn.digium.com/view/asterisk-gui?view=rev&
;rev=545
Log:
cleanup setup wizard - few more commits will follow
Modified:
trunk/config/setup/3.html
Modified: trunk/config/setup/3.html
URL: htt
p://svn.digium.com/view/asterisk-gui/trunk/config/setup/3.ht
ml?view=diff&rev=545&r1=544&r2=545
============================================================
==================
--- trunk/config/setup/3.html (original)
+++ trunk/config/setup/3.html Thu Mar 29 13:04:17 2007
 -25,70
+25,70 
<link href="setup.css" media="all"
rel="Stylesheet" type="text/css" />
</HEAD>
<script
src="../scripts/prototype.js"></script>
-<SCRIPT LANGUAGE="JavaScript">
-<!--
+<SCRIPT>
+
var rawman_url;
var usercallbacks = new Object;
var fieldnames = new Array(
'save','userbase','localextenlength','allow_aliasextns');
-var widgets = new Array;
+var widgets = {};
var go = "";
var nextpage = "4.html";
var prevpage = "1.html";
function localinit(){
- parent.$('next').disabled = true;
- parent.$('next').onclick = function(){
- if( !$('save').disabled ){
- go = nextpage;
- $('save').click();
- }else{
- window.location.href=nextpage;
- }
- };
- parent.$('back').disabled = true;
- parent.$('back').onclick = function(){
- if( !$('save').disabled ){
- go = prevpage;
- $('save').click();
- }else{
- window.location.href=prevpage;
- }
+ parent._$('next').disabled = true;
+ parent._$('next').onclick = function(){
+ if( !_$('save').disabled ){
+ go = nextpage;
+ _$('save').click();
+ }else{
+ window.location.href=nextpage;
+ }
+ };
+ parent._$('back').disabled = true;
+ parent._$('back').onclick = function(){
+ if( !_$('save').disabled ){
+ go = prevpage;
+ _$('save').click();
+ }else{
+ window.location.href=prevpage;
+ }
};
rawman_url = parent.rawman_url ;
parent.astmanEngine.setURL(rawman_url);
- $('localextenlength').addEventListener("change",
update_spae, false);
+ _$('localextenlength').addEventListener("change"
, update_spae, false);
ping();
}
function ping(){
- var opt = {
- method: 'get',
- asynchronous: true,
- onComplete: isloggedin
- };
- opt.parameters="action=ping" ;
- var tmp = new Ajax.Request(rawman_url , opt);
+ var opt = {
+ method: 'get',
+ asynchronous: true,
+ onComplete: isloggedin
+ };
+ opt.parameters="action=ping" ;
+ var tmp = new Ajax.Request(rawman_url , opt);
}
function isloggedin(originalRequest){
- if (
originalRequest.responseText.match("Error") ) {
- // User is not logged in , show him the login screen
- parent.window.location.href =
parent.window.location.href ;
+ if ( originalRequest.responseText.match("Error")
) {
+ // User is not logged in , show him the login screen
+ parent.window.location.href = parent.window.location.href
;
+ }
+
+ if ( originalRequest.responseText.match("Pong")
) {
+ // read users.conf to get localextenlength and userbase
+ for (var x =0 ; x < fieldnames.length ; x++ ) {
+ widgets[fieldnames[x]] = _$(fieldnames[x]);
+ widgets[fieldnames[x]].disabled = true;
}
-
- if ( originalRequest.responseText.match("Pong")
) {
- // read users.conf to get localextenlength and userbase
- for (var x =0 ; x < fieldnames.length ; x++ ) {
- widgets[fieldnames[x]] = $(fieldnames[x]);
- widgets[fieldnames[x]].disabled = true;
- }
- parent.astmanEngine.config2list("users.conf",
$('devices'),widgets, usercallbacks);
- }
+ parent.astmanEngine.config2list("users.conf",
_$('devices'),widgets, usercallbacks);
+ }
}
usercallbacks.format = function(t) {
if(t.name == "general" ){
- return t.name;
+ return t.name;
}
return null;
}
 -98,87
+98,96 
}
usercallbacks.beforeSaving= function(){
- if( $('localextenlength').value !=
$('userbase').value.length ){
- alert("'length of Local Extensions' does not match
n the 'length of the Starting point of Allocation'");
- return false;
- }
+ if( _$('localextenlength').value !=
_$('userbase').value.length ){
+ alert("'length of Local Extensions' does not match
n the 'length of the Starting point of Allocation'");
+ return false;
+ }
return true;
}
usercallbacks.loaded = function(){
- $('localextenlength').addEventListener("change"
, store_extlength, false);
- parent.astmanEngine.pollEvents();
- $('devices').selectitem(0);
- parent.$('next').disabled = false;
- parent.$('back').disabled = false;
- if ( typeof
$('devices').stored_config.catbyname['general'].fieldbyname[
'localextenlength'] == "undefined" ){
- var opt = {
- method: 'get',
- asynchronous: true,
- onSuccess: function(t) {
- $('localextenlength').selectedIndex = 2 ;
- parent.localextenlength = 4 ;
- },
- onFailure: function(t) {
- alert("Config Error: " + t.status +
": " + t.statusText);
- }
- };
- opt.parameters="action=updateconfig&srcfilena
me=" + encodeURIComponent("users.conf") +
"&dstfilename=" +
encodeURIComponent("users.conf") +
"&Action-000000=update&Cat-000000=general&V
ar-000000=localextenlength&Value-000000=4"; ;
- var tmp = new Ajax.Request(rawman_url, opt);
- }
+ _$('localextenlength').addEventListener("change"
, store_extlength, false);
+ parent.astmanEngine.pollEvents();
+ _$('devices').selectitem(0);
+ parent._$('next').disabled = false;
+ parent._$('back').disabled = false;
+ if ( typeof
_$('devices').stored_config.catbyname['general'].fieldbyname
['localextenlength'] == "undefined" ){
+ var opt = {
+ method: 'get',
+ asynchronous: true,
+ onSuccess: function(t) {
+ _$('localextenlength').selectedIndex = 2 ;
+ parent.localextenlength = 4 ;
+ },
+ onFailure: function(t) {
+ alert("Config Error: " + t.status + ":
" + t.statusText);
+ }
+ };
+ opt.parameters="action=updateconfig&srcfilename=
" + encodeURIComponent("users.conf") +
"&dstfilename=" +
encodeURIComponent("users.conf") +
"&Action-000000=update&Cat-000000=general&V
ar-000000=localextenlength&Value-000000=4"; ;
+ var tmp = new Ajax.Request(rawman_url, opt);
+ }
}
function store_extlength(){
- parent.localextenlength = $('localextenlength').value ;
- parent.userbase = $('userbase').value ;
+ parent.localextenlength = _$('localextenlength').value ;
+ parent.userbase = _$('userbase').value ;
}
function update_spae(){
- if( $('localextenlength').value ==
$('userbase').value.length ) return;
- if( $('localextenlength').value <
$('userbase').value.length ){
- $('userbase').value =
$('userbase').value.substr(0,$('localextenlength').value);
- return;
+ if( _$('localextenlength').value ==
_$('userbase').value.length ) return;
+ if( _$('localextenlength').value <
_$('userbase').value.length ){
+ _$('userbase').value =
_$('userbase').value.substr(0,_$('localextenlength').value);
+ return;
+ }
+ if( _$('localextenlength').value >
_$('userbase').value.length ){
+ while ( _$('localextenlength').value !=
_$('userbase').value.length ){
+ _$('userbase').value = _$('userbase').value +
"0" ;
}
- if( $('localextenlength').value >
$('userbase').value.length ){
- while ( $('localextenlength').value !=
$('userbase').value.length ){
- $('userbase').value = $('userbase').value +
"0" ;
- }
- }
+ }
}
-//-->
</SCRIPT>
<BODY bgcolor="#FFFFFF"
onload="localinit()" topmargin=0 leftmargin=0
onunload="store_extlength()">
<table width="100%" height="100%"
border=0 cellpadding=0 cellspacing=0>
- <tr><td width="190" valign=top
align=left>
- <div id="menu">
- <table cellpadding=3 cellspacing=2 border=0
id="sidelist">
- <tr><td
width=3></td><td>Start</td></tr>
- <tr><td></td><td>Verify
Analog Ports</td></tr>
- <!-- <tr><td></td><td>Date
& Time</td></tr> -->
- <tr><td></td><td
class="slselected">Local Extension
Settings</td></tr>
- <tr><td></td><td>Service
Providers</td></tr>
- <tr><td></td><td>Calling
Rules</td></tr>
- <tr><td></td><td>VoiceMail
Settings</td></tr>
- <tr><td></td><td>User
Extensions</td></tr>
- <tr><td></td><td>Incoming
Calls</td></tr>
- <!--
<tr><td></td><td>VoiceMenus</td&g
t;</tr> -->
- <tr><td></td><td>Finish</t
d></tr>
- </table>
- </div>
- </td>
- <td valign=top align=center>
- <!-- this page -->
- <select id="devices"
style="display:none"></select> <input
type=button id="save" value="Submit"
style="display:none">
- <div class="heading">Step 2 of
<script>document.write(parent.numberofsteps);</scri
pt> - Local Extension
Settings</div>
- <p class="subheading"> Local
Extensions are <select
id="localextenlength">
- <option
value="2">2</option><option
value="3">3</option><option
value="4" selected>4</option><option
value="5">5</option></select>
digits long
- </p>
- <p class="subheading">First Extension
Number : <input type=text id="userbase" size=5
dfalt="6000"> </p>
- <p class="subheading"><input
type=checkbox id="allow_aliasextns"> Allow
analog phones to be assigned to multiple
extensions</p>
- <!-- this page -->
- </td>
- </tr>
+<tr> <td width="190" valign=top
align=left>
+ <div id="menu">
+ <table cellpadding=3 cellspacing=2 border=0
id="sidelist">
+ <tr><td
width=3></td><td>Start</td></tr>
+ <tr><td></td><td>Verify Analog
Ports</td></tr>
+ <!-- <tr><td></td><td>Date
& Time</td></tr> -->
+ <tr><td></td><td
class="slselected">Local Extension
Settings</td></tr>
+ <tr><td></td><td>Service
Providers</td></tr>
+ <tr><td></td><td>Calling
Rules</td></tr>
+ <tr><td></td><td>VoiceMail
Settings</td></tr>
+ <tr><td></td><td>User
Extensions</td></tr>
+ <tr><td></td><td>Incoming
Calls</td></tr>
+ <!--
<tr><td></td><td>VoiceMenus</td&g
t;</tr> -->
+ <tr><td></td><td>Finish</td&g
t;</tr>
+ </table>
+ </div>
+ </td>
+ <td valign=top align=center>
+ <!-- this page -->
+ <select id="devices"
style="display:none"></select>
+ <input type=button id="save"
value="Submit" style="display:none">
+
+ <div class="heading">Step 2 of
<script>document.write(parent.numberofsteps);</scri
pt> - Local Extension
Settings</div>
+ <p class="subheading"> Local Extensions
are
+ <select id="localextenlength">
+ <option value="2">2</option>
+ <option value="3">3</option>
+ <option value="4"
selected>4</option>
+ <option value="5">5</option>
+ </select> digits long
+ </p>
+
+ <p class="subheading">First Extension
Number : <input type=text id="userbase" size=5
dfalt="6000"> </p>
+
+ <p class="subheading"><input
type=checkbox id="allow_aliasextns"> Allow
analog phones to be assigned to multiple
extensions</p>
+
+ <!-- this page -->
+ </td>
+</tr>
</table>
</BODY>
</HTML>
_______________________________________________
asterisk-gui-commits mailing list
asterisk-gui-commits lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-g
ui-commits
|