Skip Navigation LinksPDF-CustomOpenMenu

 
MenuItem.PNG

 
 
The Sharepoint AddDocLibMenuItems() Function in Core.js always executes Custom_AddDocLibMenuItems if a function by that name exists.  So to add menu items to a library all you have to do is put this code in a text file on your site then add the script to your Doc Lib View (AllItems.aspx for example) using a Content Editor Web Part.
 
MenuJS.PNG

I dug around in core.js found some useful functions including:
 
FindSTSMenuTable(sourceElement, Attribute) which seems to find the List View Items Table of a given source element by climbing up the DOM until it finds a tag with the given attribute name.  I used this to get to the first <a> link href which is the Relative URL of the PDF Document.

‚Äč