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

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Wed Mar 25 12:03:57 CDT 2009


Author: rbrindley
Date: Wed Mar 25 12:03:54 2009
New Revision: 4659

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

- move $(document).ready() to incoming.html
- move javascript in incoming.html to bottom to optimize
- how about we use existing jquery methods instead of custom ones :-)


Modified:
    branches/2.0/config/incoming.html
    branches/2.0/config/js/incoming.js

Modified: branches/2.0/config/incoming.html
URL: http://svn.digium.com/svn-view/asterisk-gui/branches/2.0/config/incoming.html?view=diff&rev=4659&r1=4658&r2=4659
==============================================================================
--- branches/2.0/config/incoming.html (original)
+++ branches/2.0/config/incoming.html Wed Mar 25 12:03:54 2009
@@ -18,10 +18,6 @@
  * at the top of the source tree.
  *
 -->
-<script src="js/jquery.js"></script>
-<script src="js/astman.js"></script>
-<script src="js/incoming.js"></script>
-<script src="js/jquery.tooltip.js"></script>
 <link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
 <style type="text/css">
 
@@ -103,4 +99,53 @@
 		</TABLE>
 	</div>
 
+<script src="js/jquery.js"></script>
+<script src="js/astman.js"></script>
+<script src="js/incoming.js"></script>
+<script src="js/jquery.tooltip.js"></script>
+<script type="text/javascript">
+	$(document).ready(function() {
+		top.document.title = "Incoming Calling Rules";
+		
+		incomingRules_MiscFunctions.listAllRulesInTable();
+
+		/* Populate Time Intervals <select> */
+		var itrl_tf = $('#edit_itrl_tf');
+		var list = parent.pbx.time_intervals.list();
+		for (var ti in list) {
+			if (!list.hasOwnProperty(ti)) {
+				continue;
+			}
+
+			itrl_tf.append($('<option>').html(ti).val(list[ti]));
+		};
+		itrl_tf.append($('<option>').html('None (no Time Intervals matched)').val(''));
+		delete itrl_tf;
+		delete list;
+
+		/* Populate Destinations <select> */
+		var dest = $('#edit_itrl_dest');
+		var list = parent.miscFunctions.getAllDestinations();
+		for (var d in list) {
+			if (!list.hasOwnProperty(d)) {
+				continue;
+			}
+
+			dest.append($('<option>').html(d).val(list[d]));
+		}
+		dest.append($('<option>').html('Local Extension by DID').val('ByDID'));
+
+		/* now lets add some events!! */
+		dest.change(function() {
+			if (this.val() === 'ByDID') {
+				$('.localext_byDid').show();
+			} else {
+				$('.localext_byDid').hide();
+			}
+		});
+		$('#edit_itrl_trunk').click(function() {
+			incomingRules_MiscFunctions.enableDisablePattern();
+		});
+	});
+</script>
 </body>

Modified: branches/2.0/config/js/incoming.js
URL: http://svn.digium.com/svn-view/asterisk-gui/branches/2.0/config/js/incoming.js?view=diff&rev=4659&r1=4658&r2=4659
==============================================================================
--- branches/2.0/config/js/incoming.js (original)
+++ branches/2.0/config/js/incoming.js Wed Mar 25 12:03:54 2009
@@ -491,26 +491,3 @@
 		}
 	}
 };
-
-
-
-var localajaxinit = function(){
-	top.document.title = 'Incoming Calling Rules' ;
-	incomingRules_MiscFunctions.listAllRulesInTable();
-
-	var TI_LIST = parent.miscFunctions.getTimeIntervals() ;
-	ASTGUI.selectbox.populateArray( 'edit_itrl_tf', TI_LIST.getOwnProperties() );
-	ASTGUI.selectbox.append( 'edit_itrl_tf' , 'None (no TimeIntervals matched)' , '' );
-	ASTGUI.selectbox.populateArray( 'edit_itrl_dest' ,  parent.miscFunctions.getAllDestinations() );
-	ASTGUI.selectbox.append( 'edit_itrl_dest' , 'Local Extension by DID' , 'ByDID' );
-	ASTGUI.events.add( 'edit_itrl_trunk' , 'click' , incomingRules_MiscFunctions.enableDisablePattern );
-
-	ASTGUI.events.add( 'edit_itrl_dest', 'change' , function(){
-		if( _$('edit_itrl_dest').value == 'ByDID' ){
-			$('.localext_byDid').show();
-		}else{
-			$('.localext_byDid').hide();
-		}
-	});
-	//'edit_itrl_trunk', 'edit_itrl_tf', 'edit_itrl_pattern', 'edit_itrl_dest'
-};




More information about the asterisk-gui-commits mailing list