Here are the user interface elements and the useful functions they call that I have used this technique to intercept. Be advised that, unfortunately, there are some edge cases, like the infernal calendar view, that do things differently.
- Edit Item ribbon button – STSNavigateWithCheckoutAlert
- New Item ribbon button – NewItem2
- Add link in list views – NewItem2
- Item links in list views – EditLink2
- Edit Properties ribbon button in document libraries and edit control block – EditItemWithCheckoutAlert
- View Properties/View Item ribbon button and edit control block – EditItem2
- Upload ribbon button in document libraries – EditItem2
- Add Document link – NewItem2
Here is an example in a document library view in SharePoint 2013 Preview. I used a content editor web part to contain the following script (http://jsfiddle.net/DougWare/u83LV/).
When I select a document and click Edit Properties an alert displays before executing the original function.
If I view the properties the alert for EditItem2 displays.
Be careful with this technique. If you use it, be prepared to change when you upgrade to SharePoint 2016.
Author: Doug Ware