When I open a dialog for an EditFrom and use the “Delete Item” button from the ribbon, then the main page is redirected to the related Sharepoint list. This behavior is very bad for the user experience.

To change it I used the below Javascript code:

// replace the Delete Item default action when into a popup
$(document).ready(function() {
// if it's in a popup
if (window !== window.top) {
$('a[id$="_toolBarTbl_RptControls_diidIODeleteItem"]').attr("href","javascript:commonDeleteItem(); return false")
}
})
// now when clicking on the Delete item it will call my own function
// here I use http://aymkdn.github.io/SharepointPlus/ to show a waiting message and to delete the current item, and then close the modal
function commonDeleteItem() {
$SP().waitModalDialog("Deleting...");
$SP().list("{"+WPQ2FormCtx.ListAttributes.Id+"}").remove({ID:GetUrlKeyValue("ID")}, {
after:function() {
$SP().closeModalDialog();
$SP().closeModalDialog(2);
}
})
}

With Sharepoint 2010, when you use Internet Explorer you can open an Office document in readonly or in edit mode. Also, when trying to open an Excel file in Firefox/Chrome it will probably open the ugly xslviewer and won’t let you deal with your file.

After searching a bit about it, I found a clue that helped me to find a good solution: on Firefox/Chrome when you click on an Excel file, you’ll now have a modal asking if you want to open it in edit or readonly mode!

To achieve this result you have to insert the below Javascript code somewhere into your masterpage: