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

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Mon Jan 19 08:35:04 CST 2009


Author: rbrindley
Date: Mon Jan 19 08:35:04 2009
New Revision: 4447

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

- added click handlers for the 'save' and 'cancel' buttons inside an action edit
- added CSS for vmenu edit section
- added the HTML template for the vmenu edit section
- added 'editCancel', 'editSave', and 'editShow' to the Background action object.
	- will add to others in future revs.


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=4447&r1=4446&r2=4447
==============================================================================
--- team/rbrindley/vmenus_revamp/config/js/menus2.js (original)
+++ team/rbrindley/vmenus_revamp/config/js/menus2.js Mon Jan 19 08:35:04 2009
@@ -58,6 +58,9 @@
 	new_vmenu.removeClass('template');
 
 	updateVmenu();
+	new_vmenu.find('.edit span.save').click(action.editSave);
+	new_vmenu.find('.edit span.cancel').click(action.editCancel);
+	action.editShow(new_vmenu.children('.edit'));
  }
 
  function updateVmenu() {

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=4447&r1=4446&r2=4447
==============================================================================
--- team/rbrindley/vmenus_revamp/config/menus2.html (original)
+++ team/rbrindley/vmenus_revamp/config/menus2.html Mon Jan 19 08:35:04 2009
@@ -178,6 +178,38 @@
 
 .vmenu .vmenu_item .number {
 	background-color: #bbbbbb;
+}
+
+.vmenu .vmenu_item .edit {
+	display: none;
+	min-height: 50px;
+}
+
+.vmenu .vmenu_item .edit .form {
+	width: 50%;
+}
+
+.vmenu .vmenu_item .edit .form > div {
+	border: 1px dashed #ef8700;
+	margin: 2px;
+	min-height: 25px;
+	padding: 2px;
+}
+
+.vmenu .vmenu_item .edit .help {
+	float: right;
+	width: 50%;
+}
+
+.vmenu .vmenu_item .edit .help > div {
+	margin: 2px;
+	padding: 2px;
+}
+
+.vmenu .vmenu_item .save_cancel {
+	padding: 2px;
+	display: block;
+	float: none;
 }
 
 div.ui-tabs-panel-side {
@@ -252,6 +284,14 @@
 						<span></span>
 						<input class="autocomplete" type="text" />
 					</span>
+					<div class="edit">
+						<div class="help"><div>help</div></div>
+						<div class="form">
+							<div>
+							<span class="save_cancel"><span class="save">Save</span><span class="cancel">Cancel</span></span>
+							</div>
+						</div>
+					</div>
 				</div>
 				<div class="vmenu_item new">
 					<span class="command" title="Click here to utilize the Custom action and write your own command.">
@@ -290,7 +330,25 @@
 			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.',
+			editCancel: function (e) {
+			},
+			editSave: function (e) {
+				$(e.target).parents('.edit').hide();
+				var file  = $(e.target).parents('.edit').find('input.file').attr('value');
+				var command = "Background("+file+")";
+				$(e.target).parents('.vmenu_item').find('.command > span').html(command);
+				$(e.target).parents('.vmenu_item').find('.command > input').attr('value',command);
+			},
+			editShow: function (ele) {
+				var form = $(ele).find('.form > div');
+				var help = $(ele).find('.help > div');
+				form.prepend($("<input/>").addClass('file').attr('value','file'));
+				form.prepend($("<span></span>").html('Please insert the file you wish to play: '));
+				help.html(this.desc);
+				$(ele).show();
+				$(ele).find('input.file').focus().select();
+			}},
 		{ name: 'Busy',
 			command: 'Busy()',
 			desc: 'Runs the Busy() command.', },
@@ -483,9 +541,12 @@
 					});
 				$(ui.item)
 					.hide().fadeIn('slow')
-					.removeClass('template');
+					.removeClass('template')
+					.find('.edit span.save').click(action.editSave).end()
+					.find('.edit span.cancel').click(action.editCancel);
 
 				updateVmenu();
+				action.editShow($(ui.item).children('.edit'));
 			},
 			stop: updateVmenu
 		});




More information about the asterisk-gui-commits mailing list