rbrindley: branch rbrindley/features_revamp r4735 - in /team/rbrindley/featur...

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Thu Apr 9 16:56:31 CDT 2009


Author: rbrindley
Date: Thu Apr  9 16:56:28 2009
New Revision: 4735

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

- now loads dial options and feature map


Modified:
    team/rbrindley/features_revamp/config/features2.html
    team/rbrindley/features_revamp/config/js/features2.js

Modified: team/rbrindley/features_revamp/config/features2.html
URL: http://svn.digium.com/svn-view/asterisk-gui/team/rbrindley/features_revamp/config/features2.html?view=diff&rev=4735&r1=4734&r2=4735
==============================================================================
--- team/rbrindley/features_revamp/config/features2.html (original)
+++ team/rbrindley/features_revamp/config/features2.html Thu Apr  9 16:56:28 2009
@@ -190,6 +190,9 @@
 <script type="text/javascript">
 	$(document).ready( function() {
 		top.document.title = "Call Feature Preferences";
+
+		load();
+
 		$('.refresh_icon').click( function() {
 			window.location.reload();
 		});

Modified: team/rbrindley/features_revamp/config/js/features2.js
URL: http://svn.digium.com/svn-view/asterisk-gui/team/rbrindley/features_revamp/config/js/features2.js?view=diff&rev=4735&r1=4734&r2=4735
==============================================================================
--- team/rbrindley/features_revamp/config/js/features2.js (original)
+++ team/rbrindley/features_revamp/config/js/features2.js Thu Apr  9 16:56:28 2009
@@ -26,16 +26,69 @@
  * function to edit options
  * @param obj the DOM object
  */
-edit = function(obj) {
+var edit = function(obj) {
 	this.vals[obj.attr('id')] = obj.val();
 	updateMsg(obj, 'edit');
 };
 
 /**
+ * function to load options
+ */
+var load = function() {
+	var exten_conf = context2json({
+		filename: 'extensions.conf',
+		context: 'globals',
+		usf: 1
+	});
+
+	var dial_opts = exten_conf['DIALOPTIONS'] || '';
+
+	if (exten_conf['FEATURES'] && exten_conf['FEATURES'].length) {
+		var enabled_apps = exten_conf['FEATURES'].split('#');
+	}
+
+	/* set all the enabled dial options to checked */
+	dial_opts = dial_opts.split('');
+	for (var i=0; i<dial_opts.length; i++) {
+		$('#dial_'+dial_opts[i]).attr('checked', 'checked').parents('.feature').removeClass('disabled');
+	}
+
+	var feat_conf = config2json({
+		filename: 'features.conf',
+		usf: 1
+	});
+
+	if (!feat_conf['general'] || !feat_conf['featuremap'] || !feat_conf['applicationmap']) {
+		var u = new listOfSynActions('features.conf');
+		if( !feat_conf.hasOwnProperty('general') ) {
+			u.new_action('newcat', 'general', '', '');
+		}
+		if( !feat_conf.hasOwnProperty('featuremap') ) {
+			u.new_action('newcat', 'feature_map', '', '');
+		}
+		if( !feat_conf.hasOwnProperty('applicationmap') ) {
+			u.new_action('newcat', 'applicationmap', '', '');
+		}
+		u.callActions();
+		window.location.reload();
+		return;
+	}
+
+	var app_map = feat_conf['applicationmap'];
+	$('#feature_map > .feature > :text').each(function() {
+		var vari = $(this).attr('id').split('_')[1];
+		$(this).val(feat_conf['featuremap'][vari]);
+		if (feat_conf['featuremap'][vari]) {
+			$(this).parents('.feature').removeClass('disabled');
+		}
+	});
+}
+
+/**
  * function to removing options
  * @param obj the DOM object
  */
-remove = function(obj) {
+var remove = function(obj) {
 	this.vals[obj.attr('id')] = obj.val();
 	updateMsg(obj, 'remove');
 };




More information about the asterisk-gui-commits mailing list