pari: branch 2.0 r3878 - /branches/2.0/config/js/astman.js

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Wed Sep 24 18:19:35 CDT 2008


Author: pari
Date: Wed Sep 24 18:19:34 2008
New Revision: 3878

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=3878
Log:

 Commenting out some functions that are no longer used in the gui.



Modified:
    branches/2.0/config/js/astman.js

Modified: branches/2.0/config/js/astman.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/astman.js?view=diff&rev=3878&r1=3877&r2=3878
==============================================================================
--- branches/2.0/config/js/astman.js (original)
+++ branches/2.0/config/js/astman.js Wed Sep 24 18:19:34 2008
@@ -466,15 +466,13 @@
 			case 'B': // Busy
 				return "<img src='images/status_red.png' border=0>";
 				break ;
-			case 'U': // UnAvailable
-				return "<img src='images/status_gray.png' border=0>";
-				break ;
 			case 'R': // Ringing
 				return "<img src='images/status_orange.png' border=0>";
 				break ;
 			case 'H': // Hold
 				return "<img src='images/status_yellow.png' border=0>";
 				break ;
+			case 'U': // UnAvailable
 			default :
 				return "<img src='images/status_gray.png' border=0>";
 				break ;
@@ -1074,42 +1072,39 @@
 		top.miscFunctions.setFeedback(fb);
 	},
 
-	generateGraph : function( DATA ){ // generates bar graph into table DATA.TBL for array DATA.VALS
-		// ASTGUI.generateGraph( {TBL: 'DIV_Graph', VALS: gr_vals, HEIGHT: 150, WIDTH: 9 });
-		// WIDTH is width of each cell
-		var TBL = DATA.TBL;
-		var VALS = DATA.VALS ;
-		var HEIGHT = Number(DATA.HEIGHT) || 100 ;
-		var WIDTH = DATA.WIDTH || 5 ;
-
-		var table_ofHeight = function(h, color){
-			h = Math.floor((HEIGHT * Number(h))/100) ;
-			var uh = HEIGHT - h ;
-			if(!color){ color = '#a8b6e5';}
-			return "<TABLE cellpadding=0 cellspacing=0><TR><TD bgcolor='#FFFFFF' height=" + uh + " width=" + WIDTH + "></TD></TR>"
-				+ "<TR><TD bgcolor='"+ color +"' height=" + h + " width=" + WIDTH + "></TD></TR></TABLE>" ;
-		};
-
-		if ( typeof TBL == 'string'){ TBL = _$(TBL); }
-		ASTGUI.domActions.clear_table(TBL);
-		var newRow = TBL.insertRow(-1);
-		VALS.each( function( this_val ){
-			var newcell = newRow.insertCell( newRow.cells.length );
-			newcell.align = 'center' ;
-			newcell.valign = 'bottom' ;
-			newcell.width = WIDTH + 'px' ;
-			newcell.height = HEIGHT ;
-			var clr = ((newRow.cells.length)%2==1) ? '#a8b6e5' : '#dce5f6' ;
-			newcell.innerHTML = table_ofHeight( this_val , clr );
-		});
-	},
+// 	generateGraph : function( DATA ){ // generates bar graph into table DATA.TBL for array DATA.VALS
+// 		// ASTGUI.generateGraph( {TBL: 'DIV_Graph', VALS: gr_vals, HEIGHT: 150, WIDTH: 9 });
+// 		// WIDTH is width of each cell
+// 		var TBL = DATA.TBL;
+// 		var VALS = DATA.VALS ;
+// 		var HEIGHT = Number(DATA.HEIGHT) || 100 ;
+// 		var WIDTH = DATA.WIDTH || 5 ;
+// 
+// 		var table_ofHeight = function(h, color){
+// 			h = Math.floor((HEIGHT * Number(h))/100) ;
+// 			var uh = HEIGHT - h ;
+// 			if(!color){ color = '#a8b6e5';}
+// 			return "<TABLE cellpadding=0 cellspacing=0><TR><TD bgcolor='#FFFFFF' height=" + uh + " width=" + WIDTH + "></TD></TR>"
+// 				+ "<TR><TD bgcolor='"+ color +"' height=" + h + " width=" + WIDTH + "></TD></TR></TABLE>" ;
+// 		};
+// 
+// 		if ( typeof TBL == 'string'){ TBL = _$(TBL); }
+// 		ASTGUI.domActions.clear_table(TBL);
+// 		var newRow = TBL.insertRow(-1);
+// 		VALS.each( function( this_val ){
+// 			var newcell = newRow.insertCell( newRow.cells.length );
+// 			newcell.align = 'center' ;
+// 			newcell.valign = 'bottom' ;
+// 			newcell.width = WIDTH + 'px' ;
+// 			newcell.height = HEIGHT ;
+// 			var clr = ((newRow.cells.length)%2==1) ? '#a8b6e5' : '#dce5f6' ;
+// 			newcell.innerHTML = table_ofHeight( this_val , clr );
+// 		});
+// 	},
 
 	getFieldValue : function(el){ // ASTGUI.getFieldValue(el)
 		if ( typeof el == 'string'){ el = _$(el) ; }
 		switch(el.type){
-			case 'text':
-				return el.value.trim();
-				break ;
 			case 'checkbox':
 				return (el.checked) ? 'yes':'no' ;
 				break;
@@ -1119,13 +1114,12 @@
 			case 'select-one':
 				return el.value ; //.trim()
 				break;
+
+			case 'text':
 			case 'textarea':
+			case 'password':
+			default:
 				return el.value.trim() ;
-				break;
-			case 'password':
-				return el.value.trim() ;
-				break;
-			default:
 				break;
 		}
 		return '';
@@ -1861,22 +1855,22 @@
 		}
 	},
 
