diff --git a/src/sunstone/public/js/plugins/clusters-tab.js b/src/sunstone/public/js/plugins/clusters-tab.js index 245c255590..a2fc651f41 100644 --- a/src/sunstone/public/js/plugins/clusters-tab.js +++ b/src/sunstone/public/js/plugins/clusters-tab.js @@ -485,6 +485,8 @@ function popUpCreateClusterDialog(){ Sunstone.runAction("ClusterDS.list"); $create_cluster_dialog.reveal(); + $("input#name",$create_cluster_dialog).focus(); + return false; } diff --git a/src/sunstone/public/js/plugins/datastores-tab.js b/src/sunstone/public/js/plugins/datastores-tab.js index 8481629063..fc6ef32187 100644 --- a/src/sunstone/public/js/plugins/datastores-tab.js +++ b/src/sunstone/public/js/plugins/datastores-tab.js @@ -1123,6 +1123,7 @@ function popUpCreateDatastoreDialog(){ $('select#cluster_id',$create_datastore_dialog).html(clusters_sel()); $('select#datastore_cluster_raw',$create_datastore_dialog).html(clusters_sel()); $create_datastore_dialog.reveal(); + $("input#name",$create_datastore_dialog).focus(); hide_all($create_datastore_dialog); select_filesystem(); } diff --git a/src/sunstone/public/js/plugins/files-tab.js b/src/sunstone/public/js/plugins/files-tab.js index f926825033..e58a3c7e41 100644 --- a/src/sunstone/public/js/plugins/files-tab.js +++ b/src/sunstone/public/js/plugins/files-tab.js @@ -403,12 +403,7 @@ var file_buttons = { type: "confirm", layout: "del", text: tr("Delete") - }, - //"File.help" : { - // type: "action", - // text: '?', - // alwaysActive: true - //} + } } var file_info_panel = { @@ -664,21 +659,8 @@ function setupCreateFileDialog(){ var height = Math.floor($(window).height()*0.8); //set height to a percentage of the window - //Prepare jquery dialog - //dialog.dialog({ - // autoOpen: false, - // modal:true, - // width: 520, - // height: height - //}); dialog.addClass("reveal-modal large max-height"); - - //$('#img_tabs',dialog).tabs(); - //$('button',dialog).button(); - //$('#datablock_img',dialogs_contextog).attr('disabled','disabled'); - - $('select#img_type',dialog).change(function(){ var value = $(this).val(); var context = $create_file_dialog; @@ -829,7 +811,6 @@ function setupCreateFileDialog(){ //Inform complete upload, destroy upload dialog, refresh img list - //$('div#pb_dialog').dialog('destroy'); $('div#pb_dialog').trigger("reveal:close") return false; }, @@ -947,6 +928,7 @@ function popUpCreateFileDialog(){ $('#file_datastore_raw',$create_file_dialog).html(datastores_str); $create_file_dialog.reveal(); + $("input#img_name",$create_file_dialog).focus(); } // Set the autorefresh interval for the datatable diff --git a/src/sunstone/public/js/plugins/groups-tab.js b/src/sunstone/public/js/plugins/groups-tab.js index 8a96583f97..6b924332be 100644 --- a/src/sunstone/public/js/plugins/groups-tab.js +++ b/src/sunstone/public/js/plugins/groups-tab.js @@ -578,6 +578,7 @@ function setupCreateGroupDialog(){ function popUpCreateGroupDialog(){ $create_group_dialog.reveal(); + $("input#name",$create_group_dialog).focus(); return false; } diff --git a/src/sunstone/public/js/plugins/hosts-tab.js b/src/sunstone/public/js/plugins/hosts-tab.js index 956724045a..24c37ff9f3 100644 --- a/src/sunstone/public/js/plugins/hosts-tab.js +++ b/src/sunstone/public/js/plugins/hosts-tab.js @@ -888,16 +888,9 @@ function setupCreateHostDialog(){ var dialog = $create_host_dialog; dialog.html(create_host_tmpl); - //dialog.dialog({ - // autoOpen: false, - // modal: true, - // width: 500 - //}); + dialog.addClass("reveal-modal max-height"); - //$('button',dialog).button(); - - // Show custom driver input only when custom is selected in selects $('input[name="custom_vmm_mad"],'+ 'input[name="custom_im_mad"],'+ @@ -972,6 +965,7 @@ function setupCreateHostDialog(){ function popUpCreateHostDialog(){ $('#host_cluster_id',$create_host_dialog).html(clusters_sel()); $create_host_dialog.reveal(); + $("input#name",$create_host_dialog).focus(); return false; } diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js index 006fee889a..cd151dde03 100644 --- a/src/sunstone/public/js/plugins/images-tab.js +++ b/src/sunstone/public/js/plugins/images-tab.js @@ -1230,6 +1230,7 @@ function popUpCreateImageDialog(){ $('#img_datastore_raw',$create_image_dialog).html(datastores_str); $create_image_dialog.reveal(); + $("input#img_name",$create_image_dialog).focus(); $('select#img_datastore').children('option').each(function() { if ($(this).val() == "2") @@ -1294,18 +1295,8 @@ function setupImageCloneDialog(){ '; dialog.html(html); - - //Convert into jQuery - //dialog.dialog({ - // autoOpen:false, - // width:375, - // modal:true, - // resizable:false - //}); dialog.addClass("reveal-modal"); - //$('button',dialog).button(); - $('form',dialog).submit(function(){ var name = $('input', this).val(); var sel_elems = imageElements(); @@ -1345,6 +1336,7 @@ function popUpImageCloneDialog(){ }; $(dialog).reveal(); + $("input[name='name']",dialog).focus(); } //The DOM is ready at this point diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index f7b87377b7..4700876b12 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -4213,6 +4213,8 @@ function popUpCreateTemplateDialog(){ $create_template_dialog.reveal(); + $("input#NAME",$create_template_dialog).focus(); + $('button.refresh').each(function(){ this.click(); }) @@ -4924,6 +4926,7 @@ function popUpTemplateCloneDialog(){ }; $(dialog).reveal(); + $("input[name='name']",dialog).focus(); } // Set the autorefresh interval for the datatable @@ -5121,6 +5124,7 @@ function setupInstantiateTemplateDialog(easy_provision){ function popUpInstantiateVMTemplateDialog(easy_provision){ setupInstantiateTemplateDialog(easy_provision); $instantiate_vm_template_dialog.reveal(); + $("input#vm_name",$instantiate_vm_template_dialog).focus(); } //The DOM is ready at this point diff --git a/src/sunstone/public/js/plugins/users-tab.js b/src/sunstone/public/js/plugins/users-tab.js index 8fdf5ea272..330851c092 100644 --- a/src/sunstone/public/js/plugins/users-tab.js +++ b/src/sunstone/public/js/plugins/users-tab.js @@ -811,13 +811,6 @@ function setupCreateUserDialog(){ var dialog = $create_user_dialog; dialog.html(create_user_tmpl); - //Prepare jquery dialog - //dialog.dialog({ - // autoOpen: false, - // modal:true, - // width: 400 - //}); - dialog.addClass("reveal-modal"); //$('button',dialog).button(); @@ -920,18 +913,19 @@ function setupUserQuotasDialog(){ } function popUpUserQuotasDialog(){ - popUpQuotasDialog($user_quotas_dialog, 'User', userElements()) + popUpQuotasDialog($user_quotas_dialog, 'User', userElements()); } function popUpCreateUserDialog(){ $create_user_dialog.reveal(); - + $("input#username",$create_user_dialog).focus(); } function popUpUpdatePasswordDialog(){ $('#new_password',$update_pw_dialog).val(""); $update_pw_dialog.reveal(); + $("input#new_password",$update_pw_dialog).focus(); } function popUpChangeAuthenticationDialog(){ diff --git a/src/sunstone/public/js/plugins/vms-tab.js b/src/sunstone/public/js/plugins/vms-tab.js index f21fee47dc..07e66a1e33 100644 --- a/src/sunstone/public/js/plugins/vms-tab.js +++ b/src/sunstone/public/js/plugins/vms-tab.js @@ -2081,6 +2081,7 @@ function popUpSaveAsDialog(vm_id, disk_id){ $('#vm_id',$save_as_dialog).text(vm_id); $('#disk_id',$save_as_dialog).text(disk_id); $save_as_dialog.reveal(); + $("input#image_name",$save_as_dialog).focus(); } @@ -2786,6 +2787,7 @@ function setupSnapshotDialog(){ function popUpSnapshotDialog(vm_id){ $('#vm_id',$snapshot_dialog).text(vm_id); $snapshot_dialog.reveal(); + $("input#snapshot_name",$snapshot_dialog).focus(); } @@ -3017,6 +3019,7 @@ function setupCreateVMDialog(include_select_image){ function popUpCreateVMDialog(include_select_image){ setupCreateVMDialog(include_select_image); $create_vm_dialog.reveal(); + $("input#vm_name",$create_vm_dialog).focus(); } //Prepares autorefresh diff --git a/src/sunstone/public/js/plugins/vnets-tab.js b/src/sunstone/public/js/plugins/vnets-tab.js index 8439354b77..8362bc34f6 100644 --- a/src/sunstone/public/js/plugins/vnets-tab.js +++ b/src/sunstone/public/js/plugins/vnets-tab.js @@ -1479,6 +1479,7 @@ function setupCreateVNetDialog() { function popUpCreateVnetDialog() { $create_vn_dialog.reveal(); + $("input#name",$create_vn_dialog).focus(); } diff --git a/src/sunstone/public/js/sunstone-util.js b/src/sunstone/public/js/sunstone-util.js index b310325d41..d3f47dac04 100644 --- a/src/sunstone/public/js/sunstone-util.js +++ b/src/sunstone/public/js/sunstone-util.js @@ -1565,6 +1565,8 @@ function popUpQuotasDialog(dialog, resource, sel_elems){ $('input[value="vm"]', dialog).click(); dialog.reveal(); + + $("input[name='VMS']",dialog).focus(); }