pari: branch 2.0 r3761 - /branches/2.0/config/js/astman.js
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Thu Sep 4 18:55:07 CDT 2008
Author: pari
Date: Thu Sep 4 18:55:07 2008
New Revision: 3761
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=3761
Log:
getting rid of some unnecessary variables
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=3761&r1=3760&r2=3761
==============================================================================
--- branches/2.0/config/js/astman.js (original)
+++ branches/2.0/config/js/astman.js Thu Sep 4 18:55:07 2008
@@ -1230,42 +1230,34 @@
miscFunctions: {
getChunksFromManagerOutput : function( op , usf){ // ASTGUI.miscFunctions.getChunksFromManagerOutput( output_str ) ;
+ var tr_Array = [];
+ var tmp_chunk = (usf) ? {} : [] ;
+ var count = 0;
var tmp_lines = op.split('\n');
if( tmp_lines[0].contains('Response: ') ) tmp_lines.removeFirst();
if( tmp_lines[0].contains('Message: ') ) tmp_lines.removeFirst();
-
- var tmp_Array_chunksAsArrays = []; // each element of the array is an Array of chunk_lines
- var tmp_Array_chunksAsObjects = []; // each element of the array is an object of chunk_lines
-
- var tmp_chunk = (usf) ? {} : [] ;
- var count = 0;
for( var r = 0; r < tmp_lines.length ; r++ ){
var this_line = tmp_lines[r];
if( this_line.trim() == '' ){
if( !count ){ continue; }
- if( usf ){
- tmp_Array_chunksAsObjects.push(tmp_chunk);
- tmp_chunk = {} ;
- }else{
- tmp_Array_chunksAsArrays.push(tmp_chunk);
- tmp_chunk = [] ;
- }
+ tr_Array.push(tmp_chunk);
+ tmp_chunk = (usf) ? {} : [] ;
count = 0;
continue;
}
if( !this_line.contains(': ') ){ continue; }
+
if( usf ){
tmp_chunk[ this_line.beforeStr(': ').trim() ] = this_line.afterStr(': ').trim() ;
- count++ ;
}else{
tmp_chunk.push(this_line) ;
- count++ ;
- }
- }
-
- return ( usf ) ? tmp_Array_chunksAsObjects : tmp_Array_chunksAsArrays ;
+ }
+ count++ ;
+ }
+
+ return tr_Array ;
},
More information about the asterisk-gui-commits
mailing list