-	profiling : {
-		start: function(){
-			if(!top.sessionData.DEBUG_MODE ){ return true; }
-			var now = new Date();
-			top.sessionData.DEBUG_PROFILER_BEGIN = now.getTime() ;
-		},
-
-		snapShot: function(a){
-			if(!top.sessionData.DEBUG_MODE ){ return true; }
-			if ( !a || (typeof a != 'string') ){ a = ''; }
-			var now = new Date();
-			var diff = now.getTime() - top.sessionData.DEBUG_PROFILER_BEGIN ;
-			ASTGUI.debugLog( '<B> Profiler Time : '+ diff +' ms</B> ' + a , '#990033');
-			top.sessionData.DEBUG_PROFILER_BEGIN = now.getTime() ;
-		}
-	},
+// 	profiling : {
+// 		start: function(){
+// 			if(!top.sessionData.DEBUG_MODE ){ return true; }
+// 			var now = new Date();
+// 			top.sessionData.DEBUG_PROFILER_BEGIN = now.getTime() ;
+// 		},
+// 
+// 		snapShot: function(a){
+// 			if(!top.sessionData.DEBUG_MODE ){ return true; }
+// 			if ( !a || (typeof a != 'string') ){ a = ''; }
+// 			var now = new Date();
+// 			var diff = now.getTime() - top.sessionData.DEBUG_PROFILER_BEGIN ;
+// 			ASTGUI.debugLog( '<B> Profiler Time : '+ diff +' ms</B> ' + a , '#990033');
+// 			top.sessionData.DEBUG_PROFILER_BEGIN = now.getTime() ;
+// 		}
+// 	},
 
 	resetTheseFields : function( flds ){ // ASTGUI.resetTheseFields(arr) , flds = [ el1, el2 , el_3 ] ; - sets each element to blank value
 		if(!ASTGUI.isArray(flds)){ return; }
@@ -2072,126 +2066,126 @@
 		}
 	}, // { selectbox }
 
