rbrindley: branch rbrindley/vmenus_revamp r4412 - in /team/rbrindley/vmenus_r...

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Tue Jan 13 10:02:29 CST 2009


Author: rbrindley
Date: Tue Jan 13 10:02:28 2009
New Revision: 4412

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

- added the loadAction function in js/menus2.js
- fixed a CSS scope issue with > .title
- renamed action_info class to just info, action is assumed because the info resides in a div of class 'action'
- added the .template class
- moved the [action_]info div inside the action template div
- added a comma in the actions list after background
- now generating actions list html dynamically on load.


Modified:
    team/rbrindley/vmenus_revamp/config/js/menus2.js
    team/rbrindley/vmenus_revamp/config/menus2.html

Modified: team/rbrindley/vmenus_revamp/config/js/menus2.js
URL: http://svn.digium.com/svn-view/asterisk-gui/team/rbrindley/vmenus_revamp/config/js/menus2.js?view=diff&rev=4412&r1=4411&r2=4412
==============================================================================
--- team/rbrindley/vmenus_revamp/config/js/menus2.js (original)
+++ team/rbrindley/vmenus_revamp/config/js/menus2.js Tue Jan 13 10:02:28 2009
@@ -18,3 +18,12 @@
  * at the top of the source tree.
  *
  */
+
+ function loadAction(action) {
+	var html = action_template.clone();
+
+	html.find('span.name').html(action.name);
+	html.children('.info').html(action.desc);
+	html.removeClass('template');
+	html.appendTo('#actions_list');
+ }

Modified: team/rbrindley/vmenus_revamp/config/menus2.html
URL: http://svn.digium.com/svn-view/asterisk-gui/team/rbrindley/vmenus_revamp/config/menus2.html?view=diff&rev=4412&r1=4411&r2=4412
==============================================================================
--- team/rbrindley/vmenus_revamp/config/menus2.html (original)
+++ team/rbrindley/vmenus_revamp/config/menus2.html Tue Jan 13 10:02:28 2009
@@ -59,7 +59,7 @@
 	padding: 4px;
 }
 
-#actions_container .title {
+#actions_container > .title {
 	border-bottom: 1px solid #6b79a5;
 	color: #333333;
 	font-weight: bold;
@@ -105,9 +105,10 @@
 	width: 100%;
 }
 
-#actions_list .action_info {
+#actions_list .info {
 	background-color: #dddddd;
 	color: #333333;
+	display: none;
 	font-size: 10px;
 	padding-left: 2px;
 	padding-right: 2px;
@@ -198,6 +199,11 @@
 .clear {
 	clear: both;
 }
+
+.template {
+	display: none;
+}
+
 </style>
 <!-- end load CSS -->
 </head>
@@ -207,11 +213,10 @@
 	<div class="title">Actions</div>
 	<div class="search"><input type="text" value="Search" /></div>
 	<div id="actions_list">
-		<div class="action odd"><a href="#"><span>Answer</span></a></div>
-		<div class="action_info">
-			Answer() is designed to signal to the caller that its destination has been reached.
+		<div class="action template">
+			<a href="#"><span class="name"></span></a>
+			<div class="info"></div>
 		</div>
-		<div class="action even"><a href="#"><span>Authenticate</span></a></div>
 	</div>
 </div>
 <div id="vmenus_container">
@@ -260,7 +265,7 @@
 			desc: 'Authenticate is often used to verify that the caller acknowledges a certain key combination.' },
 		{ name: 'Background',
 			command: 'Background(file)',
-			desc: 'Play a file in the background.' }
+			desc: 'Play a file in the background.' },
 		{ name: 'Busy',
 			command: 'Busy()',
 			desc: 'Runs the Busy() command.', },
@@ -342,7 +347,18 @@
 			hideClass: 'ui-tabs-hide-side',
 			loadingClass: 'ui-tabs-loading-side'
 		});
+
+		//generate the actions list
+		action_template = $('#actions_list > .template');
+		for (var i=0; i<actions.length; i++) {
+			loadAction(actions[i]);
+		}
+		$('#actions_list div.action:odd').removeClass('even').addClass('odd');
+		$('#actions_list div.action:even').removeClass('odd').addClass('even');
 	});
+
+	/* many variables only need to be pulled from html once. */
+	var action_template;	//html template for actions
 </script>
 <!-- end load Javascript -->
 </body>




More information about the asterisk-gui-commits mailing list