pari: trunk r551 - /trunk/config/setup/6.html

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Thu Mar 29 14:30:05 MST 2007


Author: pari
Date: Thu Mar 29 16:30:04 2007
New Revision: 551

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=551
Log:
cleanup setup/6

Modified:
    trunk/config/setup/6.html

Modified: trunk/config/setup/6.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/setup/6.html?view=diff&rev=551&r1=550&r2=551
==============================================================================
--- trunk/config/setup/6.html (original)
+++ trunk/config/setup/6.html Thu Mar 29 16:30:04 2007
@@ -26,141 +26,136 @@
 </HEAD>
 <script src="../scripts/prototype.js"></script>
 <script src="../scripts/astman.js"></script>
-<SCRIPT LANGUAGE="JavaScript">
-<!--
+<SCRIPT>
+
 var rawman_url ;
 var vmexten='';
 var voicemailcallbacks = new Object;
 var callbacks = new Object;
 var vmfields = ['attach', 'cancel', 'maxgreet', 'maxmessage', 'maxmsg', 'save'];
 var fields = new Array('name');
-var vmwidgets = new Array;
-var widgets = new Array;
+var vmwidgets = {};
+var widgets = {};
 var go = "";
 var nextpage = "7.html";
 var prevpage = "5.html";
 
 callbacks.savechanges = function() {
-	window.location.href = go ; 
+	window.location.href = go ;
 }
 
 function localinit(){
-		//parent.$('next').disabled = true;
-		parent.$('next').onclick = function(){	 
-					if ( $('name').value.length==0 ){
-						alert("Looks like a default Voicemail Extension is not yet configured \n\n Please set an \'Extension for Checking messages\'");
-						return false;
-					}
-					if( parent.localextenlength != $('name').value.length ){
-						if(typeof parent.localextenlength == "undefined"){ parent.localextenlength = 4; }
-						alert("The Voicemail Extension has to be " + parent.localextenlength + " digits long" );
-						return false;
-					}
-					if( !$('save').disabled ){
-							go = nextpage;
-							$('save').click();
-					}else{
-						window.location.href= nextpage ; 
-					}
-		};
-		parent.$('back').disabled = false;
-		parent.$('back').onclick  = function(){
-					if( !$('save').disabled ){
-							go = prevpage;
-							$('save').click();
-					}else{
-						window.location.href= prevpage ; 
-					}
-		
-		
-		};
-		rawman_url = parent.rawman_url ;
-
-			for (var x =0; x< vmfields.length; x++) {
-				vmwidgets[vmfields[x]] = $(vmfields[x]);
-				vmwidgets[vmfields[x]].disabled = true;
-			}
-			for (var x =0; x < fields.length; x++) {
-				widgets[fields[x]] = $(fields[x]);
-				widgets[fields[x]].disabled = true;
-			}
-
-		parent.astmanEngine.setURL(rawman_url);
-		ping();
+	//parent.$('next').disabled = true;
+	parent._$('next').onclick = function(){	 
+		if ( _$('name').value.length==0 ){
+			alert("Looks like a default Voicemail Extension is not yet configured \n\n Please set an \'Extension for Checking messages\'");
+			return false;
+		}
+		if( parent.localextenlength != _$('name').value.length ){
+			if(typeof parent.localextenlength == "undefined"){ parent.localextenlength = 4; }
+			alert("The Voicemail Extension has to be " + parent.localextenlength + " digits long" );
+			return false;
+		}
+		if( !_$('save').disabled ){
+			go = nextpage;
+			_$('save').click();
+		}else{
+			window.location.href= nextpage ; 
+		}
+	};
+	parent._$('back').disabled = false;
+	parent._$('back').onclick  = function(){
+		if( !_$('save').disabled ){
+			go = prevpage;
+			_$('save').click();
+		}else{
+			window.location.href= prevpage ; 
+		}
+	};
+	rawman_url = parent.rawman_url ;
+
+	for (var x =0; x< vmfields.length; x++) {
+		vmwidgets[vmfields[x]] = $(vmfields[x]);
+		vmwidgets[vmfields[x]].disabled = true;
+	}
+	for (var x =0; x < fields.length; x++) {
+		widgets[fields[x]] = $(fields[x]);
+		widgets[fields[x]].disabled = true;
+	}
+
+	parent.astmanEngine.setURL(rawman_url);
+	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("Pong") ) {
-					// load default Voicemail Settings
-					parent.astmanEngine.config2list("voicemail.conf", $('hiddenvoicemail'), vmwidgets, voicemailcallbacks);
-			}
+	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") ) {
+		// load default Voicemail Settings
+		parent.astmanEngine.config2list("voicemail.conf", _$('hiddenvoicemail'), vmwidgets, voicemailcallbacks);
+	}
 }
 
 voicemailcallbacks.cancelchanges = function(){
-	$('name').value = vmexten ; 
+	_$('name').value = vmexten ; 
 }
 	
 voicemailcallbacks.savechanges = function() {
-		if (vmexten != $('name').value) {
-			if (vmexten.length) {
-				if (!$('name').value.length) {
-					delete_item($('extensions'),null,1);
-					alert("Default Voicemail Extension has been removed");
-				} else {
-					save_item($('extensions'));
-				}
+	if (vmexten != _$('name').value) {
+		if (vmexten.length) {
+			if (!_$('name').value.length) {
+				delete_item(_$('extensions'),null,1);
+				alert("Default Voicemail Extension has been removed");
 			} else {
-				new_subitem($('extensions'));
-				save_item($('extensions'));
+				save_item(_$('extensions'));
 			}
-			vmexten = $('name').value;
-			$('name').disabled = false;
-			return true;
-		}
-		$('name').disabled = false;
-		callbacks.savechanges();
-		return false;
+		} else {
+			new_subitem(_$('extensions'));
+			save_item(_$('extensions'));
+		}
+		vmexten = _$('name').value;
+		_$('name').disabled = false;
+		return true;
+	}
+	_$('name').disabled = false;
+	callbacks.savechanges();
+	return false;
 }
 
 voicemailcallbacks.loaded = function() {
-		$('hiddenvoicemail').selectedIndex = 0;
-		if ($('hiddenvoicemail').onchange)
-			$('hiddenvoicemail').onchange($('hiddenvoicemail'));
-		parent.astmanEngine.config2list("extensions.conf", $('extensions'), widgets, callbacks);
+	_$('hiddenvoicemail').selectedIndex = 0;
+	if (_$('hiddenvoicemail').onchange)
+		$('hiddenvoicemail').onchange($('hiddenvoicemail'));
+	parent.astmanEngine.config2list("extensions.conf", _$('extensions'), widgets, callbacks);
 }
 
 voicemailcallbacks.format = function(t) {
-		if (t.name != 'general')
-			return null;
-		return "General";
-}
-
-
-
+	if (t.name != 'general')
+		return null;
+	return "General";
+}
 
 callbacks.format = function(t, x) {
 	if ((t.name != specialcontext))
 		return null;
-	return format_extension($('extensions'), t, x);
+	return format_extension(_$('extensions'), t, x);
 }
 
 callbacks.fields2val = function() {
-	return $('name').value + ",1,VoiceMailMain";
+	return _$('name').value + ",1,VoiceMailMain";
 }
 
 callbacks.sortfunc = function(a,b) {
@@ -169,7 +164,7 @@
 
 callbacks.newsubitem = function() {
 	var tmp = new Object;
-	tmp['name'] = $('name').value;
+	tmp['name'] = _$('name').value;
 	tmp['>'] = true;
 	return new Array(specialcontext, 'exten', tmp);
 }
@@ -180,127 +175,132 @@
 callbacks.loaded = function() {
 	parent.astmanEngine.pollEvents();
 	var whichexten = "";
-	for (x=0;x<$('extensions').options.length;x++) {
+	for (x=0;x<_$('extensions').options.length;x++) {
 		var tmp;
-		tmp = $('extensions').options[x].value.split(']');
+		tmp = _$('extensions').options[x].value.split(']');
 		if (tmp.length > 1) {
-			if ($('extensions').stored_config.catbyname[tmp[0]].subfields[tmp[1]]['app'].toLowerCase() != "voicemailmain") {
+			if (_$('extensions').stored_config.catbyname[tmp[0]].subfields[tmp[1]]['app'].toLowerCase() != "voicemailmain") {
 				//$('extensions').options[x].disabled = true;
-				$('extensions').options[x].style.color = "#ABABAB";
-				$('extensions').options[x].value = "reserved";
+				_$('extensions').options[x].style.color = "#ABABAB";
+				_$('extensions').options[x].value = "reserved";
 			} else {
-				whichexten = $('extensions').stored_config.catbyname[tmp[0]].subfields[tmp[1]]['name'];
-				$('extensions').selectitem(x);
+				whichexten = _$('extensions').stored_config.catbyname[tmp[0]].subfields[tmp[1]]['name'];
+				_$('extensions').selectitem(x);
 				vmexten = whichexten;
 			}
 		}
 	}
-	$('extensions').contentEditable = 'true';
-	$('extensions').disabled = 0;
-	$('extensions').current_category = specialcontext;
-	$('name').onkeydown = newexten;
-	$('name').disabled = false;
+	_$('extensions').contentEditable = 'true';
+	_$('extensions').disabled = 0;
+	_$('extensions').current_category = specialcontext;
+	_$('name').onkeydown = newexten;
+	_$('name').disabled = false;
 	if (whichexten.length ==0 ){
 		//alert("Looks like a default Voicemail Extension is not yet configured \n\n Please set an \'Extension for Checking messages\'");
-			switch (parent.localextenlength){
-			case "2":
-				$('name').value = parent.userbase.charAt(0) + "5";
-				break;
-			case "3":
-				$('name').value = parent.userbase.charAt(0) + "50";
-				break;
-			case "4":
-				$('name').value = parent.userbase.charAt(0) + "500";
-				break;
-			case "5":
-				$('name').value = parent.userbase.charAt(0) + "5000";
-				break;
-			default : $('name').value = "8500";
+		switch (parent.localextenlength){
+		case "2":
+			_$('name').value = parent.userbase.charAt(0) + "5";
+			break;
+		case "3":
+			_$('name').value = parent.userbase.charAt(0) + "50";
+			break;
+		case "4":
+			_$('name').value = parent.userbase.charAt(0) + "500";
+			break;
+		case "5":
+			_$('name').value = parent.userbase.charAt(0) + "5000";
+			break;
+		default : _$('name').value = "8500";
+		}
+	}else{
+		if( parent.localextenlength != _$('name').value.length ){
+			if(	parent.localextenlength < _$('name').value.length ){
+				_$('name').value = _$('name').value.substr(0,parent.localextenlength);
+				_$('save').disabled = false;
+			}else if( parent.localextenlength > _$('name').value.length ){
+				while ( parent.localextenlength != _$('name').value.length  ){
+					_$('name').value = _$('name').value + "0" ; 
+					_$('save').disabled = false;
+				}
 			}
-	}else{
-					if( parent.localextenlength != $('name').value.length ){
-							if(	parent.localextenlength < $('name').value.length ){
-									$('name').value = $('name').value.substr(0,parent.localextenlength);
-									$('save').disabled = false;
-							}else if(	parent.localextenlength > $('name').value.length ){
-									while ( parent.localextenlength != $('name').value.length  ){
-										$('name').value = $('name').value + "0" ; 
-										$('save').disabled = false;
-									}
-							}
-					}
-	}
-}
-
+		}
+	}
+}
 
 callbacks.postselect = function(box, val) {
 
 }
 
-
-	function newexten() {
-		var newname = $('name').value;
-		$('save').disabled = false;
-	}
-
-//-->
+function newexten() {
+	var newname = _$('name').value;
+	_$('save').disabled = false;
+}
 </SCRIPT>
 <BODY bgcolor="#FFFFFF" onload="localinit()" topmargin=0 leftmargin=0>
 <table width="100%" height="100%" border=0 cellpadding=0 cellspacing=0>
-	<tr><td width="170" 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>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 class="slselected">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></tr> -->
-						<tr><td></td><td>Finish</td></tr>
-					</table>
-					</div>
-			</td>
-			<td valign=top align=center>
-			<!--  this page -->
-					<select id='hiddenvoicemail' style="display:none"></select>
-					<select id="extensions" style="display:none"></select>
-
-					<div class="heading">Step 5 of <script>document.write(parent.numberofsteps);</script>&nbsp;&nbsp;-  VoiceMail Settings</div>
-		<table cellpadding=2 cellspacing=2 border=0 align=center  class="subheading">
-					<tr><td>Extension for checking messages:</td><td>&nbsp;<input size='5' id='name' pattern='^\d*$' onKeyUp="$('cancel').disabled=false;"  class="input8" ></td></tr>
-					<tr><td>Attach recordings to e-mail:</td><td><input type='checkbox' id='attach'></td></tr>
-					<tr><td>Maximum messages per folder:</td>
-							<td>&nbsp;<select id='maxmsg' class="input8">
-												<option value='10'>10</option>
-												<option value='25'>25</option>
-												<option value='100'>100</option>
-												<option value='250' selected>250</option>
-												<option value='500'>500</option>
-												<option value='1000'>1000</option>
-												</select>
-							</td>
-					</tr>
-					<tr><td>Maximum message time</td>
-							<td>&nbsp;<select id='maxmessage' class="input8">
-												<option value='60'>1 minute</option>
-												<option value='120'>2 minutes</option>
-												<option value='300'>5 minutes</option>
-												<option value='900' selected>15 minutes</option>
-												<option value='1800'>30 minutes</option>
-												<option value='0'>Unlimited</option>
-												</select>
-							</td>
-					</tr>
-					<tr><td>Max&nbsp;greeting&nbsp;(seconds)</td><td>&nbsp;<input size=4 id='maxgreet' pattern='^\d*$' class="input8" dfalt=60></td></tr>
-			</table>					
-			<div style="display:none"><input type='button' id='save' value='Save'>&nbsp;<input type='button' id='cancel' value='Cancel'></div>
-			<!--  this page -->
-			</td>
-		</tr>
+<tr>	
+<td width="170" 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>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 class="slselected">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></tr> -->
+		<tr><td></td><td>Finish</td></tr>
+	</table>
+	</div>
+</td>
+<td valign=top align=center>
+<!--  this page -->
+	<select id='hiddenvoicemail' style="display:none"></select>
+	<select id="extensions" style="display:none"></select>
+
+	<div class="heading">
+		Step 5 of <script>document.write(parent.numberofsteps);</script>&nbsp;&nbsp;-  VoiceMail Settings
+	</div>
+	<table cellpadding=2 cellspacing=2 border=0 align=center  class="subheading">
+	<tr>	<td>Extension for checking messages:</td>
+		<td>&nbsp;<input size='5' id='name' pattern='^\d*$' onKeyUp="$('cancel').disabled=false;"  class="input8" ></td>
+	</tr>
+	<tr>	<td>Attach recordings to e-mail:</td>
+		<td><input type='checkbox' id='attach'></td>
+	</tr>
+	<tr>	<td>Maximum messages per folder:</td>
+		<td>&nbsp;<select id='maxmsg' class="input8">
+			<option value='10'>10</option>
+			<option value='25'>25</option>
+			<option value='100'>100</option>
+			<option value='250' selected>250</option>
+			<option value='500'>500</option>
+			<option value='1000'>1000</option>
+			</select>
+		</td>
+	</tr>
+	<tr>	<td>Maximum message time</td>
+		<td>&nbsp;<select id='maxmessage' class="input8">
+			<option value='60'>1 minute</option>
+			<option value='120'>2 minutes</option>
+			<option value='300'>5 minutes</option>
+			<option value='900' selected>15 minutes</option>
+			<option value='1800'>30 minutes</option>
+			<option value='0'>Unlimited</option>
+			</select>
+		</td>
+	</tr>
+	<tr>	<td>Max&nbsp;greeting&nbsp;(seconds)</td>
+		<td>&nbsp;<input size=4 id='maxgreet' pattern='^\d*$' class="input8" dfalt=60></td>
+	</tr>
+	</table>					
+	<div style="display:none"><input type='button' id='save' value='Save'>&nbsp;<input type='button' id='cancel' value='Cancel'></div>
+<!--  this page -->
+</td>
+</tr>
 </table>
 </BODY>
 </HTML>



More information about the asterisk-gui-commits mailing list