-	selectRange_populate : function(g , els){
-		/* 	TODO
-			The 'selectRange_populate function' is right now a bit heavy, ugly and relies extensively on closures.
-			this function should in future be replaced with a prototype based object
-		*/
-		if(typeof g == 'string'){ g = _$(g); }
-		g.startRange = '';
-		g.stopRange = '';
-		var range_documentCatch = function(){
-			try{
-				var children = g.childNodes;
-				for (var i = 0; i < children.length; i++) {
-					var tmp = children[i] ;
-					ASTGUI.events.remove( tmp , 'mousemove' , update_range ) ;
-				};
-			}catch(err){
-			
-			}finally{
-				ASTGUI.events.remove( document , 'mouseup' , range_documentCatch ) ;
-			}
-		};
-		var range_start = function(event){
-			g.startRange = g.stopRange = this.innerHTML;
-			//console.log( 'Range is : ' + g.startRange + ' to ' + g.stopRange );
-			if($.browser.msie){
-				event.returnValue = false;
-			} else{
-				event.preventDefault();
-			}
-	
-			var children = g.childNodes ;
-			for (var i = 0; i < children.length; i++) {
-				var tmp = children[i] ;
-				ASTGUI.events.add( tmp , 'mousemove' , update_range ) ;
-				//$(tmp).css({backgroundColor : '#FFFFFF' });
-				tmp.className = 'selectRange_notselected';
-			};
-			ASTGUI.events.add( document , 'mouseup' , range_documentCatch ) ;
-			//$(this).css({backgroundColor :'#EFEFEF' });
-			$(this).addClass('selectRange_selected');
-		};
-		var update_range = function(event){
-			if($.browser.msie){
-				event.returnValue = false;
-			} else{
-				event.preventDefault();
-			}
-			try{
-				g.stopRange = this.innerHTML;
-			}catch(err){
-				var p = ASTGUI.events.getTarget(event) ;
-				g.stopRange = p.innerHTML;
-			}
-			//console.log( 'Range is : ' + g.startRange + ' to ' + g.stopRange );
-			var x = els.indexOf(g.startRange) ;
-			var y = els.indexOf(g.stopRange) ; 
-			var start_index = Math.min(x,y);
-			var stop_index = Math.max(x,y);
-	
-			var children = g.childNodes;
-			for (var i = 0; i < children.length; i++) {
-				var tmp = children[i] ;
-				var tmp_html = tmp.innerHTML;
-				var tmp_index = els.indexOf(tmp_html) ;
-				tmp.className = ( tmp_index <= stop_index && tmp_index >= start_index ) ? 'selectRange_selected' : 'selectRange_notselected' ;
-				//$(tmp).css({backgroundColor : ( tmp_index <= stop_index && tmp_index >= start_index ) ? '#EFEFEF' : '#FFFFFF' });
-			};
-		};
-		var range_stop = function(){
-			//console.log( 'Range is : ' + g.startRange + ' to ' + g.stopRange );
-			var x = els.indexOf(g.startRange) ;
-			var y = els.indexOf(g.stopRange) ; 
-			var start_index = Math.min(x,y);
-			var stop_index = Math.max(x,y);
-			g.startRange = els[start_index];
-			g.stopRange = els[stop_index];
-	
-			var children = g.childNodes;
-			for (var i = 0; i < children.length; i++) {
-				var tmp = children[i] ;
-				var tmp_html = tmp.innerHTML;
-				var tmp_index = els.indexOf(tmp_html) ;
-				ASTGUI.events.remove( tmp , 'mousemove' , update_range ) ;
-				//$(tmp).css({backgroundColor : ( tmp_index <= stop_index && tmp_index >= start_index ) ? '#EFEFEF' : '#FFFFFF' });
-				tmp.className = ( tmp_index <= stop_index && tmp_index >= start_index ) ? 'selectRange_selected' : 'selectRange_notselected' ;
-			};
-			ASTGUI.events.remove( document , 'mouseup' , range_documentCatch ) ;
-		};
-	
-		els.each(function(elm){
-			var tmp = document.createElement('SPAN'); 
-			tmp.innerHTML = elm ;
-			tmp.className = 'selectRange_notselected';
-			$(tmp).mousedown( range_start );
-			$(tmp).mouseup( range_stop );
-			g.appendChild( tmp );
-		});
-	
-		$(g).css({cursor:'pointer'});
-
-		g.reset_range = function(){
-			g.startRange = g.stopRange = '';
-			var children = g.childNodes;
-			for ( var i = 0; i < children.length; i++ ) { children[i].className = 'selectRange_notselected' ; }
-		};
-
-		g.set_range = function(a,b){
-			var x = els.indexOf(a) ;
-			var y = els.indexOf(b) ; 
-			g.startRange = Math.min(x,y) ;
-			g.stopRange = Math.max(x,y);
-			var children = g.childNodes;
-			for ( var i = 0; i < children.length; i++ ) {
-				var tmp = children[i] ;
-				var tmp_html = tmp.innerHTML;
-				var tmp_index = els.indexOf(tmp_html) ;
-				children[i].className = ( tmp_index <= g.stopRange && tmp_index >= g.startRange ) ? 'selectRange_selected' : 'selectRange_notselected' ;
-			}
-		};
-	}, // End of selectRange_populate
+// 	selectRange_populate : function(g , els){
+// 		/* 	TODO
+// 			The 'selectRange_populate function' is right now a bit heavy, ugly and relies extensively on closures.
+// 			this function should in future be replaced with a prototype based object
+// 		*/
+// 		if(typeof g == 'string'){ g = _$(g); }
+// 		g.startRange = '';
+// 		g.stopRange = '';
+// 		var range_documentCatch = function(){
+// 			try{
+// 				var children = g.childNodes;
+// 				for (var i = 0; i < children.length; i++) {
+// 					var tmp = children[i] ;
+// 					ASTGUI.events.remove( tmp , 'mousemove' , update_range ) ;
+// 				};
+// 			}catch(err){
+// 			
+// 			}finally{
+// 				ASTGUI.events.remove( document , 'mouseup' , range_documentCatch ) ;
+// 			}
+// 		};
+// 		var range_start = function(event){
+// 			g.startRange = g.stopRange = this.innerHTML;
+// 			//console.log( 'Range is : ' + g.startRange + ' to ' + g.stopRange );
+// 			if($.browser.msie){
+// 				event.returnValue = false;
+// 			} else{
+// 				event.preventDefault();
+// 			}
+// 	
+// 			var children = g.childNodes ;
+// 			for (var i = 0; i < children.length; i++) {
+// 				var tmp = children[i] ;
+// 				ASTGUI.events.add( tmp , 'mousemove' , update_range ) ;
+// 				//$(tmp).css({backgroundColor : '#FFFFFF' });
+// 				tmp.className = 'selectRange_notselected';
+// 			};
+// 			ASTGUI.events.add( document , 'mouseup' , range_documentCatch ) ;
+// 			//$(this).css({backgroundColor :'#EFEFEF' });
+// 			$(this).addClass('selectRange_selected');
+// 		};
+// 		var update_range = function(event){
+// 			if($.browser.msie){
+// 				event.returnValue = false;
+// 			} else{
+// 				event.preventDefault();
+// 			}
+// 			try{
+// 				g.stopRange = this.innerHTML;
+// 			}catch(err){
+// 				var p = ASTGUI.events.getTarget(event) ;
+// 				g.stopRange = p.innerHTML;
+// 			}
+// 			//console.log( 'Range is : ' + g.startRange + ' to ' + g.stopRange );
+// 			var x = els.indexOf(g.startRange) ;
+// 			var y = els.indexOf(g.stopRange) ; 
+// 			var start_index = Math.min(x,y);
+// 			var stop_index = Math.max(x,y);
+// 	
+// 			var children = g.childNodes;
+// 			for (var i = 0; i < children.length; i++) {
+// 				var tmp = children[i] ;
+// 				var tmp_html = tmp.innerHTML;
+// 				var tmp_index = els.indexOf(tmp_html) ;
+// 				tmp.className = ( tmp_index <= stop_index && tmp_index >= start_index ) ? 'selectRange_selected' : 'selectRange_notselected' ;
+// 				//$(tmp).css({backgroundColor : ( tmp_index <= stop_index && tmp_index >= start_index ) ? '#EFEFEF' : '#FFFFFF' });
+// 			};
+// 		};
+// 		var range_stop = function(){
+// 			//console.log( 'Range is : ' + g.startRange + ' to ' + g.stopRange );
+// 			var x = els.indexOf(g.startRange) ;
+// 			var y = els.indexOf(g.stopRange) ; 
+// 			var start_index = Math.min(x,y);
+// 			var stop_index = Math.max(x,y);
+// 			g.startRange = els[start_index];
+// 			g.stopRange = els[stop_index];
+// 	
+// 			var children = g.childNodes;
+// 			for (var i = 0; i < children.length; i++) {
+// 				var tmp = children[i] ;
+// 				var tmp_html = tmp.innerHTML;
+// 				var tmp_index = els.indexOf(tmp_html) ;
+// 				ASTGUI.events.remove( tmp , 'mousemove' , update_range ) ;
+// 				//$(tmp).css({backgroundColor : ( tmp_index <= stop_index && tmp_index >= start_index ) ? '#EFEFEF' : '#FFFFFF' });
+// 				tmp.className = ( tmp_index <= stop_index && tmp_index >= start_index ) ? 'selectRange_selected' : 'selectRange_notselected' ;
+// 			};
+// 			ASTGUI.events.remove( document , 'mouseup' , range_documentCatch ) ;
+// 		};
+// 	
+// 		els.each(function(elm){
+// 			var tmp = document.createElement('SPAN'); 
+// 			tmp.innerHTML = elm ;
+// 			tmp.className = 'selectRange_notselected';
+// 			$(tmp).mousedown( range_start );
+// 			$(tmp).mouseup( range_stop );
+// 			g.appendChild( tmp );
+// 		});
+// 	
+// 		$(g).css({cursor:'pointer'});
+// 
+// 		g.reset_range = function(){
+// 			g.startRange = g.stopRange = '';
+// 			var children = g.childNodes;
+// 			for ( var i = 0; i < children.length; i++ ) { children[i].className = 'selectRange_notselected' ; }
+// 		};
+// 
+// 		g.set_range = function(a,b){
+// 			var x = els.indexOf(a) ;
+// 			var y = els.indexOf(b) ; 
+// 			g.startRange = Math.min(x,y) ;
+// 			g.stopRange = Math.max(x,y);
+// 			var children = g.childNodes;
+// 			for ( var i = 0; i < children.length; i++ ) {
+// 				var tmp = children[i] ;
+// 				var tmp_html = tmp.innerHTML;
+// 				var tmp_index = els.indexOf(tmp_html) ;
+// 				children[i].className = ( tmp_index <= g.stopRange && tmp_index >= g.startRange ) ? 'selectRange_selected' : 'selectRange_notselected' ;
+// 			}
+// 		};
+// 	}, // End of selectRange_populate
 
 	showbg: function(t){ // show/hide a transparent bg layer - ASTGUI.showbg(true);
 		try{




More information about the asterisk-gui-commits mailing list