pari: branch asterisknow r633 - in /branches: aadk/ aadk/config/ aadk/config/...

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Mon Apr 9 15:38:21 MST 2007


Author: pari
Date: Mon Apr  9 17:38:21 2007
New Revision: 633

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=633
Log:
merging 626-631

Modified:
    branches/aadk/   (props changed)
    branches/aadk/config/home.html
    branches/aadk/config/meetme.html
    branches/aadk/config/scripts/astman.js
    branches/aadk/config/voicemail.html
    branches/asterisknow/   (props changed)
    branches/asterisknow/config/home.html
    branches/asterisknow/config/meetme.html
    branches/asterisknow/config/scripts/astman.js
    branches/asterisknow/config/voicemail.html

Propchange: branches/aadk/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Apr  9 17:38:21 2007
@@ -1,1 +1,1 @@
-/trunk:1-430,433-449,489-501,505-506,508-510,512-540,542-557,559,561-577,580-586,588-616,618-623
+/trunk:1-430,433-449,489-501,505-506,508-510,512-540,542-557,559,561-577,580-586,588-616,618-631

Modified: branches/aadk/config/home.html
URL: http://svn.digium.com/view/asterisk-gui/branches/aadk/config/home.html?view=diff&rev=633&r1=632&r2=633
==============================================================================
--- branches/aadk/config/home.html (original)
+++ branches/aadk/config/home.html Mon Apr  9 17:38:21 2007
@@ -94,13 +94,19 @@
 
 demo.logins = function(msgs) {
 	_$('statusbar').innerHTML = msgs[0].headers['message'];
-	resp = msgs[0].headers['response'];
-	if (resp == "Success" || msgs[0].headers['message'] == "Invalid/unknown command" ){
+	if ( msgs[0].headers['response'] == "Success" ){
+		parent.gui_feedback("Login Successful",'blue',6000);
 		_$('statusbar').innerHTML = "<img src='images/tick.gif'><i>Connected!</i>";
 		parent.astmanEngine.pollEvents();
 		loggedOn();
-	}else
+	}else if( msgs[0].headers['message'] == "Authentication failed" ){
+		parent.gui_feedback("Invalid Username/Password",'default',6000);
+		_$('username').focus();
+		_$('username').select();
 		loggedOff();
+	}else{
+		loggedOff();
+	}
 };
 
 demo.pongs  = function(msgs) {

Modified: branches/aadk/config/meetme.html
URL: http://svn.digium.com/view/asterisk-gui/branches/aadk/config/meetme.html?view=diff&rev=633&r1=632&r2=633
==============================================================================
--- branches/aadk/config/meetme.html (original)
+++ branches/aadk/config/meetme.html Mon Apr  9 17:38:21 2007
@@ -159,8 +159,12 @@
 
 callbacks.postselect = function(box, val) {
 	parent._$('tooltip').innerHTML = parent.tooltip_default ; 
-	var _pv = _$('pin').value = ""  ;
-	var _pa = _$('pinadmin').value = "" ;
+	var _pv = _$('pin');
+	var _pa = _$('pinadmin');
+
+	_pv.value = "";
+	_pa.value = "" ;
+
 	if( box.selectedIndex == -1){
 		enable_disable_fields(0);
 		return true;
@@ -198,8 +202,8 @@
 	for ( var r=0; r < f.stored_config.catbyname.rooms.fields.length; r++ ) {
 		var k = f.stored_config.catbyname.rooms.fields[r].split(",");
 		if(k[0] == temp_selectedexten ){
-			_pv = k[1] ;		
-			_pa = k[2] ;
+			_pv.value = k[1] ;
+			_pa.value = k[2] ;
 			break;
 		}
 	}
@@ -506,4 +510,4 @@
 		</td>				
 	</tr>
 </table>
-</body>
+</body>

Modified: branches/aadk/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/branches/aadk/config/scripts/astman.js?view=diff&rev=633&r1=632&r2=633
==============================================================================
--- branches/aadk/config/scripts/astman.js (original)
+++ branches/aadk/config/scripts/astman.js Mon Apr  9 17:38:21 2007
@@ -1409,15 +1409,11 @@
 
 				if (savewidget) {
 					widgets[x].savewidget = savewidget;
-					widgets[x].onclick = function() {
-						this.oldvalue = this.value;
-						return true;
-					}
-					widgets[x].onchange = function() {
-						this.savewidget.activateSave();
-						if (this.altonchange)
-							this.altonchange();
-					}
+					add_event( widgets[x] , 'click', function() { this.oldvalue = this.value; return true; });
+					add_event( widgets[x] , 'change', function() { 
+						this.savewidget.activateSave(); 
+						if (this.altonchange){ this.altonchange();} 
+					});
 				}
 				if (widgets[x].altonchange)
 					widgets[x].altonchange();
@@ -1471,11 +1467,10 @@
 						if (widgets[x].altonclick)
 							widgets[x].altonclick();
 					} else {
-						widgets[x].onkeydown = function() {
-							this.oldvalue = this.value;
-							return true;
-						}
-						widgets[x].onkeyup = function(event) {
+
+						add_event( widgets[x] , 'keydown', function() { this.oldvalue = this.value; return true; });
+
+						add_event( widgets[x] , 'keyup', function() { 
 							if (this.oldvalue == this.value){return true;}
 							pattern = this.getAttribute('pattern');
 							if (pattern && check_pattern(pattern, this.oldvalue) && !check_pattern(pattern, this.value)) {
@@ -1486,7 +1481,8 @@
 								this.savewidget.activateSave();
 							}
 							return true;
-						}
+						});
+
 					}
 				}
 			} else if (widgets[x].src != null) {
@@ -1614,7 +1610,12 @@
 			asynchronous: true,
 			onSuccess: this.managerResponse,
 			onFailure: function(t) {
+				if( request == 'action=ping' && String(t.status) == '404' ){
+				 gui_alert("Error: " +" Make sure <I>enabled=yes</I> and <I>webenabled=yes</I> are set in manager.conf");
+				 setLoggedOn(0);
+				}else{
 				gui_alert("Error: " + t.status + ": " + t.statusText);
+				}
 			}
 		};
 		me.callback = callback;
