rbrindley: branch 2.0 r4631 - in /branches/2.0/config: ./ js/

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Thu Mar 12 12:01:33 CDT 2009


Author: rbrindley
Date: Thu Mar 12 12:01:29 2009
New Revision: 4631

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

- merged the latest and greated from astman_revamp branch
- fixed a few bug issues with time intervals
- fixed a few issues with object.customs


Modified:
    branches/2.0/config/js/astman2.js
    branches/2.0/config/js/index.js
    branches/2.0/config/js/log.js
    branches/2.0/config/js/object.customs.js
    branches/2.0/config/js/pbx2.js
    branches/2.0/config/js/timeintervals.js
    branches/2.0/config/timeintervals.html

Modified: branches/2.0/config/js/astman2.js
URL: http://svn.digium.com/svn-view/asterisk-gui/branches/2.0/config/js/astman2.js?view=diff&rev=4631&r1=4630&r2=4631
==============================================================================
--- branches/2.0/config/js/astman2.js (original)
+++ branches/2.0/config/js/astman2.js Thu Mar 12 12:01:29 2009
@@ -188,7 +188,7 @@
  */
 astman.makeSyncRequest = function(params) {
 	if (top.session && top.session.debug_mode) {
-		log.ajax('makeSyncRequest: AJAX Request: "' + params.getProperties() + '"');
+		log.ajax('makeSyncRequest: AJAX Request: "' + getProperties(param) + '"');
 	}
 
 	if (typeof params !== 'object') {

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=4631&r1=4630&r2=4631
==============================================================================
--- branches/2.0/config/js/index.js (original)
+++ branches/2.0/config/js/index.js Thu Mar 12 12:01:29 2009
@@ -1042,14 +1042,6 @@
 		}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');
@@ -1093,6 +1085,14 @@
 			$(".debugWindow").show();
 			sessionData.DEBUG_MODE = true;
 		}
+
+		/* 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 = '|';
+		}
 	};
 
 	ASTGUI.dialog.waitWhile(' Loading ...');

Modified: branches/2.0/config/js/log.js
URL: http://svn.digium.com/svn-view/asterisk-gui/branches/2.0/config/js/log.js?view=diff&rev=4631&r1=4630&r2=4631
==============================================================================
--- branches/2.0/config/js/log.js (original)
+++ branches/2.0/config/js/log.js Thu Mar 12 12:01:29 2009
@@ -88,7 +88,7 @@
 	}
 
 	if (typeof msg === 'object') {
-		msg = 'OBJECT: ' + msg.getProperties();
+		msg = 'OBJECT: ' + getProperties(msg);
 	}
 
 	var now = new Date();

Modified: branches/2.0/config/js/object.customs.js
URL: http://svn.digium.com/svn-view/asterisk-gui/branches/2.0/config/js/object.customs.js?view=diff&rev=4631&r1=4630&r2=4631
==============================================================================
--- branches/2.0/config/js/object.customs.js (original)
+++ branches/2.0/config/js/object.customs.js Thu Mar 12 12:01:29 2009
@@ -157,24 +157,25 @@
 /**
  * Get Properties As String.
  * Gets Object's properties and returns them as a string. Use to be ASTGUI.getObjectPropertiesAsString.
+ * Its important to note that the Object shouldn't EVER be prototype'd, it breaks Object as a hash.
  * @returns a string of the object's properties
  */
