rbrindley: branch 2.0 r4589 - /branches/2.0/config/js/

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Thu Mar 5 17:35:19 CST 2009


Author: rbrindley
Date: Thu Mar  5 17:35:16 2009
New Revision: 4589

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

- added session.delimiter for special extensions.conf cases
- used session.delimiter to fix a bug with time intervals


Modified:
    branches/2.0/config/js/index.js
    branches/2.0/config/js/session.js
    branches/2.0/config/js/timeintervals.js

Modified: branches/2.0/config/js/index.js
URL: http://svn.digium.com/svn-view/asterisk-gui/branches/2.0/config/js/index.js?view=diff&rev=4589&r1=4588&r2=4589
==============================================================================
--- branches/2.0/config/js/index.js (original)
+++ branches/2.0/config/js/index.js Thu Mar  5 17:35:16 2009
@@ -1042,6 +1042,14 @@
 		}catch(err){}
 	}
 
+	/* unfortunately, there are certain cases in 1.4 where 
+	 * both commas and pipes aren't supported, such as when
+	 * doing time intervals for includes :-/
+	 * */
+	if (!sessionData.PLATFORM.isAST_1_6) {
+		top.session.delimiter = '|';
+	}
+
 	var loadGUI = function(){
 		DOM_accordion_div = _$('accordion_div');
 		DOM_mainscreen = _$('mainscreen');

Modified: branches/2.0/config/js/session.js
URL: http://svn.digium.com/svn-view/asterisk-gui/branches/2.0/config/js/session.js?view=diff&rev=4589&r1=4588&r2=4589
==============================================================================
--- branches/2.0/config/js/session.js (original)
+++ branches/2.0/config/js/session.js Thu Mar  5 17:35:16 2009
@@ -26,6 +26,7 @@
  */
 var session = {
 	debug_log: [], /**< array holding all the logging */
+	delimiter: ',', /**< extensions.conf delimiter, used only in special cases. */
 	log: false, /**< boolean toggling logging */
 	/**
 	 * Logging Modes.

Modified: branches/2.0/config/js/timeintervals.js
URL: http://svn.digium.com/svn-view/asterisk-gui/branches/2.0/config/js/timeintervals.js?view=diff&rev=4589&r1=4588&r2=4589
==============================================================================
--- branches/2.0/config/js/timeintervals.js (original)
+++ branches/2.0/config/js/timeintervals.js Thu Mar  5 17:35:16 2009
@@ -89,7 +89,7 @@
 				var tmp_months = _$('edit_ti_month').value ;
 			}
 
-		ti_time_str = tmp_timerange + ',' + tmp_daysofweek + ',' + tmp_daysofmonth + ',' + tmp_months ;
+		ti_time_str = tmp_timerange + parent.session.delimiter + tmp_daysofweek + parent.session.delimiter + tmp_daysofmonth + parent.session.delimiter + tmp_months ;
 
 		var u = new listOfActions('extensions.conf') ;
 		if( isNewTI == false ){
@@ -102,7 +102,7 @@
 				if( ct.beginsWith(ASTGUI.contexts.TrunkDIDPrefix) && !ct.contains( '_' + ASTGUI.contexts.TimeIntervalPrefix ) ){
 					var this_trunk_mainDID = EXT_CNF[ct] ;
 					this_trunk_mainDID.each(function(this_line){
-						if( this_line.beginsWith('include=') && this_line.contains(ASTGUI.contexts.TrunkDIDPrefix) && this_line.contains( OLD_TI + ',${' ) ){
+						if( this_line.beginsWith('include=') && this_line.contains(ASTGUI.contexts.TrunkDIDPrefix) && this_line.contains( OLD_TI + parent.session.delimiter + '${' ) ){
 							u.new_action( 'update' , ct , 'include' , this_line.afterChar('=').replaceXY(OLD_TI,ti_name) , this_line.afterChar('=') ) ;
 						}
 					});
@@ -138,7 +138,7 @@
 			if( ct.beginsWith(ASTGUI.contexts.TrunkDIDPrefix) && !ct.contains(ASTGUI.contexts.TimeIntervalPrefix) ){
 				var this_trunk_mainDID = EXT_CNF[ct] ;
 				this_trunk_mainDID.each(function(this_line){
-					if( this_line.beginsWith('include=') && this_line.contains(ASTGUI.contexts.TrunkDIDPrefix) && this_line.contains( ASTGUI.contexts.TimeIntervalPrefix + a+',${' ) ){
+					if( this_line.beginsWith('include=') && this_line.contains(ASTGUI.contexts.TrunkDIDPrefix) && this_line.contains( ASTGUI.contexts.TimeIntervalPrefix + a + parent.session.delimiter + '${' ) ){
 						u.new_action( 'delete' , ct , 'include' , '' , this_line.afterChar('=') ) ;
 					}
 				});
@@ -175,7 +175,7 @@
 		ASTGUI.updateFieldToValue( 'edit_ti_name', a ); // name of time interval
 		ASTGUI.resetTheseFields( ['edit_ti_starttime', 'edit_ti_endtime', 'edit_ti_dayofweek_start', 'edit_ti_dayofweek_end', 'edit_ti_from_date', 'edit_ti_month' ] );
 
-		var PIECES = TI_LIST[a].split(',') ;
+		var PIECES = TI_LIST[a].contains(',') ? TI_LIST[a].split(',') : TI_LIST[a].split('|');
 		if( PIECES[0] != '*' ){
 			_$('edit_ti_entireday').checked = false ;
 			ASTGUI.updateFieldToValue( 'edit_ti_starttime', ASTGUI.miscFunctions.asteriskTime_to_AMPM(PIECES[0].split('-')[0] ) );




More information about the asterisk-gui-commits mailing list