@@ -1664,36 +1665,31 @@
 		};
 		if (widgets['save']) {
 			widgets['save'].hostselectbox = box;
-			widgets['save'].onclick = function() {
-				save_item(this.hostselectbox);
-			}
+
+			add_event( widgets['save'] , 'click', function() { save_item(this.hostselectbox); });
+
 		}
 		if (widgets['cancel']) {
 			widgets['cancel'].hostselectbox = box;
-			widgets['cancel'].onclick = function() {
-				cancel_item(this.hostselectbox);
-			}
-		}
+			add_event( widgets['cancel'] , 'click', function() { cancel_item(this.hostselectbox); });
+		}
+
 		if (widgets['new']) {
 			widgets['new'].hostselectbox = box;
 			widgets['new'].disabled = false;
-			widgets['new'].onclick = function() {
-				new_item(this.hostselectbox);
-			}
+			add_event( widgets['new'] , 'click', function() { new_item(this.hostselectbox); });
+
 		}
 		if (widgets['newitem']) {
 			widgets['newitem'].hostselectbox = box;
 			widgets['newitem'].disabled = false;
-			widgets['newitem'].onclick = function() {
-				new_subitem(this.hostselectbox);
-			}
+			add_event( widgets['newitem'] , 'click', function() { new_subitem(this.hostselectbox); });
+
 		}
 		if (widgets['delete']) {
 			widgets['delete'].hostselectbox = box;
 			widgets['delete'].disabled = true;
-			widgets['delete'].onclick = function() {
-				delete_item(this.hostselectbox);
-			}
+			add_event( widgets['delete'] , 'click', function() { delete_item(this.hostselectbox); });
 		}
 		tmp = new Ajax.Request(this.url, opt);
 	};