-Object.prototype.getProperties = function() {
+getProperties = function(obj) {
 	var props = [];
 
-	for (var d in this) {
-		if (!this.hasOwnProperty(d)) {
+	for (var d in obj) {
+		if (!obj.hasOwnProperty(d)) {
 			continue;
 		}
 
-		if (typeof this[d] === 'object') {
-			if (this[d] instanceof Array) {
-				props.push(d + ': [' + this[d].join(',') + ']');
+		if (typeof obj[d] === 'object') {
+			if (obj[d] instanceof Array) {
+				props.push(d + ': [' + obj[d].join(',') + ']');
 			} else {
-				props.push(d + ': ' + this[d].getProperties());
+				props.push(d + ': ' + obj[d].getProperties());
 			}
 		} else {
-			props.push(d + ': ' + this[d]);
+			props.push(d + ': ' + obj[d]);
 		}
 	}
 	return '{' + props.join(' ,') + '}';
@@ -356,6 +357,8 @@
 	if (day && (day < 0 || day > 31)) {
 		return false;
 	}
+
+	return true;
 };
 
 

Modified: branches/2.0/config/js/pbx2.js
URL: http://svn.digium.com/svn-view/asterisk-gui/branches/2.0/config/js/pbx2.js?view=diff&rev=4631&r1=4630&r2=4631
==============================================================================
--- branches/2.0/config/js/pbx2.js (original)
+++ branches/2.0/config/js/pbx2.js Thu Mar 12 12:01:29 2009
@@ -412,10 +412,10 @@
  */
 pbx.time_intervals.edit = function(oldname, newname, interval) {
 	/* check the basics */
-	if (!name) {
+	if (!newname) {
 		top.log.error('pbx.time_intervals.add: name is empty.');
 		return false;
-	} else if (typeof interval !== 'undefined') {
+	} else if (typeof interval === 'undefined') {
 		top.log.error('pbx.time_intervals.add: interval is undefined.');
 		return false;
 	}
@@ -477,7 +477,7 @@
 		}
 	}
 
-	actions.new_action('update', 'globals', ASTGUI.contexts.TimeIntervalPrefix + newname, value);
+	actions.new_action('append', 'globals', ASTGUI.contexts.TimeIntervalPrefix + newname, value);
 	var resp = actions.callActions();
 	if (!resp.contains('Response: Success')) {
 		top.log.error('pbx.time_intervals.add: error updating extensions.conf');
@@ -595,9 +595,9 @@
 		return true;
 	}
 
-	if (week.contains('-') && week[3] !== '-') {
-		return false;
-	} else if (week[3] === '-') {
+	if (week.contains('-') && week[2] !== '-') {
+		return false;
+	} else if (week[2] === '-') {
 		var first = week.split('-')[0];
 		var second = week.split('-')[1];
 

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=4631&r1=4630&r2=4631
==============================================================================
--- branches/2.0/config/js/timeintervals.js (original)
+++ branches/2.0/config/js/timeintervals.js Thu Mar 12 12:01:29 2009
@@ -81,17 +81,18 @@
 			var endtime = ASTGUI.miscFunctions.AMPM_to_asteriskTime(end) || '24:00';
 
 			if (starttime !== '00:00' || endtime !== '24:00') {
-				interval.time = starttime + '-' + endttime;
-			}
-		}
-
-		if (!$('#edit_ti_byDayofWeek:selected').length) {
+				interval.time = starttime + '-' + endtime;
+			}
+		}
+
+		if ($('#ti_type_byDayofWeek:checked').val()) {
 			interval.weekdays = $('#edit_ti_dayofweek_start').val() + '-' + $('#edit_ti_dayofweek_end').val();
 		}
 
-		if ($('#ti_type_byGroupofDates:selected').length) {
+		if ($('#ti_type_byGroupofDates:checked').val()) {
 			interval.days = $('#edit_ti_from_date').val();
 
+			interval.days = interval.days.toString();
 			if (!interval.days.valiDate()) {
 				ASTGUI.highlightField('edit_ti_from_date', 'Invalid Date Range!');
 				return;
@@ -112,7 +113,7 @@
 			return;
 		}
 
-		ASTGUI.feedback({ msg: "Created time interval '" + newname + "'!", showfor: 3, color:'green', bgcolor:'#FFFFFF'});
+		ASTGUI.feedback({ msg: "Time Interval '" + newname + "' " + ((isNewTI) ? "created" : "edited") + "!", showfor: 3, color:'green', bgcolor:'#FFFFFF'});
 		window.location.reload();
 
 	},

Modified: branches/2.0/config/timeintervals.html
URL: http://svn.digium.com/svn-view/asterisk-gui/branches/2.0/config/timeintervals.html?view=diff&rev=4631&r1=4630&r2=4631
==============================================================================
--- branches/2.0/config/timeintervals.html (original)
+++ branches/2.0/config/timeintervals.html Thu Mar 12 12:01:29 2009
@@ -174,6 +174,7 @@
 
 <script src="js/jquery.js"></script>
 <script src="js/astman.js"></script>
+<script src="js/object.customs.js"></script>
 <script src="js/timeintervals.js"></script>
 <script src="js/jquery.tooltip.js"></script>
 <script src="js/jquery.date_input.js"></script>




More information about the asterisk-gui-commits mailing list