Modified: branches/aadk/config/voicemail.html
URL: http://svn.digium.com/view/asterisk-gui/branches/aadk/config/voicemail.html?view=diff&rev=633&r1=632&r2=633
==============================================================================
--- branches/aadk/config/voicemail.html (original)
+++ branches/aadk/config/voicemail.html Mon Apr  9 17:38:21 2007
@@ -43,7 +43,7 @@
 
 function changed_extension() {
 	var app;
-	tmp = $('extensions').value.split(']');
+	var tmp = $('extensions').value.split(']');
 	app = findapp($('extensions').stored_config.catbyname[tmp[0]].subfields[tmp[1]]['app']);
 	$('name').value = $('extensions').stored_config.catbyname[tmp[0]].subfields[tmp[1]]['name'];
 };
@@ -74,7 +74,7 @@
 callbacks.loaded = function() {
 	var whichexten = "";
 	merge_extensions($('extensions'), $('hiddenusers'));
-	for (x=0;x<$('extensions').options.length;x++) {
+	for (var x=0;x<$('extensions').options.length;x++) {
 		var tmp;
 		tmp = $('extensions').options[x].value.split(']');
 		if (tmp.length > 1) {
@@ -92,12 +92,15 @@
 	$('extensions').contentEditable = 'true';
 	$('extensions').disabled = 0;
 	$('extensions').current_category = specialcontext;
-	$('name').onkeydown = function(event){ this.oldvalue = this.value ; };
-	$('name').onkeyup = function(event){  
-		if(this.oldvalue == this.value){return true;} 
-		$('save').disabled = false; 
-		$('cancel').disabled = false; 
-	};	
+
+	add_event( $('name') , 'keydown', function(){ this.oldvalue = this.value ;} );
+
+	add_event( $('name') , 'keyup', function(){
+		if(this.oldvalue == this.value){return true;}
+		$('save').disabled = false;
+		$('cancel').disabled = false;
+	});
+
 	$('name').disabled = false;
 	if (whichexten.length ==0 ){
 		gui_alert("Looks like a default Voicemail Extension is not yet configured \n\n Please set an \'Extension for Checking messages\'  and \n click on 'save' button");
@@ -420,7 +423,7 @@
 	<tr>	<td align='center'><span><A href="smtp_settings.html" class="splbutton">SMTP Settings</A></span></td>
 		<td align='center' colspan='2'>
 			<input type='button' id='save' value='Save' class="buttonbold">&nbsp;<input type='button' id='cancel' value='Cancel' class="buttonbold">
-		</td>				
+		</td>
 	</tr>
 </table>
 </div>

Propchange: branches/asterisknow/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Apr  9 17:38:21 2007
@@ -1,1 +1,1 @@
-/trunk:1-449,489-540,542-557,559,561-577,580-586,588-623
+/trunk:1-449,489-540,542-557,559,561-577,580-586,588-631

Modified: branches/asterisknow/config/home.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/home.html?view=diff&rev=633&r1=632&r2=633
==============================================================================
--- branches/asterisknow/config/home.html (original)
+++ branches/asterisknow/config/home.html Mon Apr  9 17:38:21 2007
@@ -91,13 +91,19 @@
 
 demo.logins = function(msgs) {
 	_$('statusbar').innerHTML = msgs[0].headers['message'];
-	resp = msgs[0].headers['response'];
-	if (resp == "Success" || msgs[0].headers['message'] == "Invalid/unknown command" ){
+	if ( msgs[0].headers['response'] == "Success" ){
+		parent.gui_feedback("Login Successful",'blue',6000);
 		_$('statusbar').innerHTML = "<img src='images/tick.gif'><i>Connected!</i>";
 		parent.astmanEngine.pollEvents();
 		loggedOn();
-	}else
+	}else if( msgs[0].headers['message'] == "Authentication failed" ){
+		parent.gui_feedback("Invalid Username/Password",'default',6000);
+		_$('username').focus();
+		_$('username').select();
 		loggedOff();
+	}else{
+		loggedOff();
+	}
 };
 
 demo.pongs  = function(msgs) {
@@ -216,4 +222,4 @@
 	</tr>
 </table>
 </div>
-</body>
+</body>

Modified: branches/asterisknow/config/meetme.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/meetme.html?view=diff&rev=633&r1=632&r2=633
==============================================================================
--- branches/asterisknow/config/meetme.html (original)
+++ branches/asterisknow/config/meetme.html Mon Apr  9 17:38:21 2007
@@ -159,8 +159,12 @@
 
 callbacks.postselect = function(box, val) {
 	parent._$('tooltip').innerHTML = parent.tooltip_default ; 
-	var _pv = _$('pin').value = ""  ;
-	var _pa = _$('pinadmin').value = "" ;
+	var _pv = _$('pin');
+	var _pa = _$('pinadmin');
+
+	_pv.value = "";
+	_pa.value = "" ;
+
 	if( box.selectedIndex == -1){
 		enable_disable_fields(0);
 		return true;
@@ -198,8 +202,8 @@
 	for ( var r=0; r < f.stored_config.catbyname.rooms.fields.length; r++ ) {
 		var k = f.stored_config.catbyname.rooms.fields[r].split(",");
 		if(k[0] == temp_selectedexten ){
-			_pv = k[1] ;		
-			_pa = k[2] ;
+			_pv.value = k[1] ;
+			_pa.value = k[2] ;
 			break;
 		}
 	}
@@ -506,4 +510,4 @@
 		</td>				
 	</tr>
 </table>
-</body>
+</body>

Modified: branches/asterisknow/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/scripts/astman.js?view=diff&rev=633&r1=632&r2=633
==============================================================================
--- branches/asterisknow/config/scripts/astman.js (original)
+++ branches/asterisknow/config/scripts/astman.js Mon Apr  9 17:38:21 2007
@@ -1408,15 +1408,11 @@
 
 				if (savewidget) {
 					widgets[x].savewidget = savewidget;
-					widgets[x].onclick = function() {
-						this.oldvalue = this.value;
-						return true;
-					}
-					widgets[x].onchange = function() {
-						this.savewidget.activateSave();
-						if (this.altonchange)
-							this.altonchange();
-					}
+					add_event( widgets[x] , 'click', function() { this.oldvalue = this.value; return true; });
+					add_event( widgets[x] , 'change', function() { 
+						this.savewidget.activateSave(); 
+						if (this.altonchange){ this.altonchange();} 
+					});
 				}
 				if (widgets[x].altonchange)
 					widgets[x].altonchange();
@@ -1470,11 +1466,10 @@
 						if (widgets[x].altonclick)
 							widgets[x].altonclick();
 					} else {
-						widgets[x].onkeydown = function() {
-							this.oldvalue = this.value;
-							return true;
-						}
-						widgets[x].onkeyup = function(event) {
+
+						add_event( widgets[x] , 'keydown', function() { this.oldvalue = this.value; return true; });
+
+						add_event( widgets[x] , 'keyup', function() { 
 							if (this.oldvalue == this.value){return true;}
 							pattern = this.getAttribute('pattern');
 							if (pattern && check_pattern(pattern, this.oldvalue) && !check_pattern(pattern, this.value)) {
@@ -1485,7 +1480,8 @@
 								this.savewidget.activateSave();
 							}
 							return true;
-						}
+						});
+
 					}
 				}
 			} else if (widgets[x].src != null) {
@@ -1613,7 +1609,12 @@
 			asynchronous: true,
 			onSuccess: this.managerResponse,
 			onFailure: function(t) {
+				if( request == 'action=ping' && String(t.status) == '404' ){
+				 gui_alert("Error: " +" Make sure <I>enabled=yes</I> and <I>webenabled=yes</I> are set in manager.conf");
+				 setLoggedOn(0);
+				}else{
 				gui_alert("Error: " + t.status + ": " + t.statusText);
+				}
 			}
 		};
 		me.callback = callback;
@@ -1663,36 +1664,31 @@
 		};
 		if (widgets['save']) {
 			widgets['save'].hostselectbox = box;
-			widgets['save'].onclick = function() {
-				save_item(this.hostselectbox);
-			}
+
+			add_event( widgets['save'] , 'click', function() { save_item(this.hostselectbox); });
+
 		}
 		if (widgets['cancel']) {
 			widgets['cancel'].hostselectbox = box;
-			widgets['cancel'].onclick = function() {
-				cancel_item(this.hostselectbox);
-			}
-		}
+			add_event( widgets['cancel'] , 'click', function() { cancel_item(this.hostselectbox); });
+		}
+
 		if (widgets['new']) {
 			widgets['new'].hostselectbox = box;
 			widgets['new'].disabled = false;
-			widgets['new'].onclick = function() {
-				new_item(this.hostselectbox);
-			}
+			add_event( widgets['new'] , 'click', function() { new_item(this.hostselectbox); });
+
 		}
 		if (widgets['newitem']) {
 			widgets['newitem'].hostselectbox = box;
 			widgets['newitem'].disabled = false;
-			widgets['newitem'].onclick = function() {
-				new_subitem(this.hostselectbox);
-			}
+			add_event( widgets['newitem'] , 'click', function() { new_subitem(this.hostselectbox); });
+
 		}
 		if (widgets['delete']) {
 			widgets['delete'].hostselectbox = box;
 			widgets['delete'].disabled = true;
-			widgets['delete'].onclick = function() {
-				delete_item(this.hostselectbox);
-			}
+			add_event( widgets['delete'] , 'click', function() { delete_item(this.hostselectbox); });
 		}
 		tmp = new Ajax.Request(this.url, opt);
 	};

Modified: branches/asterisknow/config/voicemail.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/voicemail.html?view=diff&rev=633&r1=632&r2=633
==============================================================================
--- branches/asterisknow/config/voicemail.html (original)
+++ branches/asterisknow/config/voicemail.html Mon Apr  9 17:38:21 2007
@@ -43,7 +43,7 @@
 
 function changed_extension() {
 	var app;
-	tmp = $('extensions').value.split(']');
+	var tmp = $('extensions').value.split(']');
 	app = findapp($('extensions').stored_config.catbyname[tmp[0]].subfields[tmp[1]]['app']);
 	$('name').value = $('extensions').stored_config.catbyname[tmp[0]].subfields[tmp[1]]['name'];
 };
@@ -74,7 +74,7 @@
 callbacks.loaded = function() {
 	var whichexten = "";
 	merge_extensions($('extensions'), $('hiddenusers'));
-	for (x=0;x<$('extensions').options.length;x++) {
+	for (var x=0;x<$('extensions').options.length;x++) {
 		var tmp;
 		tmp = $('extensions').options[x].value.split(']');
 		if (tmp.length > 1) {
@@ -92,12 +92,15 @@
 	$('extensions').contentEditable = 'true';
 	$('extensions').disabled = 0;
 	$('extensions').current_category = specialcontext;
-	$('name').onkeydown = function(event){ this.oldvalue = this.value ; };
-	$('name').onkeyup = function(event){  
-		if(this.oldvalue == this.value){return true;} 
-		$('save').disabled = false; 
-		$('cancel').disabled = false; 
-	};	
+
+	add_event( $('name') , 'keydown', function(){ this.oldvalue = this.value ;} );
+
+	add_event( $('name') , 'keyup', function(){
+		if(this.oldvalue == this.value){return true;}
+		$('save').disabled = false;
+		$('cancel').disabled = false;
+	});
+
 	$('name').disabled = false;
 	if (whichexten.length ==0 ){
 		gui_alert("Looks like a default Voicemail Extension is not yet configured \n\n Please set an \'Extension for Checking messages\'  and \n click on 'save' button");
@@ -420,7 +423,7 @@
 	<tr>	<td align='center'></td>
 		<td align='center' colspan='2'>
 			<input type='button' id='save' value='Save' class="buttonbold">&nbsp;<input type='button' id='cancel' value='Cancel' class="buttonbold">
-		</td>				
+		</td>
 	</tr>
 </table>
 </div>



More information about the asterisk-gui-commits mailing list